Mercurial > MadButterfly
diff src/graph_engine_openvg.c @ 597:3300992b29ff openvg
Define mbe_clear() for VG
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 01 Jul 2010 15:52:29 +0800 |
parents | aaab76730beb |
children | aba62eb9362d |
line wrap: on
line diff
--- a/src/graph_engine_openvg.c Thu Jul 01 14:48:57 2010 +0800 +++ b/src/graph_engine_openvg.c Thu Jul 01 15:52:29 2010 +0800 @@ -267,6 +267,7 @@ canvas->src = NULL; canvas->paint = VG_INVALID_HANDLE; + canvas->paint_installed = 0; canvas->tgt = surface; canvas->ctx = ctx; canvas->path = path; @@ -314,3 +315,22 @@ vgSeti(VG_SCISSORING, VG_TRUE); } +void +mbe_clear(mbe_t *canvas) { + VGPaint paint; + + _MK_CURRENT_CTX(canvas); + + paint = vgCreatePaint(); + ASSERT(paint != VG_INVALID_HANDLE); + vgSetColor(paint, 0); + + vgSetPaint(paint, VG_FILL_PATH); + vgSeti(VG_BLEND_MODE, VG_BLEND_SRC); + vgDrawPath(canvas->path, VG_FILL_PATH); + vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER); + + vgDestroyPaint(paint); + + canvas->paint_installed = 0; +}