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

Side by Side Diff: cc/test/fake_layer_tree_host.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 | « cc/layers/layer_impl_unittest.cc ('k') | cc/test/test_layer_tree_host_base.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/fake_layer_tree_host.h" 5 #include "cc/test/fake_layer_tree_host.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "cc/animation/animation_host.h" 10 #include "cc/animation/animation_host.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 TreeSynchronizer::SynchronizeTrees(root_layer(), active_tree()); 72 TreeSynchronizer::SynchronizeTrees(root_layer(), active_tree());
73 active_tree()->SetPropertyTrees(property_trees()); 73 active_tree()->SetPropertyTrees(property_trees());
74 TreeSynchronizer::PushLayerProperties(root_layer()->layer_tree_host(), 74 TreeSynchronizer::PushLayerProperties(root_layer()->layer_tree_host(),
75 active_tree()); 75 active_tree());
76 mutator_host()->PushPropertiesTo(host_impl_.mutator_host()); 76 mutator_host()->PushPropertiesTo(host_impl_.mutator_host());
77 77
78 active_tree()->property_trees()->scroll_tree.PushScrollUpdatesFromMainThread( 78 active_tree()->property_trees()->scroll_tree.PushScrollUpdatesFromMainThread(
79 property_trees(), active_tree()); 79 property_trees(), active_tree());
80 80
81 if (page_scale_layer() && inner_viewport_scroll_layer()) { 81 if (page_scale_layer() && inner_viewport_scroll_layer()) {
82 active_tree()->SetViewportLayersFromIds( 82 LayerTreeImpl::ViewportLayerIds ids;
83 overscroll_elasticity_layer() ? overscroll_elasticity_layer()->id() 83 if (overscroll_elasticity_layer())
84 : Layer::INVALID_ID, 84 ids.overscroll_elasticity = overscroll_elasticity_layer()->id();
85 page_scale_layer()->id(), 85 ids.page_scale = page_scale_layer()->id();
86 inner_viewport_container_layer() 86 if (inner_viewport_container_layer())
87 ? inner_viewport_container_layer()->id() 87 ids.inner_viewport_container = inner_viewport_container_layer()->id();
88 : Layer::INVALID_ID, 88 if (outer_viewport_container_layer())
89 outer_viewport_container_layer() 89 ids.outer_viewport_container = outer_viewport_container_layer()->id();
90 ? outer_viewport_container_layer()->id() 90 ids.inner_viewport_scroll = inner_viewport_scroll_layer()->id();
91 : Layer::INVALID_ID, 91 if (outer_viewport_scroll_layer())
92 inner_viewport_scroll_layer()->id(), 92 ids.outer_viewport_scroll = outer_viewport_scroll_layer()->id();
93 outer_viewport_scroll_layer() ? outer_viewport_scroll_layer()->id() 93 active_tree()->SetViewportLayersFromIds(ids);
94 : Layer::INVALID_ID);
95 } 94 }
96 95
97 return active_tree()->root_layer_for_testing(); 96 return active_tree()->root_layer_for_testing();
98 } 97 }
99 98
100 LayerImpl* FakeLayerTreeHost::CommitAndCreatePendingTree() { 99 LayerImpl* FakeLayerTreeHost::CommitAndCreatePendingTree() {
101 TreeSynchronizer::SynchronizeTrees(root_layer(), pending_tree()); 100 TreeSynchronizer::SynchronizeTrees(root_layer(), pending_tree());
102 pending_tree()->SetPropertyTrees(property_trees()); 101 pending_tree()->SetPropertyTrees(property_trees());
103 TreeSynchronizer::PushLayerProperties(root_layer()->layer_tree_host(), 102 TreeSynchronizer::PushLayerProperties(root_layer()->layer_tree_host(),
104 pending_tree()); 103 pending_tree());
105 mutator_host()->PushPropertiesTo(host_impl_.mutator_host()); 104 mutator_host()->PushPropertiesTo(host_impl_.mutator_host());
106 105
107 pending_tree()->property_trees()->scroll_tree.PushScrollUpdatesFromMainThread( 106 pending_tree()->property_trees()->scroll_tree.PushScrollUpdatesFromMainThread(
108 property_trees(), pending_tree()); 107 property_trees(), pending_tree());
109 return pending_tree()->root_layer_for_testing(); 108 return pending_tree()->root_layer_for_testing();
110 } 109 }
111 110
112 } // namespace cc 111 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/test/test_layer_tree_host_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698