changeset 600:20b396c09c23 openvg

Integrate pattern source with paint model of canvas
author Thinker K.F. Li <thinker@branda.to>
date Thu, 01 Jul 2010 16:39:59 +0800
parents 28aa5e53abaa
children 8863d23cea4b
files include/mb_graph_engine_openvg.h src/graph_engine_openvg.c
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/include/mb_graph_engine_openvg.h	Thu Jul 01 16:31:22 2010 +0800
+++ b/include/mb_graph_engine_openvg.h	Thu Jul 01 16:39:59 2010 +0800
@@ -39,12 +39,17 @@
 #define mbe_query_font_face(family, slant, weight) ((mbe_font_face_t *)NULL)
 #define mbe_free_font_face(face)
 #define mbe_set_line_width(canvas, w)
-#define mbe_set_source_rgb(canvas, r, g, b)
+#define mbe_set_source_rgb(canvas, r, g, b)	\
+    mbe_set_source_rgba(canvas, r, g, b, 1)
 #define mbe_get_font_face(canvas) ((mbe_font_face_t *)NULL)
 #define mbe_fill_preserve(canvas)
 #define mbe_copy_source(src_canvas, dst_canvas)
 #define mbe_set_source(canvas, pattern)		\
-    do { (canvas)->src = (pattern); } while(0)
+    do {					\
+	(canvas)->src = (pattern);		\
+	(canvas)->paint = (pattern)->paint;	\
+	(canvas)->paint_installed = 0;		\
+    } while(0)
 #define mbe_reset_scissoring(canvas)
 #define mbe_get_target(canvas) ((mbe_surface_t *)(canvas)->tgt)
 #define mbe_close_path(canvas)
--- a/src/graph_engine_openvg.c	Thu Jul 01 16:31:22 2010 +0800
+++ b/src/graph_engine_openvg.c	Thu Jul 01 16:39:59 2010 +0800
@@ -12,8 +12,9 @@
 				   (((int)(0xf * b) & 0xf) << 16) |	\
 				   ((int)(0xf * a) & 0xf))
 
-void mbe_set_source_rgba(mbe_t *canvas, co_comp_t r, co_comp_t g,
-			 co_comp_t b, co_comp_t a) {
+void
+mbe_set_source_rgba(mbe_t *canvas, co_comp_t r, co_comp_t g,
+		    co_comp_t b, co_comp_t a) {
     VGPaint paint;
     VGuint color;