diff options
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbimage.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbimage.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp index 181d99e85b..bc800524ef 100644 --- a/src/plugins/platforms/xcb/qxcbimage.cpp +++ b/src/plugins/platforms/xcb/qxcbimage.cpp @@ -68,6 +68,14 @@ QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t d && visual->green_mask == 0xff00 && visual->blue_mask == 0xff) return QImage::Format_ARGB32_Premultiplied; + if (depth == 30 && format->bits_per_pixel == 32 && visual->red_mask == 0x3ff + && visual->green_mask == 0x0ffc00 && visual->blue_mask == 0x3ff00000) + return QImage::Format_BGR30; + + if (depth == 30 && format->bits_per_pixel == 32 && visual->blue_mask == 0x3ff + && visual->green_mask == 0x0ffc00 && visual->red_mask == 0x3ff00000) + return QImage::Format_RGB30; + if (depth == 24 && format->bits_per_pixel == 32 && visual->red_mask == 0xff0000 && visual->green_mask == 0xff00 && visual->blue_mask == 0xff) return QImage::Format_RGB32; @@ -147,6 +155,13 @@ QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap p[x] |= 0xff000000; p += bytes_per_line / 4; } + } else if (format == QImage::Format_BGR30 || format == QImage::Format_RGB30) { + QRgb *p = (QRgb *)image.bits(); + for (int y = 0; y < height; ++y) { + for (int x = 0; x < width; ++x) + p[x] |= 0xc0000000; + p += bytes_per_line / 4; + } } result = QPixmap::fromImage(image.copy()); |