OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/rotator/screen_rotation.h" | 5 #include "ash/rotator/screen_rotation.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "ui/compositor/layer_animation_delegate.h" | 9 #include "ui/compositor/layer_animation_delegate.h" |
10 #include "ui/gfx/interpolated_transform.h" | 10 #include "ui/gfx/interpolated_transform.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 ScreenRotation::~ScreenRotation() { | 40 ScreenRotation::~ScreenRotation() { |
41 } | 41 } |
42 | 42 |
43 void ScreenRotation::OnStart(ui::LayerAnimationDelegate* delegate) { | 43 void ScreenRotation::OnStart(ui::LayerAnimationDelegate* delegate) { |
44 // No rotation required. | 44 // No rotation required. |
45 if (degrees_ == 0) | 45 if (degrees_ == 0) |
46 return; | 46 return; |
47 | 47 |
48 const ui::Transform& current_transform = | 48 const gfx::Transform& current_transform = |
49 delegate->GetTransformForAnimation(); | 49 delegate->GetTransformForAnimation(); |
50 const gfx::Rect& bounds = delegate->GetBoundsForAnimation(); | 50 const gfx::Rect& bounds = delegate->GetBoundsForAnimation(); |
51 | 51 |
52 gfx::Point old_pivot; | 52 gfx::Point old_pivot; |
53 gfx::Point new_pivot; | 53 gfx::Point new_pivot; |
54 | 54 |
55 int width = bounds.width(); | 55 int width = bounds.width(); |
56 int height = bounds.height(); | 56 int height = bounds.height(); |
57 | 57 |
58 switch (degrees_) { | 58 switch (degrees_) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // static | 117 // static |
118 const ui::LayerAnimationElement::AnimatableProperties& | 118 const ui::LayerAnimationElement::AnimatableProperties& |
119 ScreenRotation::GetProperties() { | 119 ScreenRotation::GetProperties() { |
120 static ui::LayerAnimationElement::AnimatableProperties properties; | 120 static ui::LayerAnimationElement::AnimatableProperties properties; |
121 if (properties.empty()) | 121 if (properties.empty()) |
122 properties.insert(ui::LayerAnimationElement::TRANSFORM); | 122 properties.insert(ui::LayerAnimationElement::TRANSFORM); |
123 return properties; | 123 return properties; |
124 } | 124 } |
125 | 125 |
126 } // namespace ash | 126 } // namespace ash |
OLD | NEW |