diff options
Diffstat (limited to 'src/gui/opengl')
-rw-r--r-- | src/gui/opengl/qopenglengineshadermanager.cpp | 14 | ||||
-rw-r--r-- | src/gui/opengl/qopenglfunctions.cpp | 6 | ||||
-rw-r--r-- | src/gui/opengl/qtriangulator_p.h | 11 |
3 files changed, 16 insertions, 15 deletions
diff --git a/src/gui/opengl/qopenglengineshadermanager.cpp b/src/gui/opengl/qopenglengineshadermanager.cpp index 40f4ce94c2..7bdd3cb1bb 100644 --- a/src/gui/opengl/qopenglengineshadermanager.cpp +++ b/src/gui/opengl/qopenglengineshadermanager.cpp @@ -191,7 +191,7 @@ QOpenGLEngineSharedShaders::QOpenGLEngineSharedShaders(QOpenGLContext* context) #if defined(QT_DEBUG) // Check that all the elements have been filled: for (int i = 0; i < TotalSnippetCount; ++i) { - if (qShaderSnippets[i] == 0) { + if (Q_UNLIKELY(!qShaderSnippets[i])) { qFatal("Shader snippet for %s (#%d) is missing!", snippetNameStr(SnippetName(i)).constData(), i); } @@ -240,11 +240,11 @@ QOpenGLEngineSharedShaders::QOpenGLEngineSharedShaders(QOpenGLContext* context) simpleShaderProg->link(); - if (simpleShaderProg->isLinked()) { + if (Q_UNLIKELY(!simpleShaderProg->isLinked())) { + qCritical("Errors linking simple shader: %s", qPrintable(simpleShaderProg->log())); + } else { if (!inCache) simpleShaderCache.store(simpleShaderProg, context); - } else { - qCritical("Errors linking simple shader: %s", qPrintable(simpleShaderProg->log())); } // Compile the blit shader: @@ -281,11 +281,11 @@ QOpenGLEngineSharedShaders::QOpenGLEngineSharedShaders(QOpenGLContext* context) } blitShaderProg->link(); - if (blitShaderProg->isLinked()) { + if (Q_UNLIKELY(!blitShaderProg->isLinked())) { + qCritical("Errors linking blit shader: %s", qPrintable(blitShaderProg->log())); + } else { if (!inCache) blitShaderCache.store(blitShaderProg, context); - } else { - qCritical("Errors linking blit shader: %s", qPrintable(blitShaderProg->log())); } #ifdef QT_GL_SHARED_SHADER_DEBUG diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index d614ad8401..bfd30735b2 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -5795,7 +5795,9 @@ QOpenGLES3Helper::QOpenGLES3Helper() { m_supportedVersion = qMakePair(2, 0); - if (init()) { + if (Q_UNLIKELY(!init())) { + qFatal("Failed to load libGLESv2"); + } else { const QPair<int, int> contextVersion = QOpenGLContext::currentContext()->format().version(); qCDebug(lcGLES3, "Resolving OpenGL ES 3.0 entry points"); @@ -5993,8 +5995,6 @@ QOpenGLES3Helper::QOpenGLES3Helper() } m_supportedVersion = qMakePair(3, 1); } - } else { - qFatal("Failed to load libGLESv2"); } } diff --git a/src/gui/opengl/qtriangulator_p.h b/src/gui/opengl/qtriangulator_p.h index 0ab3f7496c..4e13e5bdd0 100644 --- a/src/gui/opengl/qtriangulator_p.h +++ b/src/gui/opengl/qtriangulator_p.h @@ -88,12 +88,13 @@ public: inline QVertexIndexVector &operator = (const QVertexIndexVector &other) { - if (t == UnsignedInt) - indices32 = other.indices32; - else - indices16 = other.indices16; + if (t == UnsignedInt) + indices32 = other.indices32; + else + indices16 = other.indices16; - return *this; + t = other.t; + return *this; } private: |