Commit 873d3822 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[GLVertexBuffer] Port from QRegion::rects() to QRegion iterators

This code path is executed a lot during animations (e.g. maximize, minimize).
Saves creating a temporary QVector.

Differential Revision: https://phabricator.kde.org/D9082
parent ff2e8834
......@@ -2123,7 +2123,7 @@ void GLVertexBuffer::draw(const QRegion &region, GLenum primitiveMode, int first
glDrawElementsBaseVertex(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, nullptr, first);
} else {
// Clip using scissoring
foreach (const QRect &r, region.rects()) {
for (const QRect &r : region) {
glScissor((r.x() - s_virtualScreenGeometry.x()) * s_virtualScreenScale,
(s_virtualScreenGeometry.height() + s_virtualScreenGeometry.y() - r.y() - r.height()) * s_virtualScreenScale,
r.width() * s_virtualScreenScale,
......@@ -2138,7 +2138,7 @@ void GLVertexBuffer::draw(const QRegion &region, GLenum primitiveMode, int first
glDrawArrays(primitiveMode, first, count);
} else {
// Clip using scissoring
foreach (const QRect &r, region.rects()) {
for (const QRect &r : region) {
glScissor((r.x() - s_virtualScreenGeometry.x()) * s_virtualScreenScale,
(s_virtualScreenGeometry.height() + s_virtualScreenGeometry.y() - r.y() - r.height()) * s_virtualScreenScale,
r.width() * s_virtualScreenScale,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment