diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-02-27 14:34:46 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-02-28 19:07:07 +0000 |
commit | 79cbff60dd8e1e1bbe922c0cf0dc65296e50a5c5 (patch) | |
tree | 9e63da9b4f67b80cdec16a2189f3d26745827853 /src/gui/opengl/qopenglpaintengine.cpp | |
parent | d8f0a8a8a413c454b8d8edfbe629095ee6c47988 (diff) |
QtGui: use new QRegion::begin()/end() instead of rect()
Saves ~1100b in text size on optimized GCC 5.3 Linux AMD64 builds.
Change-Id: I928be44314dde06d5fdd2486a3417870bda64af4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/gui/opengl/qopenglpaintengine.cpp')
-rw-r--r-- | src/gui/opengl/qopenglpaintengine.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index d93871c99b..5c05a05d80 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -1012,11 +1012,11 @@ void QOpenGL2PaintEngineExPrivate::fillStencilWithVertexArray(const float *data, funcs.glStencilMask(0xff); // Enable stencil writes if (dirtyStencilRegion.intersects(currentScissorBounds)) { - QVector<QRect> clearRegion = dirtyStencilRegion.intersected(currentScissorBounds).rects(); + const QRegion clearRegion = dirtyStencilRegion.intersected(currentScissorBounds); funcs.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 funcs.glClear(GL_STENCIL_BUFFER_BIT); } |