From afdd5b84c7abaf4b068025a786349d4872efab4a Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 31 Aug 2020 23:07:17 +0300 Subject: [PATCH] effects/blur: Remove leftovers after blur cache The original purpose of m_damageArea was to indicate which region of the blur cache became dirty and needs to be updated. However, we no longer need to keep track of damaged area since the blur cache was removed. --- effects/blur/blur.cpp | 11 ----------- effects/blur/blur.h | 3 +-- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index 07e27c8e22..b314f0c27b 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -471,7 +471,6 @@ void BlurEffect::uploadGeometry(GLVertexBuffer *vbo, const QRegion &blurRegion, void BlurEffect::prePaintScreen(ScreenPrePaintData &data, int time) { - m_damagedArea = QRegion(); m_paintedArea = QRegion(); m_currentBlur = QRegion(); @@ -499,8 +498,6 @@ void BlurEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int t } data.clip = newClip; - const QRegion oldPaint = data.paint; - // we don't have to blur a region we don't see m_currentBlur -= newClip; // if we have to paint a non-opaque part of this window that intersects with the @@ -518,8 +515,6 @@ void BlurEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int t // blur everything if (m_paintedArea.intersects(expandedBlur) || data.paint.intersects(blurArea)) { data.paint |= expandedBlur; - // we keep track of the "damage propagation" - m_damagedArea |= (w->isDock() ? (expandedBlur & m_damagedArea) : expand(expandedBlur & m_damagedArea)) & blurArea; // we have to check again whether we do not damage a blurred area // of a window if (expandedBlur.intersects(m_currentBlur)) { @@ -529,12 +524,6 @@ void BlurEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int t m_currentBlur |= expandedBlur; - // we don't consider damaged areas which are occluded and are not - // explicitly damaged by this window - m_damagedArea -= data.clip; - m_damagedArea |= oldPaint; - - // in contrast to m_damagedArea does m_paintedArea keep track of all repainted areas m_paintedArea -= data.clip; m_paintedArea |= data.paint; } diff --git a/effects/blur/blur.h b/effects/blur/blur.h index 91dafec9a0..767e636e09 100644 --- a/effects/blur/blur.h +++ b/effects/blur/blur.h @@ -89,8 +89,7 @@ private: bool m_renderTargetsValid; long net_wm_blur_region; - QRegion m_damagedArea; // keeps track of the area which has been damaged (from bottom to top) - QRegion m_paintedArea; // actually painted area which is greater than m_damagedArea + QRegion m_paintedArea; // keeps track of all painted areas (from bottom to top) QRegion m_currentBlur; // keeps track of the currently blured area of the windows(from bottom to top) int m_downSampleIterations; // number of times the texture will be downsized to half size