--- rxvt-unicode/src/rxvtfont.C 2008/01/23 06:49:30 1.133 +++ rxvt-unicode/src/rxvtfont.C 2008/01/23 13:34:20 1.138 @@ -238,23 +238,20 @@ else if (color >= 0) { #if XFT - bool done = false; + Picture dst; # ifdef HAVE_BG_PIXMAP - if (term->bgPixmap.pixmap && color >= 0 && !term->pix_colors[color].is_opaque ()) + if (term->bgPixmap.pixmap + && !term->pix_colors[color].is_opaque () + && ((dst = XftDrawPicture (d)))) { - Picture dst = XftDrawPicture (d); + XClearArea (disp, d, x, y, w, h, false); - if (dst != 0) - { - XClearArea (disp, d, x, y, w, h, false); - Picture solid_color_pict = XftDrawSrcPicture (d, &term->pix_colors[color].c); - XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, x, y, w, h); - done = true; - } + Picture solid_color_pict = XftDrawSrcPicture (d, &term->pix_colors[color].c); + XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, x, y, w, h); } + else # endif - if (!done) XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); #else @@ -1347,66 +1344,57 @@ { if (ep != enc) { - bool back_rendered = false; rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); #ifdef HAVE_BG_PIXMAP - if (term->bgPixmap.pixmap) + Picture dst = 0; + + if (term->bgPixmap.pixmap + && (bg == Color_transparent || bg == Color_bg + || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) { - Picture dst = 0; + int src_x = x, src_y = y; - if (bg >= 0 && term->pix_colors[bg].is_opaque ()) - XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); + if (term->bgPixmap.is_parentOrigin ()) + { + src_x += term->window_vt_x; + src_y += term->window_vt_y; + } + + if (term->bgPixmap.pmap_width >= src_x + w + && term->bgPixmap.pmap_height >= src_y + h) + { + XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, + src_x, src_y, w, h, 0, 0); + } else - dst = XftDrawPicture (d2); + { + XGCValues gcv; + + gcv.fill_style = FillTiled; + gcv.tile = term->bgPixmap.pixmap; + gcv.ts_x_origin = -src_x; + gcv.ts_y_origin = -src_y; + + XChangeGC (disp, gc, + GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, + &gcv); + + XFillRectangle (disp, d2, gc, 0, 0, w, h); + + gcv.fill_style = FillSolid; + XChangeGC (disp, gc, GCFillStyle, &gcv); + } if (dst) { - int src_x = x, src_y = y; - - if (term->bgPixmap.is_parentOrigin ()) - { - src_x += term->window_vt_x; - src_y += term->window_vt_y; - } - - if (term->bgPixmap.pmap_width >= src_x+w - && term->bgPixmap.pmap_height >= src_y+h) - { - XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, - src_x, src_y, w, h, 0, 0); - } - else - { - XGCValues gcv; - - gcv.fill_style = FillTiled; - gcv.tile = term->bgPixmap.pixmap; - gcv.ts_x_origin = -src_x; - gcv.ts_y_origin = -src_y; - - XChangeGC (disp, gc, - GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, - &gcv); - - XFillRectangle (disp, d2, gc, 0, 0, w, h); - - gcv.fill_style = FillSolid; - XChangeGC (disp, gc, GCFillStyle, &gcv); - } - - if (bg >= 0) - { - Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); - XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); - } + Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); - back_rendered = true; + XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); } } + else #endif - - if (!back_rendered) XftDrawRect (d2, &term->pix_colors[bg < 0 ? Color_bg : bg].c, 0, 0, w, h); XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc);