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 |
… | |
… | |
1300 | |
1300 | |
1301 | /* |
1301 | /* |
1302 | * Maybe make buffering into a resource flag? Compile time option doesn't seems like a |
1302 | * Maybe make buffering into a resource flag? Compile time option doesn't seems like a |
1303 | * good idea from the perspective of packaging for wide variety of user configs. |
1303 | * good idea from the perspective of packaging for wide variety of user configs. |
1304 | */ |
1304 | */ |
1305 | bool buffered = bg >= Color_transparent; |
1305 | bool buffered = bg >= Color_transparent |
1306 | #ifdef FORCE_UNBUFFERED_XFT |
1306 | && term->option (Opt_buffered); |
1307 | buffered = false; |
|
|
1308 | #endif |
|
|
1309 | |
1307 | |
1310 | // cut trailing spaces |
1308 | // cut trailing spaces |
1311 | while (len && text [len - 1] == ' ') |
1309 | while (len && text [len - 1] == ' ') |
1312 | len--; |
1310 | len--; |
1313 | |
1311 | |
… | |
… | |
1345 | if (ep != enc) |
1343 | if (ep != enc) |
1346 | { |
1344 | { |
1347 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1345 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1348 | |
1346 | |
1349 | #ifdef HAVE_BG_PIXMAP |
1347 | #ifdef HAVE_BG_PIXMAP |
1350 | Picture dst = 0; |
1348 | Picture dst = 0; // the only assignment is done conditionally in the following if condition |
1351 | |
1349 | |
1352 | if (term->bgPixmap.pixmap |
1350 | if (term->bgPixmap.pixmap |
1353 | && (bg == Color_transparent || bg == Color_bg |
1351 | && (bg == Color_transparent || bg == Color_bg |
1354 | || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) |
1352 | || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) |
1355 | { |
1353 | { |
… | |
… | |
1388 | |
1386 | |
1389 | if (dst) |
1387 | if (dst) |
1390 | { |
1388 | { |
1391 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
1389 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
1392 | |
1390 | |
|
|
1391 | // dst can only be set when bg >= 0 |
1393 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); |
1392 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); |
1394 | } |
1393 | } |
1395 | } |
1394 | } |
1396 | else |
1395 | else |
1397 | #endif |
1396 | #endif |