Mercurial > MadButterfly
changeset 508:b106fa78a090 Android_Skia
Add functions of mbe_set_source_rgba() and mbe_surface_destroy().
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 01 Dec 2009 22:55:27 +0800 |
parents | dd65f8c8da66 |
children | 3e0d63d7c7ae |
files | src/graph_engine_skia.cpp |
diffstat | 1 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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) {}