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
This commit is contained in:
Ali Alzyod 2020-05-12 10:00:15 -04:00 committed by Mike Blumenkrantz
parent 9e6e805689
commit 789900d49a
1 changed files with 3 additions and 9 deletions

View File

@ -15830,13 +15830,13 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
}
//evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data);
if (!_relayout_if_needed(eo_obj, o))
is_v = evas_object_is_visible(obj);
was_v = evas_object_was_visible(obj);
if (is_v && !_relayout_if_needed(eo_obj, o))
{
o->redraw = 0;
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
eo_obj, obj);
is_v = evas_object_is_visible(obj);
was_v = evas_object_was_visible(obj);
goto done;
}
if (o->changed)
@ -15845,8 +15845,6 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
o->redraw = 0;
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
eo_obj, obj);
is_v = evas_object_is_visible(obj);
was_v = evas_object_was_visible(obj);
goto done;
}
@ -15855,14 +15853,10 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
o->redraw = 0;
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
eo_obj, obj);
is_v = evas_object_is_visible(obj);
was_v = evas_object_was_visible(obj);
goto done;
}
/* now figure what changed and add draw rects */
/* if it just became visible or invisible */
is_v = evas_object_is_visible(obj);
was_v = evas_object_was_visible(obj);
if (is_v != was_v)
{
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes,