diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-01-06 11:01:39 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-01-08 19:08:43 +0000 |
commit | 1bcfc3de7586ddb9f5d1b778b97b26ae3dc9584d (patch) | |
tree | 66571c15008a0978c8b2335d668656075a504086 /src/plugins/platforms | |
parent | c04cf29b78f3f5747c58dd89ca21523e387ee3ac (diff) |
Use backing store formats with alpha
We depend on being able to punch holes in the backing store when
integrating with FBO elements. To do that we need a format with an alpha
channel. This was only working previously because RGB32 didn't mask when
filling or when converting to ARGB32_PM, but other formats didn't.
Also unifies the logic for getting alpha versions of QImage formats.
Task-number: QTBUG-50281
Change-Id: Ied1325f60e2b67d9ea2dfa9701b06fc2231ebfca
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbbackingstore.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index 1825a463d0..006df320fe 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -51,6 +51,7 @@ #include <qscreen.h> #include <QtGui/private/qhighdpiscaling_p.h> #include <qpa/qplatformgraphicsbuffer.h> +#include <private/qimage_p.h> #include <algorithm> QT_BEGIN_NAMESPACE @@ -172,6 +173,9 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI qWarning() << "QXcbBackingStore: Error while marking the shared memory segment to be destroyed"; } + if (QImage::toPixelFormat(format).alphaUsage() == QPixelFormat::IgnoresAlpha) + format = qt_alphaVersionForPainting(format); + m_qimage = QImage( (uchar*) m_xcb_image->data, m_xcb_image->width, m_xcb_image->height, m_xcb_image->stride, format); m_graphics_buffer = new QXcbShmGraphicsBuffer(&m_qimage); } |