changeset 593:ac942664fe86 openvg

stroke and fill for VG
author Thinker K.F. Li <thinker@branda.to>
date Wed, 30 Jun 2010 22:57:23 +0800
parents de9d210e9c38
children d416e1fff71a
files include/mb_graph_engine_openvg.h src/graph_engine_openvg.c
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/include/mb_graph_engine_openvg.h	Wed Jun 30 19:53:10 2010 +0800
+++ b/include/mb_graph_engine_openvg.h	Wed Jun 30 22:57:23 2010 +0800
@@ -62,11 +62,9 @@
 #define mbe_move_to(canvas, x, y)
 #define mbe_line_to(canvas, x, y)
 #define mbe_in_fill(canvas, x, y) (0)
-#define mbe_stroke(canvas)
 #define mbe_clear(canvas)
 #define mbe_paint(canvas)
 #define mbe_save(canvas)
-#define mbe_fill(canvas)
 #define mbe_arc(canvas, x, y, radius, angle_start, angle_stop)
 
 typedef struct _mbe_text_extents_t mbe_text_extents_t;
@@ -172,6 +170,21 @@
 
 extern mbe_t *mbe_create(mbe_surface_t *surface);
 extern void mbe_destroy(mbe_t *canvas);
+static void
+mbe_stroke(mbe_t *canvas) {
+    _MK_CURRENT_CTX(canvas);
+
+    vgDrawPath(canvas->path, VG_STROKE_PATH);
+    vgClearPath(canvas->path, VG_PATH_CAPABILITY_ALL);
+}
+
+static void
+mbe_fill(mbe_t *canvas) {
+    _MK_CURRENT_CTX(canvas);
+
+    vgDrawPath(canvas->path, VG_FILL_PATH);
+    vgClearPath(canvas->path, VG_PATH_CAPABILITY_ALL);
+}
 
 /* @} */
 
--- a/src/graph_engine_openvg.c	Wed Jun 30 19:53:10 2010 +0800
+++ b/src/graph_engine_openvg.c	Wed Jun 30 22:57:23 2010 +0800
@@ -284,3 +284,4 @@
     canvas->tgt->asso_mbe = NULL; /* remove association */
     free(canvas);
 }
+