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

perf: skip update from GIF timer if no animated elements are shown #5042

Merged
merged 2 commits into from
Dec 25, 2023

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Dec 25, 2023

Currently, when animated elements are turned on, a tick from the GIF timer (50x/s) will always trigger a repaint. This isn't needed.

This PR lays the foundation for more work on selective updates from the GIF timer by tracking elements that contain animations.
After this PR, the GIF timer will only trigger an update if at least one element was animated.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/messages/layouts/MessageLayoutElement.cpp Outdated Show resolved Hide resolved
src/messages/layouts/MessageLayoutElement.cpp Outdated Show resolved Hide resolved
src/messages/layouts/MessageLayoutElement.cpp Outdated Show resolved Hide resolved
src/messages/layouts/MessageLayoutElement.cpp Outdated Show resolved Hide resolved
@Nerixyz Nerixyz force-pushed the perf/no-no-anim-paint branch from 56c2cca to 196f0a1 Compare December 25, 2023 18:03
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍 Just a nit on a variable naming and I'm happy to merge this in

src/messages/layouts/MessageLayoutContainer.cpp Outdated Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) December 25, 2023 18:52
@pajlada pajlada merged commit 1006bf9 into Chatterino:master Dec 25, 2023
20 checks passed
@Nerixyz Nerixyz deleted the perf/no-no-anim-paint branch December 25, 2023 19:18
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