… | |
… | |
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 | # ifdef ENABLE_TRANSPARENCY |
1283 | && bg >= 0 |
1280 | || !term->am_transparent // we aren't transparent |
|
|
1281 | # endif |
|
|
1282 | #endif |
1284 | #endif |
1283 | ; |
1285 | ; |
1284 | |
|
|
1285 | // cut trailing spaces |
1286 | // cut trailing spaces |
1286 | while (len && text [len - 1] == ' ') |
1287 | while (len && text [len - 1] == ' ') |
1287 | len--; |
1288 | len--; |
1288 | |
1289 | |
1289 | int x_ = buffered ? 0 : x; |
1290 | int x_ = buffered ? 0 : x; |
… | |
… | |
1318 | if (buffered) |
1319 | if (buffered) |
1319 | { |
1320 | { |
1320 | if (ep != enc) |
1321 | if (ep != enc) |
1321 | { |
1322 | { |
1322 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1323 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
|
|
1324 | bool back_rendered = false; |
1323 | |
1325 | |
1324 | if (0) |
1326 | #ifdef HAVE_BG_PIXMAP |
1325 | ; |
|
|
1326 | #ifdef ENABLE_TRANSPARENCY |
|
|
1327 | else if (bg < 0 && term->am_pixmap_trans) |
|
|
1328 | XCopyArea (disp, term->pixmap, d2, gc, |
|
|
1329 | x + term->window_vt_x, y + term->window_vt_y, |
|
|
1330 | w, h, 0, 0); |
|
|
1331 | #endif |
|
|
1332 | #ifdef XPM_BACKGROUND |
|
|
1333 | else if (bg < 0 && term->bgPixmap.pixmap) |
1327 | if (term->bgPixmap.pixmap) |
1334 | { |
1328 | { |
|
|
1329 | Picture dst = 0; |
|
|
1330 | if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0x0ff00) |
|
|
1331 | dst = XftDrawPicture(d2); |
|
|
1332 | |
|
|
1333 | if (bg < 0 || dst != 0) |
|
|
1334 | { |
|
|
1335 | if (term->bgPixmap.pmap_width >= x + term->window_vt_x+w |
|
|
1336 | && term->bgPixmap.pmap_height >= y + term->window_vt_y+h) |
|
|
1337 | { |
|
|
1338 | XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, |
|
|
1339 | x + term->window_vt_x, y + term->window_vt_y, |
|
|
1340 | w, h, 0, 0); |
|
|
1341 | } |
|
|
1342 | else |
|
|
1343 | { |
1335 | XGCValues gcv; |
1344 | XGCValues gcv; |
1336 | |
1345 | |
1337 | gcv.fill_style = FillTiled; |
1346 | gcv.fill_style = FillTiled; |
1338 | gcv.tile = term->pixmap; |
1347 | gcv.tile = term->bgPixmap.pixmap; |
1339 | gcv.ts_x_origin = -x; |
1348 | gcv.ts_x_origin = -x; |
1340 | gcv.ts_y_origin = -y; |
1349 | gcv.ts_y_origin = -y; |
1341 | |
1350 | |
1342 | GC gc2 = XCreateGC (disp, d2, |
1351 | XChangeGC (disp, gc, |
1343 | GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, |
1352 | GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, |
1344 | &gcv); |
1353 | &gcv); |
1345 | |
1354 | |
1346 | XFillRectangle (disp, d2, gc2, 0, 0, w, h); |
1355 | XFillRectangle (disp, d2, gc/*gc2*/, 0, 0, w, h); |
1347 | |
1356 | |
1348 | XFreeGC (disp, gc2); |
1357 | gcv.fill_style = FillSolid; |
|
|
1358 | XChangeGC (disp, gc, GCFillStyle, &gcv); |
|
|
1359 | } |
|
|
1360 | |
|
|
1361 | if (bg >= 0) |
|
|
1362 | { |
|
|
1363 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
|
|
1364 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); |
|
|
1365 | } |
|
|
1366 | |
|
|
1367 | back_rendered = true; |
|
|
1368 | } |
1349 | } |
1369 | } |
1350 | #endif |
1370 | #endif |
1351 | else |
1371 | |
|
|
1372 | if(bg >= 0 && !back_rendered) |
1352 | XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); |
1373 | XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); |
1353 | |
1374 | |
1354 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1375 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1355 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1376 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1356 | } |
1377 | } |