| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef UI_VIEWS_ANIMATION_FLOOD_FILL_INK_DROP_ANIMATION_H_ | 5 #ifndef UI_VIEWS_ANIMATION_FLOOD_FILL_INK_DROP_ANIMATION_H_ |
| 6 #define UI_VIEWS_ANIMATION_FLOOD_FILL_INK_DROP_ANIMATION_H_ | 6 #define UI_VIEWS_ANIMATION_FLOOD_FILL_INK_DROP_ANIMATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // {All InkDropStates} => DEACTIVATED | 47 // {All InkDropStates} => DEACTIVATED |
| 48 // | 48 // |
| 49 class VIEWS_EXPORT FloodFillInkDropAnimation : public InkDropAnimation { | 49 class VIEWS_EXPORT FloodFillInkDropAnimation : public InkDropAnimation { |
| 50 public: | 50 public: |
| 51 FloodFillInkDropAnimation(const gfx::Size& size, | 51 FloodFillInkDropAnimation(const gfx::Size& size, |
| 52 const gfx::Point& center_point, | 52 const gfx::Point& center_point, |
| 53 SkColor color); | 53 SkColor color); |
| 54 ~FloodFillInkDropAnimation() override; | 54 ~FloodFillInkDropAnimation() override; |
| 55 | 55 |
| 56 // InkDropAnimation: | 56 // InkDropAnimation: |
| 57 void SnapToActivated() override; |
| 57 ui::Layer* GetRootLayer() override; | 58 ui::Layer* GetRootLayer() override; |
| 58 bool IsVisible() const override; | 59 bool IsVisible() const override; |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 friend class test::FloodFillInkDropAnimationTestApi; | 62 friend class test::FloodFillInkDropAnimationTestApi; |
| 62 | 63 |
| 63 // InkDropAnimation: | 64 // InkDropAnimation: |
| 64 void AnimateStateChange(InkDropState old_ink_drop_state, | 65 void AnimateStateChange(InkDropState old_ink_drop_state, |
| 65 InkDropState new_ink_drop_state, | 66 InkDropState new_ink_drop_state, |
| 66 ui::LayerAnimationObserver* observer) override; | 67 ui::LayerAnimationObserver* observer) override; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 90 float opacity, | 91 float opacity, |
| 91 base::TimeDelta duration, | 92 base::TimeDelta duration, |
| 92 ui::LayerAnimator::PreemptionStrategy preemption_strategy, | 93 ui::LayerAnimator::PreemptionStrategy preemption_strategy, |
| 93 gfx::Tween::Type tween, | 94 gfx::Tween::Type tween, |
| 94 ui::LayerAnimationObserver* observer); | 95 ui::LayerAnimationObserver* observer); |
| 95 | 96 |
| 96 // Returns the Transform to be applied to the |painted_layer_| for the given | 97 // Returns the Transform to be applied to the |painted_layer_| for the given |
| 97 // |target_radius|. | 98 // |target_radius|. |
| 98 gfx::Transform CalculateTransform(float target_radius) const; | 99 gfx::Transform CalculateTransform(float target_radius) const; |
| 99 | 100 |
| 101 // Returns the target Transform for the ACTIVATED animation. |
| 102 gfx::Transform GetActivatedTargetTransform() const; |
| 103 |
| 100 // The clip Size. | 104 // The clip Size. |
| 101 const gfx::Size size_; | 105 const gfx::Size size_; |
| 102 | 106 |
| 103 // The point where the Center of the ink drop's circle should be drawn. | 107 // The point where the Center of the ink drop's circle should be drawn. |
| 104 gfx::Point center_point_; | 108 gfx::Point center_point_; |
| 105 | 109 |
| 106 // The root layer that parents the animating layer. The root layer is used to | 110 // The root layer that parents the animating layer. The root layer is used to |
| 107 // manipulate opacity and clipping bounds, and it child is used to manipulate | 111 // manipulate opacity and clipping bounds, and it child is used to manipulate |
| 108 // the different shape of the ink drop. | 112 // the different shape of the ink drop. |
| 109 ui::Layer root_layer_; | 113 ui::Layer root_layer_; |
| 110 | 114 |
| 111 // ui::LayerDelegate to paint the |painted_layer_|. | 115 // ui::LayerDelegate to paint the |painted_layer_|. |
| 112 CircleLayerDelegate circle_layer_delegate_; | 116 CircleLayerDelegate circle_layer_delegate_; |
| 113 | 117 |
| 114 // Child ui::Layer of |root_layer_|. Used to manipulate the different size | 118 // Child ui::Layer of |root_layer_|. Used to manipulate the different size |
| 115 // and shape of the ink drop. | 119 // and shape of the ink drop. |
| 116 ui::Layer painted_layer_; | 120 ui::Layer painted_layer_; |
| 117 | 121 |
| 118 // The current ink drop state. | 122 // The current ink drop state. |
| 119 InkDropState ink_drop_state_; | 123 InkDropState ink_drop_state_; |
| 120 | 124 |
| 121 DISALLOW_COPY_AND_ASSIGN(FloodFillInkDropAnimation); | 125 DISALLOW_COPY_AND_ASSIGN(FloodFillInkDropAnimation); |
| 122 }; | 126 }; |
| 123 | 127 |
| 124 } // namespace views | 128 } // namespace views |
| 125 | 129 |
| 126 #endif // UI_VIEWS_ANIMATION_FLOOD_FILL_INK_DROP_ANIMATION_H_ | 130 #endif // UI_VIEWS_ANIMATION_FLOOD_FILL_INK_DROP_ANIMATION_H_ |
| OLD | NEW |