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/debug/test_context_provider.h" | 8 #include "cc/debug/test_context_provider.h" |
9 #include "cc/debug/test_web_graphics_context_3d.h" | 9 #include "cc/debug/test_web_graphics_context_3d.h" |
10 #include "cc/layers/content_layer.h" | 10 #include "cc/layers/content_layer.h" |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 root->AddChild(io_surface); | 1236 root->AddChild(io_surface); |
1237 } | 1237 } |
1238 | 1238 |
1239 // Enable the hud. | 1239 // Enable the hud. |
1240 LayerTreeDebugState debug_state; | 1240 LayerTreeDebugState debug_state; |
1241 debug_state.show_property_changed_rects = true; | 1241 debug_state.show_property_changed_rects = true; |
1242 layer_tree_host()->SetDebugState(debug_state); | 1242 layer_tree_host()->SetDebugState(debug_state); |
1243 | 1243 |
1244 scoped_refptr<PaintedScrollbarLayer> scrollbar = | 1244 scoped_refptr<PaintedScrollbarLayer> scrollbar = |
1245 PaintedScrollbarLayer::Create( | 1245 PaintedScrollbarLayer::Create( |
1246 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content->id()); | 1246 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content.get()); //
WJM |
1247 scrollbar->SetBounds(gfx::Size(10, 10)); | 1247 scrollbar->SetBounds(gfx::Size(10, 10)); |
1248 scrollbar->SetAnchorPoint(gfx::PointF()); | 1248 scrollbar->SetAnchorPoint(gfx::PointF()); |
1249 scrollbar->SetIsDrawable(true); | 1249 scrollbar->SetIsDrawable(true); |
1250 root->AddChild(scrollbar); | 1250 root->AddChild(scrollbar); |
1251 | 1251 |
1252 layer_tree_host()->SetRootLayer(root); | 1252 layer_tree_host()->SetRootLayer(root); |
1253 LayerTreeHostContextTest::SetupTree(); | 1253 LayerTreeHostContextTest::SetupTree(); |
1254 } | 1254 } |
1255 | 1255 |
1256 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 1256 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 | 1666 |
1667 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); | 1667 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); |
1668 | 1668 |
1669 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { | 1669 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { |
1670 public: | 1670 public: |
1671 ScrollbarLayerLostContext() : commits_(0) {} | 1671 ScrollbarLayerLostContext() : commits_(0) {} |
1672 | 1672 |
1673 virtual void BeginTest() OVERRIDE { | 1673 virtual void BeginTest() OVERRIDE { |
1674 scoped_refptr<Layer> scroll_layer = Layer::Create(); | 1674 scoped_refptr<Layer> scroll_layer = Layer::Create(); |
1675 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( | 1675 scrollbar_layer_ = FakePaintedScrollbarLayer::Create( |
1676 false, true, scroll_layer->id()); | 1676 false, true, scroll_layer.get()); // WJM |
1677 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); | 1677 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); |
1678 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); | 1678 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); |
1679 layer_tree_host()->root_layer()->AddChild(scroll_layer); | 1679 layer_tree_host()->root_layer()->AddChild(scroll_layer); |
1680 PostSetNeedsCommitToMainThread(); | 1680 PostSetNeedsCommitToMainThread(); |
1681 } | 1681 } |
1682 | 1682 |
1683 virtual void AfterTest() OVERRIDE {} | 1683 virtual void AfterTest() OVERRIDE {} |
1684 | 1684 |
1685 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1685 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
1686 LayerTreeHostContextTest::CommitCompleteOnThread(impl); | 1686 LayerTreeHostContextTest::CommitCompleteOnThread(impl); |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2279 protected: | 2279 protected: |
2280 FakeContentLayerClient client_; | 2280 FakeContentLayerClient client_; |
2281 scoped_refptr<FakeContentLayer> layer_; | 2281 scoped_refptr<FakeContentLayer> layer_; |
2282 int num_commits_; | 2282 int num_commits_; |
2283 }; | 2283 }; |
2284 | 2284 |
2285 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); | 2285 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestSurfaceCreateCallback); |
2286 | 2286 |
2287 } // namespace | 2287 } // namespace |
2288 } // namespace cc | 2288 } // namespace cc |
OLD | NEW |