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.
This commit is contained in:
Jean-Philippe Andre 2014-01-15 18:18:16 +09:00
parent 160d012559
commit 9adbbe0bd1
3 changed files with 4 additions and 5 deletions

View 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);

View 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;

View 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);
}