diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 047b681bcb..c1c5661da4 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; + 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()); |