| 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 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 root->AddChild(io_surface); | 1110 root->AddChild(io_surface); |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 // Enable the hud. | 1113 // Enable the hud. |
| 1114 LayerTreeDebugState debug_state; | 1114 LayerTreeDebugState debug_state; |
| 1115 debug_state.show_property_changed_rects = true; | 1115 debug_state.show_property_changed_rects = true; |
| 1116 layer_tree_host()->SetDebugState(debug_state); | 1116 layer_tree_host()->SetDebugState(debug_state); |
| 1117 | 1117 |
| 1118 scoped_refptr<PaintedScrollbarLayer> scrollbar = | 1118 scoped_refptr<PaintedScrollbarLayer> scrollbar = |
| 1119 PaintedScrollbarLayer::Create( | 1119 PaintedScrollbarLayer::Create( |
| 1120 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content->id()); | 1120 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content.get()); |
| 1121 scrollbar->SetBounds(gfx::Size(10, 10)); | 1121 scrollbar->SetBounds(gfx::Size(10, 10)); |
| 1122 scrollbar->SetAnchorPoint(gfx::PointF()); | 1122 scrollbar->SetAnchorPoint(gfx::PointF()); |
| 1123 scrollbar->SetIsDrawable(true); | 1123 scrollbar->SetIsDrawable(true); |
| 1124 root->AddChild(scrollbar); | 1124 root->AddChild(scrollbar); |
| 1125 | 1125 |
| 1126 layer_tree_host()->SetRootLayer(root); | 1126 layer_tree_host()->SetRootLayer(root); |
| 1127 LayerTreeHostContextTest::SetupTree(); | 1127 LayerTreeHostContextTest::SetupTree(); |
| 1128 } | 1128 } |
| 1129 | 1129 |
| 1130 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 1130 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 | 1480 |
| 1481 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); | 1481 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); |
| 1482 | 1482 |
| 1483 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { | 1483 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { |
| 1484 public: | 1484 public: |
| 1485 ScrollbarLayerLostContext() : commits_(0) {} | 1485 ScrollbarLayerLostContext() : commits_(0) {} |
| 1486 | 1486 |
| 1487 virtual void BeginTest() OVERRIDE { | 1487 virtual void BeginTest() OVERRIDE { |
| 1488 scoped_refptr<Layer> scroll_layer = Layer::Create(); | 1488 scoped_refptr<Layer> scroll_layer = Layer::Create(); |
| 1489 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( | 1489 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( |
| 1490 false, true, scroll_layer->id()); | 1490 false, true, scroll_layer.get()); |
| 1491 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); | 1491 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); |
| 1492 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); | 1492 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); |
| 1493 layer_tree_host()->root_layer()->AddChild(scroll_layer); | 1493 layer_tree_host()->root_layer()->AddChild(scroll_layer); |
| 1494 PostSetNeedsCommitToMainThread(); | 1494 PostSetNeedsCommitToMainThread(); |
| 1495 } | 1495 } |
| 1496 | 1496 |
| 1497 virtual void AfterTest() OVERRIDE {} | 1497 virtual void AfterTest() OVERRIDE {} |
| 1498 | 1498 |
| 1499 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1499 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
| 1500 LayerTreeHostContextTest::CommitCompleteOnThread(impl); | 1500 LayerTreeHostContextTest::CommitCompleteOnThread(impl); |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 protected: | 2022 protected: |
| 2023 FakeContentLayerClient client_; | 2023 FakeContentLayerClient client_; |
| 2024 scoped_refptr<FakeContentLayer> layer_; | 2024 scoped_refptr<FakeContentLayer> layer_; |
| 2025 int num_commits_; | 2025 int num_commits_; |
| 2026 }; | 2026 }; |
| 2027 | 2027 |
| 2028 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); | 2028 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); |
| 2029 | 2029 |
| 2030 } // namespace | 2030 } // namespace |
| 2031 } // namespace cc | 2031 } // namespace cc |
| OLD | NEW |