ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtfont.C
(Generate patch)

Comparing rxvt-unicode/src/rxvtfont.C (file contents):
Revision 1.104 by root, Tue Oct 3 10:28:25 2006 UTC vs.
Revision 1.118 by sasha, Wed Sep 12 19:51:41 2007 UTC

232rxvt_font::clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const 232rxvt_font::clear_rect (rxvt_drawable &d, int x, int y, int w, int h, int color) const
233{ 233{
234 dTermDisplay; 234 dTermDisplay;
235 dTermGC; 235 dTermGC;
236 236
237 if (color < 0 || color == Color_bg) 237 if (color == Color_bg || color == Color_transparent)
238 XClearArea (disp, d, x, y, w, h, false); 238 XClearArea (disp, d, x, y, w, h, false);
239 else 239 else if (color >= 0)
240 { 240 {
241#if XFT 241#if XFT
242 XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); 242 XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h);
243#else 243#else
244 XSetForeground (disp, gc, term->pix_colors[color]); 244 XSetForeground (disp, gc, term->pix_colors[color]);
441 *chrs = cc->c2; 441 *chrs = cc->c2;
442 rxvt_font *f2 = (f1->has_char (cc->c2, 0, careful) && !careful) 442 rxvt_font *f2 = (f1->has_char (cc->c2, 0, careful) && !careful)
443 ? f1 443 ? f1
444 : (*fs)[fs->find_font (cc->c2)]; 444 : (*fs)[fs->find_font (cc->c2)];
445 445
446 f2->draw (d, x, y, chrs, width, fg, -1); 446 f2->draw (d, x, y, chrs, width, fg, Color_none);
447 } 447 }
448 } 448 }
449#endif 449#endif
450 else 450 else
451 switch (t) 451 switch (t)
1272 dTermGC; 1272 dTermGC;
1273 1273
1274 int w = term->fwidth * len; 1274 int w = term->fwidth * len;
1275 int h = term->fheight; 1275 int h = term->fheight;
1276 1276
1277 bool buffered = bg >= 0 // we don't use a transparent bg 1277 /* TODO: this logic needs some more thinking, since we no longer do pseudo-transparency.
1278 * Maybe make buffering into a resource flag? Compile time option doesn't seems like a
1279 * good idea from the perspective of packaging for wide variety of user configs.
1280 */
1281 bool buffered = true
1278#ifndef FORCE_UNBUFFERED_XFT 1282#ifdef FORCE_UNBUFFERED_XFT
1279# if defined(XPM_BACKGROUND) || defined(TRANSPARENT) 1283 && bg >= 0
1280 || !term->am_transparent // we aren't transparent
1281 || term->am_pixmap_trans // we have a pixmap
1282# endif
1283#endif 1284#endif
1284 ; 1285 ;
1285
1286 // cut trailing spaces 1286 // cut trailing spaces
1287 while (len && text [len - 1] == ' ') 1287 while (len && text [len - 1] == ' ')
1288 len--; 1288 len--;
1289 1289
1290 int x_ = buffered ? 0 : x; 1290 int x_ = buffered ? 0 : x;
1319 if (buffered) 1319 if (buffered)
1320 { 1320 {
1321 if (ep != enc) 1321 if (ep != enc)
1322 { 1322 {
1323 rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); 1323 rxvt_drawable &d2 = d.screen->scratch_drawable (w, h);
1324 bool back_rendered = false;
1324 1325
1325 if (0) 1326#ifdef HAVE_BG_PIXMAP
1326 ;
1327#ifdef TRANSPARENT
1328 else if (bg < 0 && term->am_pixmap_trans)
1329 XCopyArea (disp, term->pixmap, d2, gc,
1330 x + term->window_vt_x, y + term->window_vt_y,
1331 w, h, 0, 0);
1332#endif
1333#ifdef XPM_BACKGROUND
1334 else if (bg < 0 && term->bgPixmap.pixmap) 1327 if (term->bgPixmap.pixmap)
1335 { 1328 {
1329 Picture dst = 0;
1330
1331 if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0x0ff00)
1332 dst = XftDrawPicture (d2);
1333
1334 if (bg < 0 || dst != 0)
1335 {
1336 int src_x = x, src_y = y ;
1337
1338 if (term->bgPixmap.is_parentOrigin ())
1339 {
1340 src_x += term->window_vt_x;
1341 src_y += term->window_vt_y;
1342 }
1343
1344 if (term->bgPixmap.pmap_width >= src_x+w
1345 && term->bgPixmap.pmap_height >= src_y+h)
1346 {
1347 XCopyArea (disp, term->bgPixmap.pixmap, d2, gc,
1348 src_x, src_y, w, h, 0, 0);
1349 }
1350 else
1351 {
1336 XGCValues gcv; 1352 XGCValues gcv;
1337 1353
1338 gcv.fill_style = FillTiled; 1354 gcv.fill_style = FillTiled;
1339 gcv.tile = term->pixmap; 1355 gcv.tile = term->bgPixmap.pixmap;
1340 gcv.ts_x_origin = -x; 1356 gcv.ts_x_origin = -src_x;
1341 gcv.ts_y_origin = -y; 1357 gcv.ts_y_origin = -src_y;
1342 1358
1343 GC gc2 = XCreateGC (disp, d2, 1359 XChangeGC (disp, gc,
1344 GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, 1360 GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle,
1345 &gcv); 1361 &gcv);
1346 1362
1347 XFillRectangle (disp, d2, gc2, 0, 0, w, h); 1363 XFillRectangle (disp, d2, gc, 0, 0, w, h);
1348 1364
1349 XFreeGC (disp, gc2); 1365 gcv.fill_style = FillSolid;
1366 XChangeGC (disp, gc, GCFillStyle, &gcv);
1367 }
1368
1369 if (bg >= 0)
1370 {
1371 Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c);
1372 XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h);
1373 }
1374
1375 back_rendered = true;
1376 }
1350 } 1377 }
1351#endif 1378#endif
1352 else 1379
1380 if (bg >= 0 && !back_rendered)
1353 XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); 1381 XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h);
1354 1382
1355 XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); 1383 XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc);
1356 XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); 1384 XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y);
1357 } 1385 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines