diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-12-08 22:46:37 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-12-08 22:46:37 (GMT) |
commit | 51297287f1be5c31337203cbf5a0e3eae6047a88 (patch) | |
tree | 8bd75f667e612cb89b062bd51dde742e73cb10f8 | |
parent | 5146c3cb984fe6bfc661811559515b9e84d14628 (diff) | |
download | Qt-51297287f1be5c31337203cbf5a0e3eae6047a88.zip Qt-51297287f1be5c31337203cbf5a0e3eae6047a88.tar.gz Qt-51297287f1be5c31337203cbf5a0e3eae6047a88.tar.bz2 |
Make sure a context is current when loading compressed textures.
Reviewed-by: trustme
-rw-r--r-- | 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(); |