diff --git a/src/backends/drm/egl_gbm_backend.cpp b/src/backends/drm/egl_gbm_backend.cpp index 78e3b12d44..9e0ef62da0 100644 --- a/src/backends/drm/egl_gbm_backend.cpp +++ b/src/backends/drm/egl_gbm_backend.cpp @@ -254,9 +254,7 @@ void EglGbmBackend::aboutToStartPainting(AbstractOutput *output, const QRegion & Q_ASSERT(m_surfaces.contains(output)); const auto &surface = m_surfaces[output]; if (surface->bufferAge() > 0 && !damagedRegion.isEmpty() && supportsPartialUpdate()) { - const QRegion region = damagedRegion & output->geometry(); - - QVector rects = regionToRects(region, static_cast(output)); + QVector rects = regionToRects(damagedRegion, static_cast(output)); const bool correct = eglSetDamageRegionKHR(eglDisplay(), surface->eglSurface(), rects.data(), rects.count()/4); if (!correct) { qCWarning(KWIN_DRM) << "eglSetDamageRegionKHR failed:" << getEglErrorString(); @@ -287,7 +285,7 @@ void EglGbmBackend::endFrame(AbstractOutput *output, const QRegion &renderedRegi Q_UNUSED(renderedRegion) m_surfaces[output]->endRendering(damagedRegion); - static_cast(output)->present(m_surfaces[output]->currentBuffer(), damagedRegion & output->geometry()); + static_cast(output)->present(m_surfaces[output]->currentBuffer(), damagedRegion); } bool EglGbmBackend::scanout(AbstractOutput *output, SurfaceItem *surfaceItem) diff --git a/src/backends/drm/egl_gbm_layer.cpp b/src/backends/drm/egl_gbm_layer.cpp index 7cf3c71ed0..adb5b883ba 100644 --- a/src/backends/drm/egl_gbm_layer.cpp +++ b/src/backends/drm/egl_gbm_layer.cpp @@ -114,7 +114,7 @@ bool EglGbmLayer::endRendering(const QRegion &damagedRegion) m_shadowBuffer->render(m_output); } GLRenderTarget::popRenderTarget(); - const auto buffer = m_gbmSurface->swapBuffersForDrm(damagedRegion.intersected(m_output->geometry())); + const auto buffer = m_gbmSurface->swapBuffersForDrm(damagedRegion); if (buffer) { m_currentBuffer = buffer; } diff --git a/src/backends/wayland/egl_wayland_backend.cpp b/src/backends/wayland/egl_wayland_backend.cpp index 155fce727d..51d71546d7 100644 --- a/src/backends/wayland/egl_wayland_backend.cpp +++ b/src/backends/wayland/egl_wayland_backend.cpp @@ -315,9 +315,7 @@ void EglWaylandBackend::aboutToStartPainting(AbstractOutput *output, const QRegi Q_ASSERT(m_outputs.contains(output)); const auto &eglOutput = m_outputs[output]; if (eglOutput->m_bufferAge > 0 && !damagedRegion.isEmpty() && supportsPartialUpdate()) { - const QRegion region = damagedRegion & eglOutput->m_waylandOutput->geometry(); - - QVector rects = regionToRects(region, eglOutput->m_waylandOutput); + QVector rects = regionToRects(damagedRegion, eglOutput->m_waylandOutput); const bool correct = eglSetDamageRegionKHR(eglDisplay(), eglOutput->m_eglSurface, rects.data(), rects.count()/4); if (!correct) { @@ -387,11 +385,10 @@ void EglWaylandBackend::endFrame(AbstractOutput *output, const QRegion &rendered GLRenderTarget::popRenderTarget(); const auto &eglOutput = m_outputs[output]; - QRegion damage = damagedRegion.intersected(eglOutput->m_waylandOutput->geometry()); - presentOnSurface(eglOutput, damage); + presentOnSurface(eglOutput, damagedRegion); if (supportsBufferAge()) { - eglOutput->m_damageJournal.add(damage); + eglOutput->m_damageJournal.add(damagedRegion); } } diff --git a/src/scene.cpp b/src/scene.cpp index 007d7c8aa1..108af23d9f 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -719,10 +719,8 @@ void Scene::clearStackingOrder() stacking_order.clear(); } -void Scene::paintWindow(Window* w, int mask, const QRegion &_region) +void Scene::paintWindow(Window *w, int mask, const QRegion ®ion) { - // no painting outside visible screen (and no transformations) - const QRegion region = _region & renderTargetRect(); if (region.isEmpty()) // completely clipped return;