[cairo] A minor modification to mask.c

Emmanuel Pacaud emmanuel.pacaud at univ-poitiers.fr
Mon Apr 17 14:52:29 PDT 2006


I would like to make this little change to mask.c:

diff --git a/test/mask.c b/test/mask.c
index a9414e0..ec3d748 100644
--- a/test/mask.c
+++ b/test/mask.c
@@ -215,10 +215,8 @@ draw (cairo_t *cr, int width, int height

                /* Clear area we are going to be drawing onto */
                cairo_save (cr2);
-               cairo_set_source_rgba (cr2, 0, 0, 0, 0); /* transparent
-               cairo_set_operator (cr2, CAIRO_OPERATOR_SOURCE);
-               cairo_rectangle (cr2, x, y, WIDTH, HEIGHT);
-               cairo_fill (cr2);
+               cairo_set_operator (cr2, CAIRO_OPERATOR_CLEAR);
+               cairo_paint (cr2);
                cairo_restore (cr2);

When testing SVG backend, this test fails because librsvg doesn't
support (yet) SVG 1.2 operators. But completely clearing a surface works
because of an optimisation in SVG backend that doesn't require the use
of those features.

Since the goal of this test is to test mask operations, and not the
behaviour of operators, I guess we can do this change.



More information about the cairo mailing list