[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
This commit is contained in:
parent
ff2e883469
commit
873d38225e
1 changed files with 2 additions and 2 deletions
|
@ -2123,7 +2123,7 @@ void GLVertexBuffer::draw(const QRegion ®ion, 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 ®ion, 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,
|
||||
|
|
Loading…
Reference in a new issue