diff --git a/autotests/mock_effectshandler.h b/autotests/mock_effectshandler.h index b2aacfea26..9bddf1393b 100644 --- a/autotests/mock_effectshandler.h +++ b/autotests/mock_effectshandler.h @@ -124,7 +124,7 @@ public: return 0; } void doneOpenGLContextCurrent() override {} - void drawWindow(KWin::EffectWindow *, int, QRegion, KWin::WindowPaintData &) override {} + void drawWindow(KWin::EffectWindow *, int, const QRegion &, KWin::WindowPaintData &) override {} KWin::EffectFrame *effectFrame(KWin::EffectFrameStyle, bool, const QPoint &, Qt::Alignment) const override { return nullptr; } @@ -173,9 +173,9 @@ public: bool optionRollOverDesktops() const override { return false; } - void paintEffectFrame(KWin::EffectFrame *, QRegion, double, double) override {} - void paintScreen(int, QRegion, KWin::ScreenPaintData &) override {} - void paintWindow(KWin::EffectWindow *, int, QRegion, KWin::WindowPaintData &) override {} + void paintEffectFrame(KWin::EffectFrame *, const QRegion &, double, double) override {} + void paintScreen(int, const QRegion &, KWin::ScreenPaintData &) override {} + void paintWindow(KWin::EffectWindow *, int, const QRegion &, KWin::WindowPaintData &) override {} void postPaintScreen() override {} void postPaintWindow(KWin::EffectWindow *) override {} void prePaintScreen(KWin::ScreenPrePaintData &, int) override {} diff --git a/effects.cpp b/effects.cpp index 5400f9832d..17ecf6de34 100644 --- a/effects.cpp +++ b/effects.cpp @@ -397,7 +397,7 @@ void EffectsHandlerImpl::prePaintScreen(ScreenPrePaintData& data, int time) // no special final code } -void EffectsHandlerImpl::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void EffectsHandlerImpl::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { if (m_currentPaintScreenIterator != m_activeEffects.constEnd()) { (*m_currentPaintScreenIterator++)->paintScreen(mask, region, data); @@ -440,7 +440,7 @@ void EffectsHandlerImpl::prePaintWindow(EffectWindow* w, WindowPrePaintData& dat // no special final code } -void EffectsHandlerImpl::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) +void EffectsHandlerImpl::paintWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) { if (m_currentPaintWindowIterator != m_activeEffects.constEnd()) { (*m_currentPaintWindowIterator++)->paintWindow(w, mask, region, data); @@ -449,7 +449,7 @@ void EffectsHandlerImpl::paintWindow(EffectWindow* w, int mask, QRegion region, m_scene->finalPaintWindow(static_cast(w), mask, region, data); } -void EffectsHandlerImpl::paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity) +void EffectsHandlerImpl::paintEffectFrame(EffectFrame* frame, const QRegion ®ion, double opacity, double frameOpacity) { if (m_currentPaintEffectFrameIterator != m_activeEffects.constEnd()) { (*m_currentPaintEffectFrameIterator++)->paintEffectFrame(frame, region, opacity, frameOpacity); @@ -477,7 +477,7 @@ Effect *EffectsHandlerImpl::provides(Effect::Feature ef) return nullptr; } -void EffectsHandlerImpl::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) +void EffectsHandlerImpl::drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) { if (m_currentDrawWindowIterator != m_activeEffects.constEnd()) { (*m_currentDrawWindowIterator++)->drawWindow(w, mask, region, data); @@ -2280,7 +2280,7 @@ void EffectFrameImpl::plasmaThemeChanged() free(); } -void EffectFrameImpl::render(QRegion region, double opacity, double frameOpacity) +void EffectFrameImpl::render(const QRegion ®ion, double opacity, double frameOpacity) { if (m_geometry.isEmpty()) { return; // Nothing to display diff --git a/effects.h b/effects.h index 23c5927497..6b0e70bbba 100644 --- a/effects.h +++ b/effects.h @@ -74,20 +74,20 @@ public: EffectsHandlerImpl(Compositor *compositor, Scene *scene); ~EffectsHandlerImpl() override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; /** * Special hook to perform a paintScreen but just with the windows on @p desktop. */ void paintDesktop(int desktop, int mask, QRegion region, ScreenPaintData& data); void postPaintScreen() override; void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) override; - void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; + void paintWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) override; void postPaintWindow(EffectWindow* w) override; - void paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity) override; + void paintEffectFrame(EffectFrame* frame, const QRegion ®ion, double opacity, double frameOpacity) override; Effect *provides(Effect::Feature ef); - void drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; + void drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) override; void buildQuads(EffectWindow* w, WindowQuadList& quadList) override; @@ -541,7 +541,7 @@ public: ~EffectFrameImpl() override; void free() override; - void render(QRegion region = infiniteRegion(), double opacity = 1.0, double frameOpacity = 1.0) override; + void render(const QRegion ®ion = infiniteRegion(), double opacity = 1.0, double frameOpacity = 1.0) override; Qt::Alignment alignment() const override; void setAlignment(Qt::Alignment alignment) override; const QFont& font() const override; diff --git a/effects/backgroundcontrast/contrast.cpp b/effects/backgroundcontrast/contrast.cpp index 961e829e2a..eb614719c4 100644 --- a/effects/backgroundcontrast/contrast.cpp +++ b/effects/backgroundcontrast/contrast.cpp @@ -431,7 +431,7 @@ bool ContrastEffect::shouldContrast(const EffectWindow *w, int mask, const Windo return true; } -void ContrastEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) +void ContrastEffect::drawWindow(EffectWindow *w, int mask, const QRegion ®ion, WindowPaintData &data) { const QRect screen = GLRenderTarget::virtualScreenGeometry(); if (shouldContrast(w, mask, data)) { @@ -467,7 +467,7 @@ void ContrastEffect::drawWindow(EffectWindow *w, int mask, QRegion region, Windo effects->drawWindow(w, mask, region, data); } -void ContrastEffect::paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity) +void ContrastEffect::paintEffectFrame(EffectFrame *frame, const QRegion ®ion, double opacity, double frameOpacity) { //FIXME: this is a no-op for now, it should figure out the right contrast, intensity, saturation effects->paintEffectFrame(frame, region, opacity, frameOpacity); diff --git a/effects/backgroundcontrast/contrast.h b/effects/backgroundcontrast/contrast.h index 3785c81c43..4efd2e793c 100644 --- a/effects/backgroundcontrast/contrast.h +++ b/effects/backgroundcontrast/contrast.h @@ -55,8 +55,8 @@ public: void reconfigure(ReconfigureFlags flags) override; void prePaintScreen(ScreenPrePaintData &data, int time) override; void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time) override; - void drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; - void paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity) override; + void drawWindow(EffectWindow *w, int mask, const QRegion ®ion, WindowPaintData &data) override; + void paintEffectFrame(EffectFrame *frame, const QRegion ®ion, double opacity, double frameOpacity) override; bool provides(Feature feature) override; diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index 9cbaf082f0..e34a73d2dc 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -580,7 +580,7 @@ bool BlurEffect::shouldBlur(const EffectWindow *w, int mask, const WindowPaintDa return true; } -void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) +void BlurEffect::drawWindow(EffectWindow *w, int mask, const QRegion ®ion, WindowPaintData &data) { const QRect screen = GLRenderTarget::virtualScreenGeometry(); if (shouldBlur(w, mask, data)) { @@ -616,7 +616,7 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPai effects->drawWindow(w, mask, region, data); } -void BlurEffect::paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity) +void BlurEffect::paintEffectFrame(EffectFrame *frame, const QRegion ®ion, double opacity, double frameOpacity) { const QRect screen = effects->virtualScreenGeometry(); bool valid = m_renderTargetsValid && m_shader && m_shader->isValid(); diff --git a/effects/blur/blur.h b/effects/blur/blur.h index 15c99fd4e4..53db214fac 100644 --- a/effects/blur/blur.h +++ b/effects/blur/blur.h @@ -58,8 +58,8 @@ public: void reconfigure(ReconfigureFlags flags) override; void prePaintScreen(ScreenPrePaintData &data, int time) override; void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) override; - void drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; - void paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity) override; + void drawWindow(EffectWindow *w, int mask, const QRegion ®ion, WindowPaintData &data) override; + void paintEffectFrame(EffectFrame *frame, const QRegion ®ion, double opacity, double frameOpacity) override; bool provides(Feature feature) override; diff --git a/effects/colorpicker/colorpicker.cpp b/effects/colorpicker/colorpicker.cpp index ea362318a1..572844376b 100644 --- a/effects/colorpicker/colorpicker.cpp +++ b/effects/colorpicker/colorpicker.cpp @@ -61,7 +61,7 @@ ColorPickerEffect::ColorPickerEffect() ColorPickerEffect::~ColorPickerEffect() = default; -void ColorPickerEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void ColorPickerEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { m_cachedOutputGeometry = data.outputGeometry(); effects->paintScreen(mask, region, data); diff --git a/effects/colorpicker/colorpicker.h b/effects/colorpicker/colorpicker.h index 79dade4c11..bb9ce9ac96 100644 --- a/effects/colorpicker/colorpicker.h +++ b/effects/colorpicker/colorpicker.h @@ -37,7 +37,7 @@ class ColorPickerEffect : public Effect, protected QDBusContext public: ColorPickerEffect(); ~ColorPickerEffect() override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; void postPaintScreen() override; bool isActive() const override; diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index 3776366771..36236a491b 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -129,7 +129,7 @@ void CoverSwitchEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void CoverSwitchEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void CoverSwitchEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); diff --git a/effects/coverswitch/coverswitch.h b/effects/coverswitch/coverswitch.h index 2629e90b23..0ba220c67e 100644 --- a/effects/coverswitch/coverswitch.h +++ b/effects/coverswitch/coverswitch.h @@ -54,7 +54,7 @@ public: void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData &data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; void postPaintScreen() override; void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; void windowInputMouseEvent(QEvent *e) override; diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index f6d48c3978..0d57d8bcaa 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -397,7 +397,7 @@ void CubeEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void CubeEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void CubeEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { if (activated) { QRect rect = effects->clientArea(FullArea, activeScreen, effects->currentDesktop()); diff --git a/effects/cube/cube.h b/effects/cube/cube.h index 654df21150..589d33ae40 100644 --- a/effects/cube/cube.h +++ b/effects/cube/cube.h @@ -59,7 +59,7 @@ public: ~CubeEffect() override; void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) override; void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; diff --git a/effects/cubeslide/cubeslide.cpp b/effects/cubeslide/cubeslide.cpp index 79c75b0a26..cf6451258c 100644 --- a/effects/cubeslide/cubeslide.cpp +++ b/effects/cubeslide/cubeslide.cpp @@ -87,7 +87,7 @@ void CubeSlideEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void CubeSlideEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void CubeSlideEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { if (isActive()) { glEnable(GL_CULL_FACE); diff --git a/effects/cubeslide/cubeslide.h b/effects/cubeslide/cubeslide.h index 42c7e2ffc3..f61a126ec8 100644 --- a/effects/cubeslide/cubeslide.h +++ b/effects/cubeslide/cubeslide.h @@ -43,7 +43,7 @@ public: ~CubeSlideEffect() override; void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) override; void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index 03925f959f..ca3a05d564 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -181,7 +181,7 @@ void DesktopGridEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void DesktopGridEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void DesktopGridEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { if (timeline.currentValue() == 0 && !isUsingPresentWindows()) { effects->paintScreen(mask, region, data); diff --git a/effects/desktopgrid/desktopgrid.h b/effects/desktopgrid/desktopgrid.h index 4d6c8df56c..6ff14cf9ce 100644 --- a/effects/desktopgrid/desktopgrid.h +++ b/effects/desktopgrid/desktopgrid.h @@ -70,7 +70,7 @@ public: ~DesktopGridEffect() override; void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) override; void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; diff --git a/effects/flipswitch/flipswitch.cpp b/effects/flipswitch/flipswitch.cpp index 38aedd98dd..03b52a80cd 100644 --- a/effects/flipswitch/flipswitch.cpp +++ b/effects/flipswitch/flipswitch.cpp @@ -120,7 +120,7 @@ void FlipSwitchEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void FlipSwitchEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void FlipSwitchEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); if (m_active) { diff --git a/effects/flipswitch/flipswitch.h b/effects/flipswitch/flipswitch.h index 922236be00..56a5e8b107 100644 --- a/effects/flipswitch/flipswitch.h +++ b/effects/flipswitch/flipswitch.h @@ -47,7 +47,7 @@ public: void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time) override; void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; diff --git a/effects/invert/invert.cpp b/effects/invert/invert.cpp index b8b907017b..bde5cb93d7 100644 --- a/effects/invert/invert.cpp +++ b/effects/invert/invert.cpp @@ -82,7 +82,7 @@ bool InvertEffect::loadData() return true; } -void InvertEffect::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) +void InvertEffect::drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) { // Load if we haven't already if (m_valid && !m_inited) @@ -103,7 +103,7 @@ void InvertEffect::drawWindow(EffectWindow* w, int mask, QRegion region, WindowP } } -void InvertEffect::paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity) +void InvertEffect::paintEffectFrame(KWin::EffectFrame* frame, const QRegion ®ion, double opacity, double frameOpacity) { if (m_valid && m_allWindows) { frame->setShader(m_shader); diff --git a/effects/invert/invert.h b/effects/invert/invert.h index 25a3d796e2..e1304b69ae 100644 --- a/effects/invert/invert.h +++ b/effects/invert/invert.h @@ -40,8 +40,8 @@ public: InvertEffect(); ~InvertEffect() override; - void drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; - void paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity) override; + void drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) override; + void paintEffectFrame(KWin::EffectFrame* frame, const QRegion ®ion, double opacity, double frameOpacity) override; bool isActive() const override; bool provides(Feature) override; diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index a08fa59806..5a1ef0e490 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -225,7 +225,7 @@ void LookingGlassEffect::slotMouseChanged(const QPoint& pos, const QPoint& old, } } -void LookingGlassEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void LookingGlassEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { // Call the next effect. effects->paintScreen(mask, region, data); diff --git a/effects/lookingglass/lookingglass.h b/effects/lookingglass/lookingglass.h index bed2a2fcee..b2b65fe292 100644 --- a/effects/lookingglass/lookingglass.h +++ b/effects/lookingglass/lookingglass.h @@ -46,7 +46,7 @@ public: void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; bool isActive() const override; static bool supported(); diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp index d800ef4f87..0c541f1357 100644 --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -138,7 +138,7 @@ void MagnifierEffect::prePaintScreen(ScreenPrePaintData& data, int time) data.paint |= magnifierArea().adjusted(-FRAME_WIDTH, -FRAME_WIDTH, FRAME_WIDTH, FRAME_WIDTH); } -void MagnifierEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void MagnifierEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); // paint normal screen if (zoom != 1.0) { diff --git a/effects/magnifier/magnifier.h b/effects/magnifier/magnifier.h index de2a215ba0..056301bc73 100644 --- a/effects/magnifier/magnifier.h +++ b/effects/magnifier/magnifier.h @@ -42,7 +42,7 @@ public: ~MagnifierEffect() override; void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; bool isActive() const override; static bool supported(); diff --git a/effects/mouseclick/mouseclick.cpp b/effects/mouseclick/mouseclick.cpp index a735b14199..636ee52c90 100644 --- a/effects/mouseclick/mouseclick.cpp +++ b/effects/mouseclick/mouseclick.cpp @@ -111,7 +111,7 @@ void MouseClickEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void MouseClickEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void MouseClickEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); diff --git a/effects/mouseclick/mouseclick.h b/effects/mouseclick/mouseclick.h index 1c4eb1e494..f9c4a6d72a 100644 --- a/effects/mouseclick/mouseclick.h +++ b/effects/mouseclick/mouseclick.h @@ -104,7 +104,7 @@ public: ~MouseClickEffect() override; void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; bool isActive() const override; diff --git a/effects/mousemark/mousemark.cpp b/effects/mousemark/mousemark.cpp index d135b04af0..2c421c743a 100644 --- a/effects/mousemark/mousemark.cpp +++ b/effects/mousemark/mousemark.cpp @@ -111,7 +111,7 @@ void MouseMarkEffect::addRect(const QPoint &p1, const QPoint &p2, xcb_rectangle_ } #endif -void MouseMarkEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void MouseMarkEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); // paint normal screen if (marks.isEmpty() && drawing.isEmpty()) diff --git a/effects/mousemark/mousemark.h b/effects/mousemark/mousemark.h index eab3c27056..c56cf7da45 100644 --- a/effects/mousemark/mousemark.h +++ b/effects/mousemark/mousemark.h @@ -40,7 +40,7 @@ public: MouseMarkEffect(); ~MouseMarkEffect() override; void reconfigure(ReconfigureFlags) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; bool isActive() const override; // for properties diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 87a31db17b..afacd3c87b 100644 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -218,7 +218,7 @@ void PresentWindowsEffect::prePaintScreen(ScreenPrePaintData &data, int time) effects->prePaintScreen(data, time); } -void PresentWindowsEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void PresentWindowsEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { effects->paintScreen(mask, region, data); diff --git a/effects/presentwindows/presentwindows.h b/effects/presentwindows/presentwindows.h index 523b46a3ef..ede10ba338 100644 --- a/effects/presentwindows/presentwindows.h +++ b/effects/presentwindows/presentwindows.h @@ -98,7 +98,7 @@ public: // Screen painting void prePaintScreen(ScreenPrePaintData &data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; void postPaintScreen() override; // Window painting diff --git a/effects/screenedge/screenedgeeffect.cpp b/effects/screenedge/screenedgeeffect.cpp index 88654bb627..dc9e84e5ed 100644 --- a/effects/screenedge/screenedgeeffect.cpp +++ b/effects/screenedge/screenedgeeffect.cpp @@ -89,7 +89,7 @@ void ScreenEdgeEffect::prePaintScreen(ScreenPrePaintData &data, int time) } } -void ScreenEdgeEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void ScreenEdgeEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { effects->paintScreen(mask, region, data); for (QHash::iterator it = m_borders.begin(); diff --git a/effects/screenedge/screenedgeeffect.h b/effects/screenedge/screenedgeeffect.h index 9ed7a524d9..3bbaa9e080 100644 --- a/effects/screenedge/screenedgeeffect.h +++ b/effects/screenedge/screenedgeeffect.h @@ -37,7 +37,7 @@ public: ScreenEdgeEffect(); ~ScreenEdgeEffect() override; void prePaintScreen(ScreenPrePaintData &data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; bool isActive() const override; int requestedEffectChainPosition() const override { diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index a37b684f25..d56cfb37b7 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -156,7 +156,7 @@ static xcb_pixmap_t xpixmapFromImage(const QImage &image) return pixmap; } -void ScreenShotEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void ScreenShotEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { m_cachedOutputGeometry = data.outputGeometry(); effects->paintScreen(mask, region, data); diff --git a/effects/screenshot/screenshot.h b/effects/screenshot/screenshot.h index bbbc789b07..6282f9b2a5 100644 --- a/effects/screenshot/screenshot.h +++ b/effects/screenshot/screenshot.h @@ -44,7 +44,7 @@ public: ScreenShotEffect(); ~ScreenShotEffect() override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; void postPaintScreen() override; bool isActive() const override; diff --git a/effects/showfps/showfps.cpp b/effects/showfps/showfps.cpp index b02ca1eef5..c7c4d23c79 100644 --- a/effects/showfps/showfps.cpp +++ b/effects/showfps/showfps.cpp @@ -151,7 +151,7 @@ void ShowFpsEffect::paintWindow(EffectWindow* w, int mask, QRegion region, Windo paint_size[ paints_pos ] += winsize; } -void ShowFpsEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void ShowFpsEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); int fps = 0; diff --git a/effects/showfps/showfps.h b/effects/showfps/showfps.h index 3f5cb15839..e75e610a40 100644 --- a/effects/showfps/showfps.h +++ b/effects/showfps/showfps.h @@ -46,7 +46,7 @@ public: ShowFpsEffect(); void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) override; void postPaintScreen() override; enum { INSIDE_GRAPH, NOWHERE, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT }; // fps text position diff --git a/effects/showpaint/showpaint.cpp b/effects/showpaint/showpaint.cpp index 42d4d66a1d..685c433f45 100644 --- a/effects/showpaint/showpaint.cpp +++ b/effects/showpaint/showpaint.cpp @@ -58,7 +58,7 @@ ShowPaintEffect::ShowPaintEffect() connect(toggleAction, &QAction::triggered, this, &ShowPaintEffect::toggle); } -void ShowPaintEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void ShowPaintEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { m_painted = QRegion(); effects->paintScreen(mask, region, data); diff --git a/effects/showpaint/showpaint.h b/effects/showpaint/showpaint.h index c2f0c83a59..bc103ab9ce 100644 --- a/effects/showpaint/showpaint.h +++ b/effects/showpaint/showpaint.h @@ -33,7 +33,7 @@ class ShowPaintEffect : public Effect public: ShowPaintEffect(); - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; bool isActive() const override; diff --git a/effects/slide/slide.cpp b/effects/slide/slide.cpp index 39dbdea88d..78b5231647 100644 --- a/effects/slide/slide.cpp +++ b/effects/slide/slide.cpp @@ -128,7 +128,7 @@ inline QRegion buildClipRegion(const QPoint &pos, int w, int h) return r; } -void SlideEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void SlideEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { const bool wrap = effects->optionRollOverDesktops(); const int w = workspaceWidth(); diff --git a/effects/slide/slide.h b/effects/slide/slide.h index 3b480019db..ecc43d0f56 100644 --- a/effects/slide/slide.h +++ b/effects/slide/slide.h @@ -45,7 +45,7 @@ public: void reconfigure(ReconfigureFlags) override; void prePaintScreen(ScreenPrePaintData &data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; void postPaintScreen() override; void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time) override; diff --git a/effects/snaphelper/snaphelper.cpp b/effects/snaphelper/snaphelper.cpp index a7857dace3..05cd2dc31a 100644 --- a/effects/snaphelper/snaphelper.cpp +++ b/effects/snaphelper/snaphelper.cpp @@ -105,7 +105,7 @@ void SnapHelperEffect::prePaintScreen(ScreenPrePaintData &data, int time) effects->prePaintScreen(data, time); } -void SnapHelperEffect::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void SnapHelperEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { effects->paintScreen(mask, region, data); diff --git a/effects/snaphelper/snaphelper.h b/effects/snaphelper/snaphelper.h index 606ee5529e..0114807301 100644 --- a/effects/snaphelper/snaphelper.h +++ b/effects/snaphelper/snaphelper.h @@ -38,7 +38,7 @@ public: void reconfigure(ReconfigureFlags flags) override; void prePaintScreen(ScreenPrePaintData &data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; void postPaintScreen() override; bool isActive() const override; diff --git a/effects/startupfeedback/startupfeedback.cpp b/effects/startupfeedback/startupfeedback.cpp index 834dcf7a61..0161d15730 100644 --- a/effects/startupfeedback/startupfeedback.cpp +++ b/effects/startupfeedback/startupfeedback.cpp @@ -169,7 +169,7 @@ void StartupFeedbackEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void StartupFeedbackEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void StartupFeedbackEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); if (m_active) { diff --git a/effects/startupfeedback/startupfeedback.h b/effects/startupfeedback/startupfeedback.h index 204f798504..aa02f05121 100644 --- a/effects/startupfeedback/startupfeedback.h +++ b/effects/startupfeedback/startupfeedback.h @@ -40,7 +40,7 @@ public: void reconfigure(ReconfigureFlags flags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; bool isActive() const override; diff --git a/effects/thumbnailaside/thumbnailaside.cpp b/effects/thumbnailaside/thumbnailaside.cpp index 9bca3c6a78..eb05497c7e 100644 --- a/effects/thumbnailaside/thumbnailaside.cpp +++ b/effects/thumbnailaside/thumbnailaside.cpp @@ -60,7 +60,7 @@ void ThumbnailAsideEffect::reconfigure(ReconfigureFlags) arrange(); } -void ThumbnailAsideEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void ThumbnailAsideEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { painted = QRegion(); effects->paintScreen(mask, region, data); diff --git a/effects/thumbnailaside/thumbnailaside.h b/effects/thumbnailaside/thumbnailaside.h index ec98bb29f5..04b6f4684c 100644 --- a/effects/thumbnailaside/thumbnailaside.h +++ b/effects/thumbnailaside/thumbnailaside.h @@ -46,7 +46,7 @@ class ThumbnailAsideEffect public: ThumbnailAsideEffect(); void reconfigure(ReconfigureFlags) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override; // for properties diff --git a/effects/touchpoints/touchpoints.cpp b/effects/touchpoints/touchpoints.cpp index 52e9e95212..69e74cf774 100644 --- a/effects/touchpoints/touchpoints.cpp +++ b/effects/touchpoints/touchpoints.cpp @@ -127,7 +127,7 @@ void TouchPointsEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void TouchPointsEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void TouchPointsEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); diff --git a/effects/touchpoints/touchpoints.h b/effects/touchpoints/touchpoints.h index f6ed782ec7..6e1145c3c7 100644 --- a/effects/touchpoints/touchpoints.h +++ b/effects/touchpoints/touchpoints.h @@ -39,7 +39,7 @@ public: TouchPointsEffect(); ~TouchPointsEffect() override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; bool isActive() const override; bool touchDown(qint32 id, const QPointF &pos, quint32 time) override; diff --git a/effects/trackmouse/trackmouse.cpp b/effects/trackmouse/trackmouse.cpp index 6bf44f7338..71df0a65fe 100644 --- a/effects/trackmouse/trackmouse.cpp +++ b/effects/trackmouse/trackmouse.cpp @@ -115,7 +115,7 @@ void TrackMouseEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void TrackMouseEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void TrackMouseEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); // paint normal screen diff --git a/effects/trackmouse/trackmouse.h b/effects/trackmouse/trackmouse.h index 6aae8927cf..6bad2ebb07 100644 --- a/effects/trackmouse/trackmouse.h +++ b/effects/trackmouse/trackmouse.h @@ -41,7 +41,7 @@ public: TrackMouseEffect(); ~TrackMouseEffect() override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; void reconfigure(ReconfigureFlags) override; bool isActive() const override; diff --git a/effects/windowgeometry/windowgeometry.cpp b/effects/windowgeometry/windowgeometry.cpp index c77af6efb3..b2e45c8e9e 100644 --- a/effects/windowgeometry/windowgeometry.cpp +++ b/effects/windowgeometry/windowgeometry.cpp @@ -92,7 +92,7 @@ void WindowGeometry::reconfigure(ReconfigureFlags) iHandleResizes = WindowGeometryConfiguration::resize(); } -void WindowGeometry::paintScreen(int mask, QRegion region, ScreenPaintData &data) +void WindowGeometry::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { effects->paintScreen(mask, region, data); if (iAmActivated && iAmActive) { diff --git a/effects/windowgeometry/windowgeometry.h b/effects/windowgeometry/windowgeometry.h index 3c98cb3da2..b19562fe72 100644 --- a/effects/windowgeometry/windowgeometry.h +++ b/effects/windowgeometry/windowgeometry.h @@ -39,7 +39,7 @@ public: return ef == Effect::GeometryTip; } void reconfigure(ReconfigureFlags) override; - void paintScreen(int mask, QRegion region, ScreenPaintData &data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; bool isActive() const override; int requestedEffectChainPosition() const override { diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index 413d0261c6..d884262777 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -271,7 +271,7 @@ void ZoomEffect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void ZoomEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void ZoomEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { if (zoom != 1.0) { data *= QVector2D(zoom, zoom); diff --git a/effects/zoom/zoom.h b/effects/zoom/zoom.h index 153434121e..61fe5ee29b 100644 --- a/effects/zoom/zoom.h +++ b/effects/zoom/zoom.h @@ -49,7 +49,7 @@ public: ~ZoomEffect() override; void reconfigure(ReconfigureFlags flags) override; void prePaintScreen(ScreenPrePaintData& data, int time) override; - void paintScreen(int mask, QRegion region, ScreenPaintData& data) override; + void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) override; void postPaintScreen() override; bool isActive() const override; // for properties diff --git a/kcmkwin/kwindecoration/declarative-plugin/previewbutton.cpp b/kcmkwin/kwindecoration/declarative-plugin/previewbutton.cpp index fda7d83fcd..d86949dafa 100644 --- a/kcmkwin/kwindecoration/declarative-plugin/previewbutton.cpp +++ b/kcmkwin/kwindecoration/declarative-plugin/previewbutton.cpp @@ -138,7 +138,7 @@ void PreviewButtonItem::paint(QPainter *painter) painter->fillRect(size, m_color); } -void PreviewButtonItem::setColor(const QColor color) +void PreviewButtonItem::setColor(const QColor &color) { m_color = color; m_color.setAlpha(127); diff --git a/kcmkwin/kwindecoration/declarative-plugin/previewbutton.h b/kcmkwin/kwindecoration/declarative-plugin/previewbutton.h index ed70e6db77..e1895c32ec 100644 --- a/kcmkwin/kwindecoration/declarative-plugin/previewbutton.h +++ b/kcmkwin/kwindecoration/declarative-plugin/previewbutton.h @@ -59,7 +59,7 @@ public: void setType(int type); const QColor &color() const { return m_color; } - void setColor(const QColor color); + void setColor(const QColor &color); Q_SIGNALS: void bridgeChanged(); diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp index 0a7c8a0e47..12ce42e1e9 100644 --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -315,7 +315,7 @@ int RulesWidget::comboToDesktop(int val) const } #ifdef KWIN_BUILD_ACTIVITIES -int RulesWidget::activityToCombo(QString d) const +int RulesWidget::activityToCombo(const QString &d) const { // TODO: ivan - do a multiselection list for (int i = 0; i < activity->count(); i++) { diff --git a/kcmkwin/kwinrules/ruleswidget.h b/kcmkwin/kwinrules/ruleswidget.h index feaf1a2213..b6b3bfbe41 100644 --- a/kcmkwin/kwinrules/ruleswidget.h +++ b/kcmkwin/kwinrules/ruleswidget.h @@ -107,7 +107,7 @@ private: int desktopToCombo(int d) const; int comboToDesktop(int val) const; #ifdef KWIN_BUILD_ACTIVITIES - int activityToCombo(QString d) const; + int activityToCombo(const QString &d) const; QString comboToActivity(int val) const; void updateActivitiesList(); KActivities::Consumer *m_activities; diff --git a/libkwineffects/anidata.cpp b/libkwineffects/anidata.cpp index 12de0f070e..4823cb3715 100644 --- a/libkwineffects/anidata.cpp +++ b/libkwineffects/anidata.cpp @@ -86,10 +86,10 @@ AniData::AniData(AnimationEffect::Attribute a, int meta_, const FPx2 &to_, , to(to_) , meta(meta_) , startTime(AnimationEffect::clock() + delay) - , fullScreenEffectLock(fullScreenEffectLock_) + , fullScreenEffectLock(std::move(fullScreenEffectLock_)) , waitAtSource(waitAtSource_) , keepAlive(keepAlive) - , previousWindowPixmapLock(previousWindowPixmapLock_) + , previousWindowPixmapLock(std::move(previousWindowPixmapLock_)) { } diff --git a/libkwineffects/anidata_p.h b/libkwineffects/anidata_p.h index 20d9a11a9f..96d0abaa2a 100644 --- a/libkwineffects/anidata_p.h +++ b/libkwineffects/anidata_p.h @@ -76,7 +76,7 @@ public: AniData(); AniData(AnimationEffect::Attribute a, int meta, const FPx2 &to, int delay, const FPx2 &from, bool waitAtSource, - FullScreenEffectLockPtr=FullScreenEffectLockPtr(), + FullScreenEffectLockPtr =FullScreenEffectLockPtr(), bool keepAlive = true, PreviousWindowPixmapLockPtr previousWindowPixmapLock = {}); bool isActive() const; diff --git a/libkwineffects/kwinanimationeffect.cpp b/libkwineffects/kwinanimationeffect.cpp index 141b9e7329..4217163228 100644 --- a/libkwineffects/kwinanimationeffect.cpp +++ b/libkwineffects/kwinanimationeffect.cpp @@ -217,7 +217,7 @@ void AnimationEffect::validate(Attribute a, uint &meta, FPx2 *from, FPx2 *to, co } } -quint64 AnimationEffect::p_animate( EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve, int delay, FPx2 from, bool keepAtTarget, bool fullScreenEffect, bool keepAlive) +quint64 AnimationEffect::p_animate( EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, const QEasingCurve &curve, int delay, FPx2 from, bool keepAtTarget, bool fullScreenEffect, bool keepAlive) { const bool waitAtSource = from.isValid(); validate(a, meta, &from, &to, w); diff --git a/libkwineffects/kwinanimationeffect.h b/libkwineffects/kwinanimationeffect.h index 7c563746a7..14471becc2 100644 --- a/libkwineffects/kwinanimationeffect.h +++ b/libkwineffects/kwinanimationeffect.h @@ -258,7 +258,7 @@ protected: * @returns An ID that you can use to cancel a running animation. * @since 4.8 */ - quint64 animate( EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve = QEasingCurve(), int delay = 0, FPx2 from = FPx2(), bool fullScreen = false, bool keepAlive = true) + quint64 animate( EffectWindow *w, Attribute a, uint meta, int ms, const FPx2 &to, const QEasingCurve &curve = QEasingCurve(), int delay = 0, const FPx2 &from = FPx2(), bool fullScreen = false, bool keepAlive = true) { return p_animate(w, a, meta, ms, to, curve, delay, from, false, fullScreen, keepAlive); } /** @@ -288,7 +288,7 @@ protected: * @returns An ID that you need to use to cancel this manipulation. * @since 4.11 */ - quint64 set( EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve = QEasingCurve(), int delay = 0, FPx2 from = FPx2(), bool fullScreen = false, bool keepAlive = true) + quint64 set( EffectWindow *w, Attribute a, uint meta, int ms, const FPx2 &to, const QEasingCurve &curve = QEasingCurve(), int delay = 0, const FPx2 &from = FPx2(), bool fullScreen = false, bool keepAlive = true) { return p_animate(w, a, meta, ms, to, curve, delay, from, true, fullScreen, keepAlive); } /** @@ -386,7 +386,7 @@ protected: AniMap state() const; private: - quint64 p_animate(EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve, int delay, FPx2 from, bool keepAtTarget, bool fullScreenEffect, bool keepAlive); + quint64 p_animate(EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, const QEasingCurve &curve, int delay, FPx2 from, bool keepAtTarget, bool fullScreenEffect, bool keepAlive); QRect clipRect(const QRect &windowRect, const AniData&) const; void clipWindow(const EffectWindow *, const AniData &, WindowQuadList &) const; float interpolated( const AniData&, int i = 0 ) const; diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp index 42be47d27f..cc59db814d 100644 --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -565,7 +565,7 @@ void Effect::prePaintScreen(ScreenPrePaintData& data, int time) effects->prePaintScreen(data, time); } -void Effect::paintScreen(int mask, QRegion region, ScreenPaintData& data) +void Effect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) { effects->paintScreen(mask, region, data); } @@ -590,7 +590,7 @@ void Effect::postPaintWindow(EffectWindow* w) effects->postPaintWindow(w); } -void Effect::paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity) +void Effect::paintEffectFrame(KWin::EffectFrame* frame, const QRegion ®ion, double opacity, double frameOpacity) { effects->paintEffectFrame(frame, region, opacity, frameOpacity); } @@ -610,7 +610,7 @@ QString Effect::debug(const QString &) const return QString(); } -void Effect::drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) +void Effect::drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) { effects->drawWindow(w, mask, region, data); } @@ -778,7 +778,7 @@ EffectWindow::~EffectWindow() { } -bool EffectWindow::isOnActivity(QString activity) const +bool EffectWindow::isOnActivity(const QString &activity) const { const QStringList _activities = activities(); return _activities.isEmpty() || _activities.contains(activity); diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index d354d7eeb9..c2473734bc 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -428,7 +428,7 @@ public: * In OpenGL based compositing, the frameworks ensures that the context is current * when this method is invoked. */ - virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data); + virtual void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data); /** * Called after all the painting has been finished. * In this method you can: @@ -487,7 +487,7 @@ public: * In OpenGL based compositing, the frameworks ensures that the context is current * when this method is invoked. */ - virtual void paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity); + virtual void paintEffectFrame(EffectFrame* frame, const QRegion ®ion, double opacity, double frameOpacity); /** * Called on Transparent resizes. @@ -516,7 +516,7 @@ public: * In OpenGL based compositing, the frameworks ensures that the context is current * when this method is invoked. */ - virtual void drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); + virtual void drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data); /** * Define new window quads so that they can be transformed by other effects. @@ -832,13 +832,13 @@ public: ~EffectsHandler() override; // for use by effects virtual void prePaintScreen(ScreenPrePaintData& data, int time) = 0; - virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data) = 0; + virtual void paintScreen(int mask, const QRegion ®ion, ScreenPaintData& data) = 0; virtual void postPaintScreen() = 0; virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time) = 0; - virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) = 0; + virtual void paintWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) = 0; virtual void postPaintWindow(EffectWindow* w) = 0; - virtual void paintEffectFrame(EffectFrame* frame, QRegion region, double opacity, double frameOpacity) = 0; - virtual void drawWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data) = 0; + virtual void paintEffectFrame(EffectFrame* frame, const QRegion ®ion, double opacity, double frameOpacity) = 0; + virtual void drawWindow(EffectWindow* w, int mask, const QRegion ®ion, WindowPaintData& data) = 0; virtual void buildQuads(EffectWindow* w, WindowQuadList& quadList) = 0; virtual QVariant kwinOption(KWinOption kwopt) = 0; /** @@ -2140,7 +2140,7 @@ public: virtual bool hasAlpha() const = 0; bool isOnCurrentActivity() const; - Q_SCRIPTABLE bool isOnActivity(QString id) const; + Q_SCRIPTABLE bool isOnActivity(const QString &id) const; bool isOnAllActivities() const; virtual QStringList activities() const = 0; @@ -3226,7 +3226,7 @@ public: /** * Register a list of windows for managing. */ - inline void manage(EffectWindowList list) { + inline void manage(const EffectWindowList &list) { for (int i = 0; i < list.size(); i++) manage(list.at(i)); } @@ -3380,7 +3380,7 @@ public: /** * Render the frame. */ - virtual void render(QRegion region = infiniteRegion(), double opacity = 1.0, double frameOpacity = 1.0) = 0; + virtual void render(const QRegion ®ion = infiniteRegion(), double opacity = 1.0, double frameOpacity = 1.0) = 0; virtual void setPosition(const QPoint& point) = 0; /** diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index ef591d8674..da21b85417 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -682,7 +682,7 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) // Parse the Mesa version const int mesaIndex = versionTokens.indexOf("Mesa"); if (mesaIndex != -1) { - const QByteArray version = versionTokens.at(mesaIndex + 1); + const QByteArray &version = versionTokens.at(mesaIndex + 1); m_mesaVersion = parseVersionString(version); } @@ -720,7 +720,7 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) if (m_renderer.startsWith("Mesa DRI R")) { // Sample renderer string: Mesa DRI R600 (RV740 94B3) 20090101 x86/MMX/SSE2 TCL DRI2 const QList tokens = m_renderer.split(' '); - const QByteArray chipClass = tokens.at(2); + const QByteArray &chipClass = tokens.at(2); m_chipset = tokens.at(3).mid(1, -1); // Strip the leading '(' if (chipClass == "R100") diff --git a/libkwineffects/kwingltexture.cpp b/libkwineffects/kwingltexture.cpp index 7ba5c8642b..427898f46d 100644 --- a/libkwineffects/kwingltexture.cpp +++ b/libkwineffects/kwingltexture.cpp @@ -467,7 +467,7 @@ void GLTexture::unbind() glBindTexture(d->m_target, 0); } -void GLTexture::render(QRegion region, const QRect& rect, bool hardwareClipping) +void GLTexture::render(const QRegion ®ion, const QRect& rect, bool hardwareClipping) { Q_D(GLTexture); if (rect.isEmpty()) diff --git a/libkwineffects/kwingltexture.h b/libkwineffects/kwingltexture.h index a4bd482a3a..f7e1b7b9e5 100644 --- a/libkwineffects/kwingltexture.h +++ b/libkwineffects/kwingltexture.h @@ -106,7 +106,7 @@ public: virtual void discard(); void bind(); void unbind(); - void render(QRegion region, const QRect& rect, bool hardwareClipping = false); + void render(const QRegion ®ion, const QRect& rect, bool hardwareClipping = false); GLuint texture() const; GLenum target() const; diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index fcd885128d..76a1fd1453 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -61,7 +61,7 @@ static QList glExtensions; // Functions -void initGL(std::function resolveFunction) +void initGL(const std::function &resolveFunction) { // Get list of supported OpenGL extensions if (hasGLVersion(3, 0)) { diff --git a/libkwineffects/kwinglutils.h b/libkwineffects/kwinglutils.h index a8252ad04d..d0adbdd16b 100644 --- a/libkwineffects/kwinglutils.h +++ b/libkwineffects/kwinglutils.h @@ -52,7 +52,7 @@ class GLVertexBufferPrivate; // well as checking for GL version and extensions // Note that GL context has to be created by the time this function is called typedef void (*resolveFuncPtr)(); -void KWINGLUTILS_EXPORT initGL(std::function resolveFunction); +void KWINGLUTILS_EXPORT initGL(const std::function &resolveFunction); // Cleans up all resources hold by the GL Context void KWINGLUTILS_EXPORT cleanupGL(); diff --git a/libkwineffects/kwinglutils_funcs.cpp b/libkwineffects/kwinglutils_funcs.cpp index c2cd7a4783..6e5d86308d 100644 --- a/libkwineffects/kwinglutils_funcs.cpp +++ b/libkwineffects/kwinglutils_funcs.cpp @@ -40,7 +40,7 @@ glGetGraphicsResetStatus_func glGetGraphicsResetStatus; glReadnPixels_func glReadnPixels; glGetnUniformfv_func glGetnUniformfv; -void glResolveFunctions(std::function resolveFunction) +void glResolveFunctions(const std::function &resolveFunction) { const bool haveArbRobustness = hasGLExtension(QByteArrayLiteral("GL_ARB_robustness")); const bool haveExtRobustness = hasGLExtension(QByteArrayLiteral("GL_EXT_robustness")); diff --git a/libkwineffects/kwinglutils_funcs.h b/libkwineffects/kwinglutils_funcs.h index 3657751e3a..8b09fc0d0c 100644 --- a/libkwineffects/kwinglutils_funcs.h +++ b/libkwineffects/kwinglutils_funcs.h @@ -43,7 +43,7 @@ namespace KWin { typedef void (*resolveFuncPtr)(); -void KWINGLUTILS_EXPORT glResolveFunctions(std::function resolveFunction); +void KWINGLUTILS_EXPORT glResolveFunctions(const std::function &resolveFunction); // GL_ARB_robustness / GL_EXT_robustness using glGetGraphicsResetStatus_func = GLenum (*)(); diff --git a/main.h b/main.h index a464bfe56c..ba6bbba2ff 100644 --- a/main.h +++ b/main.h @@ -84,21 +84,21 @@ public: return m_config; } void setConfig(KSharedConfigPtr config) { - m_config = config; + m_config = std::move(config); } KSharedConfigPtr kxkbConfig() const { return m_kxkbConfig; } void setKxkbConfig(KSharedConfigPtr config) { - m_kxkbConfig = config; + m_kxkbConfig = std::move(config); } KSharedConfigPtr inputConfig() const { return m_inputConfig; } void setInputConfig(KSharedConfigPtr config) { - m_inputConfig = config; + m_inputConfig = std::move(config); } void start(); diff --git a/orientation_sensor.h b/orientation_sensor.h index 90c6c4c3a8..e585974081 100644 --- a/orientation_sensor.h +++ b/orientation_sensor.h @@ -61,7 +61,7 @@ public: } void setConfig(KSharedConfig::Ptr config) { - m_config = config; + m_config = std::move(config); } bool isUserEnabled() const { diff --git a/virtualdesktops.h b/virtualdesktops.h index 229d8d1889..e7490f685c 100644 --- a/virtualdesktops.h +++ b/virtualdesktops.h @@ -710,7 +710,7 @@ bool VirtualDesktopManager::isNavigationWrappingAround() const inline void VirtualDesktopManager::setConfig(KSharedConfig::Ptr config) { - m_config = config; + m_config = std::move(config); } inline diff --git a/xkb.h b/xkb.h index aaeecd251e..d37c6054f0 100644 --- a/xkb.h +++ b/xkb.h @@ -56,10 +56,10 @@ public: Xkb(QObject *parent = nullptr); ~Xkb() override; void setConfig(KSharedConfigPtr config) { - m_config = config; + m_config = std::move(config); } void setNumLockConfig(KSharedConfigPtr config) { - m_numLockConfig = config; + m_numLockConfig = std::move(config); } void reconfigure();