[cairo-commit] src/cairo-xlib-display.c src/cairo-xlib-surface-shm.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Aug 24 04:00:58 PDT 2012
src/cairo-xlib-display.c | 4 ++--
src/cairo-xlib-surface-shm.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 5355eab17d026f5d5566e6de47c9dbffc5ece5d0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Aug 24 10:34:05 2012 +0100
xlib/shm: Reduce the frequency at which we emit events
Flushing the shm operation is a fairly rare event, as it is typically
only involved with mixed rendering on a similar image, and should be
triggering its own events. Therefore we should be able to reduce our
event emission to the critical points in order to limit the amount of
extra overhead we generate.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c
index 32e4699..f23a655 100644
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -63,6 +63,8 @@ _cairo_xlib_display_finish (void *abstract_display)
cairo_xlib_display_t *display = abstract_display;
Display *dpy = display->display;
+ _cairo_xlib_display_fini_shm (display);
+
if (! cairo_device_acquire (&display->base)) {
cairo_xlib_error_func_t old_handler;
@@ -83,8 +85,6 @@ _cairo_xlib_display_finish (void *abstract_display)
link));
}
- _cairo_xlib_display_fini_shm (display);
-
XSync (dpy, False);
XSetErrorHandler (old_handler);
diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index 25e6a87..2174c96 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -618,6 +618,7 @@ _cairo_xlib_shm_surface_finish (void *abstract_surface)
if (active (shm, display->display)) {
shm->info->last_request = shm->active;
_pqueue_push (&display->shm->info, shm->info);
+ trigger_event (display);
} else {
_cairo_mempool_free (&shm->info->pool->mem, shm->info->mem);
free (shm->info);
@@ -1123,7 +1124,6 @@ _cairo_xlib_shm_surface_mark_active (cairo_surface_t *surface)
shm = (cairo_xlib_shm_surface_t *) surface;
shm->active = next_request (surface->device);
- trigger_event ((cairo_xlib_display_t *)shm->image.base.device);
}
XRenderPictFormat *
More information about the cairo-commit
mailing list