Chromium Code Reviews| 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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 888 // This happens after the impl-only animation is added in | 888 // This happens after the impl-only animation is added in |
| 889 // WillCommitCompleteOnThread. | 889 // WillCommitCompleteOnThread. |
| 890 Animation* animation = ScrollOffsetPlayer(*host_impl, scroll_layer_) | 890 Animation* animation = ScrollOffsetPlayer(*host_impl, scroll_layer_) |
| 891 .GetAnimation(TargetProperty::SCROLL_OFFSET); | 891 .GetAnimation(TargetProperty::SCROLL_OFFSET); |
| 892 DCHECK(animation); | 892 DCHECK(animation); |
| 893 ScrollOffsetAnimationCurve* curve = | 893 ScrollOffsetAnimationCurve* curve = |
| 894 animation->curve()->ToScrollOffsetAnimationCurve(); | 894 animation->curve()->ToScrollOffsetAnimationCurve(); |
| 895 | 895 |
| 896 // Verifiy the initial and target position before the scroll offset | 896 // Verifiy the initial and target position before the scroll offset |
| 897 // update from MT. | 897 // update from MT. |
| 898 EXPECT_EQ(Animation::RunState::RUNNING, animation->run_state()); | |
|
ajuma
2017/02/10 16:19:05
This will be STARTING if the first draw hasn't hap
| |
| 899 EXPECT_EQ(gfx::ScrollOffset(10.f, 20.f), | 898 EXPECT_EQ(gfx::ScrollOffset(10.f, 20.f), |
| 900 curve->GetValue(base::TimeDelta())); | 899 curve->GetValue(base::TimeDelta())); |
| 901 EXPECT_EQ(gfx::ScrollOffset(650.f, 750.f), curve->target_value()); | 900 EXPECT_EQ(gfx::ScrollOffset(650.f, 750.f), curve->target_value()); |
| 902 } | 901 } |
| 903 } | 902 } |
| 904 | 903 |
| 905 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 904 void WillCommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 906 if (host_impl->sync_tree()->source_frame_number() == 0) { | 905 if (host_impl->sync_tree()->source_frame_number() == 0) { |
| 907 GetImplAnimationHost(host_impl)->ImplOnlyScrollAnimationCreate( | 906 GetImplAnimationHost(host_impl)->ImplOnlyScrollAnimationCreate( |
| 908 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f), | 907 scroll_layer_->element_id(), gfx::ScrollOffset(650.f, 750.f), |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1862 private: | 1861 private: |
| 1863 scoped_refptr<Layer> layer_; | 1862 scoped_refptr<Layer> layer_; |
| 1864 FakeContentLayerClient client_; | 1863 FakeContentLayerClient client_; |
| 1865 }; | 1864 }; |
| 1866 | 1865 |
| 1867 MULTI_THREAD_TEST_F( | 1866 MULTI_THREAD_TEST_F( |
| 1868 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); | 1867 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); |
| 1869 | 1868 |
| 1870 } // namespace | 1869 } // namespace |
| 1871 } // namespace cc | 1870 } // namespace cc |
| OLD | NEW |