| 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/trees/layer_tree_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
| 9 #include "cc/animation/animation_id_provider.h" | 9 #include "cc/animation/animation_id_provider.h" |
| 10 #include "cc/animation/keyframed_animation_curve.h" | 10 #include "cc/animation/keyframed_animation_curve.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 return true; | 351 return true; |
| 352 } | 352 } |
| 353 | 353 |
| 354 const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { | 354 const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { |
| 355 // If this assert triggers, then the list is dirty. | 355 // If this assert triggers, then the list is dirty. |
| 356 DCHECK(!needs_update_draw_properties_); | 356 DCHECK(!needs_update_draw_properties_); |
| 357 return render_surface_layer_list_; | 357 return render_surface_layer_list_; |
| 358 } | 358 } |
| 359 | 359 |
| 360 gfx::Size LayerTreeImpl::ScrollableSize() const { | 360 gfx::Size LayerTreeImpl::ScrollableSize() const { |
| 361 if (!root_scroll_layer_ || root_scroll_layer_->children().empty()) | 361 if (!root_scroll_layer_) |
| 362 return gfx::Size(); | 362 return gfx::Size(); |
| 363 return root_scroll_layer_->children()[0]->bounds(); | 363 |
| 364 gfx::Size scrollable_size; |
| 365 for (size_t i = 0; i < root_scroll_layer_->children().size(); ++i) |
| 366 scrollable_size.ClampToMin(root_scroll_layer_->children()[i]->bounds()); |
| 367 |
| 368 return scrollable_size; |
| 364 } | 369 } |
| 365 | 370 |
| 366 LayerImpl* LayerTreeImpl::LayerById(int id) { | 371 LayerImpl* LayerTreeImpl::LayerById(int id) { |
| 367 LayerIdMap::iterator iter = layer_id_map_.find(id); | 372 LayerIdMap::iterator iter = layer_id_map_.find(id); |
| 368 return iter != layer_id_map_.end() ? iter->second : NULL; | 373 return iter != layer_id_map_.end() ? iter->second : NULL; |
| 369 } | 374 } |
| 370 | 375 |
| 371 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { | 376 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { |
| 372 DCHECK(!LayerById(layer->id())); | 377 DCHECK(!LayerById(layer->id())); |
| 373 layer_id_map_[layer->id()] = layer; | 378 layer_id_map_[layer->id()] = layer; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 gfx::Vector2dF original_viewport_size = | 685 gfx::Vector2dF original_viewport_size = |
| 681 gfx::RectF(root_clip->bounds()).bottom_right() - | 686 gfx::RectF(root_clip->bounds()).bottom_right() - |
| 682 gfx::PointF(); | 687 gfx::PointF(); |
| 683 original_viewport_size.Scale(1 / page_scale_factor()); | 688 original_viewport_size.Scale(1 / page_scale_factor()); |
| 684 | 689 |
| 685 root_scroll->SetFixedContainerSizeDelta( | 690 root_scroll->SetFixedContainerSizeDelta( |
| 686 scrollable_viewport_size - original_viewport_size); | 691 scrollable_viewport_size - original_viewport_size); |
| 687 } | 692 } |
| 688 | 693 |
| 689 } // namespace cc | 694 } // namespace cc |
| OLD | NEW |