From 9adbbe0bd188578516be359843dafdd5d8d3593d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Wed, 15 Jan 2014 18:18:16 +0900 Subject: [PATCH] Evas fonts: Pass RGBA_Image instead of DATA32 buffer 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 | 2 +- src/lib/evas/common/evas_font_compress.c | 3 ++- src/lib/evas/common/evas_font_draw.c | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/common/evas_font.h b/src/lib/evas/common/evas_font.h index dff165a..1441589 100644 --- a/src/lib/evas/common/evas_font.h +++ b/src/lib/evas/common/evas_font.h @@ -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); diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 1ebfc3c..a66e476 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -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; diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c index 94d7d0a..1e88b47 100644 --- a/src/lib/evas/common/evas_font_draw.c +++ b/src/lib/evas/common/evas_font_draw.c @@ -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); } -- 2.7.4