summaryrefslogtreecommitdiff
path: root/src/cairo-clip-polygon.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-08-18 12:37:57 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-08-18 12:37:57 +0100
commitd03b0057b2865b2d51f80d874f030e52ee0c4aca (patch)
tree3531dc1b5f3a8a4b9f5517b99c7c159307884838 /src/cairo-clip-polygon.c
parent76a3d0dc11624049115cf84859eec5168194e873 (diff)
downloadcairo-d03b0057b2865b2d51f80d874f030e52ee0c4aca.tar.gz
observer: further classify general clips
A clip with only a single path or can be reduced to a single polygon are easier to handle than a clip containing a mixture of paths (typically ANTIALIAS_NONE vs ANTIALIAS_DEFAULT). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-clip-polygon.c')
-rw-r--r--src/cairo-clip-polygon.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cairo-clip-polygon.c b/src/cairo-clip-polygon.c
index 19da15dc5..0e1968d05 100644
--- a/src/cairo-clip-polygon.c
+++ b/src/cairo-clip-polygon.c
@@ -125,3 +125,20 @@ _cairo_clip_get_polygon (const cairo_clip_t *clip,
return CAIRO_STATUS_SUCCESS;
}
+
+cairo_bool_t
+_cairo_clip_is_polygon (const cairo_clip_t *clip)
+{
+ if (_cairo_clip_is_all_clipped (clip))
+ return TRUE;
+
+ /* If there is no clip, we need an infinite polygon */
+ if (clip == NULL)
+ return FALSE;
+
+ if (clip->path == NULL)
+ return TRUE;
+
+ /* check that residual is all of the same type/tolerance */
+ return can_convert_to_polygon (clip);
+}