summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorMarco Martin <mart@kde.org>2017-02-10 15:00:23 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-04-05 10:04:54 +0000
commit9ae028f507a22bd03c861e9d14c2efc4aa2efeda (patch)
tree3a4346dfdf1d4aeaa6878b9b5f2bcae433a9f8b1 /src/plugins/platforms
parent6b52039866db6629747faa0aa1b57c206ed1cd6f (diff)
Environment variable enabling the workaround FBO readback bug
On some ARM devices the font glyph generation is broken Add an environment variable to enable workaround_brokenFBOReadBack in QOpenGLContext, to fix font rendering on such devices as Mali and Adreno Change-Id: I9cc99ecb8b71a35bc369ec9dd11b877016b1179e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglcontext.cpp31
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglcontext.h1
2 files changed, 0 insertions, 32 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
index 4d52085a83..6f979f614c 100644
--- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
+++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
@@ -65,42 +65,11 @@ void QAndroidPlatformOpenGLContext::swapBuffers(QPlatformSurface *surface)
QEGLPlatformContext::swapBuffers(surface);
}
-bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaround()
-{
- static bool set = false;
- static bool needsWorkaround = false;
-
- if (!set) {
- QByteArray env = qgetenv("QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND");
- needsWorkaround = env.isEmpty() || env == "0" || env == "false";
-
- if (!needsWorkaround) {
- const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
- needsWorkaround =
- qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450
- || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205
- || qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)'
- || qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305
- || qstrncmp(rendererString, "Adreno 30x", 9) == 0 // Same as above but without the '(TM)'
- || qstrcmp(rendererString, "GC800 core") == 0
- || qstrcmp(rendererString, "GC1000 core") == 0
- || qstrcmp(rendererString, "Immersion.16") == 0;
- }
-
- set = true;
- }
-
- return needsWorkaround;
-}
-
bool QAndroidPlatformOpenGLContext::makeCurrent(QPlatformSurface *surface)
{
bool ret = QEGLPlatformContext::makeCurrent(surface);
QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
- if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround())
- ctx_d->workaround_brokenFBOReadBack = true;
-
return ret;
}
diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.h b/src/plugins/platforms/android/qandroidplatformopenglcontext.h
index 3897b3166b..8e65b4cc36 100644
--- a/src/plugins/platforms/android/qandroidplatformopenglcontext.h
+++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.h
@@ -55,7 +55,6 @@ public:
private:
EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override;
- static bool needsFBOReadBackWorkaround();
};
QT_END_NAMESPACE