From f26eeb9706aa57fe019513559ce49357983c4484 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 9 Nov 2020 16:31:26 +0200 Subject: [PATCH] Use consistent naming for begin/end frame hooks Currently, the OpenGLBackend and the QPainterBackend have hooks to indicate the start and the end of compositing cycle, but in both cases, the hooks have different names. This change fixes that inconsistency. --- platformsupport/scenes/opengl/backend.cpp | 13 ------------- platformsupport/scenes/opengl/backend.h | 4 ++-- platformsupport/scenes/qpainter/backend.h | 4 ++-- plugins/platforms/drm/egl_gbm_backend.cpp | 7 +++---- plugins/platforms/drm/egl_gbm_backend.h | 4 ++-- plugins/platforms/drm/egl_stream_backend.cpp | 4 ++-- plugins/platforms/drm/egl_stream_backend.h | 4 ++-- .../platforms/drm/scene_qpainter_drm_backend.cpp | 4 ++-- plugins/platforms/drm/scene_qpainter_drm_backend.h | 4 ++-- .../platforms/fbdev/scene_qpainter_fb_backend.cpp | 4 ++-- plugins/platforms/fbdev/scene_qpainter_fb_backend.h | 4 ++-- .../platforms/hwcomposer/egl_hwcomposer_backend.cpp | 4 ++-- .../platforms/hwcomposer/egl_hwcomposer_backend.h | 4 ++-- plugins/platforms/virtual/egl_gbm_backend.cpp | 4 ++-- plugins/platforms/virtual/egl_gbm_backend.h | 4 ++-- .../virtual/scene_qpainter_virtual_backend.cpp | 4 ++-- .../virtual/scene_qpainter_virtual_backend.h | 4 ++-- plugins/platforms/wayland/egl_wayland_backend.cpp | 4 ++-- plugins/platforms/wayland/egl_wayland_backend.h | 4 ++-- .../wayland/scene_qpainter_wayland_backend.cpp | 4 ++-- .../wayland/scene_qpainter_wayland_backend.h | 4 ++-- plugins/platforms/x11/common/eglonxbackend.cpp | 4 ++-- plugins/platforms/x11/common/eglonxbackend.h | 4 ++-- plugins/platforms/x11/standalone/glxbackend.cpp | 4 ++-- plugins/platforms/x11/standalone/glxbackend.h | 4 ++-- plugins/platforms/x11/windowed/egl_x11_backend.cpp | 4 ++-- plugins/platforms/x11/windowed/egl_x11_backend.h | 4 ++-- .../x11/windowed/scene_qpainter_x11_backend.cpp | 4 ++-- .../x11/windowed/scene_qpainter_x11_backend.h | 4 ++-- plugins/scenes/opengl/scene_opengl.cpp | 4 ++-- plugins/scenes/qpainter/scene_qpainter.cpp | 4 ++-- 31 files changed, 61 insertions(+), 75 deletions(-) diff --git a/platformsupport/scenes/opengl/backend.cpp b/platformsupport/scenes/opengl/backend.cpp index 1745fcb96b..51fcae0adf 100644 --- a/platformsupport/scenes/opengl/backend.cpp +++ b/platformsupport/scenes/opengl/backend.cpp @@ -74,19 +74,6 @@ OverlayWindow* OpenGLBackend::overlayWindow() const return nullptr; } -QRegion OpenGLBackend::prepareRenderingForScreen(int screenId) -{ - // fallback to repaint complete screen - return screens()->geometry(screenId); -} - -void OpenGLBackend::endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion) -{ - Q_UNUSED(screenId) - Q_UNUSED(damage) - Q_UNUSED(damagedRegion) -} - bool OpenGLBackend::perScreenRendering() const { return false; diff --git a/platformsupport/scenes/opengl/backend.h b/platformsupport/scenes/opengl/backend.h index d2499a0ec2..a3fbf8a185 100644 --- a/platformsupport/scenes/opengl/backend.h +++ b/platformsupport/scenes/opengl/backend.h @@ -56,7 +56,6 @@ public: * @p damage contains the reported damage as suggested by windows and effects on prepaint calls. */ virtual void aboutToStartPainting(int screenId, const QRegion &damage); - virtual void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion); virtual bool makeCurrent() = 0; virtual void doneCurrent() = 0; virtual bool usesOverlayWindow() const = 0; @@ -65,7 +64,8 @@ public: * Default implementation returns @c false. */ virtual bool perScreenRendering() const; - virtual QRegion prepareRenderingForScreen(int screenId); + virtual QRegion beginFrame(int screenId) = 0; + virtual void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) = 0; /** * @brief Compositor is going into idle mode, flushes any pending paints. */ diff --git a/platformsupport/scenes/qpainter/backend.h b/platformsupport/scenes/qpainter/backend.h index f005b65550..18b187fd6f 100644 --- a/platformsupport/scenes/qpainter/backend.h +++ b/platformsupport/scenes/qpainter/backend.h @@ -21,8 +21,8 @@ class QPainterBackend { public: virtual ~QPainterBackend(); - virtual void present(int screenId, int mask, const QRegion &damage) = 0; - virtual void prepareRenderingFrame(int screenId) = 0; + virtual void endFrame(int screenId, int mask, const QRegion &damage) = 0; + virtual void beginFrame(int screenId) = 0; /** * @brief React on screen geometry changes. * diff --git a/plugins/platforms/drm/egl_gbm_backend.cpp b/plugins/platforms/drm/egl_gbm_backend.cpp index 24e9f6903e..c3a5d0913d 100644 --- a/plugins/platforms/drm/egl_gbm_backend.cpp +++ b/plugins/platforms/drm/egl_gbm_backend.cpp @@ -521,7 +521,7 @@ void EglGbmBackend::setViewport(const Output &output) const overall.width() * scale, overall.height() * scale); } -QRegion EglGbmBackend::prepareRenderingForScreen(int screenId) +QRegion EglGbmBackend::beginFrame(int screenId) { const Output &output = m_outputs.at(screenId); @@ -545,9 +545,8 @@ QRegion EglGbmBackend::prepareRenderingForScreen(int screenId) return output.output->geometry(); } -void EglGbmBackend::endRenderingFrameForScreen(int screenId, - const QRegion &renderedRegion, - const QRegion &damagedRegion) +void EglGbmBackend::endFrame(int screenId, const QRegion &renderedRegion, + const QRegion &damagedRegion) { Output &output = m_outputs[screenId]; renderFramebufferToSurface(output); diff --git a/plugins/platforms/drm/egl_gbm_backend.h b/plugins/platforms/drm/egl_gbm_backend.h index 8a21bda8f7..3f69b61e05 100644 --- a/plugins/platforms/drm/egl_gbm_backend.h +++ b/plugins/platforms/drm/egl_gbm_backend.h @@ -35,10 +35,10 @@ public: ~EglGbmBackend() override; void screenGeometryChanged(const QSize &size) override; SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override; - void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; bool usesOverlayWindow() const override; bool perScreenRendering() const override; - QRegion prepareRenderingForScreen(int screenId) override; + QRegion beginFrame(int screenId) override; + void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; void init() override; QSharedPointer textureForOutput(AbstractOutput *requestedOutput) const override; diff --git a/plugins/platforms/drm/egl_stream_backend.cpp b/plugins/platforms/drm/egl_stream_backend.cpp index 10b2cb9444..3904d44d16 100644 --- a/plugins/platforms/drm/egl_stream_backend.cpp +++ b/plugins/platforms/drm/egl_stream_backend.cpp @@ -475,14 +475,14 @@ SceneOpenGLTexturePrivate *EglStreamBackend::createBackendTexture(SceneOpenGLTex return new EglStreamTexture(texture, this); } -QRegion EglStreamBackend::prepareRenderingForScreen(int screenId) +QRegion EglStreamBackend::beginFrame(int screenId) { const Output &o = m_outputs.at(screenId); makeContextCurrent(o); return o.output->geometry(); } -void EglStreamBackend::endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) +void EglStreamBackend::endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) { Q_UNUSED(renderedRegion); Q_UNUSED(damagedRegion); diff --git a/plugins/platforms/drm/egl_stream_backend.h b/plugins/platforms/drm/egl_stream_backend.h index 8013078757..6ed8da0b9a 100644 --- a/plugins/platforms/drm/egl_stream_backend.h +++ b/plugins/platforms/drm/egl_stream_backend.h @@ -32,10 +32,10 @@ public: ~EglStreamBackend() override; void screenGeometryChanged(const QSize &size) override; SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override; - void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; bool usesOverlayWindow() const override; bool perScreenRendering() const override; - QRegion prepareRenderingForScreen(int screenId) override; + QRegion beginFrame(int screenId) override; + void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; void init() override; protected: diff --git a/plugins/platforms/drm/scene_qpainter_drm_backend.cpp b/plugins/platforms/drm/scene_qpainter_drm_backend.cpp index e837243f69..a52052df3d 100644 --- a/plugins/platforms/drm/scene_qpainter_drm_backend.cpp +++ b/plugins/platforms/drm/scene_qpainter_drm_backend.cpp @@ -100,13 +100,13 @@ bool DrmQPainterBackend::needsFullRepaint(int screenId) const return true; } -void DrmQPainterBackend::prepareRenderingFrame(int screenId) +void DrmQPainterBackend::beginFrame(int screenId) { Output &rendererOutput = m_outputs[screenId]; rendererOutput.index = (rendererOutput.index + 1) % 2; } -void DrmQPainterBackend::present(int screenId, int mask, const QRegion &damage) +void DrmQPainterBackend::endFrame(int screenId, int mask, const QRegion &damage) { Q_UNUSED(mask) Q_UNUSED(damage) diff --git a/plugins/platforms/drm/scene_qpainter_drm_backend.h b/plugins/platforms/drm/scene_qpainter_drm_backend.h index 02f13ab79d..bf26d30f61 100644 --- a/plugins/platforms/drm/scene_qpainter_drm_backend.h +++ b/plugins/platforms/drm/scene_qpainter_drm_backend.h @@ -29,8 +29,8 @@ public: QImage *bufferForScreen(int screenId) override; bool needsFullRepaint(int screenId) const override; - void prepareRenderingFrame(int screenId) override; - void present(int screenId, int mask, const QRegion &damage) override; + void beginFrame(int screenId) override; + void endFrame(int screenId, int mask, const QRegion &damage) override; bool perScreenRendering() const override; private: diff --git a/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp b/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp index 8322819fb3..68864aa35c 100644 --- a/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp +++ b/plugins/platforms/fbdev/scene_qpainter_fb_backend.cpp @@ -59,13 +59,13 @@ bool FramebufferQPainterBackend::needsFullRepaint(int screenId) const return m_needsFullRepaint; } -void FramebufferQPainterBackend::prepareRenderingFrame(int screenId) +void FramebufferQPainterBackend::beginFrame(int screenId) { Q_UNUSED(screenId) m_needsFullRepaint = true; } -void FramebufferQPainterBackend::present(int screenId, int mask, const QRegion &damage) +void FramebufferQPainterBackend::endFrame(int screenId, int mask, const QRegion &damage) { Q_UNUSED(screenId) Q_UNUSED(mask) diff --git a/plugins/platforms/fbdev/scene_qpainter_fb_backend.h b/plugins/platforms/fbdev/scene_qpainter_fb_backend.h index 44f54165ae..fabbede078 100644 --- a/plugins/platforms/fbdev/scene_qpainter_fb_backend.h +++ b/plugins/platforms/fbdev/scene_qpainter_fb_backend.h @@ -26,8 +26,8 @@ public: QImage *bufferForScreen(int screenId) override; bool needsFullRepaint(int screenId) const override; - void prepareRenderingFrame(int screenId) override; - void present(int screenId, int mask, const QRegion &damage) override; + void beginFrame(int screenId) override; + void endFrame(int screenId, int mask, const QRegion &damage) override; bool perScreenRendering() const override; private: diff --git a/plugins/platforms/hwcomposer/egl_hwcomposer_backend.cpp b/plugins/platforms/hwcomposer/egl_hwcomposer_backend.cpp index 8ac642f827..ef9e6d240e 100644 --- a/plugins/platforms/hwcomposer/egl_hwcomposer_backend.cpp +++ b/plugins/platforms/hwcomposer/egl_hwcomposer_backend.cpp @@ -140,7 +140,7 @@ void EglHwcomposerBackend::screenGeometryChanged(const QSize &size) Q_UNUSED(size) } -QRegion EglHwcomposerBackend::prepareRenderingFrame(int screenId) +QRegion EglHwcomposerBackend::beginFrame(int screenId) { Q_UNUSED(screenId) present(); @@ -150,7 +150,7 @@ QRegion EglHwcomposerBackend::prepareRenderingFrame(int screenId) return QRegion(QRect(QPoint(0, 0), m_backend->size())); } -void EglHwcomposerBackend::endRenderingFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) +void EglHwcomposerBackend::endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) { Q_UNUSED(screenId) Q_UNUSED(damagedRegion) diff --git a/plugins/platforms/hwcomposer/egl_hwcomposer_backend.h b/plugins/platforms/hwcomposer/egl_hwcomposer_backend.h index 5a361f6d27..ca8592e334 100644 --- a/plugins/platforms/hwcomposer/egl_hwcomposer_backend.h +++ b/plugins/platforms/hwcomposer/egl_hwcomposer_backend.h @@ -24,8 +24,8 @@ public: bool usesOverlayWindow() const override; SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override; void screenGeometryChanged(const QSize &size) override; - QRegion prepareRenderingFrame(int screenId) override; - void endRenderingFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) override; + QRegion beginFrame(int screenId) override; + void endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) override; void init() override; protected: diff --git a/plugins/platforms/virtual/egl_gbm_backend.cpp b/plugins/platforms/virtual/egl_gbm_backend.cpp index 597192fb43..c8e4699fa5 100644 --- a/plugins/platforms/virtual/egl_gbm_backend.cpp +++ b/plugins/platforms/virtual/egl_gbm_backend.cpp @@ -162,7 +162,7 @@ SceneOpenGLTexturePrivate *EglGbmBackend::createBackendTexture(SceneOpenGLTextur return new EglGbmTexture(texture, this); } -QRegion EglGbmBackend::prepareRenderingForScreen(int screenId) +QRegion EglGbmBackend::beginFrame(int screenId) { Q_UNUSED(screenId) if (!lastDamage().isEmpty()) { @@ -205,7 +205,7 @@ static void convertFromGLImage(QImage &img, int w, int h) img = img.mirrored(); } -void EglGbmBackend::endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) +void EglGbmBackend::endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) { Q_UNUSED(screenId) Q_UNUSED(damagedRegion) diff --git a/plugins/platforms/virtual/egl_gbm_backend.h b/plugins/platforms/virtual/egl_gbm_backend.h index 608be626c1..6acbb338e8 100644 --- a/plugins/platforms/virtual/egl_gbm_backend.h +++ b/plugins/platforms/virtual/egl_gbm_backend.h @@ -26,8 +26,8 @@ public: ~EglGbmBackend() override; void screenGeometryChanged(const QSize &size) override; SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override; - QRegion prepareRenderingForScreen(int screenId) override; - void endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) override; + QRegion beginFrame(int screenId) override; + void endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) override; bool usesOverlayWindow() const override; void init() override; diff --git a/plugins/platforms/virtual/scene_qpainter_virtual_backend.cpp b/plugins/platforms/virtual/scene_qpainter_virtual_backend.cpp index ae1aff1dd8..6dead48705 100644 --- a/plugins/platforms/virtual/scene_qpainter_virtual_backend.cpp +++ b/plugins/platforms/virtual/scene_qpainter_virtual_backend.cpp @@ -36,7 +36,7 @@ bool VirtualQPainterBackend::needsFullRepaint(int screenId) const return true; } -void VirtualQPainterBackend::prepareRenderingFrame(int screenId) +void VirtualQPainterBackend::beginFrame(int screenId) { Q_UNUSED(screenId) } @@ -51,7 +51,7 @@ void VirtualQPainterBackend::createOutputs() } } -void VirtualQPainterBackend::present(int screenId, int mask, const QRegion &damage) +void VirtualQPainterBackend::endFrame(int screenId, int mask, const QRegion &damage) { Q_UNUSED(mask) Q_UNUSED(damage) diff --git a/plugins/platforms/virtual/scene_qpainter_virtual_backend.h b/plugins/platforms/virtual/scene_qpainter_virtual_backend.h index 38cd246139..a81a5daab9 100644 --- a/plugins/platforms/virtual/scene_qpainter_virtual_backend.h +++ b/plugins/platforms/virtual/scene_qpainter_virtual_backend.h @@ -28,8 +28,8 @@ public: QImage *bufferForScreen(int screenId) override; bool needsFullRepaint(int screenId) const override; - void prepareRenderingFrame(int screenId) override; - void present(int screenId, int mask, const QRegion &damage) override; + void beginFrame(int screenId) override; + void endFrame(int screenId, int mask, const QRegion &damage) override; bool perScreenRendering() const override; private: diff --git a/plugins/platforms/wayland/egl_wayland_backend.cpp b/plugins/platforms/wayland/egl_wayland_backend.cpp index 34bb53c1eb..5d9f3e56a9 100644 --- a/plugins/platforms/wayland/egl_wayland_backend.cpp +++ b/plugins/platforms/wayland/egl_wayland_backend.cpp @@ -360,7 +360,7 @@ SceneOpenGLTexturePrivate *EglWaylandBackend::createBackendTexture(SceneOpenGLTe return new EglWaylandTexture(texture, this); } -QRegion EglWaylandBackend::prepareRenderingForScreen(int screenId) +QRegion EglWaylandBackend::beginFrame(int screenId) { eglWaitNative(EGL_CORE_NATIVE_ENGINE); @@ -382,7 +382,7 @@ QRegion EglWaylandBackend::prepareRenderingForScreen(int screenId) return QRegion(); } -void EglWaylandBackend::endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) +void EglWaylandBackend::endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) { EglWaylandOutput *output = m_outputs[screenId]; QRegion damage = damagedRegion.intersected(output->m_waylandOutput->geometry()); diff --git a/plugins/platforms/wayland/egl_wayland_backend.h b/plugins/platforms/wayland/egl_wayland_backend.h index 183be589a3..1884ea6b44 100644 --- a/plugins/platforms/wayland/egl_wayland_backend.h +++ b/plugins/platforms/wayland/egl_wayland_backend.h @@ -70,8 +70,8 @@ public: ~EglWaylandBackend() override; void screenGeometryChanged(const QSize &size) override; SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override; - QRegion prepareRenderingForScreen(int screenId) override; - void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; + QRegion beginFrame(int screenId) override; + void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; bool usesOverlayWindow() const override; bool perScreenRendering() const override; void init() override; diff --git a/plugins/platforms/wayland/scene_qpainter_wayland_backend.cpp b/plugins/platforms/wayland/scene_qpainter_wayland_backend.cpp index df1608d569..2bfdcb4e80 100644 --- a/plugins/platforms/wayland/scene_qpainter_wayland_backend.cpp +++ b/plugins/platforms/wayland/scene_qpainter_wayland_backend.cpp @@ -168,7 +168,7 @@ void WaylandQPainterBackend::createOutput(WaylandOutput *waylandOutput) m_outputs << output; } -void WaylandQPainterBackend::present(int screenId, int mask, const QRegion &damage) +void WaylandQPainterBackend::endFrame(int screenId, int mask, const QRegion &damage) { Q_UNUSED(mask) @@ -187,7 +187,7 @@ QImage *WaylandQPainterBackend::bufferForScreen(int screenId) return &output->m_backBuffer; } -void WaylandQPainterBackend::prepareRenderingFrame(int screenId) +void WaylandQPainterBackend::beginFrame(int screenId) { WaylandQPainterOutput *rendererOutput = m_outputs.value(screenId); Q_ASSERT(rendererOutput); diff --git a/plugins/platforms/wayland/scene_qpainter_wayland_backend.h b/plugins/platforms/wayland/scene_qpainter_wayland_backend.h index 78086ba9d3..5128ae1ffc 100644 --- a/plugins/platforms/wayland/scene_qpainter_wayland_backend.h +++ b/plugins/platforms/wayland/scene_qpainter_wayland_backend.h @@ -72,8 +72,8 @@ public: QImage *bufferForScreen(int screenId) override; - void present(int screenId, int mask, const QRegion& damage) override; - void prepareRenderingFrame(int screenId) override; + void endFrame(int screenId, int mask, const QRegion& damage) override; + void beginFrame(int screenId) override; bool needsFullRepaint(int screenId) const override; bool perScreenRendering() const override; diff --git a/plugins/platforms/x11/common/eglonxbackend.cpp b/plugins/platforms/x11/common/eglonxbackend.cpp index 9c1ca1aec4..c032095c3c 100644 --- a/plugins/platforms/x11/common/eglonxbackend.cpp +++ b/plugins/platforms/x11/common/eglonxbackend.cpp @@ -384,7 +384,7 @@ SceneOpenGLTexturePrivate *EglOnXBackend::createBackendTexture(SceneOpenGLTextur return new EglTexture(texture, this); } -QRegion EglOnXBackend::prepareRenderingForScreen(int screenId) +QRegion EglOnXBackend::beginFrame(int screenId) { Q_UNUSED(screenId) QRegion repaint; @@ -408,7 +408,7 @@ QRegion EglOnXBackend::prepareRenderingForScreen(int screenId) return repaint; } -void EglOnXBackend::endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) +void EglOnXBackend::endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) { Q_UNUSED(screenId) diff --git a/plugins/platforms/x11/common/eglonxbackend.h b/plugins/platforms/x11/common/eglonxbackend.h index 88c5bacfc7..f114f0b741 100644 --- a/plugins/platforms/x11/common/eglonxbackend.h +++ b/plugins/platforms/x11/common/eglonxbackend.h @@ -27,8 +27,8 @@ public: ~EglOnXBackend() override; void screenGeometryChanged(const QSize &size) override; SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override; - QRegion prepareRenderingForScreen(int screenId) override; - void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; + QRegion beginFrame(int screenId) override; + void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; OverlayWindow* overlayWindow() const override; bool usesOverlayWindow() const override; void init() override; diff --git a/plugins/platforms/x11/standalone/glxbackend.cpp b/plugins/platforms/x11/standalone/glxbackend.cpp index 2e94c7dec4..00c6b4eba0 100644 --- a/plugins/platforms/x11/standalone/glxbackend.cpp +++ b/plugins/platforms/x11/standalone/glxbackend.cpp @@ -781,7 +781,7 @@ SceneOpenGLTexturePrivate *GlxBackend::createBackendTexture(SceneOpenGLTexture * return new GlxTexture(texture, this); } -QRegion GlxBackend::prepareRenderingForScreen(int screenId) +QRegion GlxBackend::beginFrame(int screenId) { Q_UNUSED(screenId) QRegion repaint; @@ -806,7 +806,7 @@ QRegion GlxBackend::prepareRenderingForScreen(int screenId) return repaint; } -void GlxBackend::endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) +void GlxBackend::endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) { Q_UNUSED(screenId) diff --git a/plugins/platforms/x11/standalone/glxbackend.h b/plugins/platforms/x11/standalone/glxbackend.h index b2803332cf..d75834dda5 100644 --- a/plugins/platforms/x11/standalone/glxbackend.h +++ b/plugins/platforms/x11/standalone/glxbackend.h @@ -61,8 +61,8 @@ public: ~GlxBackend() override; void screenGeometryChanged(const QSize &size) override; SceneOpenGLTexturePrivate *createBackendTexture(SceneOpenGLTexture *texture) override; - QRegion prepareRenderingForScreen(int screenId) override; - void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; + QRegion beginFrame(int screenId) override; + void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; bool makeCurrent() override; void doneCurrent() override; OverlayWindow* overlayWindow() const override; diff --git a/plugins/platforms/x11/windowed/egl_x11_backend.cpp b/plugins/platforms/x11/windowed/egl_x11_backend.cpp index b0d6daa49f..b17148a544 100644 --- a/plugins/platforms/x11/windowed/egl_x11_backend.cpp +++ b/plugins/platforms/x11/windowed/egl_x11_backend.cpp @@ -70,7 +70,7 @@ bool EglX11Backend::perScreenRendering() const return true; } -QRegion EglX11Backend::prepareRenderingForScreen(int screenId) +QRegion EglX11Backend::beginFrame(int screenId) { makeContextCurrent(m_surfaces.at(screenId)); setupViewport(screenId); @@ -88,7 +88,7 @@ void EglX11Backend::setupViewport(int screenId) glViewport(-v.x(), v.height() - overall.height() + v.y(), overall.width() * scale, overall.height() * scale); } -void EglX11Backend::endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) +void EglX11Backend::endFrame(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) { Q_UNUSED(damagedRegion) const QRect &outputGeometry = screens()->geometry(screenId); diff --git a/plugins/platforms/x11/windowed/egl_x11_backend.h b/plugins/platforms/x11/windowed/egl_x11_backend.h index d8b337b66a..bb354b74ee 100644 --- a/plugins/platforms/x11/windowed/egl_x11_backend.h +++ b/plugins/platforms/x11/windowed/egl_x11_backend.h @@ -25,8 +25,8 @@ public: ~EglX11Backend() override; bool usesOverlayWindow() const override; bool perScreenRendering() const override; - QRegion prepareRenderingForScreen(int screenId) override; - void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; + QRegion beginFrame(int screenId) override; + void endFrame(int screenId, const QRegion &damage, const QRegion &damagedRegion) override; protected: void present() override; diff --git a/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.cpp b/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.cpp index 06ffef0ecf..a624dcf450 100644 --- a/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.cpp +++ b/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.cpp @@ -53,12 +53,12 @@ bool X11WindowedQPainterBackend::needsFullRepaint(int screenId) const return rendererOutput->needsFullRepaint; } -void X11WindowedQPainterBackend::prepareRenderingFrame(int screenId) +void X11WindowedQPainterBackend::beginFrame(int screenId) { Q_UNUSED(screenId) } -void X11WindowedQPainterBackend::present(int screenId, int mask, const QRegion &damage) +void X11WindowedQPainterBackend::endFrame(int screenId, int mask, const QRegion &damage) { Q_UNUSED(mask) Q_UNUSED(damage) diff --git a/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h b/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h index 206eccbf63..373f3faf4d 100644 --- a/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h +++ b/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h @@ -31,8 +31,8 @@ public: QImage *bufferForScreen(int screenId) override; bool needsFullRepaint(int screenId) const override; - void prepareRenderingFrame(int screenId) override; - void present(int screenId, int mask, const QRegion &damage) override; + void beginFrame(int screenId) override; + void endFrame(int screenId, int mask, const QRegion &damage) override; bool perScreenRendering() const override; private: diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp index a4523500fb..4e30abe58d 100644 --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -639,7 +639,7 @@ void SceneOpenGL::paint(int screenId, const QRegion &damage, const QListprepareRenderingForScreen(screenId); + repaint = m_backend->beginFrame(screenId); if (screenId != -1) { geo = screens()->geometry(screenId); scaling = screens()->scale(screenId); @@ -679,7 +679,7 @@ void SceneOpenGL::paint(int screenId, const QRegion &damage, const QListendOfFrame(); - m_backend->endRenderingFrameForScreen(screenId, valid, update); + m_backend->endFrame(screenId, valid, update); GLVertexBuffer::streamingBuffer()->framePosted(); if (m_currentFence) { diff --git a/plugins/scenes/qpainter/scene_qpainter.cpp b/plugins/scenes/qpainter/scene_qpainter.cpp index cc4d1c3633..68e8aa31de 100644 --- a/plugins/scenes/qpainter/scene_qpainter.cpp +++ b/plugins/scenes/qpainter/scene_qpainter.cpp @@ -91,7 +91,7 @@ void SceneQPainter::paint(int screenId, const QRegion &_damage, const QListprepareRenderingFrame(screenId); + m_backend->beginFrame(screenId); const bool needsFullRepaint = m_backend->needsFullRepaint(screenId); if (needsFullRepaint) { mask |= Scene::PAINT_SCREEN_BACKGROUND_FIRST; @@ -108,7 +108,7 @@ void SceneQPainter::paint(int screenId, const QRegion &_damage, const QListend(); - m_backend->present(screenId, mask, updateRegion); + m_backend->endFrame(screenId, mask, updateRegion); } // do cleanup