[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:
M Joonas Pihlaja 2009-11-29 15:40:30 +02:00
parent e09b754fdd
commit b76565d2f4

View file

@ -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);