diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-27 05:51:20 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-27 05:51:20 +0000 |
commit | 8d2a9a32d0d09d09abf561bea48e97e436f84609 (patch) | |
tree | ac5e6cb24a9e0f05ba32ad735a0648982d909d11 /ash/rotator/screen_rotation.h | |
parent | 4f0e111044e56a31274813aecd8ae1384e6a0a12 (diff) | |
download | chromium_src-8d2a9a32d0d09d09abf561bea48e97e436f84609.zip chromium_src-8d2a9a32d0d09d09abf561bea48e97e436f84609.tar.gz chromium_src-8d2a9a32d0d09d09abf561bea48e97e436f84609.tar.bz2 |
cros: Fix crash with screen rotation animation
Ensure the interpolated_transform_ member is initialized in the constructor
such that OnGetTarget() can be called before OnStart(). I added the animation
delegate to the constructor as we need it to initialize the transformation
matrix.
BUG=172328
TEST=manual, Ctrl-Alt-Shift-F3 should spin the windows and not crash
Review URL: https://chromiumcodereview.appspot.com/12087009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179082 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/rotator/screen_rotation.h')
-rw-r--r-- | ash/rotator/screen_rotation.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ash/rotator/screen_rotation.h b/ash/rotator/screen_rotation.h index 88bad2b..83d696c 100644 --- a/ash/rotator/screen_rotation.h +++ b/ash/rotator/screen_rotation.h @@ -32,10 +32,15 @@ class ASH_EXPORT ScreenRotation : public ui::LayerAnimationElement { public: // The screen rotation does not own the view or the listener, and these // objects are required to outlive the Screen rotation object. - ScreenRotation(int degrees); + // |delegate| is usually a layer. + ScreenRotation(int degrees, ui::LayerAnimationDelegate* delegate); virtual ~ScreenRotation(); private: + // Generates the intermediate transformation matrices used during the + // animation. + void InitTransform(ui::LayerAnimationDelegate* delegate); + // Implementation of ui::LayerAnimationDelegate virtual void OnStart(ui::LayerAnimationDelegate* delegate) OVERRIDE; virtual bool OnProgress(double t, @@ -46,8 +51,6 @@ class ASH_EXPORT ScreenRotation : public ui::LayerAnimationElement { static const ui::LayerAnimationElement::AnimatableProperties& GetProperties(); - // Generates the intermediate transformation matrices used during the - // animation. scoped_ptr<ui::InterpolatedTransform> interpolated_transform_; // The number of degrees to rotate. |