From eae6298202f7f258c18ff88949f07c82654b9f3d Mon Sep 17 00:00:00 2001 From: Louai Al-Khanji <louai.al-khanji@theqtcompany.com> Date: Wed, 2 Mar 2016 13:17:43 -0800 Subject: [PATCH] xcb: support more visual formats Change-Id: I03e0fc5fdfbd7ce478ebc4b0ae8e72d57450bc51 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> --- src/plugins/platforms/xcb/qxcbwindow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 11202944bdd..6ac28684a85 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -201,6 +201,20 @@ static inline QImage::Format imageFormatForVisual(int depth, quint32 red_mask, q case 16: if (blue_mask == 0x1f) return QImage::Format_RGB16; + if (red_mask == 0x1f) { + if (rgbSwap) + *rgbSwap = true; + return QImage::Format_RGB16; + } + break; + case 15: + if (blue_mask == 0x1f) + return QImage::Format_RGB555; + if (red_mask == 0x1f) { + if (rgbSwap) + *rgbSwap = true; + return QImage::Format_RGB555; + } break; default: break; -- GitLab