ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.C
(Generate patch)

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.148 by root, Tue Apr 26 09:48:09 2011 UTC vs.
Revision 1.151 by sf-exg, Sun May 8 21:02:28 2011 UTC

723 result = gdk_pixbuf_scale_simple (pixbuf, 723 result = gdk_pixbuf_scale_simple (pixbuf,
724 w, h, 724 w, h,
725 GDK_INTERP_BILINEAR); 725 GDK_INTERP_BILINEAR);
726 } 726 }
727 727
728 if (!result)
729 return false;
730
728 bool ret = false; 731 bool ret = false;
729 732
730 if (result)
731 {
732 XGCValues gcv; 733 XGCValues gcv;
733 GC gc; 734 GC gc;
734 Pixmap root_pmap; 735 Pixmap root_pmap;
735 736
736 image_width = gdk_pixbuf_get_width (result); 737 image_width = gdk_pixbuf_get_width (result);
842 g_object_unref (result); 843 g_object_unref (result);
843 844
844 XFreeGC (dpy, gc); 845 XFreeGC (dpy, gc);
845 846
846 ret = true; 847 ret = true;
847 }
848 848
849 return ret; 849 return ret;
850} 850}
851# endif /* HAVE_PIXBUF */ 851# endif /* HAVE_PIXBUF */
852 852
1184 } 1184 }
1185 1185
1186 return ret; 1186 return ret;
1187} 1187}
1188 1188
1189/* make_transparency_pixmap() 1189/*
1190 * Builds a pixmap of the same size as the terminal window that contains 1190 * Builds a pixmap of the same size as the terminal window that contains
1191 * the tiled portion of the root pixmap that is supposed to be covered by 1191 * the tiled portion of the root pixmap that is supposed to be covered by
1192 * our window. 1192 * our window.
1193 */ 1193 */
1194unsigned long 1194unsigned long
1252 if (src && dst) 1252 if (src && dst)
1253 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, root_pmap_width, root_pmap_height); 1253 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, root_pmap_width, root_pmap_height);
1254 else 1254 else
1255 { 1255 {
1256 XFreePixmap (dpy, recoded_root_pmap); 1256 XFreePixmap (dpy, recoded_root_pmap);
1257 root_pixmap = None; 1257 recoded_root_pmap = None;
1258 } 1258 }
1259 1259
1260 XRenderFreePicture (dpy, src); 1260 XRenderFreePicture (dpy, src);
1261 XRenderFreePicture (dpy, dst); 1261 XRenderFreePicture (dpy, dst);
1262 } 1262 }
1263 else 1263 else
1264#endif 1264#endif
1265 root_pixmap = None; 1265 recoded_root_pmap = None;
1266 } 1266 }
1267 1267
1268 if (root_pixmap == None) 1268 if (recoded_root_pmap == None)
1269 return 0; 1269 return 0;
1270 1270
1271 if (bg_pixmap == None 1271 if (bg_pixmap == None
1272 || bg_pmap_width != window_width 1272 || bg_pmap_width != window_width
1273 || bg_pmap_height != window_height) 1273 || bg_pmap_height != window_height)
1277 bg_pixmap = XCreatePixmap (dpy, vt, window_width, window_height, depth); 1277 bg_pixmap = XCreatePixmap (dpy, vt, window_width, window_height, depth);
1278 bg_pmap_width = window_width; 1278 bg_pmap_width = window_width;
1279 bg_pmap_height = window_height; 1279 bg_pmap_height = window_height;
1280 } 1280 }
1281 1281
1282 if (bg_pixmap == None) 1282 if (bg_pixmap != None)
1283 return 0; 1283 {
1284
1285 /* straightforward pixmap copy */ 1284 /* straightforward pixmap copy */
1286 while (sx < 0) sx += (int)root_width; 1285 while (sx < 0) sx += (int)root_width;
1287 while (sy < 0) sy += (int)root_height; 1286 while (sy < 0) sy += (int)root_height;
1288 1287
1289 gcv.tile = recoded_root_pmap; 1288 gcv.tile = recoded_root_pmap;
1290 gcv.fill_style = FillTiled; 1289 gcv.fill_style = FillTiled;
1291 gcv.ts_x_origin = -sx; 1290 gcv.ts_x_origin = -sx;
1292 gcv.ts_y_origin = -sy; 1291 gcv.ts_y_origin = -sy;
1293 gc = XCreateGC (dpy, vt, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv); 1292 gc = XCreateGC (dpy, vt, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &gcv);
1294 1293
1295 if (gc) 1294 if (gc)
1296 { 1295 {
1297 XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height); 1296 XFillRectangle (dpy, bg_pixmap, gc, 0, 0, window_width, window_height);
1298 result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS); 1297 result |= BG_IS_VALID | (bg_flags & BG_EFFECTS_FLAGS);
1299 XFreeGC (dpy, gc); 1298 XFreeGC (dpy, gc);
1300 1299
1301 if (!(bg_flags & BG_CLIENT_RENDER)) 1300 if (!(bg_flags & BG_CLIENT_RENDER))
1302 { 1301 {
1303 if ((bg_flags & BG_NEEDS_BLUR) 1302 if ((bg_flags & BG_NEEDS_BLUR)
1304 && (bg_flags & BG_HAS_RENDER_CONV)) 1303 && (bg_flags & BG_HAS_RENDER_CONV))
1305 { 1304 {
1306 if (blur_pixmap (bg_pixmap, visual, window_width, window_height)) 1305 if (blur_pixmap (bg_pixmap, visual, window_width, window_height))
1307 result &= ~BG_NEEDS_BLUR; 1306 result &= ~BG_NEEDS_BLUR;
1308 } 1307 }
1309 if ((bg_flags & BG_NEEDS_TINT) 1308 if ((bg_flags & BG_NEEDS_TINT)
1310 && (bg_flags & (BG_TINT_BITAND | BG_HAS_RENDER))) 1309 && (bg_flags & (BG_TINT_BITAND | BG_HAS_RENDER)))
1311 { 1310 {
1312 if (tint_pixmap (bg_pixmap, visual, window_width, window_height)) 1311 if (tint_pixmap (bg_pixmap, visual, window_width, window_height))
1313 result &= ~BG_NEEDS_TINT; 1312 result &= ~BG_NEEDS_TINT;
1314 } 1313 }
1315 } /* server side rendering completed */ 1314 } /* server side rendering completed */
1315 }
1316 } 1316 }
1317 1317
1318 if (recoded_root_pmap != root_pixmap) 1318 if (recoded_root_pmap != root_pixmap)
1319 XFreePixmap (dpy, recoded_root_pmap); 1319 XFreePixmap (dpy, recoded_root_pmap);
1320 1320

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines