Use non-threaded render loop on Samsung Galaxy Tab 3
We get EGL_BAD_ACCESS from eglMakeCurrent() on this device, and only on this device, so we simply work around it by disabling the threaded render loop. [ChangeLog][Android] Add workarounds for OpenGL bugs on Samsung Galaxy Tab 3. Task-number: QTBUG-34984 Change-Id: I309881f8317473ff87aea2f92d0f6f1b898342d3 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>bb10
parent
0c09d2ccb9
commit
a19817082c
|
|
@ -418,7 +418,15 @@ namespace QtAndroid
|
|||
{
|
||||
return m_qtTag;
|
||||
}
|
||||
}
|
||||
|
||||
QString deviceName()
|
||||
{
|
||||
QString manufacturer = QJNIObjectPrivate::getStaticObjectField("android/os/Build", "MANUFACTURER", "Ljava/lang/String;").toString();
|
||||
QString model = QJNIObjectPrivate::getStaticObjectField("android/os/Build", "MODEL", "Ljava/lang/String;").toString();
|
||||
|
||||
return manufacturer + QStringLiteral(" ") + model;
|
||||
}
|
||||
} // namespace QtAndroid
|
||||
|
||||
static jboolean startQtAndroidPlugin(JNIEnv* /*env*/, jobject /*object*//*, jobject applicationAssetManager*/)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -120,5 +120,6 @@ namespace QtAndroid
|
|||
const char *methodErrorMsgFmt();
|
||||
const char *qtTagText();
|
||||
|
||||
QString deviceName();
|
||||
}
|
||||
#endif // ANDROID_APP_H
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA
|
|||
return &m_palettes;
|
||||
if (resource == "AndroidStyleFonts")
|
||||
return &m_fonts;
|
||||
if (resource == "AndroidDeviceName") {
|
||||
static QString deviceName = QtAndroid::deviceName();
|
||||
return &deviceName;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -119,12 +123,26 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶
|
|||
m_androidSystemLocale = new QAndroidSystemLocale;
|
||||
}
|
||||
|
||||
bool QAndroidPlatformIntegration::needsBasicRenderloopWorkaround()
|
||||
{
|
||||
static bool needsWorkaround =
|
||||
QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0
|
||||
|| QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0
|
||||
|| QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0;
|
||||
return needsWorkaround;
|
||||
}
|
||||
|
||||
bool QAndroidPlatformIntegration::hasCapability(Capability cap) const
|
||||
{
|
||||
switch (cap) {
|
||||
case ThreadedPixmaps: return true;
|
||||
case ApplicationState: return true;
|
||||
case NativeWidgets: return false;
|
||||
|
||||
case ThreadedOpenGL:
|
||||
if (needsBasicRenderloopWorkaround())
|
||||
return false;
|
||||
// fall through
|
||||
default:
|
||||
#ifndef ANDROID_PLUGIN_OPENGL
|
||||
return QPlatformIntegration::hasCapability(cap);
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ public:
|
|||
#endif
|
||||
|
||||
private:
|
||||
static bool needsBasicRenderloopWorkaround();
|
||||
|
||||
friend class QEglFSAndroidHooks;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue