diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-12-20 18:15:48 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-12-20 21:21:32 +0000 |
commit | 3bf06c336629d9a485fdb150058897e5a6a30b45 (patch) | |
tree | 979bd85b70707deb4e1b88ed8406571ba9a53b01 /test | |
parent | 643834e7aa3e90678276453439017359ef942c9e (diff) |
[test/*] Create new surfaces using the group target.
cairo_get_target() returns the original surface passed to
cairo_create(), and not the current destination as required when
testing drawing to the same surface using multiple contexts.
For completeness we also use the group target when creating similar
surfaces within the tests (to check that similar surfaces of similar
surfaces also work).
Diffstat (limited to 'test')
-rw-r--r-- | test/cairo-test.c | 2 | ||||
-rw-r--r-- | test/clip-nesting.c | 2 | ||||
-rw-r--r-- | test/clip-operator.c | 2 | ||||
-rw-r--r-- | test/clip-zero.c | 2 | ||||
-rw-r--r-- | test/device-offset-positive.c | 2 | ||||
-rw-r--r-- | test/device-offset.c | 2 | ||||
-rw-r--r-- | test/get-clip.c | 2 | ||||
-rw-r--r-- | test/get-path-extents.c | 2 | ||||
-rw-r--r-- | test/invalid-matrix.c | 2 | ||||
-rw-r--r-- | test/mask.c | 4 | ||||
-rw-r--r-- | test/meta-surface-pattern.c | 2 | ||||
-rw-r--r-- | test/operator-clear.c | 2 | ||||
-rw-r--r-- | test/operator-source.c | 4 | ||||
-rw-r--r-- | test/pixman-rotate.c | 2 | ||||
-rw-r--r-- | test/self-copy.c | 2 | ||||
-rw-r--r-- | test/source-clip-scale.c | 2 | ||||
-rw-r--r-- | test/source-clip.c | 2 | ||||
-rw-r--r-- | test/svg-clip.c | 2 | ||||
-rw-r--r-- | test/unbounded-operator.c | 2 |
19 files changed, 21 insertions, 21 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c index 9e1bdfe76..8fbd5e31f 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -241,7 +241,7 @@ cairo_test_target_has_similar (const cairo_test_t *test, cairo_boilerplate_targe cairo_t * cr = cairo_create (surface); cairo_surface_t *similar; cairo_push_group_with_content (cr, target->content); - similar = cairo_get_target (cr); + similar = cairo_get_group_target (cr); has_similar = cairo_surface_get_type (similar) == cairo_surface_get_type (surface); cairo_destroy (cr); diff --git a/test/clip-nesting.c b/test/clip-nesting.c index 2d53782ae..09f77fda8 100644 --- a/test/clip-nesting.c +++ b/test/clip-nesting.c @@ -46,7 +46,7 @@ draw (cairo_t *cr, int width, int height) cairo_surface_t *target_surface; cairo_t *cr2, *cr3; - target_surface = cairo_get_target (cr); + target_surface = cairo_get_group_target (cr); cr2 = cairo_create (target_surface); diff --git a/test/clip-operator.c b/test/clip-operator.c index 0745e16ca..3bfb5ba49 100644 --- a/test/clip-operator.c +++ b/test/clip-operator.c @@ -42,7 +42,7 @@ draw_mask (cairo_t *cr, int x, int y) x += 0.05 * WIDTH; y += 0.05 * HEIGHT; - mask_surface = cairo_surface_create_similar (cairo_get_target (cr), + mask_surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_ALPHA, width, height); cr2 = cairo_create (mask_surface); diff --git a/test/clip-zero.c b/test/clip-zero.c index ec2dcc839..bf96d8c91 100644 --- a/test/clip-zero.c +++ b/test/clip-zero.c @@ -60,7 +60,7 @@ draw (cairo_t *cr, int width, int height) cairo_mask (cr, cairo_get_source (cr)); - surf = cairo_surface_create_similar (cairo_get_target (cr), CAIRO_CONTENT_COLOR_ALPHA, 0, 0); + surf = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR_ALPHA, 0, 0); pat = cairo_pattern_create_for_surface (surf); cairo_surface_destroy (surf); diff --git a/test/device-offset-positive.c b/test/device-offset-positive.c index 908061282..ab1adcfff 100644 --- a/test/device-offset-positive.c +++ b/test/device-offset-positive.c @@ -59,7 +59,7 @@ draw (cairo_t *cr, int width, int height) draw_square (cr); /* Then, create an offset surface and repeat the drawing in red. */ - target = cairo_get_target (cr); + target = cairo_get_group_target (cr); surface = cairo_surface_create_similar (target, cairo_surface_get_content (target), SIZE / 2, SIZE / 2); diff --git a/test/device-offset.c b/test/device-offset.c index 5f0eb80f0..cee603f3c 100644 --- a/test/device-offset.c +++ b/test/device-offset.c @@ -59,7 +59,7 @@ draw (cairo_t *cr, int width, int height) draw_square (cr); /* Then, create an offset surface and repeat the drawing in red. */ - target = cairo_get_target (cr); + target = cairo_get_group_target (cr); surface = cairo_surface_create_similar (target, cairo_surface_get_content (target), SIZE / 2, SIZE / 2); diff --git a/test/get-clip.c b/test/get-clip.c index 0de84e904..bd92e1e1e 100644 --- a/test/get-clip.c +++ b/test/get-clip.c @@ -119,7 +119,7 @@ draw (cairo_t *cr, int width, int height) const char *phase; cairo_bool_t uses_clip_rects; - surface = cairo_surface_create_similar (cairo_get_target (cr), + surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR, 100, 100); /* don't use cr accidentally */ cr = NULL; diff --git a/test/get-path-extents.c b/test/get-path-extents.c index b5af7fabd..917039efc 100644 --- a/test/get-path-extents.c +++ b/test/get-path-extents.c @@ -105,7 +105,7 @@ draw (cairo_t *cr, int width, int height) cairo_text_extents_t extents; cairo_test_status_t ret = CAIRO_TEST_SUCCESS; - surface = cairo_surface_create_similar (cairo_get_target (cr), + surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR, 100, 100); /* don't use cr accidentally */ cr = NULL; diff --git a/test/invalid-matrix.c b/test/invalid-matrix.c index d6b4f5044..8a5a9bff3 100644 --- a/test/invalid-matrix.c +++ b/test/invalid-matrix.c @@ -77,7 +77,7 @@ if ((status) == CAIRO_STATUS_SUCCESS) { \ cairo_matrix_init_identity (&identity); - target = cairo_get_target (cr); + target = cairo_get_group_target (cr); /* test cairo_transform with invalid matrix */ cr2 = cairo_create (target); diff --git a/test/mask.c b/test/mask.c index 984b82df8..14dd8b30e 100644 --- a/test/mask.c +++ b/test/mask.c @@ -75,7 +75,7 @@ mask_polygon (cairo_t *cr, int x, int y) cairo_surface_t *mask_surface; cairo_t *cr2; - mask_surface = cairo_surface_create_similar (cairo_get_target (cr), + mask_surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_ALPHA, WIDTH, HEIGHT); cr2 = cairo_create (mask_surface); @@ -199,7 +199,7 @@ draw (cairo_t *cr, int width, int height) /* Some of our drawing is unbounded, so we draw each test to * a temporary surface and copy over. */ - tmp_surface = cairo_surface_create_similar (cairo_get_target (cr), + tmp_surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR_ALPHA, IMAGE_WIDTH, IMAGE_HEIGHT); cr2 = cairo_create (tmp_surface); diff --git a/test/meta-surface-pattern.c b/test/meta-surface-pattern.c index 4d280c71a..a047b3e3b 100644 --- a/test/meta-surface-pattern.c +++ b/test/meta-surface-pattern.c @@ -58,7 +58,7 @@ draw (cairo_t *cr, int width, int height) cairo_translate (cr, PAD, PAD); - pat_surface = cairo_surface_create_similar (cairo_get_target (cr), + pat_surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR_ALPHA, PAT_WIDTH, PAT_HEIGHT); diff --git a/test/operator-clear.c b/test/operator-clear.c index d0760470b..e6cb042a7 100644 --- a/test/operator-clear.c +++ b/test/operator-clear.c @@ -61,7 +61,7 @@ draw_mask (cairo_t *cr, int x, int y) x += 0.05 * WIDTH; y += 0.05 * HEIGHT; - mask_surface = cairo_surface_create_similar (cairo_get_target (cr), + mask_surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_ALPHA, width, height); cr2 = cairo_create (mask_surface); diff --git a/test/operator-source.c b/test/operator-source.c index 4224c15cc..e63bceaf9 100644 --- a/test/operator-source.c +++ b/test/operator-source.c @@ -67,7 +67,7 @@ set_surface_pattern (cairo_t *cr, int x, int y) x += 0.2 * WIDTH; y += 0.2 * HEIGHT; - source_surface = cairo_surface_create_similar (cairo_get_target (cr), + source_surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR_ALPHA, width, height); cr2 = cairo_create (source_surface); @@ -98,7 +98,7 @@ draw_mask (cairo_t *cr, int x, int y) x += 0.05 * WIDTH; y += 0.05 * HEIGHT; - mask_surface = cairo_surface_create_similar (cairo_get_target (cr), + mask_surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_ALPHA, width, height); cr2 = cairo_create (mask_surface); diff --git a/test/pixman-rotate.c b/test/pixman-rotate.c index 118b82e10..4d8e3001f 100644 --- a/test/pixman-rotate.c +++ b/test/pixman-rotate.c @@ -55,7 +55,7 @@ draw (cairo_t *cr, int width, int height) cairo_surface_t *stamp; cairo_t *cr2; - stamp = cairo_surface_create_similar (cairo_get_target (cr), + stamp = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR_ALPHA, WIDTH, HEIGHT); cr2 = cairo_create (stamp); diff --git a/test/self-copy.c b/test/self-copy.c index 0c238555f..63e18974e 100644 --- a/test/self-copy.c +++ b/test/self-copy.c @@ -58,7 +58,7 @@ draw (cairo_t *cr, int width, int height) /* Create a pattern with the target surface as the source, * offset by SIZE/2 */ - pattern = cairo_pattern_create_for_surface (cairo_get_target (cr)); + pattern = cairo_pattern_create_for_surface (cairo_get_group_target (cr)); cairo_matrix_init_translate (&matrix, - SIZE / 2, - SIZE / 2); cairo_pattern_set_matrix (pattern, &matrix); diff --git a/test/source-clip-scale.c b/test/source-clip-scale.c index cc2496911..26684d304 100644 --- a/test/source-clip-scale.c +++ b/test/source-clip-scale.c @@ -44,7 +44,7 @@ draw (cairo_t *cr, int width, int height) cairo_surface_t *source; cairo_t *cr2; - source = cairo_surface_create_similar (cairo_get_target (cr), + source = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR_ALPHA, SIZE, SIZE); cr2 = cairo_create (source); diff --git a/test/source-clip.c b/test/source-clip.c index cb9386a3c..46eb233b1 100644 --- a/test/source-clip.c +++ b/test/source-clip.c @@ -44,7 +44,7 @@ draw (cairo_t *cr, int width, int height) cairo_surface_t *source; cairo_t *cr2; - source = cairo_surface_create_similar (cairo_get_target (cr), + source = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_COLOR_ALPHA, SIZE, SIZE); diff --git a/test/svg-clip.c b/test/svg-clip.c index 81af1040f..338f28f1e 100644 --- a/test/svg-clip.c +++ b/test/svg-clip.c @@ -76,7 +76,7 @@ test_clip (cairo_t *cr, double width, double height) /* Create a new context for this surface to test overlapped * drawing from two contexts */ - cr2 = cairo_create (cairo_get_target (cr)); + cr2 = cairo_create (cairo_get_group_target (cr)); /* Using the new context, draw a black vertical line, which should * appear unclipped on top of everything drawn so far. */ diff --git a/test/unbounded-operator.c b/test/unbounded-operator.c index e04ec8031..06f5cb128 100644 --- a/test/unbounded-operator.c +++ b/test/unbounded-operator.c @@ -43,7 +43,7 @@ draw_mask (cairo_t *cr, int x, int y) x += 0.05 * WIDTH; y += 0.05 * HEIGHT; - mask_surface = cairo_surface_create_similar (cairo_get_target (cr), + mask_surface = cairo_surface_create_similar (cairo_get_group_target (cr), CAIRO_CONTENT_ALPHA, width, height); cr2 = cairo_create (mask_surface); |