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 |
… | |
… | |
1296 | dTermGC; |
1296 | dTermGC; |
1297 | |
1297 | |
1298 | int w = term->fwidth * len; |
1298 | int w = term->fwidth * len; |
1299 | int h = term->fheight; |
1299 | int h = term->fheight; |
1300 | |
1300 | |
1301 | /* |
|
|
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. |
|
|
1304 | */ |
|
|
1305 | bool buffered = bg >= Color_transparent; |
1301 | bool buffered = bg >= Color_transparent |
1306 | #ifdef FORCE_UNBUFFERED_XFT |
1302 | && term->option (Opt_buffered); |
1307 | buffered = false; |
|
|
1308 | #endif |
|
|
1309 | buffered=false;//D |
|
|
1310 | |
1303 | |
1311 | // cut trailing spaces |
1304 | // cut trailing spaces |
1312 | while (len && text [len - 1] == ' ') |
1305 | while (len && text [len - 1] == ' ') |
1313 | len--; |
1306 | len--; |
1314 | |
1307 | |
… | |
… | |
1346 | if (ep != enc) |
1339 | if (ep != enc) |
1347 | { |
1340 | { |
1348 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1341 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1349 | |
1342 | |
1350 | #ifdef HAVE_BG_PIXMAP |
1343 | #ifdef HAVE_BG_PIXMAP |
1351 | Picture dst = 0; |
1344 | Picture dst = 0; // the only assignment is done conditionally in the following if condition |
1352 | |
1345 | |
1353 | if (term->bgPixmap.pixmap |
1346 | if (term->bgPixmap.pixmap |
1354 | && (bg == Color_transparent || bg == Color_bg |
1347 | && (bg == Color_transparent || bg == Color_bg |
1355 | || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) |
1348 | || (bg >= 0 && !term->pix_colors[bg].is_opaque () && ((dst = XftDrawPicture (d2)))))) |
1356 | { |
1349 | { |
… | |
… | |
1389 | |
1382 | |
1390 | if (dst) |
1383 | if (dst) |
1391 | { |
1384 | { |
1392 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
1385 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
1393 | |
1386 | |
|
|
1387 | // 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); |
1388 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); |
1395 | } |
1389 | } |
1396 | } |
1390 | } |
1397 | else |
1391 | else |
1398 | #endif |
1392 | #endif |
1399 | clear_rect (d, x, y, w, h, bg); |
1393 | XftDrawRect (d2, &term->pix_colors[bg >= 0 ? bg : Color_bg].c, 0, 0, w, h); |
1400 | |
1394 | |
1401 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1395 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1402 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1396 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1403 | } |
1397 | } |
1404 | else |
1398 | else |