Commit 4aa19c2e authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[effects/magiclamp] Eliminate unnecessary reallocations

The maximum size of `newQuads` is known in advance, so we can avoid
unnecessary reallocations when adding transformed window quads to

Test Plan: Minimized/unminimized System Settings.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision:
parent 049c6e09
......@@ -198,6 +198,7 @@ void MagicLampEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Win
quad[3]._SET_B_(quad[3]._B_() + offset[_O3_])
WindowQuadList newQuads;
float quadFactor; // defines how fast a quad is vertically moved: y coordinates near to window top are slowed down
// it is used as quadFactor^3/windowHeight^3
// quadFactor is the y position of the quad but is changed towards becomming the window height
Supports Markdown
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