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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 public: | 765 public: |
766 LayerTreeHostAnimationTestScrollOffsetAnimationTakeover() {} | 766 LayerTreeHostAnimationTestScrollOffsetAnimationTakeover() {} |
767 | 767 |
768 void SetupTree() override { | 768 void SetupTree() override { |
769 LayerTreeHostAnimationTest::SetupTree(); | 769 LayerTreeHostAnimationTest::SetupTree(); |
770 | 770 |
771 scroll_layer_ = FakePictureLayer::Create(&client_); | 771 scroll_layer_ = FakePictureLayer::Create(&client_); |
772 scroll_layer_->SetBounds(gfx::Size(10000, 10000)); | 772 scroll_layer_->SetBounds(gfx::Size(10000, 10000)); |
773 client_.set_bounds(scroll_layer_->bounds()); | 773 client_.set_bounds(scroll_layer_->bounds()); |
774 scroll_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20)); | 774 scroll_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20)); |
| 775 scroll_layer_->SetScrollClipLayerId(layer_tree()->root_layer()->id()); |
775 layer_tree()->root_layer()->AddChild(scroll_layer_); | 776 layer_tree()->root_layer()->AddChild(scroll_layer_); |
776 | 777 |
777 AttachPlayersToTimeline(); | 778 AttachPlayersToTimeline(); |
778 player_child_->AttachElement(scroll_layer_->element_id()); | 779 player_child_->AttachElement(scroll_layer_->element_id()); |
779 // Allows NotifyAnimationTakeover to get called. | 780 // Allows NotifyAnimationTakeover to get called. |
780 player_child_->set_animation_delegate(this); | 781 player_child_->set_animation_delegate(this); |
781 } | 782 } |
782 | 783 |
783 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 784 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
784 | 785 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 public: | 829 public: |
829 LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted() {} | 830 LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted() {} |
830 | 831 |
831 void SetupTree() override { | 832 void SetupTree() override { |
832 LayerTreeHostAnimationTest::SetupTree(); | 833 LayerTreeHostAnimationTest::SetupTree(); |
833 | 834 |
834 scroll_layer_ = FakePictureLayer::Create(&client_); | 835 scroll_layer_ = FakePictureLayer::Create(&client_); |
835 scroll_layer_->SetBounds(gfx::Size(10000, 10000)); | 836 scroll_layer_->SetBounds(gfx::Size(10000, 10000)); |
836 client_.set_bounds(scroll_layer_->bounds()); | 837 client_.set_bounds(scroll_layer_->bounds()); |
837 scroll_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20)); | 838 scroll_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20)); |
| 839 scroll_layer_->SetScrollClipLayerId(layer_tree()->root_layer()->id()); |
838 layer_tree()->root_layer()->AddChild(scroll_layer_); | 840 layer_tree()->root_layer()->AddChild(scroll_layer_); |
839 | 841 |
840 AttachPlayersToTimeline(); | 842 AttachPlayersToTimeline(); |
841 player_child_->AttachElement(scroll_layer_->element_id()); | 843 player_child_->AttachElement(scroll_layer_->element_id()); |
842 } | 844 } |
843 | 845 |
844 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 846 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
845 | 847 |
846 void DidCommit() override { | 848 void DidCommit() override { |
847 if (layer_tree_host()->SourceFrameNumber() == 1) { | 849 if (layer_tree_host()->SourceFrameNumber() == 1) { |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1856 private: | 1858 private: |
1857 scoped_refptr<Layer> layer_; | 1859 scoped_refptr<Layer> layer_; |
1858 FakeContentLayerClient client_; | 1860 FakeContentLayerClient client_; |
1859 }; | 1861 }; |
1860 | 1862 |
1861 MULTI_THREAD_TEST_F( | 1863 MULTI_THREAD_TEST_F( |
1862 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); | 1864 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); |
1863 | 1865 |
1864 } // namespace | 1866 } // namespace |
1865 } // namespace cc | 1867 } // namespace cc |
OLD | NEW |