diff options
author | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-09-23 12:49:18 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-09-23 12:51:57 (GMT) |
commit | 07c5429d5aacab932cd912e66287d66fb952e7c4 (patch) | |
tree | 5ed4f1a69ea33a86c5bd07d7de4cd74d960aefe1 | |
parent | 82d28ac2065f348e7eacb20c455894ab349b666e (diff) | |
download | Qt-07c5429d5aacab932cd912e66287d66fb952e7c4.zip Qt-07c5429d5aacab932cd912e66287d66fb952e7c4.tar.gz Qt-07c5429d5aacab932cd912e66287d66fb952e7c4.tar.bz2 |
Don't try to use the texture_from_pixmap extension in GL on desktop/X11.
There are far too many problems with this extension for it to be usable
on desktop at the moment, so disable on desktop GL for now. It's still
enabled for EGL, where it seems to have better driver support.
Task-number: related to QTBUG-11158
Reviewed-by: Samuel
-rw-r--r-- | src/opengl/qgl.cpp | 33 | ||||
-rw-r--r-- | src/opengl/qgl_p.h | 3 |
2 files changed, 7 insertions, 29 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 diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 623eeaf..6323ce2 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -401,9 +401,6 @@ public: uint workaround_brokenFBOReadBack : 1; uint workaroundsCached : 1; - uint workaround_brokenTextureFromPixmap : 1; - uint workaround_brokenTextureFromPixmap_init : 1; - QPaintDevice *paintDevice; QColor transpColor; QGLContext *q_ptr; |