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

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

Issue 2887053002: Remove scroll_clip_layer dependency from viewport layer tracking (Closed)
Patch Set: Cleanup return stmt Created 3 years, 7 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 | « no previous file | cc/layers/layer_position_constraint_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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Make root the inner viewport scroll layer. This ensures the later call to 141 // Make root the inner viewport scroll layer. This ensures the later call to
142 // |SetViewportBoundsDelta| will be on a viewport layer. 142 // |SetViewportBoundsDelta| will be on a viewport layer.
143 host_impl.active_tree()->SetViewportLayersFromIds( 143 host_impl.active_tree()->SetViewportLayersFromIds(
144 Layer::INVALID_ID, Layer::INVALID_ID, root->id(), Layer::INVALID_ID); 144 Layer::INVALID_ID, Layer::INVALID_ID, Layer::INVALID_ID,
145 Layer::INVALID_ID, root->id(), Layer::INVALID_ID);
145 146
146 root->test_properties()->force_render_surface = true; 147 root->test_properties()->force_render_surface = true;
147 root->SetMasksToBounds(true); 148 root->SetMasksToBounds(true);
148 root->layer_tree_impl()->ResetAllChangeTracking(); 149 root->layer_tree_impl()->ResetAllChangeTracking();
149 150
150 root->test_properties()->AddChild( 151 root->test_properties()->AddChild(
151 LayerImpl::Create(host_impl.active_tree(), 7)); 152 LayerImpl::Create(host_impl.active_tree(), 7));
152 LayerImpl* child = root->test_properties()->children[0]; 153 LayerImpl* child = root->test_properties()->children[0];
153 child->test_properties()->AddChild( 154 child->test_properties()->AddChild(
154 LayerImpl::Create(host_impl.active_tree(), 8)); 155 LayerImpl::Create(host_impl.active_tree(), 8));
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 607
607 pending_layer->PushPropertiesTo(layer()); 608 pending_layer->PushPropertiesTo(layer());
608 609
609 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 610 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
610 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 611 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
611 pending_layer->CurrentScrollOffset()); 612 pending_layer->CurrentScrollOffset());
612 } 613 }
613 614
614 } // namespace 615 } // namespace
615 } // namespace cc 616 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer_position_constraint_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698