summaryrefslogtreecommitdiff
path: root/test/subsurface-repeat.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-04-28 14:26:21 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-04-30 10:16:24 +0100
commit8ded35fd69ed0bbb07359c0278071a25af66571c (patch)
treee6b44acf234b3399306240600c29f470e6045e92 /test/subsurface-repeat.c
parent5fc04bba9fa8ddda8cf7d7a97015f21a21429172 (diff)
downloadcairo-8ded35fd69ed0bbb07359c0278071a25af66571c.tar.gz
ps: Enable native encoding of subsurface patterns.
Carefully handle subsurfaces of a recording surface through the analysis and paginated surfaces so that we can generate a native pattern for the vector backends, demonstrated by the PostScript backend. Nothing remarkable, just a lot of bookkeeping to track the wrapped surface types and to apply the correct offsets when generating the subsurface pattern.
Diffstat (limited to 'test/subsurface-repeat.c')
-rw-r--r--test/subsurface-repeat.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/subsurface-repeat.c b/test/subsurface-repeat.c
index 849c0dfd2..84e25f4fb 100644
--- a/test/subsurface-repeat.c
+++ b/test/subsurface-repeat.c
@@ -36,7 +36,7 @@ draw (cairo_t *cr, int width, int height)
/* fill the centre */
region = cairo_surface_create_for_rectangle (cairo_get_target (cr),
- 0, 0, 20, 20);
+ 20, 20, 20, 20);
cr_region = cairo_create (region);
cairo_surface_destroy (region);
@@ -58,8 +58,12 @@ draw (cairo_t *cr, int width, int height)
cairo_set_source_surface (cr, cairo_get_target (cr_region), 20, 20);
cairo_destroy (cr_region);
+
+ /* repeat the pattern around the outside, but do not overwrite...*/
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
- cairo_paint (cr);
+ cairo_rectangle (cr, 0, 0, width, height);
+ cairo_rectangle (cr, 20, 40, 20, -20);
+ cairo_fill (cr);
return CAIRO_TEST_SUCCESS;
}