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 <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 "CalcDrawProperties should not set_needs_update_draw_properties()"; | 563 "CalcDrawProperties should not set_needs_update_draw_properties()"; |
564 return true; | 564 return true; |
565 } | 565 } |
566 | 566 |
567 const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { | 567 const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { |
568 // If this assert triggers, then the list is dirty. | 568 // If this assert triggers, then the list is dirty. |
569 DCHECK(!needs_update_draw_properties_); | 569 DCHECK(!needs_update_draw_properties_); |
570 return render_surface_layer_list_; | 570 return render_surface_layer_list_; |
571 } | 571 } |
572 | 572 |
573 gfx::SizeF LayerTreeImpl::ScrollableSize() const { | 573 gfx::Size LayerTreeImpl::ScrollableSize() const { |
574 LayerImpl* root_scroll_layer = OuterViewportScrollLayer() | 574 LayerImpl* root_scroll_layer = OuterViewportScrollLayer() |
575 ? OuterViewportScrollLayer() | 575 ? OuterViewportScrollLayer() |
576 : InnerViewportScrollLayer(); | 576 : InnerViewportScrollLayer(); |
577 if (!root_scroll_layer || root_scroll_layer->children().empty()) | 577 if (!root_scroll_layer || root_scroll_layer->children().empty()) |
578 return gfx::SizeF(); | 578 return gfx::Size(); |
579 return root_scroll_layer->children()[0]->bounds(); | 579 return root_scroll_layer->children()[0]->bounds(); |
580 } | 580 } |
581 | 581 |
582 LayerImpl* LayerTreeImpl::LayerById(int id) { | 582 LayerImpl* LayerTreeImpl::LayerById(int id) { |
583 LayerIdMap::iterator iter = layer_id_map_.find(id); | 583 LayerIdMap::iterator iter = layer_id_map_.find(id); |
584 return iter != layer_id_map_.end() ? iter->second : NULL; | 584 return iter != layer_id_map_.end() ? iter->second : NULL; |
585 } | 585 } |
586 | 586 |
587 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { | 587 void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { |
588 DCHECK(!LayerById(layer->id())); | 588 DCHECK(!LayerById(layer->id())); |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 page_scale, | 1505 page_scale, |
1506 duration.InSecondsF()); | 1506 duration.InSecondsF()); |
1507 } | 1507 } |
1508 } | 1508 } |
1509 | 1509 |
1510 scoped_ptr<PageScaleAnimation> LayerTreeImpl::TakePageScaleAnimation() { | 1510 scoped_ptr<PageScaleAnimation> LayerTreeImpl::TakePageScaleAnimation() { |
1511 return page_scale_animation_.Pass(); | 1511 return page_scale_animation_.Pass(); |
1512 } | 1512 } |
1513 | 1513 |
1514 } // namespace cc | 1514 } // namespace cc |
OLD | NEW |