diff --git a/effects.cpp b/effects.cpp
index 8155de6b34..4454c61e48 100644
--- a/effects.cpp
+++ b/effects.cpp
@@ -32,7 +32,6 @@ along with this program. If not, see .
#include "group.h"
#include "osd.h"
#include "pointer_input.h"
-#include "scene_xrender.h"
#include "scene_qpainter.h"
#include "unmanaged.h"
#ifdef KWIN_BUILD_TABBOX
@@ -1324,11 +1323,7 @@ void EffectsHandlerImpl::unregisterTouchBorder(ElectricBorder border, QAction *a
unsigned long EffectsHandlerImpl::xrenderBufferPicture()
{
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
- if (SceneXrender* s = dynamic_cast< SceneXrender* >(m_scene))
- return s->bufferPicture();
-#endif
- return None;
+ return m_scene->xrenderBufferPicture();
}
QPainter *EffectsHandlerImpl::scenePainter()
diff --git a/scene.cpp b/scene.cpp
index c4b372757e..4b95cf6030 100644
--- a/scene.cpp
+++ b/scene.cpp
@@ -652,6 +652,11 @@ QMatrix4x4 Scene::screenProjectionMatrix() const
return QMatrix4x4();
}
+xcb_render_picture_t Scene::xrenderBufferPicture() const
+{
+ return XCB_RENDER_PICTURE_NONE;
+}
+
//****************************************
// Scene::Window
//****************************************
diff --git a/scene.h b/scene.h
index 29a5dceb47..c1fc0d6eba 100644
--- a/scene.h
+++ b/scene.h
@@ -157,6 +157,12 @@ public:
**/
virtual bool animationsSupported() const = 0;
+ /**
+ * The render buffer used by an XRender based compositor scene.
+ * Default implementation returns XCB_RENDER_PICTURE_NONE
+ **/
+ virtual xcb_render_picture_t xrenderBufferPicture() const;
+
Q_SIGNALS:
void frameRendered();
diff --git a/scene_xrender.cpp b/scene_xrender.cpp
index 98295f0544..263c75f14f 100644
--- a/scene_xrender.cpp
+++ b/scene_xrender.cpp
@@ -280,7 +280,7 @@ void SceneXrender::paintBackground(QRegion region)
{
xcb_render_color_t col = { 0, 0, 0, 0xffff }; // black
const QVector &rects = Xcb::regionToRects(region);
- xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, bufferPicture(), col, rects.count(), rects.data());
+ xcb_render_fill_rectangles(connection(), XCB_RENDER_PICT_OP_SRC, xrenderBufferPicture(), col, rects.count(), rects.data());
}
Scene::Window *SceneXrender::createWindow(Toplevel *toplevel)
@@ -515,7 +515,7 @@ void SceneXrender::Window::performPaint(int mask, QRegion region, WindowPaintDat
const bool blitInTempPixmap = xRenderOffscreen() || (data.crossFadeProgress() < 1.0 && !opaque) ||
(scaled && (wantShadow || (client && !client->noBorder()) || (deleted && !deleted->noBorder())));
- xcb_render_picture_t renderTarget = m_scene->bufferPicture();
+ xcb_render_picture_t renderTarget = m_scene->xrenderBufferPicture();
if (blitInTempPixmap) {
if (scene_xRenderOffscreenTarget()) {
temp_visibleRect = toplevel->visibleRect().translated(-toplevel->pos());
@@ -729,7 +729,7 @@ xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, m_xrenderShadow->pic
xcb_render_set_picture_transform(connection(), *s_tempPicture, xform);
setPictureFilter(*s_tempPicture, filter);
xcb_render_composite(connection(), XCB_RENDER_PICT_OP_OVER, *s_tempPicture,
- XCB_RENDER_PICTURE_NONE, m_scene->bufferPicture(),
+ XCB_RENDER_PICTURE_NONE, m_scene->xrenderBufferPicture(),
0, 0, 0, 0, r.x(), r.y(), r.width(), r.height());
xcb_render_set_picture_transform(connection(), *s_tempPicture, identity);
}
diff --git a/scene_xrender.h b/scene_xrender.h
index a9eee6bf1c..d4dacd3610 100644
--- a/scene_xrender.h
+++ b/scene_xrender.h
@@ -160,7 +160,7 @@ public:
virtual Scene::EffectFrame *createEffectFrame(EffectFrameImpl *frame);
virtual Shadow *createShadow(Toplevel *toplevel);
virtual void screenGeometryChanged(const QSize &size);
- xcb_render_picture_t bufferPicture();
+ xcb_render_picture_t xrenderBufferPicture() const override;
virtual OverlayWindow *overlayWindow() {
return m_backend->overlayWindow();
}
@@ -253,7 +253,7 @@ private:
};
inline
-xcb_render_picture_t SceneXrender::bufferPicture()
+xcb_render_picture_t SceneXrender::xrenderBufferPicture() const
{
return m_backend->buffer();
}