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: add signal to invalidate buffers without doing layout #5123

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jan 23, 2024

I wanted to fix a bug in the 7TV fork related to paints and noticed that I needed a way to just invalidate the paint buffers but not do layout (if it's not needed).

This PR adds a signal similar to layoutRequested that tells channel-views to discard the paint buffers. This is done by setting a flag when doing (re-)layout.

I noticed two settings that benefit from this: Alternate background color and Separate with lines. You can test this PR by toggling the settings.

src/widgets/helper/ChannelView.cpp Outdated Show resolved Hide resolved
src/messages/layouts/MessageLayout.cpp Outdated Show resolved Hide resolved
@Nerixyz Nerixyz changed the title perf: add signal to delete buffers without doing layout perf: add signal to invalidate buffers without doing layout Jan 24, 2024
@Nerixyz
Copy link
Contributor Author

Nerixyz commented Jan 24, 2024

I noticed that invalidating is better than deleting, since we know the width of the message didn't change. This way we can re-use the old buffer.

@pajlada pajlada merged commit 7604d7e into Chatterino:master Jan 24, 2024
20 checks passed
@Nerixyz Nerixyz deleted the feat/discard-buffers branch January 24, 2024 17:44
devJimmyboy pushed a commit to devJimmyboy/chatterino7 that referenced this pull request Feb 11, 2024
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