diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-24 16:44:52 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-24 16:44:52 +0000 |
commit | c2b829c7181c7f25876f6df948f181529de5f5d5 (patch) | |
tree | 9fcbf5e538276c628fb3f177725065c3400541e7 | |
parent | 1a6acd6596d6b568d0dbf48ade8c5982c884cda1 (diff) |
xlib: Tweak synchronisation
Dispose of the old workaround!
-rw-r--r-- | xlib.c | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -13,23 +13,18 @@ struct xlib_device { Display *display; Window drawable; - Pixmap pixmap, flush; - GC gc; + Pixmap pixmap; }; static void destroy (struct framebuffer *fb) { - struct xlib_device *device = (struct xlib_device *) fb->device; - XCopyArea(device->display, device->pixmap, device->flush, device->gc, - 0, 0, 1, 1, 0, 0); } static void show (struct framebuffer *fb) { struct xlib_device *device = (struct xlib_device *) fb->device; - XImage *image; cairo_t *cr; cr = cairo_create (device->base.scanout); @@ -37,12 +32,14 @@ show (struct framebuffer *fb) cairo_paint (cr); cairo_destroy (cr); - //XSync (device->display, True); - image = XGetImage(device->display, device->flush, - 0, 0, 1, 1, - AllPlanes, ZPixmap); - if (image) - XDestroyImage(image); + if (1) { + XImage *image = XGetImage(device->display, + device->pixmap, + 0, 0, 1, 1, + AllPlanes, ZPixmap); + if (image) + XDestroyImage(image); + } } static struct framebuffer * @@ -90,10 +87,6 @@ xlib_open (int argc, char **argv) DefaultVisual (dpy, screen), device->base.width, device->base.height); - device->flush = XCreatePixmap(dpy, device->drawable, - 1, 1, DefaultDepth (dpy, screen)); - device->gc = XCreateGC(dpy, device->flush, 0, NULL); - device->pixmap = XCreatePixmap(dpy, device->drawable, device->base.width, device->base.height, DefaultDepth (dpy, screen)); |