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

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

Issue 2889093003: Refactor SetViewportLayerIds to use a struct instead of 6 values (Closed)
Patch Set: Fix small mistake made in a test 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/test/fake_layer_tree_host.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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // 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 LayerTreeImpl::ViewportLayerIds viewport_ids;
144 Layer::INVALID_ID, Layer::INVALID_ID, Layer::INVALID_ID, 144 viewport_ids.inner_viewport_scroll = root->id();
145 Layer::INVALID_ID, root->id(), Layer::INVALID_ID); 145 host_impl.active_tree()->SetViewportLayersFromIds(viewport_ids);
146 146
147 root->test_properties()->force_render_surface = true; 147 root->test_properties()->force_render_surface = true;
148 root->SetMasksToBounds(true); 148 root->SetMasksToBounds(true);
149 root->layer_tree_impl()->ResetAllChangeTracking(); 149 root->layer_tree_impl()->ResetAllChangeTracking();
150 150
151 root->test_properties()->AddChild( 151 root->test_properties()->AddChild(
152 LayerImpl::Create(host_impl.active_tree(), 7)); 152 LayerImpl::Create(host_impl.active_tree(), 7));
153 LayerImpl* child = root->test_properties()->children[0]; 153 LayerImpl* child = root->test_properties()->children[0];
154 child->test_properties()->AddChild( 154 child->test_properties()->AddChild(
155 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
607 607
608 pending_layer->PushPropertiesTo(layer()); 608 pending_layer->PushPropertiesTo(layer());
609 609
610 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); 610 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset());
611 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), 611 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(),
612 pending_layer->CurrentScrollOffset()); 612 pending_layer->CurrentScrollOffset());
613 } 613 }
614 614
615 } // namespace 615 } // namespace
616 } // namespace cc 616 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/fake_layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698