summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-05-12 10:00:15 -0400
committerMike Blumenkrantz <zmike@samsung.com>2020-05-12 10:00:16 -0400
commit789900d49adb6d3c0b29b831514b621431108b0b (patch)
tree17e9720dfdc2fe084013198e004e0e50c54b7976
parent9e6e805689fe9c55766706ca11d01495fe8b74cf (diff)
evas_object_textblock: reduce layout calculations
Summary: This patch reduces calculations for layouting textblock when it is not needed. Exactly in **evas_object_textblock_render_pre**, layouting was done (if needed) regardless of object visibility. evas_object_render_pre will async called if object status is changed, for example show->hide In short words: **We do not layout textblock content if textblock t is hidden.** ``` // suppose textblock is shown // and user want to hide it and set content in it // to be visible later on if needed evas_object_hide(textblock); evas_object_textblock_text_markup_set(textblock, "Hello World"); //Layouting will be done on textblock regardless of its visiblity, becase render_pre //will be called and will make it relayout ``` Reviewers: woohyun, zmike, tasn, raster, bu5hm4n Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11508
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 937cc60263..e92b55ba68 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -15830,13 +15830,13 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
15830 } 15830 }
15831 15831
15832 //evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data); 15832 //evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data);
15833 if (!_relayout_if_needed(eo_obj, o)) 15833 is_v = evas_object_is_visible(obj);
15834 was_v = evas_object_was_visible(obj);
15835 if (is_v && !_relayout_if_needed(eo_obj, o))
15834 { 15836 {
15835 o->redraw = 0; 15837 o->redraw = 0;
15836 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, 15838 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
15837 eo_obj, obj); 15839 eo_obj, obj);
15838 is_v = evas_object_is_visible(obj);
15839 was_v = evas_object_was_visible(obj);
15840 goto done; 15840 goto done;
15841 } 15841 }
15842 if (o->changed) 15842 if (o->changed)
@@ -15845,8 +15845,6 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
15845 o->redraw = 0; 15845 o->redraw = 0;
15846 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, 15846 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
15847 eo_obj, obj); 15847 eo_obj, obj);
15848 is_v = evas_object_is_visible(obj);
15849 was_v = evas_object_was_visible(obj);
15850 goto done; 15848 goto done;
15851 } 15849 }
15852 15850
@@ -15855,14 +15853,10 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
15855 o->redraw = 0; 15853 o->redraw = 0;
15856 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, 15854 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
15857 eo_obj, obj); 15855 eo_obj, obj);
15858 is_v = evas_object_is_visible(obj);
15859 was_v = evas_object_was_visible(obj);
15860 goto done; 15856 goto done;
15861 } 15857 }
15862 /* now figure what changed and add draw rects */ 15858 /* now figure what changed and add draw rects */
15863 /* if it just became visible or invisible */ 15859 /* if it just became visible or invisible */
15864 is_v = evas_object_is_visible(obj);
15865 was_v = evas_object_was_visible(obj);
15866 if (is_v != was_v) 15860 if (is_v != was_v)
15867 { 15861 {
15868 evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, 15862 evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes,