diff options
author | Carl Worth <cworth@cworth.org> | 2005-05-06 13:23:41 +0000 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2005-05-06 13:23:41 +0000 |
commit | d6fc5ee5e97f60972ec80fcfc52f0cf8b780d2a9 (patch) | |
tree | 9adec3ec1e637a1cca92ba8e36f3aac661217d74 /test/surface-pattern.c | |
parent | cea1de7579fad18ca6c9ec9bb29660970ec283b3 (diff) | |
download | cairo-d6fc5ee5e97f60972ec80fcfc52f0cf8b780d2a9.tar.gz |
Remove cairo_set_target_surface and all other backend-specific cairo_set_target functions. Require a cairo_surface_t* to call cairo_create.
Port to use new cairo_create interface.
Rewrite all tests that were using cairo_set_target_surface to instead create a temporary cairo_t, (eventually to be replaced with cairo_begin_group).
Diffstat (limited to 'test/surface-pattern.c')
-rw-r--r-- | test/surface-pattern.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/test/surface-pattern.c b/test/surface-pattern.c index 826b3ecd0..4f91d4336 100644 --- a/test/surface-pattern.c +++ b/test/surface-pattern.c @@ -35,25 +35,24 @@ static cairo_test_status_t draw (cairo_t *cr, int width, int height) { cairo_surface_t *surface; + cairo_t *cr2; cairo_pattern_t *pattern; surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 6, 6); - cairo_save (cr); + cr2 = cairo_create (surface); { - cairo_set_target_surface (cr, surface); - - cairo_rectangle (cr, 0, 0, 3, 3); - cairo_rectangle (cr, 3, 3, 3, 3); - cairo_set_source_rgb (cr, 1, 1, 0); - cairo_fill (cr); - - cairo_rectangle (cr, 3, 0, 3, 3); - cairo_rectangle (cr, 0, 3, 3, 3); - cairo_set_source_rgb (cr, 0, 0, 1); - cairo_fill (cr); + cairo_rectangle (cr2, 0, 0, 3, 3); + cairo_rectangle (cr2, 3, 3, 3, 3); + cairo_set_source_rgb (cr2, 1, 1, 0); + cairo_fill (cr2); + + cairo_rectangle (cr2, 3, 0, 3, 3); + cairo_rectangle (cr2, 0, 3, 3, 3); + cairo_set_source_rgb (cr2, 0, 0, 1); + cairo_fill (cr2); } - cairo_restore (cr); + cairo_destroy (cr2); pattern = cairo_pattern_create_for_surface (surface); cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); |