From 4a38f15d90e05b1e15e920db65048a1f7b49ea78 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Sun, 29 Jul 2018 11:29:14 +0300 Subject: [PATCH] [effects/slidingpopups] Don't filter window quads Summary: Slided popups are clipped twice: * first, when filtering window quads in prePaintWindow; * then, when doing scissor test (the opengl scene plugin does scissor test for transformed windows). Because of that, we don't need to filter window quads. Filtering window quads only adds overhead. This change simplifies code and "fixes" incorrect clipping when a slided popup has shadows. Test Plan: * Put Plasma panel on the left screen edge; * Open and close the Application Launcher. (repeat for top/right/bottom screen edge) Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: davidedmundson, graesslin, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D14450 --- effects/slidingpopups/slidingpopups.cpp | 70 ------------------------- 1 file changed, 70 deletions(-) diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 1312d6b0a5..7e55ac28ef 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -103,76 +103,6 @@ void SlidingPopupsEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& da data.setTransformed(); w->enablePainting(EffectWindow::PAINT_DISABLED | EffectWindow::PAINT_DISABLED_BY_DELETE); - const int start = mWindowsData[ w ].start; - if (start != 0) { - const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), effects->currentDesktop()); - const QRect geo = w->expandedGeometry(); - const qreal t = (*animationIt).timeLine.value(); - // filter out window quads, but only if the window does not start from the edge - int slideLength; - if (mWindowsData[ w ].slideLength > 0) { - slideLength = mWindowsData[ w ].slideLength; - } else { - slideLength = mSlideLength; - } - - switch(mWindowsData[ w ].from) { - case West: { - const double splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - start) + interpolate(qMin(geo.width(), slideLength), 0, t); - data.quads = data.quads.splitAtX(splitPoint); - WindowQuadList filtered; - filtered.reserve(data.quads.count()); - for (const WindowQuad &quad : qAsConst(data.quads)) { - if (quad.left() >= splitPoint) { - filtered << quad; - } - } - data.quads = filtered; - break; - } - case North: { - const double splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - start) + interpolate(qMin(geo.height(), slideLength), 0, t); - data.quads = data.quads.splitAtY(splitPoint); - WindowQuadList filtered; - filtered.reserve(data.quads.count()); - for (const WindowQuad &quad : qAsConst(data.quads)) { - if (quad.top() >= splitPoint) { - filtered << quad; - } - } - data.quads = filtered; - break; - } - case East: { - const double splitPoint = screenRect.x() + screenRect.width() - geo.x() - start - interpolate(qMin(geo.width(), slideLength), 0, t); - data.quads = data.quads.splitAtX(splitPoint); - WindowQuadList filtered; - filtered.reserve(data.quads.count()); - for (const WindowQuad &quad : qAsConst(data.quads)) { - if (quad.right() <= splitPoint) { - filtered << quad; - } - } - data.quads = filtered; - break; - } - case South: - default: { - const double splitPoint = screenRect.y() + screenRect.height() - geo.y() - start - interpolate(qMin(geo.height(), slideLength), 0, t); - data.quads = data.quads.splitAtY(splitPoint); - WindowQuadList filtered; - filtered.reserve(data.quads.count()); - for (const WindowQuad &quad : qAsConst(data.quads)) { - if (quad.bottom() <= splitPoint) { - filtered << quad; - } - } - data.quads = filtered; - break; - } - } - } - effects->prePaintWindow(w, data, time); }