1 | /*----------------------------------------------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: rxvtfont.C |
2 | * File: rxvtfont.C |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> |
4 | * Copyright (c) 2003-2008 Marc Lehmann <pcg@goof.com> |
5 | * - original version. |
5 | * - original version. |
6 | * |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by |
8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or |
9 | * the Free Software Foundation; either version 2 of the License, or |
… | |
… | |
1304 | */ |
1304 | */ |
1305 | bool buffered = bg >= Color_transparent; |
1305 | bool buffered = bg >= Color_transparent; |
1306 | #ifdef FORCE_UNBUFFERED_XFT |
1306 | #ifdef FORCE_UNBUFFERED_XFT |
1307 | buffered = false; |
1307 | buffered = false; |
1308 | #endif |
1308 | #endif |
1309 | buffered=false;//D |
|
|
1310 | |
1309 | |
1311 | // cut trailing spaces |
1310 | // cut trailing spaces |
1312 | while (len && text [len - 1] == ' ') |
1311 | while (len && text [len - 1] == ' ') |
1313 | len--; |
1312 | len--; |
1314 | |
1313 | |
… | |
… | |
1346 | if (ep != enc) |
1345 | if (ep != enc) |
1347 | { |
1346 | { |
1348 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1347 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1349 | |
1348 | |
1350 | #ifdef HAVE_BG_PIXMAP |
1349 | #ifdef HAVE_BG_PIXMAP |
1351 | Picture dst = 0; |
1350 | Picture dst = 0; // the only assignment is done conditionally in the following if condition |
1352 | |
1351 | |
1353 | if (term->bgPixmap.pixmap |
1352 | if (term->bgPixmap.pixmap |
1354 | && (bg == Color_transparent || bg == Color_bg |
1353 | && (bg == Color_transparent || bg == Color_bg |
1355 | || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) |
1354 | || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) |
1356 | { |
1355 | { |
… | |
… | |
1389 | |
1388 | |
1390 | if (dst) |
1389 | if (dst) |
1391 | { |
1390 | { |
1392 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
1391 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
1393 | |
1392 | |
|
|
1393 | // dst can only be set when bg >= 0 |
1394 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); |
1394 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); |
1395 | } |
1395 | } |
1396 | } |
1396 | } |
1397 | else |
1397 | else |
1398 | #endif |
1398 | #endif |
1399 | clear_rect (d, x, y, w, h, bg); |
1399 | XftDrawRect (d2, &term->pix_colors[bg >= 0 ? bg : Color_bg].c, 0, 0, w, h); |
1400 | |
1400 | |
1401 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1401 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1402 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1402 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1403 | } |
1403 | } |
1404 | else |
1404 | else |