summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp8
-rw-r--r--src/opengl/qgl.h9
2 files changed, 15 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 047b681bcb..d5ce4efd1a 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -45,7 +45,11 @@
QT_BEGIN_NAMESPACE
-QBasicAtomicInt qgltextureglyphcache_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1);
+static int next_qgltextureglyphcache_serial_number()
+{
+ static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(0);
+ return 1 + serial.fetchAndAddRelaxed(1);
+}
QGLTextureGlyphCache::QGLTextureGlyphCache(QFontEngine::GlyphFormat format, const QTransform &matrix)
: QImageTextureGlyphCache(format, matrix)
@@ -53,7 +57,7 @@ QGLTextureGlyphCache::QGLTextureGlyphCache(QFontEngine::GlyphFormat format, cons
, pex(0)
, m_blitProgram(0)
, m_filterMode(Nearest)
- , m_serialNumber(qgltextureglyphcache_serial_number.fetchAndAddRelaxed(1))
+ , m_serialNumber(next_qgltextureglyphcache_serial_number())
{
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
qDebug(" -> QGLTextureGlyphCache() %p for context %p.", this, QOpenGLContext::currentContext());
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index a97ddb2b27..ab418c191a 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -51,6 +51,15 @@
#include <QtGui/QSurfaceFormat>
+#if defined(Q_CLANG_QDOC)
+#undef GLint
+typedef int GLint;
+#undef GLuint
+typedef unsigned int GLuint;
+#undef GLenum
+typedef unsigned int GLenum;
+#endif
+
QT_BEGIN_NAMESPACE