summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience
diff options
context:
space:
mode:
authorLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2016-03-28 10:37:44 -0700
committerLouai Al-Khanji <louai.al-khanji@theqtcompany.com>2016-04-01 22:01:14 +0000
commit36bc2477753d19a14c587b97d4ec4f263e9e16c0 (patch)
tree59f005ce1dc84724b8ebe85bfac3cdfce8927730 /src/platformsupport/eglconvenience
parent77c0730f55ede6117028805bbf05a6180c248c73 (diff)
EGL/GLX: Resolve depth buffer more intelligently
If a depth buffer size >=32 is requested, try 24 bits as a fallback. Task-number: QTBUG-44029 Done-with: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Change-Id: I43157d17c2bfe19b3b4a9139412e4c297e6150b7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/eglconvenience')
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp
index 8c41773f06..f8efd105bc 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience.cpp
+++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp
@@ -172,6 +172,17 @@ bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes)
return true;
}
+ i = configAttributes->indexOf(EGL_DEPTH_SIZE);
+ if (i >= 0) {
+ if (configAttributes->at(i + 1) >= 32)
+ configAttributes->replace(i + 1, 24);
+ else if (configAttributes->at(i + 1) > 1)
+ configAttributes->replace(i + 1, 1);
+ else
+ configAttributes->remove(i, 2);
+ return true;
+ }
+
i = configAttributes->indexOf(EGL_ALPHA_SIZE);
if (i >= 0) {
configAttributes->remove(i,2);
@@ -195,14 +206,6 @@ bool q_reduceConfigAttributes(QVector<EGLint> *configAttributes)
return true;
}
- i = configAttributes->indexOf(EGL_DEPTH_SIZE);
- if (i >= 0) {
- if (configAttributes->at(i + 1) > 1)
- configAttributes->replace(i + 1, 1);
- else
- configAttributes->remove(i, 2);
- return true;
- }
#ifdef EGL_BIND_TO_TEXTURE_RGB
i = configAttributes->indexOf(EGL_BIND_TO_TEXTURE_RGB);
if (i >= 0) {