Cross fading with previous pixmap is achieved by referencing the old
window pixmap. WindowPaintData has a cross-fade-factor which interpolates
between 0.0 (completely old pixmap) to 1.0 (completely new pixmap).
If a cross fading factor is set and a previous pixmap is valid this one
is rendered on top of the current pixmap with opacity adjusted. This
results in a smoother fading.
To simplify the setup the AnimationEffect is extended and also takes care
about correctly (un)referencing the previous window pixmap. The maximize
effect is adjusted to make use of this new capabilities.
Unfortunately this setup has a huge problem with the case that the window
decoration gets smaller (e.g. from normal to maximized state). In this
situation it can happen that the old window is rendered with parts outside
the content resulting in video garbage being shown. To prevent this a set
of new WindowQuads is generated with normalized texture coordinates in
the safe area which contains real content.
For OpenGL2Window a PreviousContentLeaf is added which is only set up in
case the crass fading factor is set.
REVIEW: 110578
The behavior for creating a pixmap for a window is moved from Toplevel
into a dedicated class WindowPixmap. Scene::Window holds a reference to
this class and creates a new WindowPixmap whenever the pixmap needs to be
discarded. In addition it also keeps the old WindowPixmap around for the
case that creating the new pixmap fails. The compositor can in that case
use the previous pixmap which reduces possible flickering. Also this
referencing can be used to improve transition effects like the maximize
windows effect which would benefit from starting with the old pixmap.
For XRender and OpenGL a dedicated sub-class of the WindowPixmap is
created which provides the additional mapping to an XRender picture and
OpenGL texture respectively.
BUG: 319563
FIXED-IN: 4.11
REVIEW: 110577
This avoids the overhead of allocating each WindowQuad on the heap
when appending items to the list, and also ensures that the quads
are continuous in memory.
This reduces the size of the geometry that needs to be uploaded by
one-third, and allows kwin to take advantage of the post-transform
cache in the GPU.
Expose bindArrays(), unbindArrays() and add a draw() method that takes
an offset and a count. This makes it possible to upload geometry, call
bindArrays(), and then call draw() multiple times to draw different
subsets of the uploaded geometry.
Reimplement performPaint() in SceneOpenGL1Window and SceneOpenGL2Window.
The roles between begin/endRenderWindow() and performPaint() are now
reversed; performPaint() contains the specialized code while begin/
endRenderWindow() contains the shared code.
This reduces the state churn in the OpenGL2 backend from the repeated
calls to prepare/restoreStates().
This fixes artifacts from over-sampling along the edges of the
decorations when effects such a wobbly windows are active.
The textures are only cleared when framebuffer objects are supported.
All drivers support FBO's now, so in practice this shouldn't be
a problem.
Split WindowQuadDecoration into WindowQuadDecorationLeftRight
and WindowQuadDecorationTopBottom.
This simplifies the code in SceneOpenGL::Window::paintDecoration().
Use two textures per window instead of four, storing the left and
right borders in the first texture, and the top and bottom borders
in the second.
This makes it possible to render the whole decoration with only two
calls to glDrawArrays(). It also reduces the number of texture
allocations while resizing a window.
Add virtual resizePixmaps() and updatePixmaps() methods that resizes and
updates all the pixmaps. Make resize() and paint() regular virtuals
with stub implementations.
The new methods will be used by OpenGLPaintRedirector in the next commit.
This effect is controlled by KScreen. It fades out all windows when
KScreen requests this and gives feedback to KScreen once all windows are
faded out. This allows KScreen to adjust the screens in a flicker free
way.
REVIEW: 110661
BUG: 319994
FIXED-IN: 4.11
Do not schedule repaints in AnimationEffect if there are no animations
going on. If an animation is waiting for starting or kept after ending
the visual appearance is no longer changed, so no repaint is needed.
REVIEW: 110795
Loop directly over the window quad list and check the type instead of
using select(WindowQuadDecoration) when separating the decoration quads.
This avoids the step of creating an intermediate list, and then looping
over that list to separate out the quads that belong to the four sides.
xcb/xcb_iccm.h isn't C++ safe (some versions) because it has
a variable called "class" in function signatures. The hack
is to define "class" to something else before that header is
included, and then undef "class" immediately afterwards.
CCMAIL: mgraesslin@kde.org, fredrik@kde.org
addImportPath prepends the path to importPathList so we must add our
paths in reverse order.
Based on the fix for kdeclarative.cpp in kdelibs
400b9f2e9d10386bb175b6123fe0cdaafeaffe61
REVIEW: 110670
Let KDeclarative::setupBindings() add the import paths: it too takes
paths from KGlobal::dirs()->findDirs("module", "imports"); it adds paths
in the correct (reverse) order [1].
[1] See kdelibs 400b9f2e9d10386bb175b6123fe0cdaafeaffe61 for further
details.
REVIEW: 110670
Write the vertex data directly into the buffer object, instead of
allocating two temporary arrays, coyping the data into them, and
then copying the data from the arrays into the buffer object.
This also makes renderQuads() handle coordinates for rectangular
textures correctly.
Write the vertex data directly into the buffer object, instead of
allocating two temporary arrays, copying the data into them, and
then copying the data from arrays into the buffer object.
Unlike makeArrays() this function writes into a pre-allocated array,
and takes a matrix that's used to transform the texture coordinates.
This allows this function to handle coordinates for rectangular
textures correctly.
Note that unlike the previous commit, this doesn't fix texture coordinates
for rectangular textures. That case cannot be handled correctly without
knowing the dimensions of the texture.