diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-09-10 11:41:29 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-09-10 11:42:50 +0200 |
commit | d572ab1bb446e880fcb8d27294ba8149550f1659 (patch) | |
tree | d29c449b551e47569c6d9f146ba9e86810c05353 /src/gui/opengl | |
parent | 211cef46f6d9d8738c09f906f9c0c3080b445dc8 (diff) | |
parent | 71df09b6cca7cd7a673bf39f49d0dda28b78a860 (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Id4997327cc01bd4bb397a463bdffbd15e80398ef
Diffstat (limited to 'src/gui/opengl')
-rw-r--r-- | src/gui/opengl/qopengl.h | 6 | ||||
-rw-r--r-- | src/gui/opengl/qopenglfunctions.h | 2 | ||||
-rw-r--r-- | src/gui/opengl/qopenglgradientcache.cpp | 2 | ||||
-rw-r--r-- | src/gui/opengl/qopenglvertexarrayobject.cpp | 10 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index 65bfc7f868..56e99ee8b8 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -117,12 +117,6 @@ typedef char GLchar; # include <QtGui/qopengles2ext.h> # endif // Q_OS_MAC -# ifndef GL_DOUBLE -# define GL_DOUBLE GL_FLOAT -# endif -# ifndef GLdouble -typedef GLfloat GLdouble; -# endif #else // non-ES2 platforms # if defined(Q_OS_MAC) # include <OpenGL/gl.h> diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h index de1de39db2..b9e7523aad 100644 --- a/src/gui/opengl/qopenglfunctions.h +++ b/src/gui/opengl/qopenglfunctions.h @@ -563,8 +563,10 @@ struct QOpenGLFunctionsPrivate void (QOPENGLF_APIENTRYP VertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr); // Special non-ES OpenGL variants, not to be called directly +#ifndef QT_OPENGL_ES_2 void (QOPENGLF_APIENTRYP ClearDepth)(GLdouble depth); void (QOPENGLF_APIENTRYP DepthRange)(GLdouble zNear, GLdouble zFar); +#endif }; // GLES2 + OpenGL1 common subset diff --git a/src/gui/opengl/qopenglgradientcache.cpp b/src/gui/opengl/qopenglgradientcache.cpp index 91b4d08474..f8060fc6a0 100644 --- a/src/gui/opengl/qopenglgradientcache.cpp +++ b/src/gui/opengl/qopenglgradientcache.cpp @@ -102,13 +102,13 @@ void QOpenGL2GradientCache::cleanCache() GLuint QOpenGL2GradientCache::getBuffer(const QGradient &gradient, qreal opacity) { - QMutexLocker lock(&m_mutex); quint64 hash_val = 0; QGradientStops stops = gradient.stops(); for (int i = 0; i < stops.size() && i <= 2; i++) hash_val += stops[i].second.rgba(); + const QMutexLocker lock(&m_mutex); QOpenGLGradientColorTableHash::const_iterator it = cache.constFind(hash_val); if (it == cache.constEnd()) diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp index f39b10dc60..15f08ddfce 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.cpp +++ b/src/gui/opengl/qopenglvertexarrayobject.cpp @@ -391,6 +391,16 @@ QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject() that supports vertex array objects current for this function to succeed. Returns \c true if the OpenGL vertex array object was successfully created. + + When the return value is \c false, vertex array object support is not available. This + is not an error: on systems with OpenGL 2.x or OpenGL ES 2.0 vertex array objects may + not be supported. The application is free to continue execution in this case, but it + then has to be prepared to operate in a VAO-less manner too. This means that instead + of merely calling bind(), the value of isCreated() must be checked and the vertex + arrays has to be initialized in the traditional way when there is no vertex array + object present. + + \sa isCreated() */ bool QOpenGLVertexArrayObject::create() { |