diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 6 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 868e9ed265..6365a7421b 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1006,11 +1006,11 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(const float *data, glStencilMask(0xff); // Enable stencil writes if (dirtyStencilRegion.intersects(currentScissorBounds)) { - QVector<QRect> clearRegion = dirtyStencilRegion.intersected(currentScissorBounds).rects(); + const QRegion clearRegion = dirtyStencilRegion.intersected(currentScissorBounds); glClearStencil(0); // Clear to zero - for (int i = 0; i < clearRegion.size(); ++i) { + for (const QRect &rect : clearRegion) { #ifndef QT_GL_NO_SCISSOR_TEST - setScissor(clearRegion.at(i)); + setScissor(rect); #endif glClear(GL_STENCIL_BUFFER_BIT); } diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index fed1779388..f249984893 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1918,7 +1918,8 @@ void QGLTextureCache::insert(QGLContext* ctx, qint64 key, QGLTexture* texture, i { QWriteLocker locker(&m_lock); const QGLTextureCacheKey cacheKey = {key, QGLContextPrivate::contextGroup(ctx)}; - m_cache.insert(cacheKey, texture, cost); + const bool inserted = m_cache.insert(cacheKey, texture, cost); + Q_UNUSED(inserted) Q_ASSERT(inserted); } void QGLTextureCache::remove(qint64 key) |