diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-17 10:10:43 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-17 10:10:43 (GMT) |
commit | 6de735b5793aa1c5ddcba65b1110d3f9e1c64d1d (patch) | |
tree | bcfdce8b93f85047a01848331ac215082f619482 /src/opengl/qgl.cpp | |
parent | 87e9034caf90fb02ae2564947b9cbf464b3ca97c (diff) | |
parent | ff405f5623d7ed18c881c097368e3e9afd2e9443 (diff) | |
download | Qt-6de735b5793aa1c5ddcba65b1110d3f9e1c64d1d.zip Qt-6de735b5793aa1c5ddcba65b1110d3f9e1c64d1d.tar.gz Qt-6de735b5793aa1c5ddcba65b1110d3f9e1c64d1d.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Outline / fill inconsistency in X11 paint engine.
Cocoa: parent windows shows on screen when they should be hidden
Prevented Xorg crash in qtdemo when running corkboards example.
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 4daa866..74bde36 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1688,6 +1688,10 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format) workaround_needsFullClearOnEveryFrame = false; workaround_brokenFBOReadBack = false; workaroundsCached = false; + + workaround_brokenTextureFromPixmap = false; + workaround_brokenTextureFromPixmap_init = false; + for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i) vertexAttributeArraysEnabledState[i] = false; } @@ -2570,11 +2574,27 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, && xinfo && xinfo->screen() == pixmap.x11Info().screen() && target == GL_TEXTURE_2D) { - texture = bindTextureFromNativePixmap(const_cast<QPixmap*>(&pixmap), key, options); - if (texture) { - texture->options |= QGLContext::MemoryManagedBindOption; - texture->boundPixmap = pd; - boundPixmaps.insert(pd, QPixmap(pixmap)); + if (!workaround_brokenTextureFromPixmap_init) { + workaround_brokenTextureFromPixmap_init = true; + + const QByteArray versionString(reinterpret_cast<const char*>(glGetString(GL_VERSION))); + const int pos = versionString.indexOf("NVIDIA "); + + if (pos >= 0) { + const QByteArray nvidiaVersionString = versionString.mid(pos + strlen("NVIDIA ")); + + if (nvidiaVersionString.startsWith("195") || nvidiaVersionString.startsWith("256")) + workaround_brokenTextureFromPixmap = true; + } + } + + if (!workaround_brokenTextureFromPixmap) { + texture = bindTextureFromNativePixmap(const_cast<QPixmap*>(&pixmap), key, options); + if (texture) { + texture->options |= QGLContext::MemoryManagedBindOption; + texture->boundPixmap = pd; + boundPixmaps.insert(pd, QPixmap(pixmap)); + } } } #endif |