Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Side by Side Diff: cc/layers/layer_impl_unittest.cc

Issue 2655233006: cc : Clean up cc clip tree (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/BUILD.gn ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/filter_operation.h" 7 #include "cc/base/filter_operation.h"
8 #include "cc/base/filter_operations.h" 8 #include "cc/base/filter_operations.h"
9 #include "cc/layers/painted_scrollbar_layer_impl.h" 9 #include "cc/layers/painted_scrollbar_layer_impl.h"
10 #include "cc/layers/solid_color_scrollbar_layer_impl.h" 10 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 std::unique_ptr<LayerImpl> root_clip_ptr = 132 std::unique_ptr<LayerImpl> root_clip_ptr =
133 LayerImpl::Create(host_impl.active_tree(), 1); 133 LayerImpl::Create(host_impl.active_tree(), 1);
134 LayerImpl* root_clip = root_clip_ptr.get(); 134 LayerImpl* root_clip = root_clip_ptr.get();
135 std::unique_ptr<LayerImpl> root_ptr = 135 std::unique_ptr<LayerImpl> root_ptr =
136 LayerImpl::Create(host_impl.active_tree(), 2); 136 LayerImpl::Create(host_impl.active_tree(), 2);
137 LayerImpl* root = root_ptr.get(); 137 LayerImpl* root = root_ptr.get();
138 root_clip_ptr->test_properties()->AddChild(std::move(root_ptr)); 138 root_clip_ptr->test_properties()->AddChild(std::move(root_ptr));
139 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_clip_ptr)); 139 host_impl.active_tree()->SetRootLayerForTesting(std::move(root_clip_ptr));
140 140
141 root->test_properties()->force_render_surface = true; 141 root->test_properties()->force_render_surface = true;
142 root->SetMasksToBounds(true);
142 root->layer_tree_impl()->ResetAllChangeTracking(); 143 root->layer_tree_impl()->ResetAllChangeTracking();
143 144
144 root->test_properties()->AddChild( 145 root->test_properties()->AddChild(
145 LayerImpl::Create(host_impl.active_tree(), 7)); 146 LayerImpl::Create(host_impl.active_tree(), 7));
146 LayerImpl* child = root->test_properties()->children[0]; 147 LayerImpl* child = root->test_properties()->children[0];
147 child->test_properties()->AddChild( 148 child->test_properties()->AddChild(
148 LayerImpl::Create(host_impl.active_tree(), 8)); 149 LayerImpl::Create(host_impl.active_tree(), 8));
149 LayerImpl* grand_child = child->test_properties()->children[0]; 150 LayerImpl* grand_child = child->test_properties()->children[0];
150 root->SetScrollClipLayer(root_clip->id()); 151 root->SetScrollClipLayer(root_clip->id());
151 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); 152 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting();
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 ScrollTree* scroll_tree(LayerImpl* layer_impl) { 437 ScrollTree* scroll_tree(LayerImpl* layer_impl) {
437 return &layer_impl->layer_tree_impl()->property_trees()->scroll_tree; 438 return &layer_impl->layer_tree_impl()->property_trees()->scroll_tree;
438 } 439 }
439 440
440 LayerTreeHostImpl& host_impl() { return host_impl_; } 441 LayerTreeHostImpl& host_impl() { return host_impl_; }
441 442
442 LayerTreeImpl* tree() { return host_impl_.active_tree(); } 443 LayerTreeImpl* tree() { return host_impl_.active_tree(); }
443 444
444 LayerTreeSettings settings() { 445 LayerTreeSettings settings() {
445 LayerTreeSettings settings; 446 LayerTreeSettings settings;
446 settings.verify_clip_tree_calculations = true;
447 return settings; 447 return settings;
448 } 448 }
449 449
450 private: 450 private:
451 FakeImplTaskRunnerProvider task_runner_provider_; 451 FakeImplTaskRunnerProvider task_runner_provider_;
452 TestTaskGraphRunner task_graph_runner_; 452 TestTaskGraphRunner task_graph_runner_;
453 FakeLayerTreeHostImpl host_impl_; 453 FakeLayerTreeHostImpl host_impl_;
454 int root_id_; 454 int root_id_;
455 }; 455 };
456 456
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 580
581 pending_layer->PushPropertiesTo(layer()); 581 pending_layer->PushPropertiesTo(layer());
582 582
583 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 583 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
584 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 584 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
585 pending_layer->CurrentScrollOffset()); 585 pending_layer->CurrentScrollOffset());
586 } 586 }
587 587
588 } // namespace 588 } // namespace
589 } // namespace cc 589 } // namespace cc
OLDNEW
« no previous file with comments | « cc/BUILD.gn ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698