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 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 root->AddChild(io_surface); | 1077 root->AddChild(io_surface); |
1078 } | 1078 } |
1079 | 1079 |
1080 // Enable the hud. | 1080 // Enable the hud. |
1081 LayerTreeDebugState debug_state; | 1081 LayerTreeDebugState debug_state; |
1082 debug_state.show_property_changed_rects = true; | 1082 debug_state.show_property_changed_rects = true; |
1083 layer_tree_host()->SetDebugState(debug_state); | 1083 layer_tree_host()->SetDebugState(debug_state); |
1084 | 1084 |
1085 scoped_refptr<PaintedScrollbarLayer> scrollbar = | 1085 scoped_refptr<PaintedScrollbarLayer> scrollbar = |
1086 PaintedScrollbarLayer::Create( | 1086 PaintedScrollbarLayer::Create( |
1087 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content->id()); | 1087 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content.get()); |
1088 scrollbar->SetBounds(gfx::Size(10, 10)); | 1088 scrollbar->SetBounds(gfx::Size(10, 10)); |
1089 scrollbar->SetAnchorPoint(gfx::PointF()); | 1089 scrollbar->SetAnchorPoint(gfx::PointF()); |
1090 scrollbar->SetIsDrawable(true); | 1090 scrollbar->SetIsDrawable(true); |
1091 root->AddChild(scrollbar); | 1091 root->AddChild(scrollbar); |
1092 | 1092 |
1093 layer_tree_host()->SetRootLayer(root); | 1093 layer_tree_host()->SetRootLayer(root); |
1094 LayerTreeHostContextTest::SetupTree(); | 1094 LayerTreeHostContextTest::SetupTree(); |
1095 } | 1095 } |
1096 | 1096 |
1097 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 1097 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 }; | 1442 }; |
1443 | 1443 |
1444 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); | 1444 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); |
1445 | 1445 |
1446 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { | 1446 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { |
1447 public: | 1447 public: |
1448 ScrollbarLayerLostContext() : commits_(0) {} | 1448 ScrollbarLayerLostContext() : commits_(0) {} |
1449 | 1449 |
1450 virtual void BeginTest() OVERRIDE { | 1450 virtual void BeginTest() OVERRIDE { |
1451 scoped_refptr<Layer> scroll_layer = Layer::Create(); | 1451 scoped_refptr<Layer> scroll_layer = Layer::Create(); |
1452 scrollbar_layer_ = | 1452 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( |
1453 FakePaintedScrollbarLayer::Create(false, true, scroll_layer->id()); | 1453 false, true, scroll_layer.get()); |
1454 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); | 1454 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); |
1455 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); | 1455 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); |
1456 layer_tree_host()->root_layer()->AddChild(scroll_layer); | 1456 layer_tree_host()->root_layer()->AddChild(scroll_layer); |
1457 PostSetNeedsCommitToMainThread(); | 1457 PostSetNeedsCommitToMainThread(); |
1458 } | 1458 } |
1459 | 1459 |
1460 virtual void AfterTest() OVERRIDE {} | 1460 virtual void AfterTest() OVERRIDE {} |
1461 | 1461 |
1462 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1462 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
1463 LayerTreeHostContextTest::CommitCompleteOnThread(impl); | 1463 LayerTreeHostContextTest::CommitCompleteOnThread(impl); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1976 protected: | 1976 protected: |
1977 FakeContentLayerClient client_; | 1977 FakeContentLayerClient client_; |
1978 scoped_refptr<FakeContentLayer> layer_; | 1978 scoped_refptr<FakeContentLayer> layer_; |
1979 int num_commits_; | 1979 int num_commits_; |
1980 }; | 1980 }; |
1981 | 1981 |
1982 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); | 1982 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); |
1983 | 1983 |
1984 } // namespace | 1984 } // namespace |
1985 } // namespace cc | 1985 } // namespace cc |
OLD | NEW |