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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
9 #include "cc/layers/delegated_frame_provider.h" | 9 #include "cc/layers/delegated_frame_provider.h" |
10 #include "cc/layers/delegated_frame_resource_collection.h" | 10 #include "cc/layers/delegated_frame_resource_collection.h" |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 root->AddChild(io_surface); | 1083 root->AddChild(io_surface); |
1084 } | 1084 } |
1085 | 1085 |
1086 // Enable the hud. | 1086 // Enable the hud. |
1087 LayerTreeDebugState debug_state; | 1087 LayerTreeDebugState debug_state; |
1088 debug_state.show_property_changed_rects = true; | 1088 debug_state.show_property_changed_rects = true; |
1089 layer_tree_host()->SetDebugState(debug_state); | 1089 layer_tree_host()->SetDebugState(debug_state); |
1090 | 1090 |
1091 scoped_refptr<PaintedScrollbarLayer> scrollbar = | 1091 scoped_refptr<PaintedScrollbarLayer> scrollbar = |
1092 PaintedScrollbarLayer::Create( | 1092 PaintedScrollbarLayer::Create( |
1093 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content.get()); | 1093 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content->id()); |
1094 scrollbar->SetBounds(gfx::Size(10, 10)); | 1094 scrollbar->SetBounds(gfx::Size(10, 10)); |
1095 scrollbar->SetAnchorPoint(gfx::PointF()); | 1095 scrollbar->SetAnchorPoint(gfx::PointF()); |
1096 scrollbar->SetIsDrawable(true); | 1096 scrollbar->SetIsDrawable(true); |
1097 root->AddChild(scrollbar); | 1097 root->AddChild(scrollbar); |
1098 | 1098 |
1099 layer_tree_host()->SetRootLayer(root); | 1099 layer_tree_host()->SetRootLayer(root); |
1100 LayerTreeHostContextTest::SetupTree(); | 1100 LayerTreeHostContextTest::SetupTree(); |
1101 } | 1101 } |
1102 | 1102 |
1103 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 1103 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 }; | 1448 }; |
1449 | 1449 |
1450 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); | 1450 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); |
1451 | 1451 |
1452 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { | 1452 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { |
1453 public: | 1453 public: |
1454 ScrollbarLayerLostContext() : commits_(0) {} | 1454 ScrollbarLayerLostContext() : commits_(0) {} |
1455 | 1455 |
1456 virtual void BeginTest() OVERRIDE { | 1456 virtual void BeginTest() OVERRIDE { |
1457 scoped_refptr<Layer> scroll_layer = Layer::Create(); | 1457 scoped_refptr<Layer> scroll_layer = Layer::Create(); |
1458 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( | 1458 scrollbar_layer_ = |
1459 false, true, scroll_layer.get()); | 1459 FakePaintedScrollbarLayer::Create(false, true, scroll_layer->id()); |
1460 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); | 1460 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); |
1461 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); | 1461 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); |
1462 layer_tree_host()->root_layer()->AddChild(scroll_layer); | 1462 layer_tree_host()->root_layer()->AddChild(scroll_layer); |
1463 PostSetNeedsCommitToMainThread(); | 1463 PostSetNeedsCommitToMainThread(); |
1464 } | 1464 } |
1465 | 1465 |
1466 virtual void AfterTest() OVERRIDE {} | 1466 virtual void AfterTest() OVERRIDE {} |
1467 | 1467 |
1468 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1468 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
1469 LayerTreeHostContextTest::CommitCompleteOnThread(impl); | 1469 LayerTreeHostContextTest::CommitCompleteOnThread(impl); |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 | 1979 |
1980 protected: | 1980 protected: |
1981 FakeContentLayerClient client_; | 1981 FakeContentLayerClient client_; |
1982 scoped_refptr<FakeContentLayer> layer_; | 1982 scoped_refptr<FakeContentLayer> layer_; |
1983 }; | 1983 }; |
1984 | 1984 |
1985 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); | 1985 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); |
1986 | 1986 |
1987 } // namespace | 1987 } // namespace |
1988 } // namespace cc | 1988 } // namespace cc |
OLD | NEW |