summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp')
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp b/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp
index ab92bac37d..7b627f85ae 100644
--- a/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp
@@ -41,6 +41,7 @@
#include <QtGui/QOpenGLShaderProgram>
#include <QtGui/QOpenGLContext>
+#include <QtGui/QPainter>
#include "qeglplatformbackingstore_p.h"
#include "qeglcompositor_p.h"
@@ -180,11 +181,8 @@ void QEGLPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &r
screen->compositingContext()->makeCurrent(dstWin->window());
m_textures->clear();
- for (int i = 0; i < textures->count(); ++i) {
- uint textureId = textures->textureId(i);
- QRect geom = textures->geometry(i);
- m_textures->appendTexture(textureId, geom);
- }
+ for (int i = 0; i < textures->count(); ++i)
+ m_textures->appendTexture(textures->textureId(i), textures->geometry(i), textures->stacksOnTop(i));
updateTexture();
m_textures->appendTexture(m_bsTexture, window->geometry());
@@ -209,9 +207,16 @@ void QEGLPlatformBackingStore::composited()
}
}
-void QEGLPlatformBackingStore::beginPaint(const QRegion &rgn)
+void QEGLPlatformBackingStore::beginPaint(const QRegion &region)
{
- m_dirty |= rgn;
+ m_dirty |= region;
+
+ if (m_image.hasAlphaChannel()) {
+ QPainter p(&m_image);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ foreach (const QRect &r, region.rects())
+ p.fillRect(r, Qt::transparent);
+ }
}
void QEGLPlatformBackingStore::resize(const QSize &size, const QRegion &staticContents)
@@ -223,7 +228,8 @@ void QEGLPlatformBackingStore::resize(const QSize &size, const QRegion &staticCo
if (!dstWin || (!dstWin->isRaster() && dstWin->window()->surfaceType() != QSurface::RasterGLSurface))
return;
- m_image = QImage(size, QImage::Format_RGB32);
+ m_image = QImage(size, QImage::Format_RGBA8888);
+
m_window->create();
screen->compositingContext()->makeCurrent(dstWin->window());