aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/qt4/qt-4.6.0/0992-Make-sure-a-context-is-current-when-loading-compress.patch
blob: 301fba29fd1fc3164985c3f8973902163eeeae46 (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
From 51297287f1be5c31337203cbf5a0e3eae6047a88 Mon Sep 17 00:00:00 2001
From: Rhys Weatherley <rhys.weatherley@nokia.com>
Date: Wed, 9 Dec 2009 08:46:37 +1000
Subject: [PATCH 0992/1244] Make sure a context is current when loading compressed textures.

Reviewed-by: trustme
---
 src/opengl/qpixmapdata_gl.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 0299cea..4e1d50d 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -424,6 +424,7 @@ bool QGLPixmapData::fromFile(const QString &filename, const char *format,
         resize(0, 0);
         data = file.readAll();
         file.close();
+        QGLShareContextScope ctx(qt_gl_share_widget()->context());
         QSize size = m_texture.bindCompressedTexture
             (data.constData(), data.size(), format);
         if (!size.isEmpty()) {
@@ -449,6 +450,7 @@ bool QGLPixmapData::fromData(const uchar *buffer, uint len, const char *format,
     const char *buf = reinterpret_cast<const char *>(buffer);
     if (m_texture.canBindCompressedTexture(buf, int(len), format, &alpha)) {
         resize(0, 0);
+        QGLShareContextScope ctx(qt_gl_share_widget()->context());
         QSize size = m_texture.bindCompressedTexture(buf, int(len), format);
         if (!size.isEmpty()) {
             w = size.width();
-- 
1.6.5