diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-01 20:42:44 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-01 20:42:44 +0100 |
commit | 8f7078eba71dcd2aa70bf97c03ed7b4341260143 (patch) | |
tree | e57fc034a18a8d063a0e03a0129c3ec6a6fb36d9 /boilerplate | |
parent | d209b40c64bddeb0d830678bc2f84e1016fed879 (diff) |
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.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/cairo-boilerplate-xlib.c | 72 |
1 files changed, 4 insertions, 68 deletions
diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c index 1ddaaf40..61bdd5a1 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 |