# HG changeset patch # User Thinker K.F. Li # Date 1259679327 -28800 # Node ID b106fa78a090fb3723ea3925f48290b88f7488ad # Parent dd65f8c8da66dd745b25b39e09ad2894c48a963f Add functions of mbe_set_source_rgba() and mbe_surface_destroy(). diff -r dd65f8c8da66 -r b106fa78a090 src/graph_engine_skia.cpp --- a/src/graph_engine_skia.cpp Tue Dec 01 22:55:26 2009 +0800 +++ b/src/graph_engine_skia.cpp Tue Dec 01 22:55:27 2009 +0800 @@ -122,6 +122,7 @@ (((int)((c)->r * 255)) << 16) | \ (((int)((c)->g * 255)) << 8) | \ (((int)((c)->b * 255)))) +#define MB_CO_COMP_2_SK(c) (((int)((c) * 255)) & 0xff) static const co_aix id_matrix[6] = { 1, 0, 0, 0, 1, 0 }; @@ -499,9 +500,20 @@ } -void mbe_surface_destroy(mbe_surface_t *surface) {} +void mbe_surface_destroy(mbe_surface_t *surface) { + SkBitmap *bmap = (SkBitmap *)surface; + + delete bmap; +} + void mbe_set_source_rgba(mbe_t *canvas, - co_aix r, co_aix g, co_aix b, co_aix a) {} + co_aix r, co_aix g, co_aix b, co_aix a) { + canvas->paint->setARGB(MB_CO_COMP_2_SK(a), + MB_CO_COMP_2_SK(r), + MB_CO_COMP_2_SK(g), + MB_CO_COMP_2_SK(b)); +} + void mbe_set_scaled_font(mbe_t *canvas, const mbe_scaled_font_t *scaled) {} void mbe_set_source_rgb(mbe_t *canvas, co_aix r, co_aix g, co_aix b) {}