From 4dc751360a605f010fd5031e95302bed3317d5e6 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 26 Aug 2014 17:25:26 +0200 Subject: Android: added more devices to the FBO readback workaround check. Task-number: QTBUG-40483 Change-Id: I7f3d375934a57fe3ac58ae35cb00d394349cb33f Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../platforms/android/qandroidplatformopenglcontext.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/android/qandroidplatformopenglcontext.cpp') diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp index f27bea8863..a352d3ebb8 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp @@ -64,7 +64,7 @@ void QAndroidPlatformOpenGLContext::swapBuffers(QPlatformSurface *surface) static_cast(surface)->checkNativeSurface(eglConfig()); } -bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaroud() +bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaround() { static bool set = false; static bool needsWorkaround = false; @@ -74,7 +74,12 @@ bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaroud() needsWorkaround = qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450 || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205 - || qstrcmp(rendererString, "GC1000 core") == 0; + || 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; } @@ -90,7 +95,7 @@ bool QAndroidPlatformOpenGLContext::makeCurrent(QPlatformSurface *surface) if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) ctx_d->workaround_missingPrecisionQualifiers = true; - if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaroud()) + if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround()) ctx_d->workaround_brokenFBOReadBack = true; return ret; -- cgit v1.2.3 From 05670f586ffe05425b7542a27fcca31bddf231aa Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 2 Sep 2014 15:50:55 +0200 Subject: Android: use FBO readback workaround by default. Maintaining a black list of devices can't be reasonably done. The workaround is now enabled by default. It can be disabled with the QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND environment variable, in which case the current list of blacklisted drivers will still be taken into account. Task-number: QTBUG-40483 Change-Id: I9b90ab45e86569e8e4679333ddb9b835189892c7 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../android/qandroidplatformopenglcontext.cpp | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/plugins/platforms/android/qandroidplatformopenglcontext.cpp') diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp index a352d3ebb8..dfc43f0fa5 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp @@ -70,16 +70,22 @@ bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaround() static bool needsWorkaround = false; if (!set) { - const char *rendererString = reinterpret_cast(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; + QByteArray env = qgetenv("QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND"); + needsWorkaround = env.isEmpty() || env == "0" || env == "false"; + + if (!needsWorkaround) { + const char *rendererString = reinterpret_cast(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; } -- cgit v1.2.3