From 433682ac2dd8c34a032578713b187afb3f8ca23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 18 Nov 2013 21:08:25 +0100 Subject: BackgroundEffectHelper: keep a cached version of blur geometries Now the blurred geometries are saved in a list that gets updated only when they change, this allows to reduce a lot the cost of GetBlurGeometries that now only returns a const reference of the actual vector. Improved also HasEnabledHelpers (no helper can be registered if it's not enabled). (bzr r3347.5.20) --- plugins/unityshell/src/unityshell.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins/unityshell') diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 9ec2ae919..a1a4ff3c5 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -777,9 +777,8 @@ void UnityScreen::paintDisplay() /* We are using a CompRegion here so that we can combine rectangles * where it might make sense to. Saves calls into OpenGL */ CompRegion blur_region; - auto const& blur_geometries = BackgroundEffectHelper::GetBlurGeometries(); - for (auto const& blur_geometry : blur_geometries) + for (auto const& blur_geometry : BackgroundEffectHelper::GetBlurGeometries()) { auto blur_rect = CompRectFromNuxGeo(blur_geometry); blur_region += (blur_rect & *output); -- cgit v1.2.3