kwin: Optimize decoration quad selection
Loop directly over the window quad list and check the type instead of using select(WindowQuadDecoration) when separating the decoration quads. This avoids the step of creating an intermediate list, and then looping over that list to separate out the quads that belong to the four sides.
This commit is contained in:
parent
9c348c9a82
commit
c8e3d670e7
1 changed files with 4 additions and 1 deletions
|
@ -1162,7 +1162,10 @@ void SceneOpenGL::Window::paintDecorations(const WindowPaintData &data, const QR
|
|||
t->layoutDecorationRects(rect[0], rect[1], rect[2], rect[3], Client::WindowRelative);
|
||||
|
||||
// Split the quads into four lists
|
||||
foreach (const WindowQuad &quad, data.quads.select(WindowQuadDecoration)) {
|
||||
foreach (const WindowQuad &quad, data.quads) {
|
||||
if (quad.type() != WindowQuadDecoration)
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (rect[i].contains(QPoint(quad.originalLeft(), quad.originalTop()))) {
|
||||
quads[i].append(quad);
|
||||
|
|
Loading…
Reference in a new issue