From ad34b3c65467d8f6b1586f38592c98d2fd7743d9 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 12 Dec 2022 05:25:20 +0200 Subject: [PATCH] kwin: convert KWin::PaintRedirector decoration pixmap getters to non-template methods there is only one paint redirector implementation and it always returns xcb_render_picture_t Signed-off-by: Ivailo Monev --- kwin/paintredirector.h | 52 +++++++++++++----------------------------- kwin/scene_xrender.cpp | 8 +++---- 2 files changed, 20 insertions(+), 40 deletions(-) diff --git a/kwin/paintredirector.h b/kwin/paintredirector.h index 8ebb755d..3c0763de 100644 --- a/kwin/paintredirector.h +++ b/kwin/paintredirector.h @@ -68,14 +68,22 @@ public: } void resizePixmaps(); - template - T topDecoPixmap() const; - template - T leftDecoPixmap() const; - template - T bottomDecoPixmap() const; - template - T rightDecoPixmap() const; + inline xcb_render_picture_t topDecoPixmap() const + { + return picture(TopPixmap); + } + inline xcb_render_picture_t leftDecoPixmap() const + { + return picture(LeftPixmap); + } + inline xcb_render_picture_t bottomDecoPixmap() const + { + return picture(BottomPixmap); + } + inline xcb_render_picture_t rightDecoPixmap() const + { + return picture(RightPixmap); + } /** * Used by Deleted::copyToDeleted() to move the PaintRedirector to the Deleted. @@ -141,34 +149,6 @@ private: QImage m_scratchImage; }; -template <> -inline -xcb_render_picture_t PaintRedirector::bottomDecoPixmap() const -{ - return picture(BottomPixmap); -} - -template <> -inline -xcb_render_picture_t PaintRedirector::leftDecoPixmap() const -{ - return picture(LeftPixmap); -} - -template <> -inline -xcb_render_picture_t PaintRedirector::rightDecoPixmap() const -{ - return picture(RightPixmap); -} - -template <> -inline -xcb_render_picture_t PaintRedirector::topDecoPixmap() const -{ - return picture(TopPixmap); -} - } // namespace #endif diff --git a/kwin/scene_xrender.cpp b/kwin/scene_xrender.cpp index 4eb88bc8..e84ed9ae 100644 --- a/kwin/scene_xrender.cpp +++ b/kwin/scene_xrender.cpp @@ -555,10 +555,10 @@ void SceneXrender::Window::performPaint(int mask, QRegion region, WindowPaintDat } if (redirector) { redirector->ensurePixmapsPainted(); - left = redirector->leftDecoPixmap(); - top = redirector->topDecoPixmap(); - right = redirector->rightDecoPixmap(); - bottom = redirector->bottomDecoPixmap(); + left = redirector->leftDecoPixmap(); + top = redirector->topDecoPixmap(); + right = redirector->rightDecoPixmap(); + bottom = redirector->bottomDecoPixmap(); } if (!noBorder) { MAP_RECT_TO_TARGET(dtr);