summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qwindowsurface_raster.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-05-26 09:25:42 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-26 22:26:17 +0200
commit01f42466d37dbbdedd0c2386f2b83c3bc7c3873b (patch)
tree2bd3a08933bf16b658b5e2d0097ce232982a5983 /src/gui/painting/qwindowsurface_raster.cpp
parentdd85cd0a1ce878a126b6b6d34518e173b9cc9d88 (diff)
Fix raster graphics on X11 RGB30
The window surface incorrectly assumes that any pixel depth of 24 or above would be on 8bit/color. This breaks 10bit/color formats like RGB30. This patch instead make it specifically check for color depth 24 or 32 which are the two with 8bit/color. Task-number: QTBUG-25998 Change-Id: Id0b7e07bdb64679f8c647158938da12efede9142 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/gui/painting/qwindowsurface_raster.cpp')
-rw-r--r--src/gui/painting/qwindowsurface_raster.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp
index ae5a5915b3..1f2b3fe156 100644
--- a/src/gui/painting/qwindowsurface_raster.cpp
+++ b/src/gui/painting/qwindowsurface_raster.cpp
@@ -256,7 +256,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi
{
int depth = widget->x11Info().depth();
const QImage &src = d->image->image;
- if (src.format() != QImage::Format_RGB32 || depth < 24 || X11->bppForDepth.value(depth) != 32) {
+ if (src.format() != QImage::Format_RGB32 || (depth != 24 && depth != 32) || X11->bppForDepth.value(depth) != 32) {
Q_ASSERT(src.depth() >= 16);
const QImage sub_src(src.scanLine(br.y()) + br.x() * (uint(src.depth()) / 8),
br.width(), br.height(), src.bytesPerLine(), src.format());