Merge lp:~smspillaz/compiz-animation-plugin/compiz-animation-plugin.fix_976469 into lp:compiz-animation-plugin

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 396
Proposed branch: lp:~smspillaz/compiz-animation-plugin/compiz-animation-plugin.fix_976469
Merge into: lp:compiz-animation-plugin
Diff against target: 181 lines (+19/-8)
8 files modified
include/animation/animeffect.h (+2/-0)
include/animation/fade.h (+1/-0)
include/animation/grid.h (+2/-0)
include/animation/gridtransform.h (+1/-0)
include/animation/transform.h (+1/-0)
include/animation/zoom.h (+2/-0)
src/animation.cpp (+3/-8)
src/private.h (+7/-0)
To merge this branch: bzr merge lp:~smspillaz/compiz-animation-plugin/compiz-animation-plugin.fix_976469
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Review via email: mp+101334@code.launchpad.net

This proposal supersedes a proposal from 2012-04-08.

Description of the change

== Problem ==

The animation plugin was setting PAINT_WINDOW_TRANSFORMED_MASK even when it didn't need it, which would confuse other plugins

== Solution ==

Added a vfunc to determine whether or not we actually need to do that

Fixes LP#976469

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

First observation: requiresTransformedWindow() should be const.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Tests OK. No obvious regressions, though I also don't see any shadows being clipped at all.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Hmm, I will approve this again, but first please:

