diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2019-08-19 14:04:00 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-08-20 10:41:56 +0000 |
commit | 2f52e1da0df5be9ba2b1e5ebda60a6b3bf63681e (patch) | |
tree | a7d3ec792c974523d909af277221ed44afe1386e /src/gui/opengl | |
parent | c7b1cbdea9a9ec3d9af9331d2704390d3bb0fafe (diff) | |
parent | 70e7445dbeba9bd24de963e7e431c4698b6b4569 (diff) |
Merge remote-tracking branch 'qt/5.12' into 5.13
Conflicts:
src/gui/configure.json
src/gui/util/qtexturefilereader.cpp
src/gui/util/util.pri
tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
Change-Id: I2bc4f84705b66099e97330cda68e0b816aceb9cc
Diffstat (limited to 'src/gui/opengl')
-rw-r--r-- | src/gui/opengl/qopenglprogrambinarycache.cpp | 2 | ||||
-rw-r--r-- | src/gui/opengl/qopenglprogrambinarycache_p.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp index af48cdacc7..40237b9935 100644 --- a/src/gui/opengl/qopenglprogrambinarycache.cpp +++ b/src/gui/opengl/qopenglprogrambinarycache.cpp @@ -263,6 +263,7 @@ public: bool QOpenGLProgramBinaryCache::load(const QByteArray &cacheKey, uint programId) { + QMutexLocker lock(&m_mutex); if (m_memCache.contains(cacheKey)) { const MemCacheEntry *e = m_memCache[cacheKey]; return setProgramBinary(programId, e->format, e->blob.constData(), e->blob.size()); @@ -401,6 +402,7 @@ void QOpenGLProgramBinaryCache::save(const QByteArray &cacheKey, uint programId) GLint outSize = 0; #if defined(QT_OPENGL_ES_2) if (context->isOpenGLES() && context->format().majorVersion() < 3) { + QMutexLocker lock(&m_mutex); initializeProgramBinaryOES(context); getProgramBinaryOES(programId, blobSize, &outSize, &blobFormat, p); } else diff --git a/src/gui/opengl/qopenglprogrambinarycache_p.h b/src/gui/opengl/qopenglprogrambinarycache_p.h index 9fade08e66..e181a6ab81 100644 --- a/src/gui/opengl/qopenglprogrambinarycache_p.h +++ b/src/gui/opengl/qopenglprogrambinarycache_p.h @@ -54,6 +54,7 @@ #include <QtGui/qtguiglobal.h> #include <QtGui/qopenglshaderprogram.h> #include <QtCore/qcache.h> +#include <QtCore/qmutex.h> QT_BEGIN_NAMESPACE @@ -99,6 +100,7 @@ private: void initializeProgramBinaryOES(QOpenGLContext *context); bool m_programBinaryOESInitialized = false; #endif + QMutex m_mutex; }; QT_END_NAMESPACE |