summaryrefslogtreecommitdiff
path: root/src/cairo-xlib-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-08-30 14:24:12 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-08-30 15:17:38 +0100
commit70cd3b473d09e9ad3d803014a904a22639db1a24 (patch)
tree45be818179ce0ce6e95cf2ddeb6e300922889407 /src/cairo-xlib-surface.c
parent6b1daace578673c72a22a2fac72df9af2312cb10 (diff)
api: Extend cairo_antialias_t to include performace/quality hints
The existing API only described the method to be used for performing rasterisation and unlike other API provided no opportunity for the user to give a hint as to how to trade off performance against speed. So in order to no be overly prescriptive, we extend the NONE/GRAY/SUBPIXEL methods with FAST/GOOD/BEST hints and leave the backend to decide how best to achieve those goals. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xlib-surface.c')
-rw-r--r--src/cairo-xlib-surface.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 96d599328..e82de6505 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -1097,8 +1097,11 @@ _cairo_xlib_surface_set_precision (cairo_xlib_display_t *display,
case CAIRO_ANTIALIAS_DEFAULT:
case CAIRO_ANTIALIAS_GRAY:
case CAIRO_ANTIALIAS_NONE:
+ case CAIRO_ANTIALIAS_FAST:
+ case CAIRO_ANTIALIAS_GOOD:
precision = PolyModeImprecise;
break;
+ case CAIRO_ANTIALIAS_BEST:
case CAIRO_ANTIALIAS_SUBPIXEL:
precision = PolyModePrecise;
break;
@@ -2966,21 +2969,9 @@ _cairo_xlib_surface_composite_trapezoids (cairo_operator_t op,
goto BAIL;
}
- switch (antialias) {
- case CAIRO_ANTIALIAS_NONE:
- pict_format =
- _cairo_xlib_display_get_xrender_format (display,
- CAIRO_FORMAT_A1);
- break;
- case CAIRO_ANTIALIAS_GRAY:
- case CAIRO_ANTIALIAS_SUBPIXEL:
- case CAIRO_ANTIALIAS_DEFAULT:
- default:
- pict_format =
- _cairo_xlib_display_get_xrender_format (display,
- CAIRO_FORMAT_A8);
- break;
- }
+ pict_format =
+ _cairo_xlib_display_get_xrender_format (display,
+ antialias == CAIRO_ANTIALIAS_NONE ? CAIRO_FORMAT_A1 : CAIRO_FORMAT_A8);
status = _cairo_xlib_surface_set_clip_region (dst, clip_region);
if (unlikely (status))