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:
Fredrik Höglund 2013-03-15 15:16:12 +01:00
parent 9c348c9a82
commit c8e3d670e7

View file

@ -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);