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.
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.
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
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.
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
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
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.
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