[cairo] [PATCH 11/39] [OpenVG] check for, and include /vg/openvg.h instead of /VG/openvg.h

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


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

---
 src/cairo-openvg-surface.c |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/cairo-openvg-surface.c b/src/cairo-openvg-surface.c
index 364e855..379d30c 100644
--- a/src/cairo-openvg-surface.c
+++ b/src/cairo-openvg-surface.c
@@ -36,7 +36,7 @@
 
 #include "cairoint.h"
 #include "cairo-openvg.h"
-#include <VG/openvg.h>
+#include <vg/openvg.h>
 
 typedef struct cairo_openvg_surface {
     cairo_surface_t base;
@@ -254,7 +254,7 @@ _cairo_openvg_cairo_operator_to_openvg (cairo_operator_t op)
             return VG_BLEND_SRC_IN;
         case CAIRO_OPERATOR_OUT:
         case CAIRO_OPERATOR_ATOP:
-            return VG_BLEND_SRC_ATOP_SH;
+            /*return VG_BLEND_SRC_ATOP_SH;*/
         case CAIRO_OPERATOR_DEST:
         case CAIRO_OPERATOR_DEST_OVER:
         case CAIRO_OPERATOR_DEST_IN:
@@ -438,7 +438,7 @@ static cairo_status_t
 _cairo_openvg_setup_surface_source (cairo_openvg_surface_t  *vgsurface,
                                     cairo_surface_pattern_t *spat)
 {
-  VGfloat color[] = {0.7, 0.5, 0.3, 0.5};
+  VGfloat color[] = {1.0, 1.0, 1.0, 1.0};
   vgSetParameterfv (vgsurface->source_paint, VG_PAINT_COLOR, 4, color);
   printf ("not handling source of type surface\n");
 
@@ -449,9 +449,11 @@ _cairo_openvg_setup_surface_source (cairo_openvg_surface_t  *vgsurface,
     int i;
     for (i=0;i<128*128*4;i++)
       {
-        data[i] = rand() % 255;
-        if (0 && i%4 == 3)
+        data[i] = 0;/*rand() % 255;*/
+        if (i%4 == 3)
           data[i] = 255;
+        if (i%4 == 2)
+          data[i] = rand ()%255;
       }
 
     vgImageSubData (vgsurface->source_image, data, 128*4, VG_sRGBA_8888, 0,
@@ -604,19 +606,18 @@ _cairo_openvg_surface_fill (void *asurface,
   if (rv)
     goto BAIL;
 
-  vgSetPaint(vgsurface->source_paint, VG_FILL_PATH);
 
 
 
   if (vgsurface->source_image)
     {
       printf ("WARNING: attempting to paint with image pattern\n");
-      vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY);
+      vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
       vgSetParameteri(vgsurface->source_image, VG_PAINT_PATTERN_TILING_MODE,
                       VG_TILE_REPEAT);
-      /*vgPaintPattern(vgsurface->source_paint, vgsurface->source_image);*/
-
+      vgPaintPattern(vgsurface->source_paint, vgsurface->source_image);
     }
+  vgSetPaint(vgsurface->source_paint, VG_FILL_PATH);
 
   vgDrawPath (vg_path.path, VG_FILL_PATH);
 
@@ -689,8 +690,15 @@ cairo_openvg_surface_create (int width, int height)
 
 
     vgLoadIdentity();
+#if 0
+    /* ShivaVG */
     vgTranslate (-1.0, 1.0);
     vgScale (2.0/width, -2.0/height);
+#else
+    /* AmanithVG */
+    vgTranslate (0.0, height);
+    vgScale (1.0, -1.0);
+#endif
 
     return (cairo_surface_t *) s;
 }
-- 
1.6.0.4



More information about the cairo mailing list