Commit graph

9 commits

Author SHA1 Message Date
Vlad Zahorodnii
48f943bd75 Introduce explicit base render backend type
The main idea behind the render backend is to decouple low level bits
from scenes. The end goal is to make the render backend provide render
targets where the scene can render.

Design-wise, such a split is more flexible than the current state, for
example we could start experimenting with using qtquick (assuming that
the legacy scene is properly encapsulated) or creating multiple scenes,
for example for each output layer, etc.

So far, the RenderBackend class only contains one getter, more stuff will
be moved from the Scene as it makes sense.
2021-11-11 08:55:29 +00:00
Vlad Zahorodnii
7580d6c6e0 scenes/opengl: Remove NPOT extension check
NPOT textures are in core spec in OpenGL 2.0+.
2021-11-10 06:05:10 +00:00
Vlad Zahorodnii
c478722655 scenes/opengl: Remove redundant debug message
The Compositor will print whether opengl compositing has been
initialized successfully.
2021-11-09 09:22:12 +02:00
Vlad Zahorodnii
3ade20eea5 Make Compositor responsible for syncing the GlStrictBinding flag
The GlStrictBinding flag indicates whether it's okay not to re-bind the X11
pixmap to the OpenGL surface texture if the corresponding window is damaged.
It doesn't really affect the SceneOpenGL, only low level backend stuff.
2021-11-09 07:16:56 +00:00
Vlad Zahorodnii
dabcb558b4 Move opengl debug output initialization to kwinglutils
kwinglutils is a better place as the debug output is initialized for the
render backend's context, not scene's context.
2021-11-09 07:16:56 +00:00
Vlad Zahorodnii
cff74b568b Decouple render backend from scene
Currently, the scene owns the renderer, which puts more
responsibilities on the scene other than painting windows and it also
puts some limitations on what we can do, for example, there can be only
one scene, etc.

This change decouples the scene and the renderer so the scene is more
swappable.

Scenes are no longer implemented as plugins because opengl backend
and scene creation needs to be wrapped in opengl safety points. We
could still create the render backend and then go through the list
of scene plugins, but accessing concrete scene implementation is
much much simpler. Besides that, having scenes implemented as plugins
is not worthwhile because there are only two scenes and each contributes
very small amount of binary size. On the other hand, we still need to
take into account how many times kwin accesses the hard drive to load
plugins in order to function as expected.
2021-11-08 18:27:22 +00:00
Vlad Zahorodnii
3485eb6200 cmake: Move base render backend classes to libkwin
This allows using base opengl backends in libkwin, which can be useful
later on for the purpose of moving the ownership of render backends from
the Scene class to the Compositor class.
2021-11-08 18:27:22 +00:00
Vlad Zahorodnii
0eb56fff6e kwineffects: Remove ShaderManager::selfTest()
It has been disabled with Mesa for almost half a decade due to false
positives and even if it weren't disabled, it contributes to the startup
time.

The commit message that added the self test doesn't explain why it was
added, but if it was added to detect unstable drivers, it's not worth it.
2021-11-08 10:29:51 +00:00
Vlad Zahorodnii
aead97c39f Move scenes to the src directory
Similar to the backends, it's far more intuitive to have scenes in the
toplevel source directory rather than the plugins directory.
2021-11-08 10:22:07 +00:00