diff options
author | Carl Worth <cworth@cworth.org> | 2006-11-14 14:35:35 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2006-11-14 15:13:58 -0800 |
commit | 28a9f1dd1407b0070a2ba1c780a6f763acb47810 (patch) | |
tree | 25887991cff7c9c8787091dbbe77daf82aef5773 /test/get-clip.c | |
parent | 7b86cf513e9f6bdf68e391f6df6f859eba05ba9c (diff) | |
download | cairo-28a9f1dd1407b0070a2ba1c780a6f763acb47810.tar.gz |
Fix get-clip test for surfaces not implementing set_clip_region
Diffstat (limited to 'test/get-clip.c')
-rw-r--r-- | test/get-clip.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/test/get-clip.c b/test/get-clip.c index cfd814190..b2a001ca4 100644 --- a/test/get-clip.c +++ b/test/get-clip.c @@ -42,6 +42,10 @@ check_count (const char *message, cairo_bool_t uses_clip_rects, if (!uses_clip_rects) { if (expected == 0 && list->num_rectangles == 0) return 1; + if (list->num_rectangles == expected) + return 1; + if (list->status == CAIRO_STATUS_CLIP_NOT_REPRESENTABLE) + return 1; cairo_test_log ("Error: %s; cairo_copy_clip_rectangles unexpectedly got %d rectangles\n", message, list->num_rectangles); return 0; @@ -122,14 +126,11 @@ draw (cairo_t *cr, int width, int height) cr2 = cairo_create (surface); cairo_surface_destroy (surface); - /* check the surface type so we ignore cairo_copy_clip_rectangles failures - on surface types that don't use rectangle lists for clipping */ + /* Check the surface type so we ignore cairo_copy_clip_rectangles failures + * on surface types that don't use rectangle lists for clipping. + * Default to FALSE for the internal surface types, (meta, test-fallback, etc.) + */ switch (cairo_surface_get_type (surface)) { - case CAIRO_SURFACE_TYPE_PDF: - case CAIRO_SURFACE_TYPE_PS: - case CAIRO_SURFACE_TYPE_SVG: - uses_clip_rects = 0; - break; case CAIRO_SURFACE_TYPE_IMAGE: case CAIRO_SURFACE_TYPE_XLIB: case CAIRO_SURFACE_TYPE_XCB: @@ -138,8 +139,15 @@ draw (cairo_t *cr, int width, int height) case CAIRO_SURFACE_TYPE_WIN32: case CAIRO_SURFACE_TYPE_BEOS: case CAIRO_SURFACE_TYPE_DIRECTFB: + uses_clip_rects = TRUE; + break; + case CAIRO_SURFACE_TYPE_PDF: + case CAIRO_SURFACE_TYPE_PS: + case CAIRO_SURFACE_TYPE_SVG: + case CAIRO_SURFACE_TYPE_NQUARTZ: + case CAIRO_SURFACE_TYPE_OS2: default: - uses_clip_rects = 1; + uses_clip_rects = FALSE; break; } |