aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase-5.1.0/0020-Use-BGRA-extension-in-bindTexture.patch
blob: e081e69a47c0a12aa45b2ae0186a6dc3736409e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From fb16e96ffef959e45c9cbcbef4cc4f51065f2e47 Mon Sep 17 00:00:00 2001
From: Jani Hautakangas <jani.hautakangas@ixonos.com>
Date: Mon, 27 May 2013 15:25:25 -0700
Subject: [PATCH 20/23] Use BGRA extension in bindTexture

Upstream-Status: Pending

Change-Id: I18aecc87c5c7d4483cabe5555da33ca6bb8580f1

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 src/gui/opengl/qopengltexturecache.cpp | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
index 94b8288..5c8aa3c 100644
--- a/src/gui/opengl/qopengltexturecache.cpp
+++ b/src/gui/opengl/qopengltexturecache.cpp
@@ -181,11 +181,7 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, con
 
     QImage tx = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
 
-    // Performance could be improved by skipping qgl_byteSwapImage().
-    if (m_useByteSwapImage)
-        qgl_byteSwapImage(tx);
-
-    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tx.width(), tx.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, const_cast<const QImage &>(tx).bits());
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, tx.width(), tx.height(), 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, const_cast<const QImage &>(tx).bits());
 
     int cost = tx.width() * tx.height() * 4 / 1024;
     m_cache.insert(key, new QOpenGLCachedTexture(id, context), cost);
-- 
1.8.3.2