Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overdraw #44

Closed
damianflannery opened this issue Dec 5, 2012 · 9 comments
Closed

Overdraw #44

damianflannery opened this issue Dec 5, 2012 · 9 comments

Comments

@damianflannery
Copy link

A new developer option in JellyBean 4.2 allows you to show GPU overdraw (you've probably seen it already at http://www.curious-creature.org/2012/12/01/android-performance-case-study).

With this option enabled you can see that the sliding menu is still being drawn behind the content view even when the sliding drawer is shut.

This will have a negative performance impact on any activity that uses this.

@pommedeterresautee
Copy link

I am not an expert in optimization but in the article the issue where about views never displayed because they are covered by another view.

In the case of this lib, to not have 2 layers you would have to destroy the menu each time it s hided, right ?

So it means you would have to recreate the menu each time the user wants to use it. It takes time. So no more butter experience!

The hided view here is useful, not like a view you will never see. Even if sometimes it is under another one.

@JakeWharton
Copy link
Contributor

@SimonVT and myself talked about this briefly on IRC. Can't remember where we came down but I think it has something to do with the fact that the library uses hardware layers. Probably still should be setting the drawer to View.GONE when fully closed.

@SimonVT
Copy link
Owner

SimonVT commented Dec 5, 2012

I'm a bit concerned about what will happen with the hardware layer if the visibility is set to gone. If its destroyed, it can take something like 50-100ms to recreate once it is shown again, which is not acceptable. If that is the case, simply moving the view off screen might be a better solution.

@JakeWharton
Copy link
Contributor

Can we do something with calling setWillNotDraw when fully closed?

@SimonVT
Copy link
Owner

SimonVT commented Dec 5, 2012

I don't think so. I wrap the menu layout in a framelayout, which doesn't do
any drawing. setWillNotDraw doesn't propagate to child views.
I'll have to investigate what exactly happens when visibility is toggled
before deciding what to do, but I don't really think we want to cause a
redraw of the menu (which will have to happen when its shown again).
Keeping the hardware layer as-is, but off screen, might be faster.
On Dec 6, 2012 12:04 AM, "Jake Wharton" notifications@github.com wrote:

Can we do something with calling setWillNotDraw when fully closed?


Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-11065325.

@JakeWharton
Copy link
Contributor

Custom FrameLayout that doesn't dispatch drawing to children when drawer is closed?

@SimonVT
Copy link
Owner

SimonVT commented Dec 6, 2012

Is onDraw called at all unless the menu view is invalidated? I think this
might be all in the GPU.
On Dec 6, 2012 12:46 AM, "Jake Wharton" notifications@github.com wrote:

Custom FrameLayout that doesn't dispatch drawing to children when drawer
is closed?


Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-11066743.

@SimonVT
Copy link
Owner

SimonVT commented Dec 11, 2012

Should be fixed. The selected solution was to move the menu off screen when drawer is closed, and hardware layers are used, since e.g. toggling visibility caused noticeable delay the first time the drawer was opened.

@SimonVT SimonVT closed this as completed Dec 11, 2012
@damianflannery
Copy link
Author

Nice work. Thank you Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants