diff options
author | David Boddie <david.boddie@nokia.com> | 2010-09-30 13:25:45 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-09-30 13:25:45 (GMT) |
commit | 70fd09b335f60be7b68f258c47abe2bb092d5775 (patch) | |
tree | cef95cddc6adad7d7efb2adb74e423e43ba04322 /src/opengl/qgl.cpp | |
parent | 6700a9f41692912f221fac55e4cae1809549fa13 (diff) | |
parent | 8c65dc25962e167237c2573979b1dfff88c29326 (diff) | |
download | Qt-70fd09b335f60be7b68f258c47abe2bb092d5775.zip Qt-70fd09b335f60be7b68f258c47abe2bb092d5775.tar.gz Qt-70fd09b335f60be7b68f258c47abe2bb092d5775.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 15070d4..0d1a66e 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1689,9 +1689,6 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format) 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; } @@ -2577,34 +2574,18 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, } } -#if defined(Q_WS_X11) - // Try to use texture_from_pixmap +#if defined(Q_WS_X11) && !defined(QT_NO_EGL) + // Only try to use texture_from_pixmap under X11/EGL const QX11Info *xinfo = qt_x11Info(paintDevice); if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType && xinfo && xinfo->screen() == pixmap.x11Info().screen() && target == GL_TEXTURE_2D) { - 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)); - } + texture = bindTextureFromNativePixmap(const_cast<QPixmap*>(&pixmap), key, options); + if (texture) { + texture->options |= QGLContext::MemoryManagedBindOption; + texture->boundPixmap = pd; + boundPixmaps.insert(pd, QPixmap(pixmap)); } } #endif |