OLD | NEW |
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/layer_tree_impl.h" | 5 #include "cc/layer_tree_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/layer_tree_host_common.h" | 8 #include "cc/layer_tree_host_common.h" |
9 #include "cc/layer_tree_host_impl.h" | 9 #include "cc/layer_tree_host_impl.h" |
10 #include "ui/gfx/vector2d_conversions.h" | 10 #include "ui/gfx/vector2d_conversions.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { | 170 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { |
171 DCHECK(!LayerById(layer->id())); | 171 DCHECK(!LayerById(layer->id())); |
172 layer_id_map_[layer->id()] = layer; | 172 layer_id_map_[layer->id()] = layer; |
173 } | 173 } |
174 | 174 |
175 void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { | 175 void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { |
176 DCHECK(LayerById(layer->id())); | 176 DCHECK(LayerById(layer->id())); |
177 layer_id_map_.erase(layer->id()); | 177 layer_id_map_.erase(layer->id()); |
178 } | 178 } |
179 | 179 |
| 180 void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pendingTree) { |
| 181 int id = currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0; |
| 182 pendingTree->set_currently_scrolling_layer( |
| 183 LayerTreeHostCommon::findLayerInSubtree(pendingTree->RootLayer(), id)); |
| 184 } |
| 185 |
180 const LayerTreeSettings& LayerTreeImpl::settings() const { | 186 const LayerTreeSettings& LayerTreeImpl::settings() const { |
181 return layer_tree_host_impl_->settings(); | 187 return layer_tree_host_impl_->settings(); |
182 } | 188 } |
183 | 189 |
184 OutputSurface* LayerTreeImpl::output_surface() const { | 190 OutputSurface* LayerTreeImpl::output_surface() const { |
185 return layer_tree_host_impl_->outputSurface(); | 191 return layer_tree_host_impl_->outputSurface(); |
186 } | 192 } |
187 | 193 |
188 ResourceProvider* LayerTreeImpl::resource_provider() const { | 194 ResourceProvider* LayerTreeImpl::resource_provider() const { |
189 return layer_tree_host_impl_->resourceProvider(); | 195 return layer_tree_host_impl_->resourceProvider(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 263 |
258 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { | 264 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { |
259 return layer_tree_host_impl_->animationRegistrar(); | 265 return layer_tree_host_impl_->animationRegistrar(); |
260 } | 266 } |
261 | 267 |
262 const PinchZoomViewport& LayerTreeImpl::pinch_zoom_viewport() const { | 268 const PinchZoomViewport& LayerTreeImpl::pinch_zoom_viewport() const { |
263 return layer_tree_host_impl_->pinchZoomViewport(); | 269 return layer_tree_host_impl_->pinchZoomViewport(); |
264 } | 270 } |
265 | 271 |
266 } // namespace cc | 272 } // namespace cc |
OLD | NEW |