| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 const LayerTreeImpl::LayerList& LayerTreeImpl::RenderSurfaceLayerList() const { | 151 const LayerTreeImpl::LayerList& LayerTreeImpl::RenderSurfaceLayerList() const { |
| 152 // If this assert triggers, then the list is dirty. | 152 // If this assert triggers, then the list is dirty. |
| 153 DCHECK(!layer_tree_host_impl_->needsUpdateDrawProperties()); | 153 DCHECK(!layer_tree_host_impl_->needsUpdateDrawProperties()); |
| 154 return render_surface_layer_list_; | 154 return render_surface_layer_list_; |
| 155 } | 155 } |
| 156 | 156 |
| 157 gfx::Size LayerTreeImpl::ContentSize() const { | 157 gfx::Size LayerTreeImpl::ContentSize() const { |
| 158 // TODO(aelias): Hardcoding the first child here is weird. Think of | 158 // TODO(aelias): Hardcoding the first child here is weird. Think of |
| 159 // a cleaner way to get the contentBounds on the Impl side. | 159 // a cleaner way to get the contentBounds on the Impl side. |
| 160 if (!root_scroll_layer() || root_scroll_layer()->children().isEmpty()) | 160 if (!root_scroll_layer() || root_scroll_layer()->children().empty()) |
| 161 return gfx::Size(); | 161 return gfx::Size(); |
| 162 return root_scroll_layer()->children()[0]->contentBounds(); | 162 return root_scroll_layer()->children()[0]->contentBounds(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 LayerImpl* LayerTreeImpl::LayerById(int id) { | 165 LayerImpl* LayerTreeImpl::LayerById(int id) { |
| 166 LayerIdMap::iterator iter = layer_id_map_.find(id); | 166 LayerIdMap::iterator iter = layer_id_map_.find(id); |
| 167 return iter != layer_id_map_.end() ? iter->second : NULL; | 167 return iter != layer_id_map_.end() ? iter->second : NULL; |
| 168 } | 168 } |
| 169 | 169 |
| 170 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { | 170 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { | 258 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { |
| 259 return layer_tree_host_impl_->animationRegistrar(); | 259 return layer_tree_host_impl_->animationRegistrar(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 const PinchZoomViewport& LayerTreeImpl::pinch_zoom_viewport() const { | 262 const PinchZoomViewport& LayerTreeImpl::pinch_zoom_viewport() const { |
| 263 return layer_tree_host_impl_->pinchZoomViewport(); | 263 return layer_tree_host_impl_->pinchZoomViewport(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace cc | 266 } // namespace cc |
| OLD | NEW |