diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index a34685aea4..2c1141df32 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -194,9 +194,9 @@ bool EglOnXBackend::initBufferConfigs() void EglOnXBackend::present() { - const bool swap = (options->glPreferBufferSwap() && options->glPreferBufferSwap() != Options::ExtendDamage) || - !(lastMask() & Scene::PAINT_SCREEN_REGION && surfaceHasSubPost && eglPostSubBufferNV); - if (swap) { + const QRegion displayRegion(0, 0, displayWidth(), displayHeight()); + const bool fullRepaint = (lastDamage() == displayRegion); + if (fullRepaint || !(surfaceHasSubPost && eglPostSubBufferNV)) { eglSwapBuffers(dpy, surface); } else { const QRect damageRect = lastDamage().boundingRect(); @@ -226,10 +226,9 @@ void EglOnXBackend::prepareRenderingFrame() startRenderTimer(); } -void EglOnXBackend::endRenderingFrame(int mask, const QRegion &damage) +void EglOnXBackend::endRenderingFrame(const QRegion &damage) { setLastDamage(damage); - setLastMask(mask); glFlush(); if (overlayWindow()->window()) // show the window only after the first pass, diff --git a/eglonxbackend.h b/eglonxbackend.h index 45df2af028..9283fbe570 100644 --- a/eglonxbackend.h +++ b/eglonxbackend.h @@ -35,7 +35,7 @@ public: virtual void screenGeometryChanged(const QSize &size); virtual SceneOpenGL::TexturePrivate *createBackendTexture(SceneOpenGL::Texture *texture); virtual void prepareRenderingFrame(); - virtual void endRenderingFrame(int mask, const QRegion &damage); + virtual void endRenderingFrame(const QRegion &damage); protected: virtual void present(); diff --git a/glxbackend.cpp b/glxbackend.cpp index 17d01e7592..f39c3a5323 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -473,10 +473,9 @@ void GlxBackend::waitSync() void GlxBackend::present() { - QRegion displayRegion(0, 0, displayWidth(), displayHeight()); - const bool fullRepaint = (lastDamage() == displayRegion); - if (isDoubleBuffer()) { + const QRegion displayRegion(0, 0, displayWidth(), displayHeight()); + const bool fullRepaint = (lastDamage() == displayRegion); if (fullRepaint) { if (haveSwapInterval) { @@ -540,11 +539,8 @@ void GlxBackend::present() glXWaitGL(); } else { glXWaitGL(); - if (!fullRepaint) - foreach (const QRect & r, lastDamage().rects()) - XCopyArea(display(), buffer, rootWindow(), gcroot, r.x(), r.y(), r.width(), r.height(), r.x(), r.y()); - else - XCopyArea(display(), buffer, rootWindow(), gcroot, 0, 0, displayWidth(), displayHeight(), 0, 0); + foreach (const QRect & r, lastDamage().rects()) + XCopyArea(display(), buffer, rootWindow(), gcroot, r.x(), r.y(), r.width(), r.height(), r.x(), r.y()); } setLastDamage(QRegion()); XFlush(display()); @@ -584,10 +580,9 @@ void GlxBackend::prepareRenderingFrame() glXWaitX(); } -void GlxBackend::endRenderingFrame(int mask, const QRegion &damage) +void GlxBackend::endRenderingFrame(const QRegion &damage) { setLastDamage(damage); - setLastMask(mask); glFlush(); if (overlayWindow()->window()) // show the window only after the first pass, diff --git a/glxbackend.h b/glxbackend.h index ce46bacec2..1e6f7561bc 100644 --- a/glxbackend.h +++ b/glxbackend.h @@ -45,7 +45,7 @@ public: virtual void screenGeometryChanged(const QSize &size); virtual SceneOpenGL::TexturePrivate *createBackendTexture(SceneOpenGL::Texture *texture); virtual void prepareRenderingFrame(); - virtual void endRenderingFrame(int mask, const QRegion &damage); + virtual void endRenderingFrame(const QRegion &damage); protected: virtual void present(); diff --git a/scene_opengl.cpp b/scene_opengl.cpp index ff5acc136c..a426d8828a 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -79,7 +79,6 @@ OpenGLBackend::OpenGLBackend() , m_directRendering(false) , m_doubleBuffer(false) , m_failed(false) - , m_lastMask(0) { } @@ -321,7 +320,7 @@ int SceneOpenGL::paint(QRegion damage, ToplevelList toplevels) checkGLError("Paint2"); #endif - m_backend->endRenderingFrame(mask, damage); + m_backend->endRenderingFrame(damage); // do cleanup stacking_order.clear(); diff --git a/scene_opengl.h b/scene_opengl.h index 9341287aa1..fa9701d778 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -408,10 +408,9 @@ public: /** * @brief Backend specific code to handle the end of rendering a frame. * - * @param mask The rendering mask of this frame * @param damage The actual updated region in this frame **/ - virtual void endRenderingFrame(int mask, const QRegion &damage) = 0; + virtual void endRenderingFrame(const QRegion &damage) = 0; /** * @brief Compositor is going into idle mode, flushes any pending paints. **/ @@ -532,15 +531,6 @@ protected: void setLastDamage(const QRegion &damage) { m_lastDamage = damage; } - /** - * @return int Rendering mask of previously rendered frame - **/ - int lastMask() const { - return m_lastMask; - } - void setLastMask(int mask) { - m_lastMask = mask; - } /** * @brief Starts the timer for how long it takes to render the frame. * @@ -575,10 +565,6 @@ private: * @brief Damaged region of previously rendered frame. **/ QRegion m_lastDamage; - /** - * @brief Rendering mask of previously rendered frame. - **/ - int m_lastMask; /** * @brief Timer to measure how long a frame renders. **/