diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-01-10 20:07:51 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-01-17 14:35:30 +0900 |
commit | 1b881704dbb5673bb2b7104123a3f8a00ebb43b6 (patch) | |
tree | 58ded549ab54a19d67529c3b6f979a18b535a661 /src/lib/evas | |
parent | 277ca9c0fcf6b6559b96f5a0ce711d63605324b5 (diff) | |
download | efl-1b881704dbb5673bb2b7104123a3f8a00ebb43b6.tar.gz |
evas: Fix classic text styles with filters in textblock
Textblock filters support RGBA input which means legacy styles
can be used in conjunction with filtering. Not recommended, but
it works. Note: We may decide to drop this behaviour and use
alpha-only inputs for simplicity.
Still missing: support for filtering strikethrough, underline, or
embedded items
Diffstat (limited to 'src/lib/evas')
-rw-r--r-- | src/lib/evas/canvas/efl_canvas_filter_internal.eo | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_filter_mixin.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 5 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_text.c | 5 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_textblock.c | 12 |
5 files changed, 16 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_filter_internal.eo b/src/lib/evas/canvas/efl_canvas_filter_internal.eo index 1f612701c5..fa3bd52bbc 100644 --- a/src/lib/evas/canvas/efl_canvas_filter_internal.eo +++ b/src/lib/evas/canvas/efl_canvas_filter_internal.eo @@ -85,6 +85,8 @@ mixin Efl.Canvas.Filter.Internal (Efl.Gfx.Filter, Efl.Object) r: int; [[Right]] t: int; [[Top]] b: int; [[Bottom]] + x: int; [[X offset]] + y: int; [[Y offset]] do_async: bool; [[$true when the operation should be done asynchronous, $false otherwise]] } } diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c index d28280b7bb..b19e4e65fe 100644 --- a/src/lib/evas/canvas/evas_filter_mixin.c +++ b/src/lib/evas/canvas/evas_filter_mixin.c @@ -309,7 +309,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, // Request rendering from the object itself (child class) evas_filter_program_padding_get(pd->data->chain, &l, &r, &t, &b); - ok = evas_filter_input_render(eo_obj, filter, drawctx, NULL, l, r, t, b, do_async); + ok = evas_filter_input_render(eo_obj, filter, drawctx, NULL, l, r, t, b, 0, 0, do_async); if (!ok) ERR("Filter input render failed."); ENFN->context_free(ENDT, drawctx); diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 1a93fafb5b..aac70dad53 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1751,7 +1751,7 @@ EOLIAN static Eina_Bool _efl_canvas_image_internal_efl_canvas_filter_internal_filter_input_render( Eo *eo_obj, Evas_Image_Data *o, void *_filter, void *context, void *data EINA_UNUSED, int l, int r EINA_UNUSED, int t, int b EINA_UNUSED, - Eina_Bool do_async) + int x, int y, Eina_Bool do_async) { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); Evas_Filter_Context *filter = _filter; @@ -1794,7 +1794,8 @@ _efl_canvas_image_internal_efl_canvas_filter_internal_filter_input_render( ENFN->context_render_op_set(output, context, EVAS_RENDER_BLEND); _evas_image_render(eo_obj, obj, output, context, surface, - l - obj->cur->geometry.x, t - obj->cur->geometry.y, + x + l - obj->cur->geometry.x, + y + t - obj->cur->geometry.y, l, t, r, b, do_async); if (!input_stolen) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 7329e78d82..01c2b190c7 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1722,6 +1722,7 @@ _evas_text_efl_canvas_filter_internal_filter_input_render(Eo *eo_obj EINA_UNUSED void *_filter, void *drawctx, void *data EINA_UNUSED, int l, int r EINA_UNUSED, int t, int b EINA_UNUSED, + int x, int y, Eina_Bool do_async) { Evas_Filter_Context *filter = _filter; @@ -1732,8 +1733,8 @@ _evas_text_efl_canvas_filter_internal_filter_input_render(Eo *eo_obj EINA_UNUSED { if (!evas_filter_font_draw(filter, drawctx, EVAS_FILTER_BUFFER_INPUT_ID, o->font, - l + it->x, - t + (int) o->max_ascent, + x + l + it->x, + y + t + (int) o->max_ascent, &it->text_props, do_async)) return EINA_FALSE; diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 3f43e9a591..de3b812b4e 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -13236,9 +13236,9 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, } #define DRAW_TEXT_FILTER(gf, ox, oy) do { \ - evas_filter_input_render(eo_obj, _filter_context_get(ti), gf->dc, ti, \ - gf->pad.l, gf->pad.r, \ - gf->pad.t, gf->pad.b, do_async); \ + evas_filter_input_render(eo_obj, ti->gfx_filter->ctx, gf->dc, ti, \ + gf->pad.l, gf->pad.r, gf->pad.t, gf->pad.b, \ + (ox), (oy), do_async); \ } while (0) #define DRAW_TEXT_NOFILTER(ox, oy) do { \ @@ -13823,14 +13823,16 @@ _efl_canvas_text_efl_canvas_filter_internal_filter_state_prepare( EOLIAN static Eina_Bool _efl_canvas_text_efl_canvas_filter_internal_filter_input_render( Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd EINA_UNUSED, void *filter, void *drawctx, - void *data, int l, int r EINA_UNUSED, int t, int b EINA_UNUSED, Eina_Bool do_async) + void *data, int l, int r EINA_UNUSED, int t, int b EINA_UNUSED, + int x, int y, Eina_Bool do_async) { Evas_Object_Textblock_Text_Item *ti = data; return evas_filter_font_draw(filter, drawctx, EVAS_FILTER_BUFFER_INPUT_ID, ti->parent.format->font.font, - l, t + ti->parent.yoff + ti->parent.h - ti->parent.ln->h, + x + l, + y + t + ti->parent.yoff + ti->parent.h - ti->parent.ln->h, &ti->text_props, do_async); } |