[cairo] [PATCH 20/39] [OpenVG] flip the cliping path vertically in the surface

tardyp at gmail.com tardyp at gmail.com
Fri Jul 10 10:02:22 PDT 2009


From: Øyvind Kolås <pippin at gimp.org>

---
 src/cairo-openvg-surface.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/cairo-openvg-surface.c b/src/cairo-openvg-surface.c
index 9f9d200..f5ecf1a 100644
--- a/src/cairo-openvg-surface.c
+++ b/src/cairo-openvg-surface.c
@@ -89,7 +89,7 @@ _cairo_openvg_surface_intersect_clip_path (void               *asurface,
   cairo_openvg_surface_t *vgsurface = asurface;
   cairo_surface_t *image;
   cairo_t               *cr;
-  cairo_pattern_t       *white;
+  cairo_pattern_t       *filled;
 
   if (path == NULL)
     {
@@ -115,6 +115,14 @@ _cairo_openvg_surface_intersect_clip_path (void               *asurface,
   cairo_paint (cr);
   cairo_restore (cr);
 
+  cairo_save (cr);
+
+  { /* flip the path upside down (perhaps we need a copy of the path?) */
+    cairo_matrix_t mat;
+    cairo_matrix_init_translate (&mat, 0, vgsurface->height);
+    cairo_matrix_scale (&mat, 1.0, -1.0);
+    _cairo_path_fixed_device_transform (path, &mat);
+  }
   status = _cairo_surface_fill (image,
                        CAIRO_OPERATOR_SOURCE,
                        filled,
@@ -122,6 +130,7 @@ _cairo_openvg_surface_intersect_clip_path (void               *asurface,
                        fill_rule,
                        tolerance,
                        antialias);
+  cairo_restore (cr);
   if (status == CAIRO_STATUS_SUCCESS)
     {
       VGImage vgimage;
-- 
1.6.0.4



More information about the cairo mailing list