1. Remove " // TODO: should only happen for distorting effects"
2. Consider making requiresTransformedWindow() const.

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/animation/animeffect.h'
--- include/animation/animeffect.h 2010-08-17 21:19:04 +0000
+++ include/animation/animeffect.h 2012-04-10 06:16:19 +0000
@@ -172,6 +172,8 @@
172 return gWindow->glPaint (attrib, transform, region, mask);172 return gWindow->glPaint (attrib, transform, region, mask);
173 }173 }
174174
175 virtual bool requiresTransformedWindow () const { return true; }
176
175 /// Gets info about the (extension) plugin that implements this animation.177 /// Gets info about the (extension) plugin that implements this animation.
176 /// Should be overriden by a base animation class in every extension plugin.178 /// Should be overriden by a base animation class in every extension plugin.
177 virtual ExtensionPluginInfo *getExtensionPluginInfo ();179 virtual ExtensionPluginInfo *getExtensionPluginInfo ();
178180
=== modified file 'include/animation/fade.h'
--- include/animation/fade.h 2010-08-17 21:19:04 +0000
+++ include/animation/fade.h 2012-04-10 06:16:19 +0000
@@ -14,6 +14,7 @@
14 void updateBB (CompOutput &output);14 void updateBB (CompOutput &output);
15 bool updateBBUsed () { return true; }15 bool updateBBUsed () { return true; }
16 void updateAttrib (GLWindowPaintAttrib &wAttrib);16 void updateAttrib (GLWindowPaintAttrib &wAttrib);
17 virtual bool requiresTransformedWindow () const { return false; }
17 virtual float getFadeProgress () { return progressLinear (); }18 virtual float getFadeProgress () { return progressLinear (); }
18};19};
19#endif20#endif
2021
=== modified file 'include/animation/grid.h'
--- include/animation/grid.h 2010-08-24 22:32:07 +0000
+++ include/animation/grid.h 2012-04-10 06:16:19 +0000
@@ -82,6 +82,8 @@
8282
83 virtual bool using3D () { return false; }83 virtual bool using3D () { return false; }
8484
85 virtual bool requiresTransformedWindow () const { return true; }
86
85 virtual void initGrid (); ///< Initializes grid width/height.87 virtual void initGrid (); ///< Initializes grid width/height.
86 ///< Default grid size is 2x2.88 ///< Default grid size is 2x2.
87 ///< Override for custom grid size.89 ///< Override for custom grid size.
8890
=== modified file 'include/animation/gridtransform.h'
--- include/animation/gridtransform.h 2010-08-24 22:32:07 +0000
+++ include/animation/gridtransform.h 2012-04-10 06:16:19 +0000
@@ -15,6 +15,7 @@
15 void updateTransform (GLMatrix &wTransform);15 void updateTransform (GLMatrix &wTransform);
16 void updateBB (CompOutput &output);16 void updateBB (CompOutput &output);
17 bool updateBBUsed () { return true; }17 bool updateBBUsed () { return true; }
18 bool requiresTransformedWindow () const { return true; }
18 19
19protected:20protected:
20 bool mUsingTransform; ///< whether transform matrix is used (default: true)21 bool mUsingTransform; ///< whether transform matrix is used (default: true)
2122
=== modified file 'include/animation/transform.h'
--- include/animation/transform.h 2010-08-17 21:19:04 +0000
+++ include/animation/transform.h 2012-04-10 06:16:19 +0000
@@ -29,6 +29,7 @@
29 virtual void adjustDuration () {}29 virtual void adjustDuration () {}
30 virtual void applyTransform () {}30 virtual void applyTransform () {}
31 virtual Point getCenter ();31 virtual Point getCenter ();
32 virtual bool requiresTransformedWindow () const { return true; }
32 33
33};34};
34#endif35#endif
3536
=== modified file 'include/animation/zoom.h'
--- include/animation/zoom.h 2010-08-17 21:19:04 +0000
+++ include/animation/zoom.h 2012-04-10 06:16:19 +0000
@@ -34,6 +34,7 @@
34 void getZoomProgress (float *moveProgress,34 void getZoomProgress (float *moveProgress,
35 float *scaleProgress,35 float *scaleProgress,
36 bool neverSpringy);36 bool neverSpringy);
37 bool requiresTransformedWindow () const { return true; }
3738
38 static const float kDurationFactor;39 static const float kDurationFactor;
39 static const float kSpringyDurationFactor;40 static const float kSpringyDurationFactor;
@@ -66,5 +67,6 @@
66 float getSpringiness () { return 0; }67 float getSpringiness () { return 0; }
67 bool scaleAroundIcon () { return false; }68 bool scaleAroundIcon () { return false; }
68 void adjustDuration ();69 void adjustDuration ();
70 bool requiresTransformedWindow () const { return true; }
69};71};
70#endif72#endif
7173
=== modified file 'src/animation.cpp'
--- src/animation.cpp 2012-03-20 10:36:39 +0000
+++ src/animation.cpp 2012-04-10 06:16:19 +0000
@@ -1265,8 +1265,6 @@
1265 mLastRedrawTime = curTime; // Store current time for next time1265 mLastRedrawTime = curTime; // Store current time for next time
1266 mLastRedrawTimeFresh = true;1266 mLastRedrawTimeFresh = true;
12671267
1268 bool animStillInProgress = false;
1269
1270 /* Paint list includes destroyed windows */1268 /* Paint list includes destroyed windows */
1271 for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();1269 for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
1272 rit != pl.rend (); rit++)1270 rit != pl.rend (); rit++)
@@ -1281,8 +1279,7 @@
1281 if (!curAnim->initialized ())1279 if (!curAnim->initialized ())
1282 curAnim->init ();1280 curAnim->init ();
12831281
1284 if (curAnim->prePreparePaint (msSinceLastPaint))1282 curAnim->prePreparePaint (msSinceLastPaint);
1285 animStillInProgress = true;
12861283
1287 /* TODO optimize grid model by reusing one GridModel1284 /* TODO optimize grid model by reusing one GridModel
1288 if (aw->com.mModel &&1285 if (aw->com.mModel &&
@@ -1345,8 +1342,6 @@
1345 bool finished = (curAnim->remainingTime () <= 0);1342 bool finished = (curAnim->remainingTime () <= 0);
1346 if (finished) // Animation is done1343 if (finished) // Animation is done
1347 windowsFinishedAnimations.push_back (w);1344 windowsFinishedAnimations.push_back (w);
1348 else
1349 animStillInProgress = true;
1350 }1345 }
1351 }1346 }
13521347
@@ -1597,8 +1592,8 @@
15971592
1598 //w->indexCount = 0; // TODO check if this is still necessary1593 //w->indexCount = 0; // TODO check if this is still necessary
15991594
1600 // TODO: should only happen for distorting effects1595 if (mCurAnimation->requiresTransformedWindow ())
1601 mask |= PAINT_WINDOW_TRANSFORMED_MASK;1596 mask |= PAINT_WINDOW_TRANSFORMED_MASK;
16021597
1603 wAttrib.xScale = 1.0f;1598 wAttrib.xScale = 1.0f;
1604 wAttrib.yScale = 1.0f;1599 wAttrib.yScale = 1.0f;
16051600
=== modified file 'src/private.h'
--- src/private.h 2011-09-19 05:59:09 +0000
+++ src/private.h 2012-04-10 06:16:19 +0000
@@ -502,6 +502,7 @@
502 inline bool hasExtraTransform () { return true; }502 inline bool hasExtraTransform () { return true; }
503 void applyExtraTransform (float progress);503 void applyExtraTransform (float progress);
504 inline bool shouldAvoidParallelogramLook () { return true; }504 inline bool shouldAvoidParallelogramLook () { return true; }
505 bool requiresTransformedWindow () const { return true; }
505};506};
506507
507class WaveAnim :508class WaveAnim :
@@ -518,6 +519,7 @@
518 void initGrid ();519 void initGrid ();
519 inline bool using3D () { return true; }520 inline bool using3D () { return true; }
520 void step ();521 void step ();
522 bool requiresTransformedWindow () const { return true; }
521523
522 static const float kMinDuration;524 static const float kMinDuration;
523};525};
@@ -540,6 +542,7 @@
540 bool zoomToIcon ();542 bool zoomToIcon ();
541 void applyTransform ();543 void applyTransform ();
542 float getFadeProgress ();544 float getFadeProgress ();
545 bool requiresTransformedWindow () const { return true; }
543546
544 float getProgress ();547 float getProgress ();
545 virtual void getParams (float *finalDistFac,548 virtual void getParams (float *finalDistFac,
@@ -759,6 +762,7 @@
759 void adjustDuration ();762 void adjustDuration ();
760 float getFadeProgress ();763 float getFadeProgress ();
761 bool zoomToIcon ();764 bool zoomToIcon ();
765 bool requiresTransformedWindow () const { return true; }
762766
763 static const float kDurationFactor;767 static const float kDurationFactor;
764};768};
@@ -776,6 +780,7 @@
776 inline bool using3D () { return true; }780 inline bool using3D () { return true; }
777 float getFadeProgress ();781 float getFadeProgress ();
778 void updateWindowAttrib (GLWindowPaintAttrib &attrib);782 void updateWindowAttrib (GLWindowPaintAttrib &attrib);
783 bool requiresTransformedWindow () const { return true; }
779};784};
780785
781class CurvedFoldAnim :786class CurvedFoldAnim :
@@ -797,6 +802,7 @@
797 float sinForProg,802 float sinForProg,
798 float relDistToCenter,803 float relDistToCenter,
799 float curveMaxAmp);804 float curveMaxAmp);
805 bool requiresTransformedWindow () const { return true; }
800};806};
801807
802class HorizontalFoldsAnim :808class HorizontalFoldsAnim :
@@ -817,4 +823,5 @@
817 float sinForProg,823 float sinForProg,
818 float relDistToFoldCenter,824 float relDistToFoldCenter,
819 float foldMaxAmp);825 float foldMaxAmp);
826 bool requiresTransformedWindow () const { return true; }
820};827};

Subscribers

People subscribed via source and target branches