From cbf649ff92e7d3416cb9d03609648f96efdf76dd Mon Sep 17 00:00:00 2001
From: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Date: Mon, 17 Mar 2014 19:43:41 -0300
Subject: [PATCH] Add workaround for GL on Android emulator
On the Android Emulator, the shaders will be compiled by a desktop
GL driver, since the GL driver in the emulator is just a thin
wrapper. The GL driver does not necessarily support the precision
qualifiers, which can cause applications to break. We detect this
at runtime in the platform plugin and set a workaround flag to
Upstream (9eeb1bd) just enabled the workaround when the android
backend is used, which is not true in our case (traditional desktop).
As a consequence, we also need a similar check in order to have
a functional Ubuntu Touch emulator.
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
---
src/gui/kernel/qopenglcontext.cpp | 5 +++++
1 file changed, 5 insertions(+)
|
|
|
815 | 815 | |
816 | 816 | d->shareGroup->d_func()->deletePendingResources(this); |
817 | 817 | |
| 818 | const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); |
| 819 | if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) { |
| 820 | QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(this); |
| 821 | ctx_d->workaround_missingPrecisionQualifiers = true; |
| 822 | } |
818 | 823 | #ifndef QT_NO_DEBUG |
819 | 824 | QOpenGLContextPrivate::toggleMakeCurrentTracker(this, true); |
820 | 825 | #endif |