diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 22:16:46 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 22:16:46 +0000 |
commit | 9badb4e5b7512e9f18d07e252bfa43c3b26653b4 (patch) | |
tree | b66bacaa7163b9254962f433f48389e89ac05097 /ash/rotator/screen_rotation.h | |
parent | 0273969d8ffd29497e074478c07db701058d8167 (diff) | |
download | chromium_src-9badb4e5b7512e9f18d07e252bfa43c3b26653b4.zip chromium_src-9badb4e5b7512e9f18d07e252bfa43c3b26653b4.tar.gz chromium_src-9badb4e5b7512e9f18d07e252bfa43c3b26653b4.tar.bz2 |
Fix window rotation animation not ending cleanly
cros: Sometimes the animation would leave windows partially rotated because
it grabbed the current transform (and hence rotation) of the windows
rather than the target. If an animation was already playing this could
compute an incorrect ending transform. Also cleaned up some includes.
BUG=173139
TEST=manual, hit Ctrl-Alt-Shift-F3 repeatedly, windows should always return to original position
Review URL: https://chromiumcodereview.appspot.com/12083004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179712 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/rotator/screen_rotation.h')
-rw-r--r-- | ash/rotator/screen_rotation.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ash/rotator/screen_rotation.h b/ash/rotator/screen_rotation.h index 83d696c..339b99f 100644 --- a/ash/rotator/screen_rotation.h +++ b/ash/rotator/screen_rotation.h @@ -8,14 +8,12 @@ #include "ash/ash_export.h" #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" -#include "ui/base/animation/animation_delegate.h" -#include "ui/compositor/compositor_export.h" #include "ui/compositor/layer_animation_element.h" #include "ui/gfx/point.h" namespace ui { class InterpolatedTransform; -class LayerAnimationDelegate; +class Layer; } namespace aura { @@ -30,16 +28,15 @@ namespace ash { // in the middle of a transition. 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. - // |delegate| is usually a layer. - ScreenRotation(int degrees, ui::LayerAnimationDelegate* delegate); + // |degrees| are clockwise. |layer| is the target of the animation. Does not + // take ownership of |layer|. + ScreenRotation(int degrees, ui::Layer* layer); virtual ~ScreenRotation(); private: // Generates the intermediate transformation matrices used during the // animation. - void InitTransform(ui::LayerAnimationDelegate* delegate); + void InitTransform(ui::Layer* layer); // Implementation of ui::LayerAnimationDelegate virtual void OnStart(ui::LayerAnimationDelegate* delegate) OVERRIDE; @@ -56,7 +53,7 @@ class ASH_EXPORT ScreenRotation : public ui::LayerAnimationElement { // The number of degrees to rotate. int degrees_; - // The target origin + // The target origin. gfx::Point new_origin_; DISALLOW_COPY_AND_ASSIGN(ScreenRotation); |