| 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 #include <climits> | 8 #include <climits> |
| 9 | 9 |
| 10 #include "cc/animation/animation_curve.h" | 10 #include "cc/animation/animation_curve.h" |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 scroll_layer_->element_id()); | 804 scroll_layer_->element_id()); |
| 805 EXPECT_TRUE( | 805 EXPECT_TRUE( |
| 806 animation_host()->scroll_offset_animations().HasUpdatesForTesting()); | 806 animation_host()->scroll_offset_animations().HasUpdatesForTesting()); |
| 807 } | 807 } |
| 808 } | 808 } |
| 809 | 809 |
| 810 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 810 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 811 if (host_impl->sync_tree()->source_frame_number() == 0) { | 811 if (host_impl->sync_tree()->source_frame_number() == 0) { |
| 812 GetImplAnimationHost(host_impl)->ImplOnlyScrollAnimationCreate( | 812 GetImplAnimationHost(host_impl)->ImplOnlyScrollAnimationCreate( |
| 813 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f), | 813 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f), |
| 814 gfx::ScrollOffset(10, 20), base::TimeDelta()); | 814 gfx::ScrollOffset(10, 20), base::TimeDelta(), base::TimeDelta()); |
| 815 } | 815 } |
| 816 } | 816 } |
| 817 | 817 |
| 818 void NotifyAnimationTakeover(base::TimeTicks monotonic_time, | 818 void NotifyAnimationTakeover(base::TimeTicks monotonic_time, |
| 819 TargetProperty::Type target_property, | 819 TargetProperty::Type target_property, |
| 820 double animation_start_time, | 820 double animation_start_time, |
| 821 std::unique_ptr<AnimationCurve> curve) override { | 821 std::unique_ptr<AnimationCurve> curve) override { |
| 822 EndTest(); | 822 EndTest(); |
| 823 } | 823 } |
| 824 | 824 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 EXPECT_EQ(gfx::ScrollOffset(10.f, 20.f), | 899 EXPECT_EQ(gfx::ScrollOffset(10.f, 20.f), |
| 900 curve->GetValue(base::TimeDelta())); | 900 curve->GetValue(base::TimeDelta())); |
| 901 EXPECT_EQ(gfx::ScrollOffset(650.f, 750.f), curve->target_value()); | 901 EXPECT_EQ(gfx::ScrollOffset(650.f, 750.f), curve->target_value()); |
| 902 } | 902 } |
| 903 } | 903 } |
| 904 | 904 |
| 905 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 905 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 906 if (host_impl->sync_tree()->source_frame_number() == 0) { | 906 if (host_impl->sync_tree()->source_frame_number() == 0) { |
| 907 GetImplAnimationHost(host_impl)->ImplOnlyScrollAnimationCreate( | 907 GetImplAnimationHost(host_impl)->ImplOnlyScrollAnimationCreate( |
| 908 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f), | 908 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f), |
| 909 gfx::ScrollOffset(10, 20), base::TimeDelta()); | 909 gfx::ScrollOffset(10, 20), base::TimeDelta(), base::TimeDelta()); |
| 910 } | 910 } |
| 911 } | 911 } |
| 912 | 912 |
| 913 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 913 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 914 if (host_impl->sync_tree()->source_frame_number() == 1) { | 914 if (host_impl->sync_tree()->source_frame_number() == 1) { |
| 915 Animation* animation = ScrollOffsetPlayer(*host_impl, scroll_layer_) | 915 Animation* animation = ScrollOffsetPlayer(*host_impl, scroll_layer_) |
| 916 .GetAnimation(TargetProperty::SCROLL_OFFSET); | 916 .GetAnimation(TargetProperty::SCROLL_OFFSET); |
| 917 DCHECK(animation); | 917 DCHECK(animation); |
| 918 ScrollOffsetAnimationCurve* curve = | 918 ScrollOffsetAnimationCurve* curve = |
| 919 animation->curve()->ToScrollOffsetAnimationCurve(); | 919 animation->curve()->ToScrollOffsetAnimationCurve(); |
| (...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 private: | 1967 private: |
| 1968 scoped_refptr<Layer> layer_; | 1968 scoped_refptr<Layer> layer_; |
| 1969 FakeContentLayerClient client_; | 1969 FakeContentLayerClient client_; |
| 1970 }; | 1970 }; |
| 1971 | 1971 |
| 1972 MULTI_THREAD_TEST_F( | 1972 MULTI_THREAD_TEST_F( |
| 1973 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); | 1973 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); |
| 1974 | 1974 |
| 1975 } // namespace | 1975 } // namespace |
| 1976 } // namespace cc | 1976 } // namespace cc |
| OLD | NEW |