OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "cc/animation/animation_curve.h" | 9 #include "cc/animation/animation_curve.h" |
10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 switch (layer_tree_host()->SourceFrameNumber()) { | 735 switch (layer_tree_host()->SourceFrameNumber()) { |
736 case 1: { | 736 case 1: { |
737 std::unique_ptr<ScrollOffsetAnimationCurve> curve( | 737 std::unique_ptr<ScrollOffsetAnimationCurve> curve( |
738 ScrollOffsetAnimationCurve::Create( | 738 ScrollOffsetAnimationCurve::Create( |
739 gfx::ScrollOffset(500.f, 550.f), | 739 gfx::ScrollOffset(500.f, 550.f), |
740 CubicBezierTimingFunction::CreatePreset( | 740 CubicBezierTimingFunction::CreatePreset( |
741 CubicBezierTimingFunction::EaseType::EASE_IN_OUT))); | 741 CubicBezierTimingFunction::EaseType::EASE_IN_OUT))); |
742 std::unique_ptr<Animation> animation(Animation::Create( | 742 std::unique_ptr<Animation> animation(Animation::Create( |
743 std::move(curve), 1, 0, TargetProperty::SCROLL_OFFSET)); | 743 std::move(curve), 1, 0, TargetProperty::SCROLL_OFFSET)); |
744 animation->set_needs_synchronized_start_time(true); | 744 animation->set_needs_synchronized_start_time(true); |
745 bool impl_scrolling_supported = | 745 bool impl_scrolling_supported = proxy()->SupportsImplScrolling(); |
746 layer_tree_host()->proxy()->SupportsImplScrolling(); | |
747 if (impl_scrolling_supported) | 746 if (impl_scrolling_supported) |
748 player_child_->AddAnimation(std::move(animation)); | 747 player_child_->AddAnimation(std::move(animation)); |
749 else | 748 else |
750 EndTest(); | 749 EndTest(); |
751 break; | 750 break; |
752 } | 751 } |
753 default: | 752 default: |
754 if (scroll_layer_->scroll_offset().x() > 10 && | 753 if (scroll_layer_->scroll_offset().x() > 10 && |
755 scroll_layer_->scroll_offset().y() > 20) | 754 scroll_layer_->scroll_offset().y() > 20) |
756 EndTest(); | 755 EndTest(); |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 } | 1650 } |
1652 | 1651 |
1653 void BeginTest() override { | 1652 void BeginTest() override { |
1654 PostAddLongAnimationToMainThreadPlayer(player_.get()); | 1653 PostAddLongAnimationToMainThreadPlayer(player_.get()); |
1655 } | 1654 } |
1656 | 1655 |
1657 void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 1656 void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
1658 TargetProperty::Type target_property, | 1657 TargetProperty::Type target_property, |
1659 int group) override { | 1658 int group) override { |
1660 called_animation_started_ = true; | 1659 called_animation_started_ = true; |
1661 layer_tree_host()->AnimateLayers(base::TimeTicks::FromInternalValue( | 1660 layer_tree_host_in_process()->AnimateLayers( |
1662 std::numeric_limits<int64_t>::max())); | 1661 base::TimeTicks::FromInternalValue( |
| 1662 std::numeric_limits<int64_t>::max())); |
1663 PostSetNeedsCommitToMainThread(); | 1663 PostSetNeedsCommitToMainThread(); |
1664 } | 1664 } |
1665 | 1665 |
1666 void NotifyAnimationFinished(base::TimeTicks monotonic_time, | 1666 void NotifyAnimationFinished(base::TimeTicks monotonic_time, |
1667 TargetProperty::Type target_property, | 1667 TargetProperty::Type target_property, |
1668 int group) override { | 1668 int group) override { |
1669 called_animation_finished_ = true; | 1669 called_animation_finished_ = true; |
1670 EndTest(); | 1670 EndTest(); |
1671 } | 1671 } |
1672 | 1672 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 private: | 1872 private: |
1873 scoped_refptr<Layer> layer_; | 1873 scoped_refptr<Layer> layer_; |
1874 FakeContentLayerClient client_; | 1874 FakeContentLayerClient client_; |
1875 }; | 1875 }; |
1876 | 1876 |
1877 MULTI_THREAD_TEST_F( | 1877 MULTI_THREAD_TEST_F( |
1878 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); | 1878 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); |
1879 | 1879 |
1880 } // namespace | 1880 } // namespace |
1881 } // namespace cc | 1881 } // namespace cc |
OLD | NEW |