optimize the GPU usage of workspace-wall #2132
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Wayfire 0.7.2 we were using auxilliary buffers to composite the workspaces before finally drawing them on the screen.
In Wayfire 0.8.0 the behavior changed: all windows were directly composited on the screen. This introduced highly improved performance for cases where the workspace contents were changing, because we could render them at scale. However, it introduced problems with static workspaces containing multiple windows, because we'd have to composite
them multiple times on each frame.
The new implementation takes a best-of-both-worlds approach. We composite workspaces to auxilliary buffers, ensuring that we do not re-composite static surfaces together on each frame.
To ensure that dynamic content also works well, we scale the buffers as well, if enough of the content has changed so that a full redraw with a different scale is less expensive than updating the current buffers. We also have to be careful to avoid visual artifacts (popping etc) when transitioning between different scales.
Fixes #1940