# HG changeset patch # User Thinker K.F. Li # Date 1278298583 -28800 # Node ID 6c74bc371e37c583b08e6287737300f9bb5205cf # Parent 51dc49fd34a8adcf01b7b56afbc077cd23cb6116 paint with alpha for OpenVG diff -r 51dc49fd34a8 -r 6c74bc371e37 include/mb_graph_engine_openvg.h --- a/include/mb_graph_engine_openvg.h Sun Jul 04 21:09:56 2010 +0800 +++ b/include/mb_graph_engine_openvg.h Mon Jul 05 10:56:23 2010 +0800 @@ -24,7 +24,6 @@ #define mbe_scaled_font_create(face, fnt_mtx, ctm) ((mbe_scaled_font_t *)NULL) #define mbe_pattern_set_matrix(ptn, mtx) #define mbe_font_face_destroy(face) -#define mbe_paint_with_alpha(canvas, alpha) #define mbe_set_scaled_font(canvas, scaled) #define mbe_pattern_destroy(pattern) #define mbe_get_scaled_font(canvas) ((mbe_scaled_font_t *)NULL) @@ -210,6 +209,7 @@ extern mbe_t *mbe_create(mbe_surface_t *surface); extern void mbe_destroy(mbe_t *canvas); +extern void mbe_paint_with_alpha(mbe_t *canvas, co_comp_t alpha); extern void mbe_paint(mbe_t *canvas); extern void mbe_clear(mbe_t *canvas); diff -r 51dc49fd34a8 -r 6c74bc371e37 src/graph_engine_openvg.c --- a/src/graph_engine_openvg.c Sun Jul 04 21:09:56 2010 +0800 +++ b/src/graph_engine_openvg.c Mon Jul 05 10:56:23 2010 +0800 @@ -446,6 +446,25 @@ free(canvas); } +/* + * This implementation support only paint with image paint. OpenVG + * does not support paint path with an alpha value. But, it supports + * to draw image with an alpha value. + */ +void +mbe_paint_with_alpha(mbe_t *canvas, co_comp_t alpha) { + VGImage vg_img; + _ge_openvg_img_t *ge_img; + + _MK_CURRENT_CTX(canvas); + + ASSERT(canvas->src != NULL && canvas->src->asso_img != NULL); + ge_img = canvas->src->asso_img; + vg_img = ge_img->img; + + vgDrawImage(vg_img); +} + void mbe_paint(mbe_t *canvas) { EGLDisplay display;