summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbscreen.h
diff options
context:
space:
mode:
authorLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2016-03-03 14:16:29 -0800
committerLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2016-04-09 05:17:27 +0000
commit5f39a0ef8d037ed8d1fa19d5514308ed4a2ca161 (patch)
treea9d0d69ba8add9ef11384a577ec5f9692aeed709 /src/plugins/platforms/xcb/qxcbscreen.h
parent89034600939bbfe241ba3d6136abf7bb6961db52 (diff)
X11: Better support non-32bit visuals
This patch improves support for non-32bit screen configurations on X. The patch mostly touches the xcb platform plugin but the changes to the glx convenience functions do affect e.g. the offscreen plugin as well. Since QWindow instances are now by default of type RasterGL instead of Raster the majority of all windows are in fact instances of QXcbGlxWindow. This means that the eventual QSurfaceFormat that we use is chosen based on the available OpenGL configurations. Here the GLX config resolution code did not do a very good job in trying to find the closest match relative to the requested QSurfaceFormat, instead preferring higher bit depths. This is an issue since many configurations support 32-bit windows even if the screen itself has a root window with depth 16. In particular, servers supporting both GLX and Render are very likely to have such visuals. Particularly affected are remote X connections - even if the application itself makes no use of OpenGL at all! The changes introduced by this patch are as follows: 1. Improve the GLX visual selection logic 2. Improve the xcb visual selection logic 3. Remove duplicated visual lookup for OpenGL-enabled windows 4. Configure the default QSurfaceFormat to match the primary screen depth Change-Id: Id1c176359e63a4581410e20350db5ac2c083e1cf Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index 30c5073459..8716af29b5 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -155,6 +155,9 @@ public:
QString windowManagerName() const { return m_windowManagerName; }
bool syncRequestSupported() const { return m_syncRequestSupported; }
+ QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &format) const;
+
+ const xcb_visualtype_t *visualForFormat(const QSurfaceFormat &format) const;
const xcb_visualtype_t *visualForId(xcb_visualid_t) const;
quint8 depthOfVisual(xcb_visualid_t) const;