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/heads_up_display_layer.h" | 9 #include "cc/layers/heads_up_display_layer.h" |
10 #include "cc/layers/io_surface_layer.h" | 10 #include "cc/layers/io_surface_layer.h" |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 io_surface_->SetIOSurfaceProperties(1, gfx::Size(10, 10)); | 1164 io_surface_->SetIOSurfaceProperties(1, gfx::Size(10, 10)); |
1165 root_->AddChild(io_surface_); | 1165 root_->AddChild(io_surface_); |
1166 } | 1166 } |
1167 | 1167 |
1168 // Enable the hud. | 1168 // Enable the hud. |
1169 LayerTreeDebugState debug_state; | 1169 LayerTreeDebugState debug_state; |
1170 debug_state.show_property_changed_rects = true; | 1170 debug_state.show_property_changed_rects = true; |
1171 layer_tree_host()->SetDebugState(debug_state); | 1171 layer_tree_host()->SetDebugState(debug_state); |
1172 | 1172 |
1173 scoped_refptr<ScrollbarLayer> scrollbar_ = ScrollbarLayer::Create( | 1173 scoped_refptr<ScrollbarLayer> scrollbar_ = ScrollbarLayer::Create( |
1174 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), | 1174 scoped_ptr<Scrollbar>(new FakeScrollbar).Pass(), content_->id(), false); |
1175 content_->id()); | |
1176 scrollbar_->SetBounds(gfx::Size(10, 10)); | 1175 scrollbar_->SetBounds(gfx::Size(10, 10)); |
1177 scrollbar_->SetAnchorPoint(gfx::PointF()); | 1176 scrollbar_->SetAnchorPoint(gfx::PointF()); |
1178 scrollbar_->SetIsDrawable(true); | 1177 scrollbar_->SetIsDrawable(true); |
1179 root_->AddChild(scrollbar_); | 1178 root_->AddChild(scrollbar_); |
1180 | 1179 |
1181 layer_tree_host()->SetRootLayer(root_); | 1180 layer_tree_host()->SetRootLayer(root_); |
1182 LayerTreeHostContextTest::SetupTree(); | 1181 LayerTreeHostContextTest::SetupTree(); |
1183 } | 1182 } |
1184 | 1183 |
1185 virtual void BeginTest() OVERRIDE { | 1184 virtual void BeginTest() OVERRIDE { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 | 1480 |
1482 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); | 1481 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting); |
1483 | 1482 |
1484 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { | 1483 class ScrollbarLayerLostContext : public LayerTreeHostContextTest { |
1485 public: | 1484 public: |
1486 ScrollbarLayerLostContext() : commits_(0) {} | 1485 ScrollbarLayerLostContext() : commits_(0) {} |
1487 | 1486 |
1488 virtual void BeginTest() OVERRIDE { | 1487 virtual void BeginTest() OVERRIDE { |
1489 scoped_refptr<Layer> scroll_layer = Layer::Create(); | 1488 scoped_refptr<Layer> scroll_layer = Layer::Create(); |
1490 scrollbar_layer_ = FakeScrollbarLayer::Create( | 1489 scrollbar_layer_ = FakeScrollbarLayer::Create( |
1491 false, true, scroll_layer->id()); | 1490 false, true, scroll_layer->id(), false); |
1492 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); | 1491 scrollbar_layer_->SetBounds(gfx::Size(10, 100)); |
1493 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); | 1492 layer_tree_host()->root_layer()->AddChild(scrollbar_layer_); |
1494 layer_tree_host()->root_layer()->AddChild(scroll_layer); | 1493 layer_tree_host()->root_layer()->AddChild(scroll_layer); |
1495 PostSetNeedsCommitToMainThread(); | 1494 PostSetNeedsCommitToMainThread(); |
1496 } | 1495 } |
1497 | 1496 |
1498 virtual void AfterTest() OVERRIDE {} | 1497 virtual void AfterTest() OVERRIDE {} |
1499 | 1498 |
1500 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1499 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
1501 LayerTreeHostContextTest::CommitCompleteOnThread(impl); | 1500 LayerTreeHostContextTest::CommitCompleteOnThread(impl); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 impl_thread ? impl_thread->message_loop_proxy() : NULL); | 1596 impl_thread ? impl_thread->message_loop_proxy() : NULL); |
1598 EXPECT_FALSE(layer_tree_host); | 1597 EXPECT_FALSE(layer_tree_host); |
1599 } | 1598 } |
1600 }; | 1599 }; |
1601 | 1600 |
1602 SINGLE_AND_MULTI_THREAD_TEST_F( | 1601 SINGLE_AND_MULTI_THREAD_TEST_F( |
1603 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); | 1602 LayerTreeHostTestCannotCreateIfCannotCreateOutputSurface); |
1604 | 1603 |
1605 } // namespace | 1604 } // namespace |
1606 } // namespace cc | 1605 } // namespace cc |
OLD | NEW |