Effects can access the QPainter used by SceneQPainter to directly render
into the back buffer.
Obviously only available in Compositing Type QPainterCompositing.
This compositor uses only the QPainter API to perform rendering. The
window's X Pixmap is mapped to a QImage using XShm. As rendering backend
a QImage is used.
The new compositing type "QPainterCompositing" is introduced. Effects
need to be adjusted to explicitly check the compositing type and no
longer assume the compositing type is XRender if it's not OpenGL.
This compositor can be selected with using "Q" as the value for
KWIN_COMPOSE env variable or setting the config value to "QPainter".
The GUI is not yet adjusted to select this compositor.
The QPainter scene provides currently the following features:
* 2D transformations (translation and scalation)
* opacity modifications
* rendering of decorations (new PaintRedirector sub class)
* rendering of shadows
* rendering of effect frames
* rendering to a Wayland surface
The following features are currently not provided:
* saturation changes
* brightness changes
* 3D transformations
* rendering to X Overlay window
* offscreen rendering (e.g. needed for screen shot effect)
* custom rendering in the effects to the current back buffer
Completing the task of replacing all NULL to nullptr in all the files in
libkwineffects folder.
(also substituting some "0" used as nullptr with nullptr)
REVIEW: 114823
Completing the task of replacing all NULL to nullptr in all the files in tests folder
(also substituting some "0" used as nullptr with nullptr)
REVIEW: 114822
A user can now directly request a Wayland::Buffer object which exposes
the memory address of the shared memory with the wl_buffer. This allows
to use the Wayland Buffer directly as the storage of a QImage.
To make sure that the ShmPool does not reuse such a buffer the Buffer can
be marked as used.
When the ShmPool gets resized the memory addresses become invalid.
Therefore the ShmPool is now a QObject and emits a signal on resized pool
so that every user of a Wayland::Buffer can remap the memory.
This backend uses an XShm pixmap for the rendering back buffer. In
present() the content of this shm pixmap is copied into a Wayland shm
buffer freeing the pixmap to be used for the next frame again and by that
we have a double buffered rendering.
In opposite to the X11 XRender backend this backend doesn't use the
overlay window.
Only the X based Scenes need an overlay window, so the Compositor doesn't
need to check for it in the Wayland case.
OverlayWindow is moved from OpenGLBackend to the sub classes which need
to provide it.
The egl wayland backend registers for the callback for a rendered frame.
This allows to throttle KWin's compositor so that we don't render frames
which wouldn't end up on the screen.
For this the Scene provides a method to query whether the last frame got
rendered. By default this returns true in all backends. The Egl Wayland
backend returns true or false depending on whether the callback for the
last frame was recieved.
In case the last frame has not been renderd when performCompositing is
tried to be called, the method returns just like in the case when the
overlay window is not visible. Once the frame callback has been recieved
performCompositing is invoked again.
An abstract backend is split out of SceneXRender which takes care of
managing the render pictures and swapping them after a frame is rendered.
Having this abstract allows to implement further backends for XRender
which do not use the Overlay Window for compositing.
To have it consistant the SceneXRender is now also created by a factory
method.
The Wayland::Buffer no longer holds the exact memory address but only
the offset in the pool. The actual address of the pool is only known to
the ShmPool which allows us to remap a resized file.
If a new buffer cannot be provided by the given pool, it gets now resized
to the new needed size. This allows us to only create a very small pool.
A new Wayland::Buffer class is provided which wraps a:
* wl_buffer
* size
* stride
* memory address of data represented by the buffer
In addition the Buffer knows whether the compositor has released it or
not. This allows the ShmPool to reuse the buffer in case the same size
and stride is requested.
This is currently most relevant for the CursorData. Instead of keeping
the wl_buffer, the QImage for the cursor is kept and each time the cursor
is set for the surface a new buffer is requested from the ShmPool.
The ShmPool now either reuses an existing buffer or creates a new one.
Furthermore the ShmPool takes care of releasing all buffers at EOL.
The backend gets created by Workspace, but only if the environment
variable WAYLAND_DISPLAY is set.
Because of that the egl wayland backend does no longer create the
backend, but uses the already created one.
The functionality to create the connection to a Wayland compositor and
creating a fullscreen surface is moved into wayland_backend.(h|cpp). The
wl_egl_window for the surface is moved into the EglWaylandBackend to have
the actual WaylandBackend free from Egl. This will allow in future to
implement other compositing backends for Wayland which do not use egl.
This means that egl is no longer a build requirement for the wayland
related functionality.
The pure virtual methods windowAdded, windowClosed, windowDeleted and
windowGeometryShapeChanged had identical implementations in both XRender
and OpenGL scene. They were accessing the hash with Scene::Windows which
is nowhere else used except for creating the stacking order in ::paint.
The implementations are moved to the base class, the only Scene specific
code is a pure virtual factory method to create the Scene window. This
already existed in SceneOpenGL to create either a SceneOpenGL1 or 2
window.
Also the hash of windows is a Scene private member now and the creation
of the stacking order is provided by a method, so that the Scene sub
classes do no longer need to access the stacking order at all.
REVIEW: 111207
Instead of having the Shadow factory method check the compositor type and
do the decision which Shadow sub class to create, a pure virtual method in
Scene is called which returns the specific Shadow sub class instance.
Instead of having the EffectFrameImpl check the compositor type and do
the decision which Scene::EffectFrame to create, a pure virtual method
in Scene is called which returns the specific Scene::EffectFrame.
They're not needed anymore, and break my build directory from time to time.
If this commit breaks your compilation, clean your build directory (or at
least the plasma and kwin subdirectories).
* Find Wayland was missing in CMakeLists.txt
* Wayland Backend is adjusted for new virtual methods (makeCurrent, doneCurrent)
* Buffer Age is implemented
This was missing from what is available in KWin core. The brightness and
saturation are implemented using a custom shader which uses the same
logic as what we use in the scene shader.
We are only rendering an image, so it's better to load the image into a
texture. This allows to properly scale the example preview which
magically fixes all the layouting problems which used to be there.
After changes in PlasmaCore.Dialog we can finally get rid of updating
the position on each visible change.
It's not 100 % perfect yet, seems the binding on screenGeometry is not
working properly. That needs investigation.
Videos for the following effects are added:
* Dim Inactive
* Dim Screen for Administration Mode
* Invert
* Looking Glass
* Magnifier
* Mouse Click
* Track Mouse
* Zoom
Link for Present Windows video fixed.