mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-23 09:40:45 +01:00
[test] Don't use uninitialised data in surface-source.c
The draw_pattern() function assumed the incoming surface was clear, but it's not. Explicitly clear the surface first.
This commit is contained in:
parent
e09b754fdd
commit
b76565d2f4
1 changed files with 4 additions and 0 deletions
|
|
@ -45,6 +45,10 @@ draw_pattern (cairo_surface_t **surface_inout, int surface_size)
|
|||
cr = cairo_create (*surface_inout);
|
||||
cairo_surface_destroy (*surface_inout);
|
||||
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_set_source_rgba (cr, 0, 0, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_rectangle (cr, 0, 0, surface_size, surface_size);
|
||||
cairo_rectangle (cr, mid - SIZE/4, mid + SIZE/4, SIZE/2, -SIZE/2);
|
||||
cairo_clip (cr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue