… | |
… | |
594 | GC gc; |
594 | GC gc; |
595 | |
595 | |
596 | /* create Pixmap */ |
596 | /* create Pixmap */ |
597 | if (pixmap == None |
597 | if (pixmap == None |
598 | || pmap_width != new_pmap_width |
598 | || pmap_width != new_pmap_width |
599 | || pmap_height != new_pmap_height |
599 | || pmap_height != new_pmap_height) |
600 | || pmap_depth != target->depth) |
|
|
601 | { |
600 | { |
602 | if (pixmap) |
601 | if (pixmap) |
603 | XFreePixmap (target->dpy, pixmap); |
602 | XFreePixmap (target->dpy, pixmap); |
604 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
603 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
605 | pmap_width = new_pmap_width; |
604 | pmap_width = new_pmap_width; |
606 | pmap_height = new_pmap_height; |
605 | pmap_height = new_pmap_height; |
607 | pmap_depth = target->depth; |
|
|
608 | } |
606 | } |
609 | /* fill with background color (if result's not completely overlapping it) */ |
607 | /* fill with background color (if result's not completely overlapping it) */ |
610 | gcv.foreground = target->pix_colors[Color_bg]; |
608 | gcv.foreground = target->pix_colors[Color_bg]; |
611 | gc = XCreateGC (target->dpy, target->vt, GCForeground, &gcv); |
609 | gc = XCreateGC (target->dpy, target->vt, GCForeground, &gcv); |
612 | |
610 | |
… | |
… | |
803 | } |
801 | } |
804 | } |
802 | } |
805 | |
803 | |
806 | if (pixmap == None |
804 | if (pixmap == None |
807 | || pmap_width != new_pmap_width |
805 | || pmap_width != new_pmap_width |
808 | || pmap_height != new_pmap_height |
806 | || pmap_height != new_pmap_height) |
809 | || pmap_depth != target->depth) |
|
|
810 | { |
807 | { |
811 | if (pixmap) |
808 | if (pixmap) |
812 | XFreePixmap (target->dpy, pixmap); |
809 | XFreePixmap (target->dpy, pixmap); |
813 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
810 | pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth); |
814 | pmap_width = new_pmap_width; |
811 | pmap_width = new_pmap_width; |
815 | pmap_height = new_pmap_height; |
812 | pmap_height = new_pmap_height; |
816 | pmap_depth = target->depth; |
|
|
817 | } |
813 | } |
818 | |
814 | |
819 | gcv.foreground = target->pix_colors[Color_bg]; |
815 | gcv.foreground = target->pix_colors[Color_bg]; |
820 | gc = XCreateGC (target->dpy, target->vt, GCForeground, &gcv); |
816 | gc = XCreateGC (target->dpy, target->vt, GCForeground, &gcv); |
821 | |
817 | |
… | |
… | |
1329 | } |
1325 | } |
1330 | |
1326 | |
1331 | if (root_pixmap == None) |
1327 | if (root_pixmap == None) |
1332 | return 0; |
1328 | return 0; |
1333 | |
1329 | |
|
|
1330 | if (pixmap == None |
|
|
1331 | || pmap_width != window_width |
|
|
1332 | || pmap_height != window_height) |
|
|
1333 | { |
|
|
1334 | if (pixmap) |
|
|
1335 | XFreePixmap (target->dpy, pixmap); |
1334 | Pixmap tiled_root_pmap = XCreatePixmap (dpy, target->vt, window_width, window_height, target->depth); |
1336 | pixmap = XCreatePixmap (target->dpy, target->vt, window_width, window_height, target->depth); |
|
|
1337 | pmap_width = window_width; |
|
|
1338 | pmap_height = window_height; |
|
|
1339 | } |
1335 | |
1340 | |
1336 | if (tiled_root_pmap == None) /* something really bad happened - abort */ |
1341 | if (pixmap == None) |
1337 | return 0; |
1342 | return 0; |
1338 | |
1343 | |
1339 | /* straightforward pixmap copy */ |
1344 | /* straightforward pixmap copy */ |
1340 | while (sx < 0) sx += (int)root_width; |
1345 | while (sx < 0) sx += (int)root_width; |
1341 | while (sy < 0) sy += (int)root_height; |
1346 | while (sy < 0) sy += (int)root_height; |
… | |
… | |
1346 | gcv.ts_y_origin = -sy; |
1351 | gcv.ts_y_origin = -sy; |
1347 | gc = XCreateGC (dpy, target->vt, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv); |
1352 | gc = XCreateGC (dpy, target->vt, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv); |
1348 | |
1353 | |
1349 | if (gc) |
1354 | if (gc) |
1350 | { |
1355 | { |
1351 | XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); |
1356 | XFillRectangle (dpy, pixmap, gc, 0, 0, window_width, window_height); |
1352 | result |= transpPmapTiled; |
1357 | result |= transpPmapTiled; |
1353 | XFreeGC (dpy, gc); |
1358 | XFreeGC (dpy, gc); |
1354 | |
1359 | |
1355 | if (!(flags & CLIENT_RENDER)) |
1360 | if (!(flags & CLIENT_RENDER)) |
1356 | { |
1361 | { |
1357 | if ((flags & blurNeeded) |
1362 | if ((flags & blurNeeded) |
1358 | && (flags & HAS_RENDER_CONV)) |
1363 | && (flags & HAS_RENDER_CONV)) |
1359 | { |
1364 | { |
1360 | if (blur_pixmap (tiled_root_pmap, target->visual, window_width, window_height)) |
1365 | if (blur_pixmap (pixmap, target->visual, window_width, window_height)) |
1361 | result |= transpPmapBlurred; |
1366 | result |= transpPmapBlurred; |
1362 | } |
1367 | } |
1363 | if ((flags & tintNeeded) |
1368 | if ((flags & tintNeeded) |
1364 | && (flags & (tintWholesome | HAS_RENDER))) |
1369 | && (flags & (tintWholesome | HAS_RENDER))) |
1365 | { |
1370 | { |
1366 | if (tint_pixmap (tiled_root_pmap, target->visual, window_width, window_height)) |
1371 | if (tint_pixmap (pixmap, target->visual, window_width, window_height)) |
1367 | result |= transpPmapTinted; |
1372 | result |= transpPmapTinted; |
1368 | } |
1373 | } |
1369 | } /* server side rendering completed */ |
1374 | } /* server side rendering completed */ |
1370 | |
|
|
1371 | if (pixmap) |
|
|
1372 | XFreePixmap (dpy, pixmap); |
|
|
1373 | |
|
|
1374 | pixmap = tiled_root_pmap; |
|
|
1375 | pmap_width = window_width; |
|
|
1376 | pmap_height = window_height; |
|
|
1377 | pmap_depth = target->depth; |
|
|
1378 | } |
1375 | } |
1379 | else |
|
|
1380 | XFreePixmap (dpy, tiled_root_pmap); |
|
|
1381 | |
1376 | |
1382 | if (recoded_root_pmap != root_pixmap) |
1377 | if (recoded_root_pmap != root_pixmap) |
1383 | XFreePixmap (dpy, recoded_root_pmap); |
1378 | XFreePixmap (dpy, recoded_root_pmap); |
1384 | |
1379 | |
1385 | return result; |
1380 | return result; |