[SceneOpenGL] Port from QRegion::rects() to QRegion iterators
ClosedPublic

Authored by broulik on Dec 1 2017, 10:43 AM.

Details

Summary

This code path is executed a lot. Saves creating a temporary QVector.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Dec 1 2017, 10:43 AM
Restricted Application added a project: KWin. · View Herald TranscriptDec 1 2017, 10:43 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
broulik requested review of this revision.Dec 1 2017, 10:43 AM
fredrik added a subscriber: fredrik.Dec 1 2017, 5:02 PM
fredrik added inline comments.
plugins/scenes/opengl/scene_opengl.cpp
802

This can also be written as:

for (const QRect &r : region) {

...

}

Note that QRegion::begin() returns a const_iterator, and doesn't detach().

broulik updated this revision to Diff 23239.Dec 1 2017, 9:44 PM
broulik edited the summary of this revision. (Show Details)
  • Use range for
graesslin accepted this revision.Dec 2 2017, 6:58 AM
This revision is now accepted and ready to land.Dec 2 2017, 6:58 AM
This revision was automatically updated to reflect the committed changes.