kwin/src/scenes/opengl
Vlad Zahorodnii aac0609bb9 scene: Rework surface damage tracking
It's not possible to get the surface damage before calling
Scene::paint(), which is a big problem because it blocks proper surface
damage and buffer damage calculation when walking render layer tree.

This change reworks the scene compositing stages to allow getting the
next surface damage before calling Scene::paint().

The main challenge is that the effects can expand the surface damage. We
have to call prePaintWindow() and prePaintScreen() before actually
starting painting. However, prePaintWindow() is called after starting
rendering.

This change makes Scene call prePaintWindow() and prePaintScreen() so
it's possible to know the surface damage beforehand. Unfortunately, it's
also a breaking change. Some fullscreen effects will have to adapt to
the new Scene paint order. Paint hooks will be invoked in the following
order:

* prePaintScreen() once per frame
* prePaintWindow() once per frame
* paintScreen() can be called multiple times
* paintWindow() can be called as many times as paintScreen()
* postPaintWindow() once per frame
* postPaintScreen() once per frame

After walking the render layer tree, the Compositor will poke the render
backend for the back buffer repair region and combine it with the
surface damage to get the buffer damage, which can be passed to the
render backend (in order to optimize performance with tiled gpus) and
Scene::paint(), which will determine what parts of the scene have to
repainted based on the buffer damage.
2022-03-21 09:32:41 +02:00
..
shaders scenes/opengl: Port lanczos filter to ShaderManager::generateShaderFromFile() 2022-01-13 12:04:37 +00:00
CMakeLists.txt Decouple render backend from scene 2021-11-08 18:27:22 +00:00
lanczosfilter.cpp kwinglutils: Make GLRenderTarget not store GLTexture reference 2022-02-15 13:30:39 +02:00
lanczosfilter.h
lanczosresources.qrc scenes/opengl: Port lanczos filter to ShaderManager::generateShaderFromFile() 2022-01-13 12:04:37 +00:00
scene_opengl.cpp scene: Rework surface damage tracking 2022-03-21 09:32:41 +02:00
scene_opengl.h scene: Rework surface damage tracking 2022-03-21 09:32:41 +02:00