[cairo-commit] boilerplate/cairo-boilerplate.c

Jamey Sharp jamey at kemper.freedesktop.org
Sun Oct 29 13:50:39 PST 2006


 boilerplate/cairo-boilerplate.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletion(-)

New commits:
diff-tree 504ea250f7c052525cf28536c767d4f9f57e7cc9 (from bc983700c463671128822e2eb9f74cbe834a1c1b)
Author: Jamey Sharp <jamey at minilop.net>
Date:   Sun Oct 29 13:48:14 2006 -0800

    XCB/perf: implement boilerplate_xcb_synchronize for fair performance tests.
    
    It sure was nice when some tests showed XCB to be 1300 times faster
    than Xlib though...

diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 9508338..33298dc 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -787,6 +787,16 @@ typedef struct _xcb_target_closure
     xcb_pixmap_t pixmap;
 } xcb_target_closure_t;
 
+static void
+boilerplate_xcb_synchronize (void *closure)
+{
+    xcb_target_closure_t *xtc = closure;
+    free (xcb_get_image_reply (xtc->c,
+		xcb_get_image (xtc->c, XCB_IMAGE_FORMAT_Z_PIXMAP,
+		    xtc->pixmap, 0, 0, 1, 1, /* AllPlanes */ ~0UL),
+		0));
+}
+
 static cairo_surface_t *
 create_xcb_surface (const char			 *name,
 		    cairo_content_t		  content,
@@ -1440,7 +1450,8 @@ cairo_boilerplate_target_t targets[] =
     /* Acceleration architectures may make the results differ by a
      * bit, so we set the error tolerance to 1. */
     { "xcb", CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR_ALPHA, 1,
-      create_xcb_surface, cairo_surface_write_to_png, cleanup_xcb},
+      create_xcb_surface, cairo_surface_write_to_png, cleanup_xcb,
+      boilerplate_xcb_synchronize},
 #endif
 #if CAIRO_HAS_XLIB_SURFACE
     /* Acceleration architectures may make the results differ by a


More information about the cairo-commit mailing list