Evas fonts: Pass RGBA_Image instead of DATA32 buffer
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 15 Jan 2014 09:18:16 +0000 (18:18 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 7 Feb 2014 06:38:43 +0000 (15:38 +0900)
Since we want to be able to draw to alpha buffers, it's
easier if we pass the whole image struct instead of just
the data pointer.

src/lib/evas/common/evas_font.h
src/lib/evas/common/evas_font_compress.c
src/lib/evas/common/evas_font_draw.c

index dff165ac2d9f20a8e428393cd4761177ee7cc753..14415890fcb43d3db6c2f1932c7cc0f0168fc253 100644 (file)
@@ -84,7 +84,7 @@ EAPI int               evas_common_font_query_run_font_end_get(RGBA_Font *fn, RG
 EAPI void              evas_common_font_ascent_descent_get(RGBA_Font *fn, const Evas_Text_Props *text_props, int *ascent, int *descent);
 
 EAPI void             *evas_common_font_glyph_compress(void *data, int num_grays, int pixel_mode, int pitch_data, int w, int h, int *size_ret);
-EAPI void              evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, RGBA_Draw_Context *dc, DATA32 *dst, int dst_pitch, int x, int y, int cx, int cy, int cw, int ch);
+EAPI void              evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, RGBA_Draw_Context *dc, RGBA_Image *dst, int dst_pitch, int x, int y, int cx, int cy, int cw, int ch);
 EAPI DATA8            *evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret);
 
 void evas_common_font_load_init(void);
index 1ebfc3cb5514b2328ae3a56746eb7dd9709f1e2c..a66e4761f41049efe40ef561642b3078ae00cf75 100644 (file)
@@ -466,11 +466,12 @@ evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret)
 EAPI void
 evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, 
                             RGBA_Draw_Context *dc,
-                            DATA32 *dst, int dst_pitch,
+                            RGBA_Image *dst_image, int dst_pitch,
                             int x, int y, int cx, int cy, int cw, int ch)
 {
    RGBA_Font_Glyph_Out *fgo = fg->glyph_out;
    int w, h, x1, x2, y1, y2, i, *iptr;
+   DATA32 *dst = dst_image->image.data;
    DATA32 coltab[16], col;
    DATA16 mtab[16], v;
    DATA8 tmp;
index 94d7d0a2ec8c4dde50f881eb889ca3f8e8ed026f..1e88b479d2e8e8edb8637204a26e8be0b959af35 100644 (file)
@@ -34,13 +34,11 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
                            Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func EINA_UNUSED, int ext_x, int ext_y, int ext_w,
                            int ext_h, int im_w, int im_h EINA_UNUSED)
 {
-   DATA32 *im;
    Evas_Glyph *glyph;
 
    if (!glyphs) return EINA_FALSE;
    if (!glyphs->array) return EINA_FALSE;
 
-   im = dst->image.data;
    EINA_INARRAY_FOREACH(glyphs->array, glyph)
      {
         RGBA_Font_Glyph *fg;
@@ -64,7 +62,7 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
                     dc->font_ext.func.gl_draw(dc->font_ext.data, (void *)dst,
                                               dc, fg, chr_x, y - (chr_y - y));
                   else if (fg->glyph_out->rle)
-                    evas_common_font_glyph_draw(fg, dc, im, im_w,
+                    evas_common_font_glyph_draw(fg, dc, dst, im_w,
                                                 chr_x, y - (chr_y - y),
                                                 ext_x, ext_y, ext_w, ext_h);
                }