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
=== modified file 'plugins/expo/src/expo.cpp'
--- plugins/expo/src/expo.cpp 2012-11-23 09:07:48 +0000
+++ plugins/expo/src/expo.cpp 2012-11-26 07:39:21 +0000
@@ -1209,6 +1209,11 @@
1209 if (expoCam > 0)1209 if (expoCam > 0)
1210 mask |= PAINT_SCREEN_CLEAR_MASK;1210 mask |= PAINT_SCREEN_CLEAR_MASK;
12111211
1212 if (optionGetExpoAnimation () == ExpoScreen::ExpoAnimationZoom)
1213 vpBrightness = 0.0f;
1214 else
1215 vpBrightness = (1.0f - sigmoidProgress (expoCam));
1216
1212 if (expoCam <= 0 || (expoCam > 0.0 && expoCam < 1.0 &&1217 if (expoCam <= 0 || (expoCam > 0.0 && expoCam < 1.0 &&
1213 optionGetExpoAnimation () != ExpoAnimationZoom))1218 optionGetExpoAnimation () != ExpoAnimationZoom))
1214 {1219 {
@@ -1241,15 +1246,17 @@
1241 if (eScreen->expoCam == 0.0f)1246 if (eScreen->expoCam == 0.0f)
1242 return gWindow->glDraw (transform, attrib, region, mask);1247 return gWindow->glDraw (transform, attrib, region, mask);
12431248
1244 GLWindowPaintAttrib eAttrib (attrib);
1245 int expoAnimation;1249 int expoAnimation;
12461250
1251 // Scaling factors to be applied to attrib later in glDrawTexture
1252 expoOpacity = 1.0f;
1253
1247 expoAnimation = eScreen->optionGetExpoAnimation ();1254 expoAnimation = eScreen->optionGetExpoAnimation ();
12481255
1249 if (eScreen->expoActive)1256 if (eScreen->expoActive)
1250 {1257 {
1251 if (expoAnimation != ExpoScreen::ExpoAnimationZoom)1258 if (expoAnimation != ExpoScreen::ExpoAnimationZoom)
1252 eAttrib.opacity = attrib.opacity * eScreen->expoCam;1259 expoOpacity = eScreen->expoCam;
12531260
1254 if (window->wmType () & CompWindowTypeDockMask &&1261 if (window->wmType () & CompWindowTypeDockMask &&
1255 eScreen->optionGetHideDocks ())1262 eScreen->optionGetHideDocks ())
@@ -1257,28 +1264,16 @@
1257 if (expoAnimation == ExpoScreen::ExpoAnimationZoom &&1264 if (expoAnimation == ExpoScreen::ExpoAnimationZoom &&
1258 eScreen->paintingVp == eScreen->selectedVp)1265 eScreen->paintingVp == eScreen->selectedVp)
1259 {1266 {
1260 eAttrib.opacity = attrib.opacity *1267 expoOpacity = (1.0f - sigmoidProgress (eScreen->expoCam));
1261 (1 - sigmoidProgress (eScreen->expoCam));
1262 }1268 }
1263 else1269 else
1264 {1270 {
1265 eAttrib.opacity = 0;1271 expoOpacity = 0.0f;
1266 }1272 }
1267 }1273 }
12681274 }
1269 eAttrib.brightness = attrib.brightness * eScreen->vpBrightness;1275
1270 eAttrib.saturation = attrib.saturation * eScreen->vpSaturation;1276 bool status = gWindow->glDraw (transform, attrib, region, mask);
1271 }
1272 else
1273 {
1274 if (expoAnimation == ExpoScreen::ExpoAnimationZoom)
1275 eAttrib.brightness = 0;
1276 else
1277 eAttrib.brightness = attrib.brightness *
1278 (1 - sigmoidProgress (eScreen->expoCam));
1279 }
1280
1281 bool status = gWindow->glDraw (transform, eAttrib, region, mask);
12821277
1283 if (window->type () & CompWindowTypeDesktopMask &&1278 if (window->type () & CompWindowTypeDesktopMask &&
1284 eScreen->optionGetSelectedColor ()[3] && // colour is visible1279 eScreen->optionGetSelectedColor ()[3] && // colour is visible
@@ -1368,6 +1363,15 @@
1368 const GLWindowPaintAttrib &attrib,1363 const GLWindowPaintAttrib &attrib,
1369 unsigned int mask)1364 unsigned int mask)
1370{1365{
1366 GLWindowPaintAttrib wAttrib (attrib);
1367
1368 if (eScreen->expoCam > 0.0)
1369 {
1370 wAttrib.opacity *= expoOpacity;
1371 wAttrib.brightness *= eScreen->vpBrightness;
1372 wAttrib.saturation *= eScreen->vpSaturation;
1373 }
1374
1371 if (eScreen->expoCam > 0.0 &&1375 if (eScreen->expoCam > 0.0 &&
1372 eScreen->optionGetDeform () == ExpoScreen::DeformCurve &&1376 eScreen->optionGetDeform () == ExpoScreen::DeformCurve &&
1373 eScreen->gScreen->lighting () &&1377 eScreen->gScreen->lighting () &&
@@ -1411,7 +1415,7 @@
1411#ifndef USE_GLES1415#ifndef USE_GLES
1412 glEnable (GL_NORMALIZE);1416 glEnable (GL_NORMALIZE);
1413#endif1417#endif
1414 gWindow->glDrawTexture (texture, transform, attrib, mask);1418 gWindow->glDrawTexture (texture, transform, wAttrib, mask);
1415#ifndef USE_GLES1419#ifndef USE_GLES
1416 glDisable (GL_NORMALIZE);1420 glDisable (GL_NORMALIZE);
1417#endif1421#endif
@@ -1419,7 +1423,7 @@
1419 else1423 else
1420 {1424 {
1421// glEnable (GL_NORMALIZE);1425// glEnable (GL_NORMALIZE);
1422 gWindow->glDrawTexture (texture, transform, attrib, mask);1426 gWindow->glDrawTexture (texture, transform, wAttrib, mask);
1423// glDisable (GL_NORMALIZE);1427// glDisable (GL_NORMALIZE);
1424 }1428 }
1425}1429}
@@ -1542,7 +1546,8 @@
1542 cWindow (CompositeWindow::get (w)),1546 cWindow (CompositeWindow::get (w)),
1543 gWindow (GLWindow::get (w)),1547 gWindow (GLWindow::get (w)),
1544 eScreen (ExpoScreen::get (screen)),1548 eScreen (ExpoScreen::get (screen)),
1545 mGlowQuads (NULL)1549 mGlowQuads (NULL),
1550 expoOpacity (1.0f)
1546{1551{
1547 CompositeWindowInterface::setHandler (cWindow, false);1552 CompositeWindowInterface::setHandler (cWindow, false);
1548 GLWindowInterface::setHandler (gWindow, false);1553 GLWindowInterface::setHandler (gWindow, false);
15491554
=== modified file 'plugins/expo/src/expo.h'
--- plugins/expo/src/expo.h 2012-11-23 08:20:42 +0000
+++ plugins/expo/src/expo.h 2012-11-26 07:39:21 +0000
@@ -171,7 +171,9 @@
171 GLWindow *gWindow;171 GLWindow *gWindow;
172 ExpoScreen *eScreen;172 ExpoScreen *eScreen;
173173
174 private:
174 GlowQuad *mGlowQuads;175 GlowQuad *mGlowQuads;
176 float expoOpacity;
175};177};
176178
177class ExpoPluginVTable :179class ExpoPluginVTable :

Subscribers

People subscribed via source and target branches