| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 settings->layer_transforms_should_scale_layer_contents = true; | 1743 settings->layer_transforms_should_scale_layer_contents = true; |
| 1744 } | 1744 } |
| 1745 | 1745 |
| 1746 void SetupTree() override { | 1746 void SetupTree() override { |
| 1747 root_layer_ = Layer::Create(); | 1747 root_layer_ = Layer::Create(); |
| 1748 root_layer_->SetBounds(gfx::Size(10, 20)); | 1748 root_layer_->SetBounds(gfx::Size(10, 20)); |
| 1749 | 1749 |
| 1750 bool paint_scrollbar = true; | 1750 bool paint_scrollbar = true; |
| 1751 bool has_thumb = false; | 1751 bool has_thumb = false; |
| 1752 scrollbar_ = FakePaintedScrollbarLayer::Create(paint_scrollbar, has_thumb, | 1752 scrollbar_ = FakePaintedScrollbarLayer::Create(paint_scrollbar, has_thumb, |
| 1753 root_layer_->id()); | 1753 root_layer_->id(), |
| 1754 root_layer_->element_id()); |
| 1754 scrollbar_->SetPosition(gfx::PointF(0.f, 10.f)); | 1755 scrollbar_->SetPosition(gfx::PointF(0.f, 10.f)); |
| 1755 scrollbar_->SetBounds(gfx::Size(10, 10)); | 1756 scrollbar_->SetBounds(gfx::Size(10, 10)); |
| 1756 | 1757 |
| 1757 root_layer_->AddChild(scrollbar_); | 1758 root_layer_->AddChild(scrollbar_); |
| 1758 | 1759 |
| 1759 layer_tree_host()->SetRootLayer(root_layer_); | 1760 layer_tree_host()->SetRootLayer(root_layer_); |
| 1760 LayerTreeHostTest::SetupTree(); | 1761 LayerTreeHostTest::SetupTree(); |
| 1761 client_.set_bounds(root_layer_->bounds()); | 1762 client_.set_bounds(root_layer_->bounds()); |
| 1762 } | 1763 } |
| 1763 | 1764 |
| (...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3730 protected: | 3731 protected: |
| 3731 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 3732 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 3732 | 3733 |
| 3733 void SetupTree() override { | 3734 void SetupTree() override { |
| 3734 root_ = Layer::Create(); | 3735 root_ = Layer::Create(); |
| 3735 root_->SetBounds(gfx::Size(1, 1)); | 3736 root_->SetBounds(gfx::Size(1, 1)); |
| 3736 | 3737 |
| 3737 bool paint_scrollbar = true; | 3738 bool paint_scrollbar = true; |
| 3738 bool has_thumb = false; | 3739 bool has_thumb = false; |
| 3739 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( | 3740 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( |
| 3740 paint_scrollbar, has_thumb, root_->id()); | 3741 paint_scrollbar, has_thumb, root_->id(), root_->element_id()); |
| 3741 | 3742 |
| 3742 root_->AddChild(scrollbar_layer_); | 3743 root_->AddChild(scrollbar_layer_); |
| 3743 | 3744 |
| 3744 layer_tree_host()->SetRootLayer(root_); | 3745 layer_tree_host()->SetRootLayer(root_); |
| 3745 LayerTreeHostTest::SetupTree(); | 3746 LayerTreeHostTest::SetupTree(); |
| 3746 } | 3747 } |
| 3747 | 3748 |
| 3748 void DidCommitAndDrawFrame() override { | 3749 void DidCommitAndDrawFrame() override { |
| 3749 switch (layer_tree_host()->SourceFrameNumber()) { | 3750 switch (layer_tree_host()->SourceFrameNumber()) { |
| 3750 case 0: | 3751 case 0: |
| (...skipping 3763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7514 DCHECK_EQ(hud->scroll_tree_index(), root_layer->scroll_tree_index()); | 7515 DCHECK_EQ(hud->scroll_tree_index(), root_layer->scroll_tree_index()); |
| 7515 } | 7516 } |
| 7516 | 7517 |
| 7517 void AfterTest() override {} | 7518 void AfterTest() override {} |
| 7518 }; | 7519 }; |
| 7519 | 7520 |
| 7520 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestHudLayerWithLayerLists); | 7521 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestHudLayerWithLayerLists); |
| 7521 | 7522 |
| 7522 } // namespace | 7523 } // namespace |
| 7523 } // namespace cc | 7524 } // namespace cc |
| OLD | NEW |