summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@profusion.mobi>2012-11-29 20:47:12 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-11-29 20:47:12 +0000
commita9bdfcca37f56c70e4ee30cc9b8edf1752ac86f3 (patch)
tree0cc009fd3a92b8e4346c71b9f04bc5ea040d7713 /src
parentbf451a024a665c326c7441c3e347e7ee43b45430 (diff)
evas/font: Refactor common code for font drawing
This patch refactors common code for font draws - so that it can be used by other engines and *threaded* X11. Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi> Patch by: Paulo Alcantara <pcacjr@profusion.mobi> SVN revision: 79853
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/common/evas_font.h3
-rw-r--r--src/lib/evas/common/evas_font_draw.c21
2 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/evas/common/evas_font.h b/src/lib/evas/common/evas_font.h
index 6517aa7f87..b259e63c8c 100644
--- a/src/lib/evas/common/evas_font.h
+++ b/src/lib/evas/common/evas_font.h
@@ -18,6 +18,9 @@ EAPI int evas_common_font_get_line_advance (RGBA_Font *fn);
18 18
19/* draw */ 19/* draw */
20 20
21typedef void (*Evas_Common_Font_Draw_Cb)(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *text_props, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
22
23EAPI void evas_common_font_draw_cb (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *intl_props, Evas_Common_Font_Draw_Cb cb);
21EAPI void evas_common_font_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *intl_props); 24EAPI void evas_common_font_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *intl_props);
22EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl); 25EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl);
23EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index); 26EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index);
diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c
index 0c760e6174..784884270e 100644
--- a/src/lib/evas/common/evas_font_draw.c
+++ b/src/lib/evas/common/evas_font_draw.c
@@ -299,7 +299,7 @@ evas_common_font_draw_prepare(Evas_Text_Props *text_props)
299} 299}
300 300
301EAPI void 301EAPI void
302evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *text_props) 302evas_common_font_draw_cb(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *text_props, Evas_Common_Font_Draw_Cb cb)
303{ 303{
304 static Cutout_Rects *rects = NULL; 304 static Cutout_Rects *rects = NULL;
305 int ext_x, ext_y, ext_w, ext_h; 305 int ext_x, ext_y, ext_w, ext_h;
@@ -342,9 +342,9 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, cons
342 342
343 if (!dc->cutout.rects) 343 if (!dc->cutout.rects)
344 { 344 {
345 evas_common_font_draw_internal(dst, dc, x, y, text_props, 345 cb(dst, dc, x, y, text_props,
346 func, ext_x, ext_y, ext_w, ext_h, 346 func, ext_x, ext_y, ext_w, ext_h,
347 im_w, im_h); 347 im_w, im_h);
348 } 348 }
349 else 349 else
350 { 350 {
@@ -358,9 +358,9 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, cons
358 { 358 {
359 r = rects->rects + i; 359 r = rects->rects + i;
360 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h); 360 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
361 evas_common_font_draw_internal(dst, dc, x, y, text_props, 361 cb(dst, dc, x, y, text_props,
362 func, r->x, r->y, r->w, r->h, 362 func, r->x, r->y, r->w, r->h,
363 im_w, im_h); 363 im_w, im_h);
364 } 364 }
365 } 365 }
366 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch; 366 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
@@ -368,6 +368,13 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, cons
368} 368}
369 369
370EAPI void 370EAPI void
371evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *text_props)
372{
373 evas_common_font_draw_cb(dst, dc, x, y, text_props,
374 evas_common_font_draw_internal);
375}
376
377EAPI void
371evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Gfx_Func func, 378evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Gfx_Func func,
372 RGBA_Image *dst, RGBA_Draw_Context *dc, 379 RGBA_Image *dst, RGBA_Draw_Context *dc,
373 int x, int y, const Evas_Text_Props *text_props) 380 int x, int y, const Evas_Text_Props *text_props)