| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ui/views/animation/test/square_ink_drop_animation_test_api.h" | |
| 6 | |
| 7 #include <vector> | |
| 8 | |
| 9 #include "base/time/time.h" | |
| 10 #include "ui/compositor/layer.h" | |
| 11 #include "ui/compositor/layer_animator.h" | |
| 12 #include "ui/compositor/test/layer_animator_test_controller.h" | |
| 13 #include "ui/views/animation/ink_drop_animation.h" | |
| 14 | |
| 15 namespace views { | |
| 16 namespace test { | |
| 17 | |
| 18 SquareInkDropAnimationTestApi::SquareInkDropAnimationTestApi( | |
| 19 SquareInkDropAnimation* ink_drop_animation) | |
| 20 : InkDropAnimationTestApi(ink_drop_animation) {} | |
| 21 | |
| 22 SquareInkDropAnimationTestApi::~SquareInkDropAnimationTestApi() {} | |
| 23 | |
| 24 void SquareInkDropAnimationTestApi::CalculateCircleTransforms( | |
| 25 const gfx::Size& size, | |
| 26 InkDropTransforms* transforms_out) const { | |
| 27 ink_drop_animation()->CalculateCircleTransforms(size, transforms_out); | |
| 28 } | |
| 29 void SquareInkDropAnimationTestApi::CalculateRectTransforms( | |
| 30 const gfx::Size& size, | |
| 31 float corner_radius, | |
| 32 InkDropTransforms* transforms_out) const { | |
| 33 ink_drop_animation()->CalculateRectTransforms(size, corner_radius, | |
| 34 transforms_out); | |
| 35 } | |
| 36 | |
| 37 float SquareInkDropAnimationTestApi::GetCurrentOpacity() const { | |
| 38 return ink_drop_animation()->GetCurrentOpacity(); | |
| 39 } | |
| 40 | |
| 41 std::vector<ui::LayerAnimator*> | |
| 42 SquareInkDropAnimationTestApi::GetLayerAnimators() { | |
| 43 std::vector<ui::LayerAnimator*> animators = | |
| 44 InkDropAnimationTestApi::GetLayerAnimators(); | |
| 45 animators.push_back(ink_drop_animation()->GetRootLayer()->GetAnimator()); | |
| 46 for (int i = 0; i < SquareInkDropAnimation::PAINTED_SHAPE_COUNT; ++i) | |
| 47 animators.push_back( | |
| 48 ink_drop_animation()->painted_layers_[i]->GetAnimator()); | |
| 49 return animators; | |
| 50 } | |
| 51 | |
| 52 } // namespace test | |
| 53 } // namespace views | |
| OLD | NEW |