diff options
author | Karl Tomlinson <karlt+@karlt.net> | 2010-07-17 13:08:53 +1200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-17 11:32:02 +0100 |
commit | 108b1c7825116ed3f93aa57384bbd3290cdc9181 (patch) | |
tree | 961de66109426b59e557d0e34333be350b862d4e /test/get-clip.c | |
parent | b79ea8a6cab8bd28aebecf6e1e8229d5ac017264 (diff) |
clip: consider gstate target extents in _cairo_gstate_copy_clip_rectangle_list
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29125
To be consistent with _cairo_gstate_clip_extents, the context's clip
should be intersected with the target surface extents (instead of only
using them when there is no clip).
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'test/get-clip.c')
-rw-r--r-- | test/get-clip.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/get-clip.c b/test/get-clip.c index f0477a1f2..f97db3f62 100644 --- a/test/get-clip.c +++ b/test/get-clip.c @@ -120,6 +120,22 @@ preamble (cairo_test_context_t *ctx) } cairo_rectangle_list_destroy (rectangle_list); + /* We should get the same results after applying a clip that contains the + existing clip. */ + phase = "Clip beyond surface extents"; + cairo_save (cr); + cairo_rectangle (cr, -10, -10, SIZE + 20 , SIZE + 20); + cairo_clip (cr); + rectangle_list = cairo_copy_clip_rectangle_list (cr); + if (! check_count (ctx, phase, rectangle_list, 1) || + ! check_clip_extents (ctx, phase, cr, 0, 0, SIZE, SIZE) || + ! check_rectangles_contain (ctx, phase, rectangle_list, 0, 0, SIZE, SIZE)) + { + goto FAIL; + } + cairo_rectangle_list_destroy (rectangle_list); + cairo_restore (cr); + /* Test simple clip rect. */ phase = "Simple clip rect"; cairo_save (cr); |