Merge lp:~vanvugt/compiz/fix-1081425 into lp:compiz/0.9.9

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3487
Merged at revision: 3485
Proposed branch: lp:~vanvugt/compiz/fix-1081425
Merge into: lp:compiz/0.9.9
Diff against target: 127 lines (+29/-22)
2 files modified
plugins/expo/src/expo.cpp (+27/-22)
plugins/expo/src/expo.h (+2/-0)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1081425
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sam Spilsbury Approve
Review via email: mp+135616@code.launchpad.net

Commit message

Move the actual setting of window opacity/brightness/saturation from
glDraw into glDrawTexture so that it is no longer sensitive to the plugin
load (wrapping) order. This fixes problems with decorations not fading out
in expo mode (LP: #1081425)

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Jenkins will complain because this breaks 100_expo_layout.patch. However I would like to get general approval for the change before modifying 100_expo_layout.patch to be compatible.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

23 + // Scaling factors to be applied to attrib later in glDrawTexture
24 + opacity = 1.0f;

Might be best to rename that to opacityScaleFactor

123 + private:
124 + float opacity;

Yeah definitely rename it, having a member called "opacity" really runs the risk of it being shadowed later.

74 + GLWindowPaintAttrib a (attrib);

wAttrib is the convention (though this is glDraw/Texture/ so maybe tAttrib?)

In any case "a" is far too undescriptive for a variable of function-scope.

Probably better to refresh the patch - we can just ignore the noise it creates. Its better to know if the tests continue passing, since that's what we care about.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm fed up with this. 100_expo_layout.patch is breaking constantly. I'm going to merge it with the main code (partially) before allowing more expo changes like this. It's totally unmaintainable to have a patch this large.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Okay - probably best to merge the changes that don't actually change
any upstream behaviour.

On Fri, Nov 23, 2012 at 2:49 PM, Daniel van Vugt
<email address hidden> wrote:
> I'm fed up with this. 100_expo_layout.patch is breaking constantly. I'm going to merge it with the main code (partially) before allowing more expo changes like this. It's totally unmaintainable to have a patch this large.
> --
> https://code.launchpad.net/~vanvugt/compiz/fix-1081425/+merge/135616
> Your team Compiz Maintainers is requested to review the proposed merge of lp:~vanvugt/compiz/fix-1081425 into lp:compiz.

--
Sam Spilsbury

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, conflicting patches have been eliminated. Jenkins should be happy now.

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/expo/src/expo.cpp'
2--- plugins/expo/src/expo.cpp 2012-11-23 09:07:48 +0000
3+++ plugins/expo/src/expo.cpp 2012-11-26 07:39:21 +0000
4@@ -1209,6 +1209,11 @@
5 if (expoCam > 0)
6 mask |= PAINT_SCREEN_CLEAR_MASK;
7
8+ if (optionGetExpoAnimation () == ExpoScreen::ExpoAnimationZoom)
9+ vpBrightness = 0.0f;
10+ else
11+ vpBrightness = (1.0f - sigmoidProgress (expoCam));
12+
13 if (expoCam <= 0 || (expoCam > 0.0 && expoCam < 1.0 &&
14 optionGetExpoAnimation () != ExpoAnimationZoom))
15 {
16@@ -1241,15 +1246,17 @@
17 if (eScreen->expoCam == 0.0f)
18 return gWindow->glDraw (transform, attrib, region, mask);
19
20- GLWindowPaintAttrib eAttrib (attrib);
21 int expoAnimation;
22
23+ // Scaling factors to be applied to attrib later in glDrawTexture
24+ expoOpacity = 1.0f;
25+
26 expoAnimation = eScreen->optionGetExpoAnimation ();
27
28 if (eScreen->expoActive)
29 {
30 if (expoAnimation != ExpoScreen::ExpoAnimationZoom)
31- eAttrib.opacity = attrib.opacity * eScreen->expoCam;
32+ expoOpacity = eScreen->expoCam;
33
34 if (window->wmType () & CompWindowTypeDockMask &&
35 eScreen->optionGetHideDocks ())
36@@ -1257,28 +1264,16 @@
37 if (expoAnimation == ExpoScreen::ExpoAnimationZoom &&
38 eScreen->paintingVp == eScreen->selectedVp)
39 {
40- eAttrib.opacity = attrib.opacity *
41- (1 - sigmoidProgress (eScreen->expoCam));
42+ expoOpacity = (1.0f - sigmoidProgress (eScreen->expoCam));
43 }
44 else
45 {
46- eAttrib.opacity = 0;
47+ expoOpacity = 0.0f;
48 }
49 }
50-
51- eAttrib.brightness = attrib.brightness * eScreen->vpBrightness;
52- eAttrib.saturation = attrib.saturation * eScreen->vpSaturation;
53- }
54- else
55- {
56- if (expoAnimation == ExpoScreen::ExpoAnimationZoom)
57- eAttrib.brightness = 0;
58- else
59- eAttrib.brightness = attrib.brightness *
60- (1 - sigmoidProgress (eScreen->expoCam));
61- }
62-
63- bool status = gWindow->glDraw (transform, eAttrib, region, mask);
64+ }
65+
66+ bool status = gWindow->glDraw (transform, attrib, region, mask);
67
68 if (window->type () & CompWindowTypeDesktopMask &&
69 eScreen->optionGetSelectedColor ()[3] && // colour is visible
70@@ -1368,6 +1363,15 @@
71 const GLWindowPaintAttrib &attrib,
72 unsigned int mask)
73 {
74+ GLWindowPaintAttrib wAttrib (attrib);
75+
76+ if (eScreen->expoCam > 0.0)
77+ {
78+ wAttrib.opacity *= expoOpacity;
79+ wAttrib.brightness *= eScreen->vpBrightness;
80+ wAttrib.saturation *= eScreen->vpSaturation;
81+ }
82+
83 if (eScreen->expoCam > 0.0 &&
84 eScreen->optionGetDeform () == ExpoScreen::DeformCurve &&
85 eScreen->gScreen->lighting () &&
86@@ -1411,7 +1415,7 @@
87 #ifndef USE_GLES
88 glEnable (GL_NORMALIZE);
89 #endif
90- gWindow->glDrawTexture (texture, transform, attrib, mask);
91+ gWindow->glDrawTexture (texture, transform, wAttrib, mask);
92 #ifndef USE_GLES
93 glDisable (GL_NORMALIZE);
94 #endif
95@@ -1419,7 +1423,7 @@
96 else
97 {
98 // glEnable (GL_NORMALIZE);
99- gWindow->glDrawTexture (texture, transform, attrib, mask);
100+ gWindow->glDrawTexture (texture, transform, wAttrib, mask);
101 // glDisable (GL_NORMALIZE);
102 }
103 }
104@@ -1542,7 +1546,8 @@
105 cWindow (CompositeWindow::get (w)),
106 gWindow (GLWindow::get (w)),
107 eScreen (ExpoScreen::get (screen)),
108- mGlowQuads (NULL)
109+ mGlowQuads (NULL),
110+ expoOpacity (1.0f)
111 {
112 CompositeWindowInterface::setHandler (cWindow, false);
113 GLWindowInterface::setHandler (gWindow, false);
114
115=== modified file 'plugins/expo/src/expo.h'
116--- plugins/expo/src/expo.h 2012-11-23 08:20:42 +0000
117+++ plugins/expo/src/expo.h 2012-11-26 07:39:21 +0000
118@@ -171,7 +171,9 @@
119 GLWindow *gWindow;
120 ExpoScreen *eScreen;
121
122+ private:
123 GlowQuad *mGlowQuads;
124+ float expoOpacity;
125 };
126
127 class ExpoPluginVTable :

Subscribers

People subscribed via source and target branches