diff --git a/autotests/integration/scene_qpainter_test.cpp b/autotests/integration/scene_qpainter_test.cpp index f5434a2534..2d19d63210 100644 --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -105,7 +105,7 @@ void SceneQPainterTest::testStartFrame() const QImage cursorImage = cursor->image(); QVERIFY(!cursorImage.isNull()); p.drawImage(cursor->pos() - cursor->hotspot(), cursorImage); - QCOMPARE(referenceImage, *scene->qpainterRenderBuffer()); + QCOMPARE(referenceImage, *scene->qpainterRenderBuffer(0)); } void SceneQPainterTest::testCursorMoving() @@ -136,7 +136,7 @@ void SceneQPainterTest::testCursorMoving() const QImage cursorImage = cursor->image(); QVERIFY(!cursorImage.isNull()); p.drawImage(QPoint(45, 45) - cursor->hotspot(), cursorImage); - QCOMPARE(referenceImage, *scene->qpainterRenderBuffer()); + QCOMPARE(referenceImage, *scene->qpainterRenderBuffer(0)); } void SceneQPainterTest::testWindow() @@ -174,13 +174,13 @@ void SceneQPainterTest::testWindow() p->setCursor(cs.data(), QPoint(5, 5)); QVERIFY(frameRenderedSpy.wait()); painter.fillRect(KWin::Cursors::self()->mouse()->pos().x() - 5, KWin::Cursors::self()->mouse()->pos().y() - 5, 10, 10, Qt::red); - QCOMPARE(referenceImage, *scene->qpainterRenderBuffer()); + QCOMPARE(referenceImage, *scene->qpainterRenderBuffer(0)); // let's move the cursor again KWin::Cursors::self()->mouse()->setPos(10, 10); QVERIFY(frameRenderedSpy.wait()); painter.fillRect(0, 0, 200, 300, Qt::blue); painter.fillRect(5, 5, 10, 10, Qt::red); - QCOMPARE(referenceImage, *scene->qpainterRenderBuffer()); + QCOMPARE(referenceImage, *scene->qpainterRenderBuffer(0)); } void SceneQPainterTest::testWindowScaled() @@ -230,7 +230,7 @@ void SceneQPainterTest::testWindowScaled() painter.fillRect(100, 150, 100, 100, Qt::red); painter.fillRect(5, 5, 10, 10, Qt::red); //cursor - QCOMPARE(referenceImage, *scene->qpainterRenderBuffer()); + QCOMPARE(referenceImage, *scene->qpainterRenderBuffer(0)); } void SceneQPainterTest::testCompositorRestart() @@ -274,7 +274,7 @@ void SceneQPainterTest::testCompositorRestart() const QImage cursorImage = cursor->image(); QVERIFY(!cursorImage.isNull()); painter.drawImage(QPoint(400, 400) - cursor->hotspot(), cursorImage); - QCOMPARE(referenceImage, *scene->qpainterRenderBuffer()); + QCOMPARE(referenceImage, *scene->qpainterRenderBuffer(0)); } struct XcbConnectionDeleter @@ -348,7 +348,7 @@ void SceneQPainterTest::testX11Window() QVERIFY(frameRenderedSpy.wait()); const QPoint startPos = client->pos() + client->clientPos(); - auto image = scene->qpainterRenderBuffer(); + auto image = scene->qpainterRenderBuffer(0); QCOMPARE(image->copy(QRect(startPos, client->clientSize())), compareImage); // and destroy the window again diff --git a/plugins/scenes/qpainter/scene_qpainter.cpp b/plugins/scenes/qpainter/scene_qpainter.cpp index 9e3a185c9d..b8a0aa513c 100644 --- a/plugins/scenes/qpainter/scene_qpainter.cpp +++ b/plugins/scenes/qpainter/scene_qpainter.cpp @@ -179,9 +179,9 @@ void SceneQPainter::screenGeometryChanged(const QSize &size) m_backend->screenGeometryChanged(size); } -QImage *SceneQPainter::qpainterRenderBuffer() const +QImage *SceneQPainter::qpainterRenderBuffer(int screenId) const { - return m_backend->bufferForScreen(0); + return m_backend->bufferForScreen(screenId); } //**************************************** diff --git a/plugins/scenes/qpainter/scene_qpainter.h b/plugins/scenes/qpainter/scene_qpainter.h index 4b84ce9a5a..dffe29d2b4 100644 --- a/plugins/scenes/qpainter/scene_qpainter.h +++ b/plugins/scenes/qpainter/scene_qpainter.h @@ -39,7 +39,7 @@ public: } QPainter *scenePainter() const override; - QImage *qpainterRenderBuffer() const override; + QImage *qpainterRenderBuffer(int screenId) const override; QPainterBackend *backend() const { return m_backend.data(); diff --git a/scene.cpp b/scene.cpp index 5f445ed0d3..3c7c02f22d 100644 --- a/scene.cpp +++ b/scene.cpp @@ -692,8 +692,9 @@ QPainter *Scene::scenePainter() const return nullptr; } -QImage *Scene::qpainterRenderBuffer() const +QImage *Scene::qpainterRenderBuffer(int screenId) const { + Q_UNUSED(screenId) return nullptr; } diff --git a/scene.h b/scene.h index c115ac6d09..5e79fcb0c8 100644 --- a/scene.h +++ b/scene.h @@ -179,7 +179,7 @@ public: * The render buffer used by a QPainter based compositor. * Default implementation returns @c nullptr. */ - virtual QImage *qpainterRenderBuffer() const; + virtual QImage *qpainterRenderBuffer(int screenId) const; /** * The backend specific extensions (e.g. EGL/GLX extensions).