… | |
… | |
1349 | { |
1349 | { |
1350 | bool back_rendered = false; |
1350 | bool back_rendered = false; |
1351 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1351 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1352 | |
1352 | |
1353 | #ifdef HAVE_BG_PIXMAP |
1353 | #ifdef HAVE_BG_PIXMAP |
|
|
1354 | |
1354 | if (term->bgPixmap.pixmap) |
1355 | if (term->bgPixmap.pixmap |
|
|
1356 | && !(bg >= 0 && term->pix_colors[bg].is_opaque ())) |
1355 | { |
1357 | { |
1356 | Picture dst = 0; |
1358 | Picture dst = XftDrawPicture (d2); |
1357 | |
1359 | |
1358 | if (bg >= 0 && term->pix_colors[bg].is_opaque ()) |
1360 | int src_x = x, src_y = y; |
1359 | XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); |
1361 | |
|
|
1362 | if (term->bgPixmap.is_parentOrigin ()) |
|
|
1363 | { |
|
|
1364 | src_x += term->window_vt_x; |
|
|
1365 | src_y += term->window_vt_y; |
|
|
1366 | } |
|
|
1367 | |
|
|
1368 | if (term->bgPixmap.pmap_width >= src_x+w |
|
|
1369 | && term->bgPixmap.pmap_height >= src_y+h) |
|
|
1370 | { |
|
|
1371 | XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, |
|
|
1372 | src_x, src_y, w, h, 0, 0); |
|
|
1373 | } |
1360 | else |
1374 | else |
1361 | dst = XftDrawPicture (d2); |
|
|
1362 | |
|
|
1363 | if (dst) |
|
|
1364 | { |
1375 | { |
1365 | int src_x = x, src_y = y; |
|
|
1366 | |
|
|
1367 | if (term->bgPixmap.is_parentOrigin ()) |
|
|
1368 | { |
|
|
1369 | src_x += term->window_vt_x; |
|
|
1370 | src_y += term->window_vt_y; |
|
|
1371 | } |
|
|
1372 | |
|
|
1373 | if (term->bgPixmap.pmap_width >= src_x+w |
|
|
1374 | && term->bgPixmap.pmap_height >= src_y+h) |
|
|
1375 | { |
|
|
1376 | XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, |
|
|
1377 | src_x, src_y, w, h, 0, 0); |
|
|
1378 | } |
|
|
1379 | else |
|
|
1380 | { |
|
|
1381 | XGCValues gcv; |
1376 | XGCValues gcv; |
1382 | |
1377 | |
1383 | gcv.fill_style = FillTiled; |
1378 | gcv.fill_style = FillTiled; |
1384 | gcv.tile = term->bgPixmap.pixmap; |
1379 | gcv.tile = term->bgPixmap.pixmap; |
1385 | gcv.ts_x_origin = -src_x; |
1380 | gcv.ts_x_origin = -src_x; |
1386 | gcv.ts_y_origin = -src_y; |
1381 | gcv.ts_y_origin = -src_y; |
1387 | |
1382 | |
1388 | XChangeGC (disp, gc, |
1383 | XChangeGC (disp, gc, |
1389 | GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, |
1384 | GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, |
1390 | &gcv); |
1385 | &gcv); |
1391 | |
1386 | |
1392 | XFillRectangle (disp, d2, gc, 0, 0, w, h); |
1387 | XFillRectangle (disp, d2, gc, 0, 0, w, h); |
1393 | |
1388 | |
1394 | gcv.fill_style = FillSolid; |
1389 | gcv.fill_style = FillSolid; |
1395 | XChangeGC (disp, gc, GCFillStyle, &gcv); |
1390 | XChangeGC (disp, gc, GCFillStyle, &gcv); |
1396 | } |
|
|
1397 | |
|
|
1398 | if (bg >= 0) |
|
|
1399 | { |
|
|
1400 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
|
|
1401 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); |
|
|
1402 | } |
|
|
1403 | |
|
|
1404 | back_rendered = true; |
|
|
1405 | } |
1391 | } |
|
|
1392 | |
|
|
1393 | if (bg >= 0 && dst) // colour must be (and is) non-opaque here |
|
|
1394 | { |
|
|
1395 | Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); |
|
|
1396 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); |
|
|
1397 | } |
|
|
1398 | |
|
|
1399 | back_rendered = true; |
1406 | } |
1400 | } |
1407 | #endif |
1401 | #endif |
1408 | |
1402 | |
1409 | if (!back_rendered) |
1403 | if (!back_rendered) |
1410 | XftDrawRect (d2, &term->pix_colors[bg < 0 ? Color_bg : bg].c, 0, 0, w, h); |
1404 | XftDrawRect (d2, &term->pix_colors[bg < 0 ? Color_bg : bg].c, 0, 0, w, h); |