OLD | NEW |
---|---|
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 "cc/animation/animation_host.h" | 8 #include "cc/animation/animation_host.h" |
9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/test/fake_image_serialization_processor.h" | 10 #include "cc/test/fake_image_serialization_processor.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 return LayerTreeHost::GetRendererCapabilities(); | 85 return LayerTreeHost::GetRendererCapabilities(); |
86 } | 86 } |
87 | 87 |
88 void FakeLayerTreeHost::SetNeedsCommit() { needs_commit_ = true; } | 88 void FakeLayerTreeHost::SetNeedsCommit() { needs_commit_ = true; } |
89 | 89 |
90 LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() { | 90 LayerImpl* FakeLayerTreeHost::CommitAndCreateLayerImplTree() { |
91 TreeSynchronizer::SynchronizeTrees(root_layer(), active_tree()); | 91 TreeSynchronizer::SynchronizeTrees(root_layer(), active_tree()); |
92 active_tree()->SetPropertyTrees(property_trees()); | 92 active_tree()->SetPropertyTrees(property_trees()); |
93 TreeSynchronizer::PushLayerProperties(root_layer()->GetLayerTree(), | 93 TreeSynchronizer::PushLayerProperties(root_layer()->GetLayerTree(), |
94 active_tree()); | 94 active_tree()); |
95 animation_host()->PushPropertiesTo(host_impl_.animation_host()); | 95 GetLayerTree()->animation_host()->PushPropertiesTo( |
Khushal
2016/08/15 17:46:39
You can make the |layer_tree_| a protected member
xingliu
2016/08/15 21:29:12
Done.
| |
96 host_impl_.animation_host()); | |
96 | 97 |
97 active_tree()->UpdatePropertyTreeScrollOffset(property_trees()); | 98 active_tree()->UpdatePropertyTreeScrollOffset(property_trees()); |
98 | 99 |
99 if (page_scale_layer() && inner_viewport_scroll_layer()) { | 100 if (page_scale_layer() && inner_viewport_scroll_layer()) { |
100 active_tree()->SetViewportLayersFromIds( | 101 active_tree()->SetViewportLayersFromIds( |
101 overscroll_elasticity_layer() ? overscroll_elasticity_layer()->id() | 102 overscroll_elasticity_layer() ? overscroll_elasticity_layer()->id() |
102 : Layer::INVALID_ID, | 103 : Layer::INVALID_ID, |
103 page_scale_layer()->id(), inner_viewport_scroll_layer()->id(), | 104 page_scale_layer()->id(), inner_viewport_scroll_layer()->id(), |
104 outer_viewport_scroll_layer() ? outer_viewport_scroll_layer()->id() | 105 outer_viewport_scroll_layer() ? outer_viewport_scroll_layer()->id() |
105 : Layer::INVALID_ID); | 106 : Layer::INVALID_ID); |
106 } | 107 } |
107 | 108 |
108 active_tree()->UpdatePropertyTreesForBoundsDelta(); | 109 active_tree()->UpdatePropertyTreesForBoundsDelta(); |
109 return active_tree()->root_layer_for_testing(); | 110 return active_tree()->root_layer_for_testing(); |
110 } | 111 } |
111 | 112 |
112 LayerImpl* FakeLayerTreeHost::CommitAndCreatePendingTree() { | 113 LayerImpl* FakeLayerTreeHost::CommitAndCreatePendingTree() { |
113 TreeSynchronizer::SynchronizeTrees(root_layer(), pending_tree()); | 114 TreeSynchronizer::SynchronizeTrees(root_layer(), pending_tree()); |
114 pending_tree()->SetPropertyTrees(property_trees()); | 115 pending_tree()->SetPropertyTrees(property_trees()); |
115 TreeSynchronizer::PushLayerProperties(root_layer()->GetLayerTree(), | 116 TreeSynchronizer::PushLayerProperties(root_layer()->GetLayerTree(), |
116 pending_tree()); | 117 pending_tree()); |
117 animation_host()->PushPropertiesTo(host_impl_.animation_host()); | 118 GetLayerTree()->animation_host()->PushPropertiesTo( |
119 host_impl_.animation_host()); | |
118 | 120 |
119 pending_tree()->UpdatePropertyTreeScrollOffset(property_trees()); | 121 pending_tree()->UpdatePropertyTreeScrollOffset(property_trees()); |
120 return pending_tree()->root_layer_for_testing(); | 122 return pending_tree()->root_layer_for_testing(); |
121 } | 123 } |
122 | 124 |
123 } // namespace cc | 125 } // namespace cc |
OLD | NEW |