From 01f42466d37dbbdedd0c2386f2b83c3bc7c3873b Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 26 May 2014 09:25:42 +0200 Subject: [PATCH 34/37] 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 --- src/gui/painting/qwindowsurface_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index ae5a591..1f2b3fe 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()); -- 1.9.3