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

Chris Wilson ickle at kemper.freedesktop.org
Thu Apr 1 12:44:07 PDT 2010


 boilerplate/cairo-boilerplate-xlib.c |   72 +----------------------------------
 1 file changed, 4 insertions(+), 68 deletions(-)

New commits:
commit 8f7078eba71dcd2aa70bf97c03ed7b4341260143
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Apr 1 20:42:44 2010 +0100

    boilerplate: Allox xlib-fallback to build without RENDER
    
    This surface doesn't use RENDER and should produce the same results
    when cairo-xlib is compiled without any support for RENDER.

diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c
index 1ddaaf4..61bdd5a 100644
--- a/boilerplate/cairo-boilerplate-xlib.c
+++ b/boilerplate/cairo-boilerplate-xlib.c
@@ -269,8 +269,10 @@ cairo_boilerplate_xlib_surface_disable_render (cairo_surface_t *abstract_surface
 
     return CAIRO_STATUS_SUCCESS;
 }
+#endif
 
 
+#if CAIRO_HAS_XLIB_SURFACE
 /* The xlib-fallback target differs from the xlib target in two ways:
  *
  * 1. It creates its surfaces without relying on the Render extension
@@ -376,60 +378,6 @@ _cairo_boilerplate_xlib_fallback_create_surface (const char			 *name,
 
     return surface;
 }
-
-static cairo_surface_t *
-_cairo_boilerplate_xlib_reference_create_surface (const char			 *name,
-						  cairo_content_t			  content,
-						  double				  width,
-						  double				  height,
-						  double				  max_width,
-						  double				  max_height,
-						  cairo_boilerplate_mode_t	  mode,
-						  int                               id,
-						  void				**closure)
-{
-    xlib_target_closure_t *xtc;
-    Display *dpy;
-    cairo_surface_t *surface;
-    const char *display;
-
-    display = getenv ("CAIRO_REFERENCE_DISPLAY");
-    if (display == NULL) {
-	return _cairo_boilerplate_xlib_fallback_create_surface (name, content,
-								width, height,
-								max_width,
-								max_height,
-								mode, id,
-								closure);
-    }
-
-    *closure = xtc = xcalloc (1, sizeof (xlib_target_closure_t));
-
-    width = ceil (width);
-    if (width < 1)
-	width = 1;
-
-    height = ceil (height);
-    if (height < 1)
-	height = 1;
-
-    xtc->dpy = dpy = XOpenDisplay (display);
-    if (xtc->dpy == NULL) {
-	free (xtc);
-	CAIRO_BOILERPLATE_DEBUG (("Failed to open display: %s\n", display));
-	return NULL;
-    }
-
-    if (mode == CAIRO_BOILERPLATE_MODE_TEST)
-	surface = _cairo_boilerplate_xlib_test_create_surface (dpy, content, width, height, xtc);
-    else /* mode == CAIRO_BOILERPLATE_MODE_PERF */
-	surface = _cairo_boilerplate_xlib_perf_create_surface (dpy, content, width, height, xtc);
-
-    if (surface == NULL || cairo_surface_status (surface))
-	_cairo_boilerplate_xlib_cleanup (xtc);
-
-    return surface;
-}
 #endif
 
 static const cairo_boilerplate_target_t targets[] = {
@@ -437,7 +385,7 @@ static const cairo_boilerplate_target_t targets[] = {
     /* Acceleration architectures may make the results differ by a
      * bit, so we set the error tolerance to 1. */
     {
-	"xlib", "xlib", NULL, "xlib-reference",
+	"xlib", "xlib", NULL, "xlib-fallback",
 	CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR_ALPHA, 1,
 	"cairo_xlib_surface_create_with_xrender_format",
 	_cairo_boilerplate_xlib_create_surface,
@@ -449,7 +397,7 @@ static const cairo_boilerplate_target_t targets[] = {
 	TRUE, FALSE, FALSE
     },
     {
-	"xlib", "xlib", NULL, "xlib-reference",
+	"xlib", "xlib", NULL, "xlib-fallback",
 	CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
 	"cairo_xlib_surface_create_with_xrender_format",
 	_cairo_boilerplate_xlib_create_surface,
@@ -460,18 +408,6 @@ static const cairo_boilerplate_target_t targets[] = {
 	_cairo_boilerplate_xlib_synchronize,
 	FALSE, FALSE, FALSE
     },
-    {
-	"xlib-reference", "xlib", NULL, NULL,
-	CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
-	"cairo_xlib_surface_create",
-	_cairo_boilerplate_xlib_reference_create_surface,
-	NULL, NULL,
-	NULL, /* get_image */
-	cairo_surface_write_to_png,
-	_cairo_boilerplate_xlib_cleanup,
-	_cairo_boilerplate_xlib_synchronize,
-	FALSE, FALSE, FALSE
-    },
 #endif
 #if CAIRO_HAS_XLIB_SURFACE
     /* This is a fallback surface which uses xlib fallbacks instead of


More information about the cairo-commit mailing list