Merge lp:~hikiko/unity/unity.opt-when-no-blur into lp:unity

Proposed by Eleni Maria Stea on 2016-07-22
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2016-12-20
Approved revision: 4155
Merged at revision: 4214
Proposed branch: lp:~hikiko/unity/unity.opt-when-no-blur
Merge into: lp:unity
Diff against target: 70 lines (+9/-6)
3 files modified
plugins/unityshell/src/unityshell.cpp (+5/-5)
plugins/unityshell/src/unityshell.h (+1/-1)
unity-shared/BackgroundEffectHelper.cpp (+3/-0)
To merge this branch: bzr merge lp:~hikiko/unity/unity.opt-when-no-blur
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2016-07-22 Approve on 2016-12-20
Review via email: mp+300864@code.launchpad.net

Commit Message

shouldn't create blur rectangles when there's no blur, skips the blur rects processing in low gfx.

Description of the Change

shouldn't create blur rectangles when there's no blur, skips the blur rects processing in low gfx.

To post a comment you must log in.
Eleni Maria Stea (hikiko) wrote :

also renamed paintDisplay to paintOutput because the name is comfusing, it actually paints the Display/Output intersection.

Marco Trevisan (Treviño) (3v1n0) wrote :

Mh, I think you should instead return false at the beginning of UpdateOwnerGeometry()

Eleni Maria Stea (hikiko) wrote :

I thought of that TBH but we call the UpdateOwnerGeometry in other places too and I wasn't sure if I should change it. For example, there's this code in BackgroundEffectHelper:

  if (!UpdateOwnerGeometry())
  {
    DirtyCache();
    UpdateBlurGeometries();
  }

Do we want to dirty +updateBlurGeometries when the blending is disabled?
Since, I wasn't sure, I chose the change that affects less parts of the code..

Marco Trevisan (Treviño) (3v1n0) wrote :

Yeah, that's the reason... This way we can avoid these computations too... So please, go for it.

Marco Trevisan (Treviño) (3v1n0) wrote :

Can you please update this branch?

4155. By Eleni Maria Stea on 2016-12-12

check if we actually have blur before updating blur geometries

Marco Trevisan (Treviño) (3v1n0) wrote :

Ok, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2016-11-28 23:40:15 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2016-12-12 08:28:26 +0000
4@@ -863,7 +863,7 @@
5 cScreen->damageRegion(CompRegionFromNuxGeo(blur_update));
6 }
7
8-void UnityScreen::paintDisplay()
9+void UnityScreen::paintOutput()
10 {
11 CompOutput *output = last_output_;
12
13@@ -1504,7 +1504,7 @@
14 doShellRepaint = false;
15
16 if (doShellRepaint)
17- paintDisplay();
18+ paintOutput();
19
20 return ret;
21 }
22@@ -3104,18 +3104,18 @@
23
24 if (uScreen->doShellRepaint && window == uScreen->onboard_)
25 {
26- uScreen->paintDisplay();
27+ uScreen->paintOutput();
28 }
29 else if (uScreen->doShellRepaint &&
30 window == uScreen->firstWindowAboveShell &&
31 !uScreen->forcePaintOnTop() &&
32 !uScreen->fullscreenRegion.contains(window->geometry()))
33 {
34- uScreen->paintDisplay();
35+ uScreen->paintOutput();
36 }
37 else if (locked && CanBypassLockScreen())
38 {
39- uScreen->paintDisplay();
40+ uScreen->paintOutput();
41 }
42
43 enum class DrawPanelShadow
44
45=== modified file 'plugins/unityshell/src/unityshell.h'
46--- plugins/unityshell/src/unityshell.h 2016-09-01 23:56:24 +0000
47+++ plugins/unityshell/src/unityshell.h 2016-12-12 08:28:26 +0000
48@@ -180,7 +180,7 @@
49 void nuxEpilogue();
50
51 /* nux draw wrapper */
52- void paintDisplay();
53+ void paintOutput();
54 void paintPanelShadow(CompRegion const& clip);
55 void setPanelShadowMatrix(const GLMatrix& matrix);
56 void updateBlurDamage();
57
58=== modified file 'unity-shared/BackgroundEffectHelper.cpp'
59--- unity-shared/BackgroundEffectHelper.cpp 2016-07-01 17:58:24 +0000
60+++ unity-shared/BackgroundEffectHelper.cpp 2016-12-12 08:28:26 +0000
61@@ -147,6 +147,9 @@
62
63 void BackgroundEffectHelper::UpdateBlurGeometries()
64 {
65+ if (blur_type == BLUR_NONE)
66+ return;
67+
68 int radius = GetBlurRadius();
69 blur_geometries_.clear();
70 blur_geometries_.reserve(registered_list_.size());