Page MenuHomePhabricator

evas_object_textblock: reduce layout calculations
ClosedPublic

Authored by ali.alzyod on Mar 15 2020, 7:59 AM.

Details

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

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ali.alzyod created this revision.Mar 15 2020, 7:59 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

ali.alzyod requested review of this revision.Mar 15 2020, 7:59 AM
ali.alzyod edited the summary of this revision. (Show Details)Mar 15 2020, 8:11 AM
tasn added a comment.Mar 26 2020, 10:44 AM

It was added recently (ish) by Daniel Hirt in this commit rEFLb63c3620dff8930f4ad029351c6d455414062c02
It's apparently there to support async layout. I have no idea, I don't know the async layout code at all. Take a look at the commit message though.

In D11508#221166, @tasn wrote:

It was added recently (ish) by Daniel Hirt in this commit rEFLb63c3620dff8930f4ad029351c6d455414062c02
It's apparently there to support async layout. I have no idea, I don't know the async layout code at all. Take a look at the commit message though.

Actually I did not change anything related to Async layout, this code simply does not layout the text block if it is hidden .

ali.alzyod edited the summary of this revision. (Show Details)Mar 26 2020, 11:14 PM
ali.alzyod added a reviewer: bu5hm4n.

I am not sure the removal of the is_v is a good idea, (@zmike isnt it possible that the call to render is somehow changing the visible state of the textblock ?)

ali.alzyod added a comment.EditedMar 27 2020, 1:58 AM

I am not sure the removal of the is_v is a good idea, (@zmike isnt it possible that the call to render is somehow changing the visible state of the textblock ?)

Current change rearranges calls,
1- Instead of calling is_visible or was visible in multiple if statments, we do it once at the beginning.
2- The only change done here is, avoid calling _relayout_if_needed if the object is not visible (this is the optimization I am looking for)

zmike added a comment.Mar 27 2020, 7:08 AM

How does this handle proxy objects?

How does this handle proxy objects?

Again this simply does not text-layout textblock object if it is hidden, which is wasteful calculation

zmike added a comment.May 4 2020, 6:12 AM

Okay, but a proxy object can be rendered even if its source is hidden, so it seems to me like this patch would break that. Can you check?

Okay, but a proxy object can be rendered even if its source is hidden, so it seems to me like this patch would break that. Can you check?

Can you please guide how to test it? I am not sure I fully understand concept of proxy object in EFL

zmike added a comment.May 4 2020, 11:44 AM

A proxy object is an image object with a source. So it could be created with image_add() -> source_set(). Specifically the case I was thinking of was when source_visible is false in the legacy codepath, but I forgot that we use a different flag for that.

This seems okay to me, but I'll give it another day or two in case HQ wants to run tests with it.

zmike accepted this revision.Tue, May 12, 6:59 AM

Seems ok.

This revision is now accepted and ready to land.Tue, May 12, 6:59 AM
This revision was automatically updated to reflect the committed changes.