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

Proposed by Sam Spilsbury on 2012-04-10
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 2012-04-10 Approve on 2012-04-10
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.
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

First observation: requiresTransformedWindow() should be const.

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
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
Daniel van Vugt (vanvugt) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/animation/animeffect.h'
2--- include/animation/animeffect.h 2010-08-17 21:19:04 +0000
3+++ include/animation/animeffect.h 2012-04-10 06:16:19 +0000
4@@ -172,6 +172,8 @@
5 return gWindow->glPaint (attrib, transform, region, mask);
6 }
7
8+ virtual bool requiresTransformedWindow () const { return true; }
9+
10 /// Gets info about the (extension) plugin that implements this animation.
11 /// Should be overriden by a base animation class in every extension plugin.
12 virtual ExtensionPluginInfo *getExtensionPluginInfo ();
13
14=== modified file 'include/animation/fade.h'
15--- include/animation/fade.h 2010-08-17 21:19:04 +0000
16+++ include/animation/fade.h 2012-04-10 06:16:19 +0000
17@@ -14,6 +14,7 @@
18 void updateBB (CompOutput &output);
19 bool updateBBUsed () { return true; }
20 void updateAttrib (GLWindowPaintAttrib &wAttrib);
21+ virtual bool requiresTransformedWindow () const { return false; }
22 virtual float getFadeProgress () { return progressLinear (); }
23 };
24 #endif
25
26=== modified file 'include/animation/grid.h'
27--- include/animation/grid.h 2010-08-24 22:32:07 +0000
28+++ include/animation/grid.h 2012-04-10 06:16:19 +0000
29@@ -82,6 +82,8 @@
30
31 virtual bool using3D () { return false; }
32
33+ virtual bool requiresTransformedWindow () const { return true; }
34+
35 virtual void initGrid (); ///< Initializes grid width/height.
36 ///< Default grid size is 2x2.
37 ///< Override for custom grid size.
38
39=== modified file 'include/animation/gridtransform.h'
40--- include/animation/gridtransform.h 2010-08-24 22:32:07 +0000
41+++ include/animation/gridtransform.h 2012-04-10 06:16:19 +0000
42@@ -15,6 +15,7 @@
43 void updateTransform (GLMatrix &wTransform);
44 void updateBB (CompOutput &output);
45 bool updateBBUsed () { return true; }
46+ bool requiresTransformedWindow () const { return true; }
47
48 protected:
49 bool mUsingTransform; ///< whether transform matrix is used (default: true)
50
51=== modified file 'include/animation/transform.h'
52--- include/animation/transform.h 2010-08-17 21:19:04 +0000
53+++ include/animation/transform.h 2012-04-10 06:16:19 +0000
54@@ -29,6 +29,7 @@
55 virtual void adjustDuration () {}
56 virtual void applyTransform () {}
57 virtual Point getCenter ();
58+ virtual bool requiresTransformedWindow () const { return true; }
59
60 };
61 #endif
62
63=== modified file 'include/animation/zoom.h'
64--- include/animation/zoom.h 2010-08-17 21:19:04 +0000
65+++ include/animation/zoom.h 2012-04-10 06:16:19 +0000
66@@ -34,6 +34,7 @@
67 void getZoomProgress (float *moveProgress,
68 float *scaleProgress,
69 bool neverSpringy);
70+ bool requiresTransformedWindow () const { return true; }
71
72 static const float kDurationFactor;
73 static const float kSpringyDurationFactor;
74@@ -66,5 +67,6 @@
75 float getSpringiness () { return 0; }
76 bool scaleAroundIcon () { return false; }
77 void adjustDuration ();
78+ bool requiresTransformedWindow () const { return true; }
79 };
80 #endif
81
82=== modified file 'src/animation.cpp'
83--- src/animation.cpp 2012-03-20 10:36:39 +0000
84+++ src/animation.cpp 2012-04-10 06:16:19 +0000
85@@ -1265,8 +1265,6 @@
86 mLastRedrawTime = curTime; // Store current time for next time
87 mLastRedrawTimeFresh = true;
88
89- bool animStillInProgress = false;
90-
91 /* Paint list includes destroyed windows */
92 for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
93 rit != pl.rend (); rit++)
94@@ -1281,8 +1279,7 @@
95 if (!curAnim->initialized ())
96 curAnim->init ();
97
98- if (curAnim->prePreparePaint (msSinceLastPaint))
99- animStillInProgress = true;
100+ curAnim->prePreparePaint (msSinceLastPaint);
101
102 /* TODO optimize grid model by reusing one GridModel
103 if (aw->com.mModel &&
104@@ -1345,8 +1342,6 @@
105 bool finished = (curAnim->remainingTime () <= 0);
106 if (finished) // Animation is done
107 windowsFinishedAnimations.push_back (w);
108- else
109- animStillInProgress = true;
110 }
111 }
112
113@@ -1597,8 +1592,8 @@
114
115 //w->indexCount = 0; // TODO check if this is still necessary
116
117- // TODO: should only happen for distorting effects
118- mask |= PAINT_WINDOW_TRANSFORMED_MASK;
119+ if (mCurAnimation->requiresTransformedWindow ())
120+ mask |= PAINT_WINDOW_TRANSFORMED_MASK;
121
122 wAttrib.xScale = 1.0f;
123 wAttrib.yScale = 1.0f;
124
125=== modified file 'src/private.h'
126--- src/private.h 2011-09-19 05:59:09 +0000
127+++ src/private.h 2012-04-10 06:16:19 +0000
128@@ -502,6 +502,7 @@
129 inline bool hasExtraTransform () { return true; }
130 void applyExtraTransform (float progress);
131 inline bool shouldAvoidParallelogramLook () { return true; }
132+ bool requiresTransformedWindow () const { return true; }
133 };
134
135 class WaveAnim :
136@@ -518,6 +519,7 @@
137 void initGrid ();
138 inline bool using3D () { return true; }
139 void step ();
140+ bool requiresTransformedWindow () const { return true; }
141
142 static const float kMinDuration;
143 };
144@@ -540,6 +542,7 @@
145 bool zoomToIcon ();
146 void applyTransform ();
147 float getFadeProgress ();
148+ bool requiresTransformedWindow () const { return true; }
149
150 float getProgress ();
151 virtual void getParams (float *finalDistFac,
152@@ -759,6 +762,7 @@
153 void adjustDuration ();
154 float getFadeProgress ();
155 bool zoomToIcon ();
156+ bool requiresTransformedWindow () const { return true; }
157
158 static const float kDurationFactor;
159 };
160@@ -776,6 +780,7 @@
161 inline bool using3D () { return true; }
162 float getFadeProgress ();
163 void updateWindowAttrib (GLWindowPaintAttrib &attrib);
164+ bool requiresTransformedWindow () const { return true; }
165 };
166
167 class CurvedFoldAnim :
168@@ -797,6 +802,7 @@
169 float sinForProg,
170 float relDistToCenter,
171 float curveMaxAmp);
172+ bool requiresTransformedWindow () const { return true; }
173 };
174
175 class HorizontalFoldsAnim :
176@@ -817,4 +823,5 @@
177 float sinForProg,
178 float relDistToFoldCenter,
179 float foldMaxAmp);
180+ bool requiresTransformedWindow () const { return true; }
181 };

Subscribers

People subscribed via source and target branches