Commit 709b7c2c authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[libkwineffects] Push render targets more efficiently in GLRenderTarget::pushRenderTargets

If s_renderTargets is not empty, GLRenderTarget::pushRenderTargets starts
to do pretty heavy things: it deletes head of the targets param in a while loop.

There is no need to do that. Because QStack inherits QVector, we can use
append method to push new render targets in a more efficient way.

Test Plan: Background behind Konsole is still blurred.

Reviewers: #kwin, mart

Reviewed By: #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision:
parent 7ee83dc5
......@@ -1099,23 +1099,9 @@ void GLRenderTarget::pushRenderTargets(QStack <GLRenderTarget*> targets)
if (s_renderTargets.isEmpty()) {
glGetIntegerv(GL_VIEWPORT, s_virtualScreenViewport);
s_renderTargets = targets;
} else {
s_renderTargets.reserve(s_renderTargets.size() + targets.size());
* Merging the two stacks.
* We cheat a little bit by using the inherited QVector functions.
* This is to not have the targets stack in reverse order without
* having to use a helper QStack first to reverse the order.
while (!targets.isEmpty()) {
GLRenderTarget* GLRenderTarget::popRenderTarget()
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