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

fix: avoid invalidating when drawing #87

Merged
merged 1 commit into from
Jan 4, 2020

Conversation

pcansUbi
Copy link
Contributor

@pcansUbi pcansUbi commented Dec 9, 2019

Description

Currently in onDraw(), the view is sometimes invalidated. This means it will be infinitely redrawn. You can see the behavior by enabling the "Show screen updates" setting in the Android debug settings.

Attached is two videos, the current 1.1.2 version that does infinite redraw, and the proposed fix that don't redraw unless needed.
redraw-issue.zip

It result in poor performance.

Another side effect is that our instrumented tests will wait for the render thread to finish, and that will never happen, so tests are ending in a timeout.

I also removed two unneeded calls to initTimeline() from showStartLine() and showEndLine() since they are private and only called by initLine() that will call initTimeline() itself.

Thanks for sharing your work on this library.

@vipulasri
Copy link
Owner

@pcansUbi thanks for raising this concern, I will look into this.

@vipulasri
Copy link
Owner

@pcansUbi Thanks for pointing out this performance issue.

@vipulasri vipulasri merged commit d8a4e10 into vipulasri:dev Jan 4, 2020
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

Successfully merging this pull request may close these issues.

2 participants