32 #include <X11/extensions/Xrender.h>
41 Display* dpy = QX11Info::display();
47 unsigned int border_w, depth;
48 if( XGetGeometry( dpy, pixmap, &root, &x, &y, &w, &h, &border_w, &depth )
49 && !handler.
error(
false ) && w > 0 && h > 0 )
55 if(
int( depth ) != pm.depth() && depth != 1 && pm.x11PictureHandle() !=
None )
57 XRenderPictFormat tmpl;
58 tmpl.type = PictTypeDirect;
60 XRenderPictFormat* format = XRenderFindFormat( dpy, PictFormatType | PictFormatDepth, &tmpl, 0 );
61 Picture pic = XRenderCreatePicture( dpy, pixmap, format, 0, NULL );
62 XRenderComposite( dpy, PictOpSrc, pic,
None, pm.x11PictureHandle(), 0, 0, 0, 0, 0, 0, w, h );
63 XRenderFreePicture( dpy, pic );
68 GC gc = XCreateGC( dpy, pixmap, 0, NULL );
72 XCopyArea( dpy, pixmap, bm.handle(), gc, 0, 0, w, h, 0, 0 );
76 XCopyArea( dpy, pixmap, pm.handle(), gc, 0, 0, w, h, 0, 0 );
80 if( pixmap_mask !=
None )
84 GC gc = XCreateGC( dpy, pixmap_mask, 0, NULL );
85 XCopyArea( dpy, pixmap_mask, bm.handle(), gc, 0, 0, w, h, 0, 0 );
89 if( !handler.
error(
true ))
103 return ( time1 - time2 ) < 0x7fffffffU ? 1 : -1;
108 return time2 - time1;
117 return quint32( time1 - time2 ) < 0x7fffffffU ? 1 : -1;
124 return quint32( time2 - time1 );