| 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_SQUARE_INK_DROP_ANIMATION_H_ | 5 #ifndef UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ |
| 6 #define UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ | 6 #define UI_VIEWS_ANIMATION_SQUARE_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 public: | 52 public: |
| 53 SquareInkDropAnimation(const gfx::Size& large_size, | 53 SquareInkDropAnimation(const gfx::Size& large_size, |
| 54 int large_corner_radius, | 54 int large_corner_radius, |
| 55 const gfx::Size& small_size, | 55 const gfx::Size& small_size, |
| 56 int small_corner_radius, | 56 int small_corner_radius, |
| 57 const gfx::Point& center_point, | 57 const gfx::Point& center_point, |
| 58 SkColor color); | 58 SkColor color); |
| 59 ~SquareInkDropAnimation() override; | 59 ~SquareInkDropAnimation() override; |
| 60 | 60 |
| 61 // InkDropAnimation: | 61 // InkDropAnimation: |
| 62 void SnapToActivated() override; |
| 62 ui::Layer* GetRootLayer() override; | 63 ui::Layer* GetRootLayer() override; |
| 63 bool IsVisible() const override; | 64 bool IsVisible() const override; |
| 64 | 65 |
| 65 private: | 66 private: |
| 66 friend class test::SquareInkDropAnimationTestApi; | 67 friend class test::SquareInkDropAnimationTestApi; |
| 67 | 68 |
| 68 // Enumeration of the different shapes that compose the ink drop. | 69 // Enumeration of the different shapes that compose the ink drop. |
| 69 enum PaintedShape { | 70 enum PaintedShape { |
| 70 TOP_LEFT_CIRCLE = 0, | 71 TOP_LEFT_CIRCLE = 0, |
| 71 TOP_RIGHT_CIRCLE, | 72 TOP_RIGHT_CIRCLE, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Updates all of the Transforms in |transforms_out| for a rounded rectangle | 132 // Updates all of the Transforms in |transforms_out| for a rounded rectangle |
| 132 // of the given |size| and |corner_radius|. | 133 // of the given |size| and |corner_radius|. |
| 133 void CalculateRectTransforms(const gfx::Size& size, | 134 void CalculateRectTransforms(const gfx::Size& size, |
| 134 float corner_radius, | 135 float corner_radius, |
| 135 InkDropTransforms* transforms_out) const; | 136 InkDropTransforms* transforms_out) const; |
| 136 | 137 |
| 137 // Updates all of the Transforms in |transforms_out| to the current Transforms | 138 // Updates all of the Transforms in |transforms_out| to the current Transforms |
| 138 // of the painted shape Layers. | 139 // of the painted shape Layers. |
| 139 void GetCurrentTransforms(InkDropTransforms* transforms_out) const; | 140 void GetCurrentTransforms(InkDropTransforms* transforms_out) const; |
| 140 | 141 |
| 142 // Updates all of the Transforms in |transforms_out| with the target |
| 143 // Transforms for the ACTIVATED animation. |
| 144 void GetActivatedTargetTransforms(InkDropTransforms* transforms_out) const; |
| 145 |
| 141 // Adds and configures a new |painted_shape| layer to |painted_layers_|. | 146 // Adds and configures a new |painted_shape| layer to |painted_layers_|. |
| 142 void AddPaintLayer(PaintedShape painted_shape); | 147 void AddPaintLayer(PaintedShape painted_shape); |
| 143 | 148 |
| 144 // Maximum size that an ink drop will be drawn to for any InkDropState whose | 149 // Maximum size that an ink drop will be drawn to for any InkDropState whose |
| 145 // final frame should be large. | 150 // final frame should be large. |
| 146 gfx::Size large_size_; | 151 gfx::Size large_size_; |
| 147 | 152 |
| 148 // Corner radius used to draw the rounded rectangles corner for any | 153 // Corner radius used to draw the rounded rectangles corner for any |
| 149 // InkDropState whose final frame should be large. | 154 // InkDropState whose final frame should be large. |
| 150 int large_corner_radius_; | 155 int large_corner_radius_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 170 | 175 |
| 171 // ui::Layers for all of the painted shape layers that compose the ink drop. | 176 // ui::Layers for all of the painted shape layers that compose the ink drop. |
| 172 scoped_ptr<ui::Layer> painted_layers_[PAINTED_SHAPE_COUNT]; | 177 scoped_ptr<ui::Layer> painted_layers_[PAINTED_SHAPE_COUNT]; |
| 173 | 178 |
| 174 DISALLOW_COPY_AND_ASSIGN(SquareInkDropAnimation); | 179 DISALLOW_COPY_AND_ASSIGN(SquareInkDropAnimation); |
| 175 }; | 180 }; |
| 176 | 181 |
| 177 } // namespace views | 182 } // namespace views |
| 178 | 183 |
| 179 #endif // UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ | 184 #endif // UI_VIEWS_ANIMATION_SQUARE_INK_DROP_ANIMATION_H_ |
| OLD | NEW |