… | |
… | |
237 | if (color == Color_bg || color == Color_transparent) |
237 | if (color == Color_bg || color == Color_transparent) |
238 | XClearArea (disp, d, x, y, w, h, false); |
238 | XClearArea (disp, d, x, y, w, h, false); |
239 | else if (color >= 0) |
239 | else if (color >= 0) |
240 | { |
240 | { |
241 | #if XFT |
241 | #if XFT |
|
|
242 | bool done = false; |
|
|
243 | #ifdef HAVE_BG_PIXMAP |
|
|
244 | if (term->bgPixmap.pixmap && color >= 0 && term->pix_colors[color].c.color.alpha < 0x0ff00) |
|
|
245 | { |
|
|
246 | Picture dst = XftDrawPicture (d); |
|
|
247 | if (dst != 0) |
|
|
248 | { |
|
|
249 | XClearArea (disp, d, x, y, w, h, false); |
|
|
250 | Picture solid_color_pict = XftDrawSrcPicture (d, &term->pix_colors[color].c); |
|
|
251 | XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, x, y, w, h); |
|
|
252 | done = true; |
|
|
253 | } |
|
|
254 | } |
|
|
255 | #endif |
|
|
256 | if (!done) |
242 | XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); |
257 | XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h); |
243 | #else |
258 | #else |
244 | XSetForeground (disp, gc, term->pix_colors[color]); |
259 | XSetForeground (disp, gc, term->pix_colors[color]); |
245 | XFillRectangle (disp, d, gc, x, y, w, h); |
260 | XFillRectangle (disp, d, gc, x, y, w, h); |
246 | #endif |
261 | #endif |
247 | } |
262 | } |
… | |
… | |
1043 | |
1058 | |
1044 | void draw (rxvt_drawable &d, int x, int y, |
1059 | void draw (rxvt_drawable &d, int x, int y, |
1045 | const text_t *text, int len, |
1060 | const text_t *text, int len, |
1046 | int fg, int bg); |
1061 | int fg, int bg); |
1047 | |
1062 | |
1048 | bool has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &carefull) const; |
1063 | bool has_char (unicode_t unicode, const rxvt_fontprop *prop, bool &careful) const; |
1049 | |
1064 | |
1050 | protected: |
1065 | protected: |
1051 | XftFont *f; |
1066 | XftFont *f; |
1052 | }; |
1067 | }; |
1053 | |
1068 | |
… | |
… | |
1316 | x_ += cwidth; |
1331 | x_ += cwidth; |
1317 | } |
1332 | } |
1318 | |
1333 | |
1319 | if (buffered) |
1334 | if (buffered) |
1320 | { |
1335 | { |
|
|
1336 | bool back_rendered = false; |
1321 | if (ep != enc) |
1337 | if (ep != enc) |
1322 | { |
1338 | { |
1323 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1339 | rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); |
1324 | bool back_rendered = false; |
|
|
1325 | |
1340 | |
1326 | #ifdef HAVE_BG_PIXMAP |
1341 | #ifdef HAVE_BG_PIXMAP |
1327 | if (term->bgPixmap.pixmap) |
1342 | if (term->bgPixmap.pixmap) |
1328 | { |
1343 | { |
1329 | Picture dst = 0; |
1344 | Picture dst = 0; |
|
|
1345 | |
1330 | if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0x0ff00) |
1346 | if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0x0ff00) |
1331 | dst = XftDrawPicture(d2); |
1347 | dst = XftDrawPicture (d2); |
1332 | |
1348 | |
1333 | if (bg < 0 || dst != 0) |
1349 | if (bg < 0 || dst != 0) |
1334 | { |
1350 | { |
|
|
1351 | int src_x = x, src_y = y ; |
|
|
1352 | |
|
|
1353 | if (term->bgPixmap.is_parentOrigin ()) |
|
|
1354 | { |
|
|
1355 | src_x += term->window_vt_x; |
|
|
1356 | src_y += term->window_vt_y; |
|
|
1357 | } |
|
|
1358 | |
1335 | if (term->bgPixmap.pmap_width >= x + term->window_vt_x+w |
1359 | if (term->bgPixmap.pmap_width >= src_x+w |
1336 | && term->bgPixmap.pmap_height >= y + term->window_vt_y+h) |
1360 | && term->bgPixmap.pmap_height >= src_y+h) |
1337 | { |
1361 | { |
1338 | XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, |
1362 | XCopyArea (disp, term->bgPixmap.pixmap, d2, gc, |
1339 | x + term->window_vt_x, y + term->window_vt_y, |
|
|
1340 | w, h, 0, 0); |
1363 | src_x, src_y, w, h, 0, 0); |
1341 | } |
1364 | } |
1342 | else |
1365 | else |
1343 | { |
1366 | { |
1344 | XGCValues gcv; |
1367 | XGCValues gcv; |
1345 | |
1368 | |
1346 | gcv.fill_style = FillTiled; |
1369 | gcv.fill_style = FillTiled; |
1347 | gcv.tile = term->bgPixmap.pixmap; |
1370 | gcv.tile = term->bgPixmap.pixmap; |
1348 | gcv.ts_x_origin = -x; |
1371 | gcv.ts_x_origin = -src_x; |
1349 | gcv.ts_y_origin = -y; |
1372 | gcv.ts_y_origin = -src_y; |
1350 | |
1373 | |
1351 | XChangeGC (disp, gc, |
1374 | XChangeGC (disp, gc, |
1352 | GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, |
1375 | GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, |
1353 | &gcv); |
1376 | &gcv); |
1354 | |
1377 | |
1355 | XFillRectangle (disp, d2, gc/*gc2*/, 0, 0, w, h); |
1378 | XFillRectangle (disp, d2, gc, 0, 0, w, h); |
1356 | |
1379 | |
1357 | gcv.fill_style = FillSolid; |
1380 | gcv.fill_style = FillSolid; |
1358 | XChangeGC (disp, gc, GCFillStyle, &gcv); |
1381 | XChangeGC (disp, gc, GCFillStyle, &gcv); |
1359 | } |
1382 | } |
1360 | |
1383 | |
… | |
… | |
1367 | back_rendered = true; |
1390 | back_rendered = true; |
1368 | } |
1391 | } |
1369 | } |
1392 | } |
1370 | #endif |
1393 | #endif |
1371 | |
1394 | |
1372 | if(bg >= 0 && !back_rendered) |
1395 | if (bg >= 0 && !back_rendered) |
1373 | XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); |
1396 | XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); |
1374 | |
1397 | |
1375 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1398 | XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); |
1376 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1399 | XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y); |
1377 | } |
1400 | } |