# HG changeset patch # User Thinker K.F. Li # Date 1277973599 -28800 # Node ID 20b396c09c23f1be62a8d8babfa4c6b55a22d856 # Parent 28aa5e53abaaf5978ad09392fb4161b618c72287 Integrate pattern source with paint model of canvas diff -r 28aa5e53abaa -r 20b396c09c23 include/mb_graph_engine_openvg.h --- 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) diff -r 28aa5e53abaa -r 20b396c09c23 src/graph_engine_openvg.c --- 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;