test: Fix clip-device-offset

The test was incorrectly translating the "target" of the context
instead of the "group target" (i.e. the current destination).

"cairo-test-suite -a" runs the tests on similar surfaces created using
cairo_push_group (), thus without this change the device-offset did
not affect the real destination surface.

Fixes clip-device-offset.
This commit is contained in:
Andrea Canciani 2011-02-13 17:28:31 +01:00
parent 7ad3aebbe6
commit 34612c400d

View file

@ -54,8 +54,8 @@ draw (cairo_t *cr, int width, int height)
cairo_pattern_t *source;
double old_x, old_y;
cairo_surface_get_device_offset (cairo_get_target (cr), &old_x, &old_y);
cairo_surface_set_device_offset (cairo_get_target (cr), old_x+5, old_y+5);
cairo_surface_get_device_offset (cairo_get_group_target (cr), &old_x, &old_y);
cairo_surface_set_device_offset (cairo_get_group_target (cr), old_x+5, old_y+5);
source = create_green_source ();
cairo_set_source (cr, source);
@ -66,7 +66,7 @@ draw (cairo_t *cr, int width, int height)
cairo_clip (cr);
cairo_paint (cr);
cairo_surface_set_device_offset (cairo_get_target (cr), old_x, old_y);
cairo_surface_set_device_offset (cairo_get_group_target (cr), old_x, old_y);
return CAIRO_TEST_SUCCESS;
}