mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-03 10:10:34 +01:00
[test/surface-pattern-scale-down] Propagate errors.
Use cairo_get_target() to propagate errors from the secondary context.
This commit is contained in:
parent
b5551cfce2
commit
e8de7d1c36
1 changed files with 4 additions and 3 deletions
|
|
@ -55,6 +55,8 @@ draw (cairo_t *cr, int width, int height)
|
|||
surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
|
||||
surface_size, surface_size);
|
||||
cr_surface = cairo_create (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
cairo_set_source_rgb (cr_surface, 1, 1, 1);
|
||||
cairo_rectangle (cr_surface,
|
||||
0, 0,
|
||||
|
|
@ -75,12 +77,11 @@ draw (cairo_t *cr, int width, int height)
|
|||
surface_size / 2, surface_size / 2,
|
||||
surface_size / 2, surface_size / 2);
|
||||
cairo_fill (cr_surface);
|
||||
cairo_destroy (cr_surface);
|
||||
|
||||
cairo_scale (cr, 0.2, 0.2);
|
||||
cairo_rotate (cr, 1.);
|
||||
cairo_set_source_surface (cr, surface, 225, -225);
|
||||
cairo_surface_destroy (surface);
|
||||
cairo_set_source_surface (cr, cairo_get_target (cr_surface), 225, -225);
|
||||
cairo_destroy (cr_surface);
|
||||
|
||||
cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_NONE);
|
||||
cairo_paint (cr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue