summaryrefslogtreecommitdiff
path: root/boilerplate/cairo-boilerplate.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-06-21 10:08:21 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-06-21 10:13:31 +0100
commitd0c1c9282164bffb76f7419873e93608dc6d9876 (patch)
tree98d47720e0ebac4eed1352d4ff0ffe97a2e0075b /boilerplate/cairo-boilerplate.c
parentd2244053dcca687a878b1008e3a8219f11d7bd0d (diff)
downloadcairo-d0c1c9282164bffb76f7419873e93608dc6d9876.tar.gz
[boilerplate] Implement a reference xlib surface
Create an xlib target that uses a separate display, specified by CAIRO_REFERENCE_DISPLAY, that can be used as a reference implementation for the normal display. So this can be used by cairo-trace-test to create a reference surface that mimics exactly the true surface, but if it targets an Xvfb display will be entirely rendered in software. If CAIRO_REFERENCE_DISPLAY is not set, the reference surface degrades into an xlib-fallback surface which is a close approximation (but still has behavioural differences).
Diffstat (limited to 'boilerplate/cairo-boilerplate.c')
-rw-r--r--boilerplate/cairo-boilerplate.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 50a28f89c..39a1a4a92 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -552,7 +552,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-fallback",
+ "xlib", "xlib", NULL, "xlib-reference",
CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR_ALPHA, 1,
_cairo_boilerplate_xlib_create_surface,
NULL, NULL,
@@ -562,7 +562,7 @@ static const cairo_boilerplate_target_t targets[] =
_cairo_boilerplate_xlib_synchronize
},
{
- "xlib", "xlib", NULL, "xlib-fallback",
+ "xlib", "xlib", NULL, "xlib-reference",
CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
_cairo_boilerplate_xlib_create_surface,
NULL, NULL,
@@ -571,6 +571,16 @@ static const cairo_boilerplate_target_t targets[] =
_cairo_boilerplate_xlib_cleanup,
_cairo_boilerplate_xlib_synchronize
},
+ {
+ "xlib-reference", "xlib", NULL, NULL,
+ CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
+ _cairo_boilerplate_xlib_reference_create_surface,
+ NULL, NULL,
+ NULL, /* get_image */
+ cairo_surface_write_to_png,
+ _cairo_boilerplate_xlib_cleanup,
+ _cairo_boilerplate_xlib_synchronize
+ },
#endif
#if CAIRO_HAS_XLIB_SURFACE
/* This is a fallback surface which uses xlib fallbacks instead of