diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-05-27 15:59:37 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-01 16:50:25 +0100 |
commit | 63bdae27a83381fb8c3786c2d7a6c2592e388ee9 (patch) | |
tree | 1897d8eac8bf89bfdc1fb6c99a1ee59b044e5143 /src/cairo-xlib-display.c | |
parent | e21b373c94b1edb2828d4fee7ff45060fb22dbda (diff) |
xlib,xcb: Force strict adherence to the Render specification when testing
Introduce cairo_xlib_device_debug_set_precision() to override the
automatic selection of rendering precision and force the Xorg/DDX to
strictly adhere to the precise rendering mode of the Render
specification. This allows us to test drivers without worrying, too
much, about minor discrepancies in antialiasing.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xlib-display.c')
-rw-r--r-- | src/cairo-xlib-display.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c index bef9c839..0dab5586 100644 --- a/src/cairo-xlib-display.c +++ b/src/cairo-xlib-display.c @@ -350,6 +350,8 @@ _cairo_xlib_device_create (Display *dpy) memset (display->cached_xrender_formats, 0, sizeof (display->cached_xrender_formats)); + display->force_precision = -1; + /* Prior to Render 0.10, there is no protocol support for gradients and * we call function stubs instead, which would silently consume the drawing. */ @@ -642,3 +644,22 @@ _cairo_xlib_display_has_gradients (cairo_device_t *device) { return ! ((cairo_xlib_display_t *) device)->buggy_gradients; } + +void +cairo_xlib_device_debug_set_precision (cairo_device_t *device, + int precision) +{ + if (device->status) + return; + + ((cairo_xlib_display_t *) device)->force_precision = precision; +} + +int +cairo_xlib_device_debug_get_precision (cairo_device_t *device) +{ + if (device->status) + return -1; + + return ((cairo_xlib_display_t *) device)->force_precision; +} |