summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltextureglyphcache.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-02-17 20:10:34 +0100
committerLiang Qi <liang.qi@qt.io>2017-02-17 20:10:34 +0100
commitbc4cd465dd5df82e13f3c7709166ee11289d219f (patch)
treed6323aaed6383e589fbefb6057648c22bb187c76 /src/gui/opengl/qopengltextureglyphcache.cpp
parent43daefb0962794b2df256cae1098e889b9b36f12 (diff)
parent07745d7bfbf6c8d83e0243150d8ce934675dea87 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: qmake/Makefile.unix Change-Id: Ia18e391198222eef34ffa2df6f683e052058d032
Diffstat (limited to 'src/gui/opengl/qopengltextureglyphcache.cpp')
-rw-r--r--src/gui/opengl/qopengltextureglyphcache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp
index 62b069a1d08..556d52ef997 100644
--- a/src/gui/opengl/qopengltextureglyphcache.cpp
+++ b/src/gui/opengl/qopengltextureglyphcache.cpp
@@ -47,7 +47,11 @@
QT_BEGIN_NAMESPACE
-QBasicAtomicInt qopengltextureglyphcache_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1);
+static int next_qopengltextureglyphcache_serial_number()
+{
+ static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(0);
+ return 1 + serial.fetchAndAddRelaxed(1);
+}
QOpenGLTextureGlyphCache::QOpenGLTextureGlyphCache(QFontEngine::GlyphFormat format, const QTransform &matrix)
: QImageTextureGlyphCache(format, matrix)
@@ -55,7 +59,7 @@ QOpenGLTextureGlyphCache::QOpenGLTextureGlyphCache(QFontEngine::GlyphFormat form
, pex(0)
, m_blitProgram(0)
, m_filterMode(Nearest)
- , m_serialNumber(qopengltextureglyphcache_serial_number.fetchAndAddRelaxed(1))
+ , m_serialNumber(next_qopengltextureglyphcache_serial_number())
, m_buffer(QOpenGLBuffer::VertexBuffer)
{
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG