Chromium Code Reviews| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 554 bool resourceless_software_draw = (layer_tree_host_impl_->GetDrawMode() == | 554 bool resourceless_software_draw = (layer_tree_host_impl_->GetDrawMode() == |
| 555 DRAW_MODE_RESOURCELESS_SOFTWARE); | 555 DRAW_MODE_RESOURCELESS_SOFTWARE); |
| 556 | 556 |
| 557 // LayerIterator is used here instead of CallFunctionForSubtree to only | 557 // LayerIterator is used here instead of CallFunctionForSubtree to only |
| 558 // UpdateTilePriorities on layers that will be visible (and thus have valid | 558 // UpdateTilePriorities on layers that will be visible (and thus have valid |
| 559 // draw properties) and not because any ordering is required. | 559 // draw properties) and not because any ordering is required. |
| 560 typedef LayerIterator<LayerImpl> LayerIteratorType; | 560 typedef LayerIterator<LayerImpl> LayerIteratorType; |
| 561 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 561 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
| 562 size_t layers_updated_count = 0; | 562 size_t layers_updated_count = 0; |
| 563 bool tile_priorities_updated = false; | 563 bool tile_priorities_updated = false; |
| 564 if (!resourceless_software_draw) { | |
| 565 viewport_rect_for_tile_priority_ = | |
| 566 layer_tree_host_impl_->ViewportRectForTilePriority(); | |
|
boliu
2015/01/15 01:36:05
I guess this is ok now, but probably safer to move
hush (inactive)
2015/01/15 01:51:59
Yes. Done.
| |
| 567 } | |
| 568 | |
| 564 for (LayerIteratorType it = | 569 for (LayerIteratorType it = |
| 565 LayerIteratorType::Begin(&render_surface_layer_list_); | 570 LayerIteratorType::Begin(&render_surface_layer_list_); |
| 566 it != end; | 571 it != end; |
| 567 ++it) { | 572 ++it) { |
| 568 if (occlusion_tracker) | 573 if (occlusion_tracker) |
| 569 occlusion_tracker->EnterLayer(it); | 574 occlusion_tracker->EnterLayer(it); |
| 570 | 575 |
| 571 LayerImpl* layer = *it; | 576 LayerImpl* layer = *it; |
| 572 const Occlusion& occlusion_in_content_space = | 577 const Occlusion& occlusion_in_content_space = |
| 573 occlusion_tracker ? occlusion_tracker->GetCurrentOcclusionForLayer( | 578 occlusion_tracker ? occlusion_tracker->GetCurrentOcclusionForLayer( |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 811 | 816 |
| 812 gfx::Rect LayerTreeImpl::DeviceViewport() const { | 817 gfx::Rect LayerTreeImpl::DeviceViewport() const { |
| 813 return layer_tree_host_impl_->DeviceViewport(); | 818 return layer_tree_host_impl_->DeviceViewport(); |
| 814 } | 819 } |
| 815 | 820 |
| 816 gfx::Size LayerTreeImpl::DrawViewportSize() const { | 821 gfx::Size LayerTreeImpl::DrawViewportSize() const { |
| 817 return layer_tree_host_impl_->DrawViewportSize(); | 822 return layer_tree_host_impl_->DrawViewportSize(); |
| 818 } | 823 } |
| 819 | 824 |
| 820 const gfx::Rect LayerTreeImpl::ViewportRectForTilePriority() const { | 825 const gfx::Rect LayerTreeImpl::ViewportRectForTilePriority() const { |
| 821 return layer_tree_host_impl_->ViewportRectForTilePriority(); | 826 return viewport_rect_for_tile_priority_; |
| 822 } | 827 } |
| 823 | 828 |
| 824 scoped_ptr<ScrollbarAnimationController> | 829 scoped_ptr<ScrollbarAnimationController> |
| 825 LayerTreeImpl::CreateScrollbarAnimationController(LayerImpl* scrolling_layer) { | 830 LayerTreeImpl::CreateScrollbarAnimationController(LayerImpl* scrolling_layer) { |
| 826 DCHECK(settings().scrollbar_fade_delay_ms); | 831 DCHECK(settings().scrollbar_fade_delay_ms); |
| 827 DCHECK(settings().scrollbar_fade_duration_ms); | 832 DCHECK(settings().scrollbar_fade_duration_ms); |
| 828 base::TimeDelta delay = | 833 base::TimeDelta delay = |
| 829 base::TimeDelta::FromMilliseconds(settings().scrollbar_fade_delay_ms); | 834 base::TimeDelta::FromMilliseconds(settings().scrollbar_fade_delay_ms); |
| 830 base::TimeDelta resize_delay = base::TimeDelta::FromMilliseconds( | 835 base::TimeDelta resize_delay = base::TimeDelta::FromMilliseconds( |
| 831 settings().scrollbar_fade_resize_delay_ms); | 836 settings().scrollbar_fade_resize_delay_ms); |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1523 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1528 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
| 1524 pending_page_scale_animation_ = pending_animation.Pass(); | 1529 pending_page_scale_animation_ = pending_animation.Pass(); |
| 1525 } | 1530 } |
| 1526 | 1531 |
| 1527 scoped_ptr<PendingPageScaleAnimation> | 1532 scoped_ptr<PendingPageScaleAnimation> |
| 1528 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1533 LayerTreeImpl::TakePendingPageScaleAnimation() { |
| 1529 return pending_page_scale_animation_.Pass(); | 1534 return pending_page_scale_animation_.Pass(); |
| 1530 } | 1535 } |
| 1531 | 1536 |
| 1532 } // namespace cc | 1537 } // namespace cc |
| OLD | NEW |