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

Don't create a new shader in every call to onDraw(). #23

Closed
simonedstromsi opened this issue Dec 15, 2014 · 7 comments
Closed

Don't create a new shader in every call to onDraw(). #23

simonedstromsi opened this issue Dec 15, 2014 · 7 comments

Comments

@simonedstromsi
Copy link

Creating a new shader and bitmap in every call to onDraw (up to 60times / second) is very bad for performance.

Try creating the shader in onSizeChanged() to make sure your bitmap has the right size.

@samskiter
Copy link
Contributor

👍 although onDraw would only be called up to 60times /seconds if you were animating the size of the view or something

@simonedstromsi
Copy link
Author

Or if it's in a list that scrolls :)

@samskiter
Copy link
Contributor

@simonedstromsi not as far as i'm aware - it will simply be snapshotted and moved, ondraw won't be called

@simonedstromsi
Copy link
Author

Ok :) I wasn't aware of that.

@samskiter
Copy link
Contributor

@lopspower this is still an issue isn't it. AFAICT this is still the case... can submit a PR if you like, normally it just requires overriding onSizeChanged

@lopspower
Copy link
Owner

Yes if you can, I want a PR :) (Please update your repos before that)

@samskiter
Copy link
Contributor

Done :)

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

3 participants