Mercurial > MadButterfly
comparison src/graph_engine_skia.cpp @ 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 | 6abc53f00792 |
children | caa087976b17 |
comparison
equal
deleted
inserted
replaced
507:dd65f8c8da66 | 508:b106fa78a090 |
---|---|
120 #define MBSTOP_2_SKCOLOR(c) \ | 120 #define MBSTOP_2_SKCOLOR(c) \ |
121 ((((int)((c)->a * 255)) << 24) | \ | 121 ((((int)((c)->a * 255)) << 24) | \ |
122 (((int)((c)->r * 255)) << 16) | \ | 122 (((int)((c)->r * 255)) << 16) | \ |
123 (((int)((c)->g * 255)) << 8) | \ | 123 (((int)((c)->g * 255)) << 8) | \ |
124 (((int)((c)->b * 255)))) | 124 (((int)((c)->b * 255)))) |
125 #define MB_CO_COMP_2_SK(c) (((int)((c) * 255)) & 0xff) | |
125 | 126 |
126 static const co_aix id_matrix[6] = { 1, 0, 0, 0, 1, 0 }; | 127 static const co_aix id_matrix[6] = { 1, 0, 0, 0, 1, 0 }; |
127 | 128 |
128 static void | 129 static void |
129 _prepare_sized_pattern(mbe_t *mbe, mbe_pattern_t *ptn) { | 130 _prepare_sized_pattern(mbe_t *mbe, mbe_pattern_t *ptn) { |
497 SkPorterDuff::kSrcOver_Mode); | 498 SkPorterDuff::kSrcOver_Mode); |
498 mbe_paint(canvas); | 499 mbe_paint(canvas); |
499 | 500 |
500 } | 501 } |
501 | 502 |
502 void mbe_surface_destroy(mbe_surface_t *surface) {} | 503 void mbe_surface_destroy(mbe_surface_t *surface) { |
504 SkBitmap *bmap = (SkBitmap *)surface; | |
505 | |
506 delete bmap; | |
507 } | |
508 | |
503 void mbe_set_source_rgba(mbe_t *canvas, | 509 void mbe_set_source_rgba(mbe_t *canvas, |
504 co_aix r, co_aix g, co_aix b, co_aix a) {} | 510 co_aix r, co_aix g, co_aix b, co_aix a) { |
511 canvas->paint->setARGB(MB_CO_COMP_2_SK(a), | |
512 MB_CO_COMP_2_SK(r), | |
513 MB_CO_COMP_2_SK(g), | |
514 MB_CO_COMP_2_SK(b)); | |
515 } | |
516 | |
505 void mbe_set_scaled_font(mbe_t *canvas, | 517 void mbe_set_scaled_font(mbe_t *canvas, |
506 const mbe_scaled_font_t *scaled) {} | 518 const mbe_scaled_font_t *scaled) {} |
507 void mbe_set_source_rgb(mbe_t *canvas, co_aix r, co_aix g, co_aix b) {} | 519 void mbe_set_source_rgb(mbe_t *canvas, co_aix r, co_aix g, co_aix b) {} |
508 | 520 |
509 void mbe_set_line_width(mbe_t *canvas, co_aix width) { | 521 void mbe_set_line_width(mbe_t *canvas, co_aix width) { |