OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "cc/layers/painted_scrollbar_layer_impl.h" | 7 #include "cc/layers/painted_scrollbar_layer_impl.h" |
8 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 8 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
9 #include "cc/output/filter_operation.h" | 9 #include "cc/output/filter_operation.h" |
10 #include "cc/output/filter_operations.h" | 10 #include "cc/output/filter_operations.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); | 92 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); |
93 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 93 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
94 &task_graph_runner); | 94 &task_graph_runner); |
95 host_impl.SetVisible(true); | 95 host_impl.SetVisible(true); |
96 EXPECT_TRUE(host_impl.InitializeRenderer(output_surface.get())); | 96 EXPECT_TRUE(host_impl.InitializeRenderer(output_surface.get())); |
97 scoped_ptr<LayerImpl> root_clip = | 97 scoped_ptr<LayerImpl> root_clip = |
98 LayerImpl::Create(host_impl.active_tree(), 1); | 98 LayerImpl::Create(host_impl.active_tree(), 1); |
99 scoped_ptr<LayerImpl> root_ptr = | 99 scoped_ptr<LayerImpl> root_ptr = |
100 LayerImpl::Create(host_impl.active_tree(), 2); | 100 LayerImpl::Create(host_impl.active_tree(), 2); |
101 LayerImpl* root = root_ptr.get(); | 101 LayerImpl* root = root_ptr.get(); |
102 root_clip->AddChild(root_ptr.Pass()); | 102 root_clip->AddChild(std::move(root_ptr)); |
103 scoped_ptr<LayerImpl> scroll_parent = | 103 scoped_ptr<LayerImpl> scroll_parent = |
104 LayerImpl::Create(host_impl.active_tree(), 3); | 104 LayerImpl::Create(host_impl.active_tree(), 3); |
105 LayerImpl* scroll_child = LayerImpl::Create(host_impl.active_tree(), 4).get(); | 105 LayerImpl* scroll_child = LayerImpl::Create(host_impl.active_tree(), 4).get(); |
106 std::set<LayerImpl*>* scroll_children = new std::set<LayerImpl*>(); | 106 std::set<LayerImpl*>* scroll_children = new std::set<LayerImpl*>(); |
107 scroll_children->insert(scroll_child); | 107 scroll_children->insert(scroll_child); |
108 scroll_children->insert(root); | 108 scroll_children->insert(root); |
109 root->SetHasRenderSurface(true); | 109 root->SetHasRenderSurface(true); |
110 | 110 |
111 scoped_ptr<LayerImpl> clip_parent = | 111 scoped_ptr<LayerImpl> clip_parent = |
112 LayerImpl::Create(host_impl.active_tree(), 5); | 112 LayerImpl::Create(host_impl.active_tree(), 5); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 &task_graph_runner); | 254 &task_graph_runner); |
255 host_impl.SetVisible(true); | 255 host_impl.SetVisible(true); |
256 EXPECT_TRUE(host_impl.InitializeRenderer(output_surface.get())); | 256 EXPECT_TRUE(host_impl.InitializeRenderer(output_surface.get())); |
257 host_impl.active_tree()->SetRootLayer( | 257 host_impl.active_tree()->SetRootLayer( |
258 LayerImpl::Create(host_impl.active_tree(), 1)); | 258 LayerImpl::Create(host_impl.active_tree(), 1)); |
259 LayerImpl* root = host_impl.active_tree()->root_layer(); | 259 LayerImpl* root = host_impl.active_tree()->root_layer(); |
260 root->SetHasRenderSurface(true); | 260 root->SetHasRenderSurface(true); |
261 scoped_ptr<LayerImpl> layer_ptr = | 261 scoped_ptr<LayerImpl> layer_ptr = |
262 LayerImpl::Create(host_impl.active_tree(), 2); | 262 LayerImpl::Create(host_impl.active_tree(), 2); |
263 LayerImpl* layer = layer_ptr.get(); | 263 LayerImpl* layer = layer_ptr.get(); |
264 root->AddChild(layer_ptr.Pass()); | 264 root->AddChild(std::move(layer_ptr)); |
265 layer->SetScrollClipLayer(root->id()); | 265 layer->SetScrollClipLayer(root->id()); |
266 host_impl.active_tree()->BuildPropertyTreesForTesting(); | 266 host_impl.active_tree()->BuildPropertyTreesForTesting(); |
267 DCHECK(host_impl.CanDraw()); | 267 DCHECK(host_impl.CanDraw()); |
268 | 268 |
269 gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f); | 269 gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f); |
270 float arbitrary_number = 0.352f; | 270 float arbitrary_number = 0.352f; |
271 gfx::Size arbitrary_size = gfx::Size(111, 222); | 271 gfx::Size arbitrary_size = gfx::Size(111, 222); |
272 gfx::Point arbitrary_point = gfx::Point(333, 444); | 272 gfx::Point arbitrary_point = gfx::Point(333, 444); |
273 gfx::Vector2d arbitrary_vector2d = gfx::Vector2d(111, 222); | 273 gfx::Vector2d arbitrary_vector2d = gfx::Vector2d(111, 222); |
274 gfx::Size large_size = gfx::Size(1000, 1000); | 274 gfx::Size large_size = gfx::Size(1000, 1000); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 574 |
575 pending_layer->PushPropertiesTo(layer()); | 575 pending_layer->PushPropertiesTo(layer()); |
576 | 576 |
577 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); | 577 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); |
578 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), | 578 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), |
579 pending_layer->CurrentScrollOffset()); | 579 pending_layer->CurrentScrollOffset()); |
580 } | 580 } |
581 | 581 |
582 } // namespace | 582 } // namespace |
583 } // namespace cc | 583 } // namespace cc |
OLD | NEW |