Commit graph

12 commits

Author SHA1 Message Date
Fredrik Höglund
c92f65583a kwin: Clear the decoration textures after resizing
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.
2013-06-05 00:41:22 +02:00
Fredrik Höglund
120e65b2c1 kwin: Use texture atlases for the decorations
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.
2013-06-05 00:41:22 +02:00
Fredrik Höglund
e862bfe569 kwin: Refactor some code in the PaintRedirector
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.
2013-06-05 00:41:22 +02:00
Martin Gräßlin
9df3af1dc6 Do not needlessly copy from QPixmap to QImage in PaintRedirector
The scratch PaintDevice is provided by the PaintRedirector's subclasses
allowing the ones wanting a QImage to provide the QImage directly and the
ones needing a QPixmap to provide a pixmap. This means the copy from
QPixmap to QImage is no longer needed in the OpenGL and XRender/raster
paint redirector.

REVIEW: 109138
2013-03-11 11:36:41 +01:00
Martin Gräßlin
aa549f45d5 OpenGLPaintRedirector updates textures directly
Ownership of decoration textures is moved from SceneOpenGL::Window to
OpenGLPaintRedirector. The PaintRedirector is responsible for updating
the textures whenever they change. For this GLTexture is extended by an
update(QImage, QPoint) method which uses glTexSubImage2D to update only
the changed parts.

The big advantage compared to before is that if e.g. only a button is
animated only the button part is updated instead of the complete deco
part.
2013-03-11 11:21:11 +01:00
Martin Gräßlin
fba7504063 Introduce dedicated PaintRedirector subclasses for OpenGL/XRender
PaintRedirector is turned into an abstract class providing a factory
method which returns either an instance of
* OpenGLPaintRedirector
* NativeXRenderPaintRedirector
* RasterXRenderPaintRedirector

OpenGLPaintRedirector is basically doing exactly the same as the parent
class used to do before. Though the idea is to extend the functionality
to have the PaintRedirector write directly into OpenGL textures to limit
copying the complete decorations.

NativeXRenderPaintRedirector is similar to OpenGLPaintRedirector by
rendering into a QPixmap and providing the pictureHandle for the QPixmap
to SceneXRender.

RasterXRenderPaintRedirector is providing the functionality for the case
that the QPixmap/XPixmap relationship is not present. From the QPixmap
containing the pending decoration paint a QImage is created and then the
relevent parts are copied directly into the decoration pixmap.

REVIEW: 109074
2013-03-11 11:19:57 +01:00
Martin Gräßlin
0d81d1d7c0 Move decoration pixmap handling from Client to PaintRedirector
The only task of the PaintRedirector is to redirect the painting of the
window decorations into Pixmaps. So it should actually do this by also
handling the four pixmaps for the decoration. This simplifies the code
as all the logic concerning redirecting the painting is now grouped
together.

Furthermore the PaintRedirector is now a child of the decoration widget,
which means it gets automatically destroyed whenever the decoration is
destroyed - the Client does not have to care about it.

Also the PaintRedirector gets only created if the Compositor is active as
it is not needed in the non-compositing case.

REVIEW: 106620
2012-10-12 07:45:31 +02:00
Philipp Knechtges
b44580f02e kwin: dont gather scheduled decoration repaints
Instead of scheduling and gathering the Workspace::addRepaint calls at the end of the main loop
we directly emit the signal which ends up in a call to addRepaint. The compositeTimer assures
that the higher number of scheduled repaints are executed in the same rendering pass.
2011-07-11 18:47:36 +02:00
Martin Gräßlin
0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Fredrik Höglund
e969813b4a Wait two seconds before deleting the scratch pixmap in the paint redirector
in case we need it again.

This should improve performance with drivers where creating pixmaps is
expensive.

svn path=/trunk/KDE/kdebase/workspace/; revision=1104069
2010-03-16 16:34:39 +00:00
Jacopo De Simoi
637ff72e1f Make sure that the paintredirector pending region is added to the repaint region only once in case the window gets minimized.
TAB--

svn path=/trunk/KDE/kdebase/workspace/; revision=1050675
2009-11-17 21:34:58 +00:00
Fredrik Höglund
e92aab0518 Implement initial support for ARGB window decorations.
Based on earlier work done by Lubos Lunak and ideas by Lucas Murray.

svn path=/trunk/KDE/kdebase/workspace/; revision=957680
2009-04-22 17:29:56 +00:00