diff options
Diffstat (limited to 'src/quick/scenegraph/util')
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture.cpp | 18 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture.cpp | 19 |
2 files changed, 31 insertions, 6 deletions
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index 6e0fdc7290..d080c59198 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -48,6 +48,7 @@ #include <QtGui/QGuiApplication> #include <QtGui/QScreen> #include <QtGui/QSurface> +#include <QtGui/qpa/qplatformnativeinterface.h> #include <private/qsgtexture_p.h> @@ -144,10 +145,21 @@ Atlas::Atlas(const QSize &size) { #ifdef QT_OPENGL_ES +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + QString *deviceName = + static_cast<QString *>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("AndroidDeviceName")); + static bool wrongfullyReportsBgra8888Support = deviceName->compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 + || deviceName->compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0 + || deviceName->compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0; +#else + static bool wrongfullyReportsBgra8888Support = false; +#endif + const char *ext = (const char *) glGetString(GL_EXTENSIONS); - if (strstr(ext, "GL_EXT_bgra") - || strstr(ext, "GL_EXT_texture_format_BGRA8888") - || strstr(ext, "GL_IMG_texture_format_BGRA8888")) { + if (!wrongfullyReportsBgra8888Support + && (strstr(ext, "GL_EXT_bgra") + || strstr(ext, "GL_EXT_texture_format_BGRA8888") + || strstr(ext, "GL_IMG_texture_format_BGRA8888"))) { m_internalFormat = m_externalFormat = GL_BGRA; #ifdef Q_OS_IOS } else if (strstr(ext, "GL_APPLE_texture_format_BGRA8888")) { diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index d84ccb7a1f..ae1bec3f42 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -47,8 +47,10 @@ #include <qthread.h> #include <private/qqmlprofilerservice_p.h> #include <private/qqmlglobal_p.h> +#include <QtGui/qguiapplication.h> +#include <QtGui/qpa/qplatformnativeinterface.h> -#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) && !defined(__UCLIBC__) #define CAN_BACKTRACE_EXECINFO #endif @@ -679,14 +681,25 @@ void QSGPlainTexture::bind() GLenum externalFormat = GL_RGBA; GLenum internalFormat = GL_RGBA; +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + QString *deviceName = + static_cast<QString *>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("AndroidDeviceName")); + static bool wrongfullyReportsBgra8888Support = deviceName->compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 + || deviceName->compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0 + || deviceName->compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0; +#else + static bool wrongfullyReportsBgra8888Support = false; +#endif + QOpenGLContext *context = QOpenGLContext::currentContext(); if (context->hasExtension(QByteArrayLiteral("GL_EXT_bgra"))) { externalFormat = GL_BGRA; #ifdef QT_OPENGL_ES internalFormat = GL_BGRA; #endif - } else if (context->hasExtension(QByteArrayLiteral("GL_EXT_texture_format_BGRA8888")) - || context->hasExtension(QByteArrayLiteral("GL_IMG_texture_format_BGRA8888"))) { + } else if (!wrongfullyReportsBgra8888Support + && (context->hasExtension(QByteArrayLiteral("GL_EXT_texture_format_BGRA8888")) + || context->hasExtension(QByteArrayLiteral("GL_IMG_texture_format_BGRA8888")))) { externalFormat = GL_BGRA; internalFormat = GL_BGRA; #ifdef Q_OS_IOS |