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
Remove or shrink unnecessary page rerender calls #4611
Remove or shrink unnecessary page rerender calls #4611
Conversation
I've restored repainting at a few points where it is needed. |
Do you have any idea why a repaint would be performed here? xournalpp/src/core/control/layer/LayerController.cpp Lines 333 to 334 in 1038ec5
|
There are some additional buttons triggering |
After a bit more testing this weekend I don't see any more issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I'm a bit conflicted about this PR.
One the one hand, it seems to work fine without the repainting you removed. On the other hand, what's the point of refreshing the page buffer if it's not to display it?
For instance, when an EditSelection is created (meaning some Elements just got selected), the Elements are:
- removed from the page, added to a selection, painted to a selection buffer, and all of that is then painted on screen in the main loop
- erased from the page buffer (via
rerenderPage()
which is an overkill) in a separated thread, followed by a full repaint.
With this PR, you removed the asynchronous full repaint, while I think the synchronous repaint is the superfluous one: we should wait for the page buffer to be updated before repainting.
That's just an example, and I think the other instances are similar. At this point, I can't imagine a situation where the page buffer needs updating without a follow up repaint being needed.
Thanks, this makes perfect sense. Instead of complicating the repainting logic I could just remove the call to |
3228571
to
e7c92ee
Compare
I've removed the |
37c0690
to
4645764
Compare
4645764
to
402fe2b
Compare
402fe2b
to
fafcbb8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Squashing and merging in 48 hours unless an objection is raised.
This requires #4158 that requires fewer explicit redraws when layers are deleted or their visibility is modified. Addresses #4580 in combination with #4158. This reduces the number of page repaints required. Full repaints are still used upon
TODO: