From da60ee1856a65ddcc349c5b42ae88d29e31c1e94 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Fri, 14 Jun 2013 10:32:10 +0200 Subject: qtdeclarative: move 5.0.2 specific patches to own directory Signed-off-by: Martin Jansa --- .../0001-qmltestexample-fix-link.patch | 34 +++++++++ ...cement-transition-bug-for-horizontal-case.patch | 32 ++++++++ ...g-calculation-of-viewPort-for-transitions.patch | 41 ++++++++++ ...inter-access-in-QQuickVisualDataModelPriv.patch | 37 +++++++++ ...void-swizzling-on-OpenGL-ES-when-possible.patch | 88 ++++++++++++++++++++++ .../0001-qmltestexample-fix-link.patch | 34 --------- ...cement-transition-bug-for-horizontal-case.patch | 32 -------- ...g-calculation-of-viewPort-for-transitions.patch | 41 ---------- ...inter-access-in-QQuickVisualDataModelPriv.patch | 37 --------- ...void-swizzling-on-OpenGL-ES-when-possible.patch | 88 ---------------------- 10 files changed, 232 insertions(+), 232 deletions(-) create mode 100644 recipes-qt/qt5/qtdeclarative-5.0.2/0001-qmltestexample-fix-link.patch create mode 100644 recipes-qt/qt5/qtdeclarative-5.0.2/0002-Fix-displacement-transition-bug-for-horizontal-case.patch create mode 100644 recipes-qt/qt5/qtdeclarative-5.0.2/0003-Fix-wrong-calculation-of-viewPort-for-transitions.patch create mode 100644 recipes-qt/qt5/qtdeclarative-5.0.2/0004-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch create mode 100644 recipes-qt/qt5/qtdeclarative-5.0.2/0005-Avoid-swizzling-on-OpenGL-ES-when-possible.patch delete mode 100644 recipes-qt/qt5/qtdeclarative/0001-qmltestexample-fix-link.patch delete mode 100644 recipes-qt/qt5/qtdeclarative/0002-Fix-displacement-transition-bug-for-horizontal-case.patch delete mode 100644 recipes-qt/qt5/qtdeclarative/0003-Fix-wrong-calculation-of-viewPort-for-transitions.patch delete mode 100644 recipes-qt/qt5/qtdeclarative/0004-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch delete mode 100644 recipes-qt/qt5/qtdeclarative/0005-Avoid-swizzling-on-OpenGL-ES-when-possible.patch (limited to 'recipes-qt/qt5') diff --git a/recipes-qt/qt5/qtdeclarative-5.0.2/0001-qmltestexample-fix-link.patch b/recipes-qt/qt5/qtdeclarative-5.0.2/0001-qmltestexample-fix-link.patch new file mode 100644 index 00000000..7ed95e4b --- /dev/null +++ b/recipes-qt/qt5/qtdeclarative-5.0.2/0001-qmltestexample-fix-link.patch @@ -0,0 +1,34 @@ +From e22cb54286083886be5081332de2f64ab0b78b4b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Eric=20B=C3=A9nard?= +Date: Sun, 26 May 2013 14:26:19 +0200 +Subject: [PATCH] qmltestexample: fix link +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +else we get : +ld: warning: libQt5Quick.so.5, needed by libQt5QuickTest.so, not found + +Upstream-Status: Inappropriate + +Signed-off-by: Eric Bénard +--- + examples/qmltest/qmltest/qmltest.pro | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/examples/qmltest/qmltest/qmltest.pro b/examples/qmltest/qmltest/qmltest.pro +index b5893c5..1b00e6c 100644 +--- a/examples/qmltest/qmltest/qmltest.pro ++++ b/examples/qmltest/qmltest/qmltest.pro +@@ -14,7 +14,7 @@ TESTDATA += tst_basic.qml tst_item.qml + # This code exists solely for the purpose of building this example + # inside the examples/ hierarchy. + +-QT += qml qmltest ++QT += qml qmltest quick + + macx: CONFIG -= app_bundle + +-- +1.8.1.4 + diff --git a/recipes-qt/qt5/qtdeclarative-5.0.2/0002-Fix-displacement-transition-bug-for-horizontal-case.patch b/recipes-qt/qt5/qtdeclarative-5.0.2/0002-Fix-displacement-transition-bug-for-horizontal-case.patch new file mode 100644 index 00000000..91740ac7 --- /dev/null +++ b/recipes-qt/qt5/qtdeclarative-5.0.2/0002-Fix-displacement-transition-bug-for-horizontal-case.patch @@ -0,0 +1,32 @@ +From eb11863cc40048e84cb383ae9e29b5929170a63d Mon Sep 17 00:00:00 2001 +From: Guenter Schwann +Date: Wed, 27 Feb 2013 15:52:03 +0100 +Subject: [PATCH 2/5] Fix displacement transition bug for horizontal case + +Task-number: QTBUG-29944 + +Upstream-Status: Backport https://codereview.qt-project.org/49226 +Signed-off-by: Florian Haenel +Signed-off-by: Martin Jansa + +Change-Id: I23381f7a1d2c8d3c6df007b5b11c12b0db3bb1e9 +--- + src/quick/items/qquickitemview.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp +index b73fb8c..1c74288 100644 +--- a/src/quick/items/qquickitemview.cpp ++++ b/src/quick/items/qquickitemview.cpp +@@ -2115,7 +2115,7 @@ void QQuickItemViewPrivate::prepareVisibleItemTransitions() + return; + + // must call for every visible item to init or discard transitions +- QRectF viewBounds(0, position(), q->width(), q->height()); ++ QRectF viewBounds(q->contentX(), q->contentY(), q->width(), q->height()); + for (int i=0; iprepareTransition(transitioner, viewBounds); + } +-- +1.8.2.1 + diff --git a/recipes-qt/qt5/qtdeclarative-5.0.2/0003-Fix-wrong-calculation-of-viewPort-for-transitions.patch b/recipes-qt/qt5/qtdeclarative-5.0.2/0003-Fix-wrong-calculation-of-viewPort-for-transitions.patch new file mode 100644 index 00000000..05451af5 --- /dev/null +++ b/recipes-qt/qt5/qtdeclarative-5.0.2/0003-Fix-wrong-calculation-of-viewPort-for-transitions.patch @@ -0,0 +1,41 @@ +From 3dfa028b27e171cb2494b22f0346be1390310ea6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Florian=20H=C3=A4nel?= +Date: Wed, 5 Jun 2013 19:23:32 +0200 +Subject: [PATCH 3/5] Fix wrong calculation of viewPort for transitions + +Viewport is calculated wrong for horizontal layout in a second instance + +Task-number: QTBUG-29944 +Task-Number: QTBUG-31546 + +Upstream-Status: Pending + +Looks like backport of https://codereview.qt-project.org/49226 but this +one was applied in previous patch, this change looks the same but is +in different part of qquickitemview.cpp and ISN'T applied yet in dev +branch. + +Signed-off-by: Florian Haenel +Signed-off-by: Martin Jansa + +Change-Id: I136ae4484278d14f796613505e3f38c65ec51ebe +--- + src/quick/items/qquickitemview.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp +index 1c74288..b316af9 100644 +--- a/src/quick/items/qquickitemview.cpp ++++ b/src/quick/items/qquickitemview.cpp +@@ -1816,7 +1816,7 @@ void QQuickItemViewPrivate::layout() + + prepareVisibleItemTransitions(); + +- QRectF viewBounds(0, position(), q->width(), q->height()); ++ QRectF viewBounds(q->contentX(), q->contentY(), q->width(), q->height()); + for (QList::Iterator it = releasePendingTransition.begin(); + it != releasePendingTransition.end(); ) { + FxViewItem *item = *it; +-- +1.8.2.1 + diff --git a/recipes-qt/qt5/qtdeclarative-5.0.2/0004-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch b/recipes-qt/qt5/qtdeclarative-5.0.2/0004-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch new file mode 100644 index 00000000..0182248e --- /dev/null +++ b/recipes-qt/qt5/qtdeclarative-5.0.2/0004-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch @@ -0,0 +1,37 @@ +From adb69cabeacbe14a4439473107000d6e94d8d033 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Florian=20H=C3=A4nel?= +Date: Mon, 3 Jun 2013 13:40:09 +0200 +Subject: [PATCH 4/5] Fix null-pointer access in QQuickVisualDataModelPrivate + +I observed null cachItem->contextData which lead to null-pointer access +on cacheItem->contextData->destroy(). + +Task-number: QTBUG-31439 + +Upstream-Status: Backport https://codereview.qt-project.org/57789 + +Signed-of-by: Florian Haenel +Signed-off-by: Martin Jansa + +Change-Id: I91f28a3ee1ac83446ecde1801a1cb7962fb883f3 +--- + src/quick/items/qquickvisualdatamodel.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/quick/items/qquickvisualdatamodel.cpp b/src/quick/items/qquickvisualdatamodel.cpp +index d2e50e8..a460e7f 100644 +--- a/src/quick/items/qquickvisualdatamodel.cpp ++++ b/src/quick/items/qquickvisualdatamodel.cpp +@@ -817,7 +817,8 @@ void QQuickVisualDataModelPrivate::incubatorStatusChanged(QVDMIncubationTask *in + delete cacheItem->object; + cacheItem->object = 0; + cacheItem->scriptRef -= 1; +- cacheItem->contextData->destroy(); ++ if (cacheItem->contextData) ++ cacheItem->contextData->destroy(); + cacheItem->contextData = 0; + if (!cacheItem->isReferenced()) { + removeCacheItem(cacheItem); +-- +1.8.2.1 + diff --git a/recipes-qt/qt5/qtdeclarative-5.0.2/0005-Avoid-swizzling-on-OpenGL-ES-when-possible.patch b/recipes-qt/qt5/qtdeclarative-5.0.2/0005-Avoid-swizzling-on-OpenGL-ES-when-possible.patch new file mode 100644 index 00000000..92be7ef8 --- /dev/null +++ b/recipes-qt/qt5/qtdeclarative-5.0.2/0005-Avoid-swizzling-on-OpenGL-ES-when-possible.patch @@ -0,0 +1,88 @@ +From 9d85c3c5823c6f73db245d4de786d911fd96edfd Mon Sep 17 00:00:00 2001 +From: Florian Haenel +Date: Sat, 8 Jun 2013 00:34:35 +0200 +Subject: [PATCH 5/5] Avoid swizzling on OpenGL ES when possible + +Add support for APPLE_texture_format_BGRA8888, +IMG_texture_format_BGRA8888, +EXT_texture_format_BGRA8888 and EXT_bgra. The apple one acts +just like the desktop EXT_bgra one, so they need slightly +different handling than the ES extensions. + +This change also has the benefit that we no longer have a dedicated +ES path. + +Upstream-Status: Backport https://codereview.qt-project.org/46549 +Signed-off-by: Florian Haenel +Signed-off-by: Martin Jansa + +Change-Id: I5ecb0a02c3a7bd984d6752fa87163726118b93de +--- + src/quick/scenegraph/util/qsgtexture.cpp | 28 ++++++++++++++++++++++------ + 1 file changed, 22 insertions(+), 6 deletions(-) + +diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp +index 16cc461..3d574f3 100644 +--- a/src/quick/scenegraph/util/qsgtexture.cpp ++++ b/src/quick/scenegraph/util/qsgtexture.cpp +@@ -65,6 +65,10 @@ + #include + #endif + ++#ifndef GL_BGRA ++#define GL_BGRA 0x80E1 ++#endif ++ + QT_BEGIN_NAMESPACE + + inline static bool isPowerOfTwo(int x) +@@ -523,7 +527,6 @@ QSGPlainTexture::~QSGPlainTexture() + glDeleteTextures(1, &m_texture_id); + } + +-#ifdef QT_OPENGL_ES + void qsg_swizzleBGRAToRGBA(QImage *image) + { + const int width = image->width(); +@@ -534,7 +537,6 @@ void qsg_swizzleBGRAToRGBA(QImage *image) + p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00); + } + } +-#endif + + void QSGPlainTexture::setImage(const QImage &image) + { +@@ -621,12 +623,26 @@ void QSGPlainTexture::bind() + + updateBindOptions(m_dirty_bind_options); + ++ GLenum externalFormat = GL_RGBA; ++ GLenum internalFormat = GL_RGBA; ++ ++ const char *extensions = (const char *) glGetString(GL_EXTENSIONS); ++ if (strstr(extensions, "GL_EXT_bgra")) { ++ externalFormat = GL_BGRA; + #ifdef QT_OPENGL_ES +- qsg_swizzleBGRAToRGBA(&tmp); +- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tmp.constBits()); +-#else +- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, tmp.constBits()); ++ internalFormat = GL_BGRA; + #endif ++ } else if (strstr(extensions, "GL_APPLE_texture_format_BGRA8888")) { ++ externalFormat = GL_BGRA; ++ } else if (strstr(extensions, "GL_EXT_texture_format_BGRA8888") ++ || strstr(extensions, "GL_IMG_texture_format_BGRA8888")) { ++ externalFormat = GL_BGRA; ++ internalFormat = GL_BGRA; ++ } else { ++ qsg_swizzleBGRAToRGBA(&tmp); ++ } ++ ++ glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, w, h, 0, externalFormat, GL_UNSIGNED_BYTE, tmp.constBits()); + + if (m_has_mipmaps) { + QOpenGLContext *ctx = QOpenGLContext::currentContext(); +-- +1.8.2.1 + diff --git a/recipes-qt/qt5/qtdeclarative/0001-qmltestexample-fix-link.patch b/recipes-qt/qt5/qtdeclarative/0001-qmltestexample-fix-link.patch deleted file mode 100644 index 7ed95e4b..00000000 --- a/recipes-qt/qt5/qtdeclarative/0001-qmltestexample-fix-link.patch +++ /dev/null @@ -1,34 +0,0 @@ -From e22cb54286083886be5081332de2f64ab0b78b4b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Eric=20B=C3=A9nard?= -Date: Sun, 26 May 2013 14:26:19 +0200 -Subject: [PATCH] qmltestexample: fix link -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -else we get : -ld: warning: libQt5Quick.so.5, needed by libQt5QuickTest.so, not found - -Upstream-Status: Inappropriate - -Signed-off-by: Eric Bénard ---- - examples/qmltest/qmltest/qmltest.pro | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/examples/qmltest/qmltest/qmltest.pro b/examples/qmltest/qmltest/qmltest.pro -index b5893c5..1b00e6c 100644 ---- a/examples/qmltest/qmltest/qmltest.pro -+++ b/examples/qmltest/qmltest/qmltest.pro -@@ -14,7 +14,7 @@ TESTDATA += tst_basic.qml tst_item.qml - # This code exists solely for the purpose of building this example - # inside the examples/ hierarchy. - --QT += qml qmltest -+QT += qml qmltest quick - - macx: CONFIG -= app_bundle - --- -1.8.1.4 - diff --git a/recipes-qt/qt5/qtdeclarative/0002-Fix-displacement-transition-bug-for-horizontal-case.patch b/recipes-qt/qt5/qtdeclarative/0002-Fix-displacement-transition-bug-for-horizontal-case.patch deleted file mode 100644 index 91740ac7..00000000 --- a/recipes-qt/qt5/qtdeclarative/0002-Fix-displacement-transition-bug-for-horizontal-case.patch +++ /dev/null @@ -1,32 +0,0 @@ -From eb11863cc40048e84cb383ae9e29b5929170a63d Mon Sep 17 00:00:00 2001 -From: Guenter Schwann -Date: Wed, 27 Feb 2013 15:52:03 +0100 -Subject: [PATCH 2/5] Fix displacement transition bug for horizontal case - -Task-number: QTBUG-29944 - -Upstream-Status: Backport https://codereview.qt-project.org/49226 -Signed-off-by: Florian Haenel -Signed-off-by: Martin Jansa - -Change-Id: I23381f7a1d2c8d3c6df007b5b11c12b0db3bb1e9 ---- - src/quick/items/qquickitemview.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp -index b73fb8c..1c74288 100644 ---- a/src/quick/items/qquickitemview.cpp -+++ b/src/quick/items/qquickitemview.cpp -@@ -2115,7 +2115,7 @@ void QQuickItemViewPrivate::prepareVisibleItemTransitions() - return; - - // must call for every visible item to init or discard transitions -- QRectF viewBounds(0, position(), q->width(), q->height()); -+ QRectF viewBounds(q->contentX(), q->contentY(), q->width(), q->height()); - for (int i=0; iprepareTransition(transitioner, viewBounds); - } --- -1.8.2.1 - diff --git a/recipes-qt/qt5/qtdeclarative/0003-Fix-wrong-calculation-of-viewPort-for-transitions.patch b/recipes-qt/qt5/qtdeclarative/0003-Fix-wrong-calculation-of-viewPort-for-transitions.patch deleted file mode 100644 index 05451af5..00000000 --- a/recipes-qt/qt5/qtdeclarative/0003-Fix-wrong-calculation-of-viewPort-for-transitions.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 3dfa028b27e171cb2494b22f0346be1390310ea6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Florian=20H=C3=A4nel?= -Date: Wed, 5 Jun 2013 19:23:32 +0200 -Subject: [PATCH 3/5] Fix wrong calculation of viewPort for transitions - -Viewport is calculated wrong for horizontal layout in a second instance - -Task-number: QTBUG-29944 -Task-Number: QTBUG-31546 - -Upstream-Status: Pending - -Looks like backport of https://codereview.qt-project.org/49226 but this -one was applied in previous patch, this change looks the same but is -in different part of qquickitemview.cpp and ISN'T applied yet in dev -branch. - -Signed-off-by: Florian Haenel -Signed-off-by: Martin Jansa - -Change-Id: I136ae4484278d14f796613505e3f38c65ec51ebe ---- - src/quick/items/qquickitemview.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp -index 1c74288..b316af9 100644 ---- a/src/quick/items/qquickitemview.cpp -+++ b/src/quick/items/qquickitemview.cpp -@@ -1816,7 +1816,7 @@ void QQuickItemViewPrivate::layout() - - prepareVisibleItemTransitions(); - -- QRectF viewBounds(0, position(), q->width(), q->height()); -+ QRectF viewBounds(q->contentX(), q->contentY(), q->width(), q->height()); - for (QList::Iterator it = releasePendingTransition.begin(); - it != releasePendingTransition.end(); ) { - FxViewItem *item = *it; --- -1.8.2.1 - diff --git a/recipes-qt/qt5/qtdeclarative/0004-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch b/recipes-qt/qt5/qtdeclarative/0004-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch deleted file mode 100644 index 0182248e..00000000 --- a/recipes-qt/qt5/qtdeclarative/0004-Fix-null-pointer-access-in-QQuickVisualDataModelPriv.patch +++ /dev/null @@ -1,37 +0,0 @@ -From adb69cabeacbe14a4439473107000d6e94d8d033 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Florian=20H=C3=A4nel?= -Date: Mon, 3 Jun 2013 13:40:09 +0200 -Subject: [PATCH 4/5] Fix null-pointer access in QQuickVisualDataModelPrivate - -I observed null cachItem->contextData which lead to null-pointer access -on cacheItem->contextData->destroy(). - -Task-number: QTBUG-31439 - -Upstream-Status: Backport https://codereview.qt-project.org/57789 - -Signed-of-by: Florian Haenel -Signed-off-by: Martin Jansa - -Change-Id: I91f28a3ee1ac83446ecde1801a1cb7962fb883f3 ---- - src/quick/items/qquickvisualdatamodel.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/quick/items/qquickvisualdatamodel.cpp b/src/quick/items/qquickvisualdatamodel.cpp -index d2e50e8..a460e7f 100644 ---- a/src/quick/items/qquickvisualdatamodel.cpp -+++ b/src/quick/items/qquickvisualdatamodel.cpp -@@ -817,7 +817,8 @@ void QQuickVisualDataModelPrivate::incubatorStatusChanged(QVDMIncubationTask *in - delete cacheItem->object; - cacheItem->object = 0; - cacheItem->scriptRef -= 1; -- cacheItem->contextData->destroy(); -+ if (cacheItem->contextData) -+ cacheItem->contextData->destroy(); - cacheItem->contextData = 0; - if (!cacheItem->isReferenced()) { - removeCacheItem(cacheItem); --- -1.8.2.1 - diff --git a/recipes-qt/qt5/qtdeclarative/0005-Avoid-swizzling-on-OpenGL-ES-when-possible.patch b/recipes-qt/qt5/qtdeclarative/0005-Avoid-swizzling-on-OpenGL-ES-when-possible.patch deleted file mode 100644 index 92be7ef8..00000000 --- a/recipes-qt/qt5/qtdeclarative/0005-Avoid-swizzling-on-OpenGL-ES-when-possible.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 9d85c3c5823c6f73db245d4de786d911fd96edfd Mon Sep 17 00:00:00 2001 -From: Florian Haenel -Date: Sat, 8 Jun 2013 00:34:35 +0200 -Subject: [PATCH 5/5] Avoid swizzling on OpenGL ES when possible - -Add support for APPLE_texture_format_BGRA8888, -IMG_texture_format_BGRA8888, -EXT_texture_format_BGRA8888 and EXT_bgra. The apple one acts -just like the desktop EXT_bgra one, so they need slightly -different handling than the ES extensions. - -This change also has the benefit that we no longer have a dedicated -ES path. - -Upstream-Status: Backport https://codereview.qt-project.org/46549 -Signed-off-by: Florian Haenel -Signed-off-by: Martin Jansa - -Change-Id: I5ecb0a02c3a7bd984d6752fa87163726118b93de ---- - src/quick/scenegraph/util/qsgtexture.cpp | 28 ++++++++++++++++++++++------ - 1 file changed, 22 insertions(+), 6 deletions(-) - -diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp -index 16cc461..3d574f3 100644 ---- a/src/quick/scenegraph/util/qsgtexture.cpp -+++ b/src/quick/scenegraph/util/qsgtexture.cpp -@@ -65,6 +65,10 @@ - #include - #endif - -+#ifndef GL_BGRA -+#define GL_BGRA 0x80E1 -+#endif -+ - QT_BEGIN_NAMESPACE - - inline static bool isPowerOfTwo(int x) -@@ -523,7 +527,6 @@ QSGPlainTexture::~QSGPlainTexture() - glDeleteTextures(1, &m_texture_id); - } - --#ifdef QT_OPENGL_ES - void qsg_swizzleBGRAToRGBA(QImage *image) - { - const int width = image->width(); -@@ -534,7 +537,6 @@ void qsg_swizzleBGRAToRGBA(QImage *image) - p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00); - } - } --#endif - - void QSGPlainTexture::setImage(const QImage &image) - { -@@ -621,12 +623,26 @@ void QSGPlainTexture::bind() - - updateBindOptions(m_dirty_bind_options); - -+ GLenum externalFormat = GL_RGBA; -+ GLenum internalFormat = GL_RGBA; -+ -+ const char *extensions = (const char *) glGetString(GL_EXTENSIONS); -+ if (strstr(extensions, "GL_EXT_bgra")) { -+ externalFormat = GL_BGRA; - #ifdef QT_OPENGL_ES -- qsg_swizzleBGRAToRGBA(&tmp); -- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tmp.constBits()); --#else -- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, tmp.constBits()); -+ internalFormat = GL_BGRA; - #endif -+ } else if (strstr(extensions, "GL_APPLE_texture_format_BGRA8888")) { -+ externalFormat = GL_BGRA; -+ } else if (strstr(extensions, "GL_EXT_texture_format_BGRA8888") -+ || strstr(extensions, "GL_IMG_texture_format_BGRA8888")) { -+ externalFormat = GL_BGRA; -+ internalFormat = GL_BGRA; -+ } else { -+ qsg_swizzleBGRAToRGBA(&tmp); -+ } -+ -+ glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, w, h, 0, externalFormat, GL_UNSIGNED_BYTE, tmp.constBits()); - - if (m_has_mipmaps) { - QOpenGLContext *ctx = QOpenGLContext::currentContext(); --- -1.8.2.1 - -- cgit v1.2.3