summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-27 14:34:46 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-03-02 21:01:00 +0000
commit9c1d3bc253abd4418f3050d19ec5f05bef3ada97 (patch)
tree18dfa273d29c98936114a1ced9062d7174b121ba /src/opengl
parent9d3a41556224bb116d51fd8ee25a28317af67b22 (diff)
QtOpenGL/plugins/platformsupport: use new QRegion::begin()/end() instead of rect()
Saves e.g. ~900b and ~2900b in text size in QtOpenGL and XcbQpa libs, resp., on optimized GCC 5.3 Linux AMD64 builds. Change-Id: Id904689164ca32df41118a23747c70048d8e6604 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp6
1 files changed, 3 insertions, 3 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);
}