summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-12-08 22:46:37 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-12-08 22:46:37 (GMT)
commit51297287f1be5c31337203cbf5a0e3eae6047a88 (patch)
tree8bd75f667e612cb89b062bd51dde742e73cb10f8 /src/opengl/qpixmapdata_gl.cpp
parent5146c3cb984fe6bfc661811559515b9e84d14628 (diff)
downloadQt-51297287f1be5c31337203cbf5a0e3eae6047a88.zip
Qt-51297287f1be5c31337203cbf5a0e3eae6047a88.tar.gz
Qt-51297287f1be5c31337203cbf5a0e3eae6047a88.tar.bz2
Make sure a context is current when loading compressed textures.
Reviewed-by: trustme
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r--src/opengl/qpixmapdata_gl.cpp2
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();