summaryrefslogtreecommitdiff
path: root/test/surface-source.c
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-11-29 15:40:30 +0200
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-11-29 15:40:30 +0200
commitb76565d2f4a2510aabada4cef968b9b597bbef09 (patch)
tree9828a191b115815437d1774f1856c0a9e2cb000b /test/surface-source.c
parente09b754fdd43206e1668812be4ff11d25188148c (diff)
[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.
Diffstat (limited to 'test/surface-source.c')
-rw-r--r--test/surface-source.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/surface-source.c b/test/surface-source.c
index bd047c97..eb8be194 100644
--- a/test/surface-source.c
+++ b/test/surface-source.c
@@ -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);