| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 occlusion_tracker.ComputeVisibleRegionInScreen(); | 647 occlusion_tracker.ComputeVisibleRegionInScreen(); |
| 648 } | 648 } |
| 649 | 649 |
| 650 { | 650 { |
| 651 TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", | 651 TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateDrawProperties::UpdateTiles", |
| 652 "IsActive", IsActiveTree(), "SourceFrameNumber", | 652 "IsActive", IsActiveTree(), "SourceFrameNumber", |
| 653 source_frame_number_); | 653 source_frame_number_); |
| 654 const bool resourceless_software_draw = | 654 const bool resourceless_software_draw = |
| 655 (layer_tree_host_impl_->GetDrawMode() == | 655 (layer_tree_host_impl_->GetDrawMode() == |
| 656 DRAW_MODE_RESOURCELESS_SOFTWARE); | 656 DRAW_MODE_RESOURCELESS_SOFTWARE); |
| 657 static const Occlusion kEmptyOcclusion; | |
| 658 size_t layers_updated_count = 0; | 657 size_t layers_updated_count = 0; |
| 659 bool tile_priorities_updated = false; | 658 bool tile_priorities_updated = false; |
| 660 for (PictureLayerImpl* layer : picture_layers_) { | 659 for (PictureLayerImpl* layer : picture_layers_) { |
| 661 // TODO(danakj): Remove this to fix crbug.com/446751 | 660 // TODO(danakj): Remove this to fix crbug.com/446751 |
| 662 if (!layer->IsDrawnRenderSurfaceLayerListMember()) | 661 if (!layer->IsDrawnRenderSurfaceLayerListMember()) |
| 663 continue; | 662 continue; |
| 664 ++layers_updated_count; | 663 ++layers_updated_count; |
| 665 const Occlusion& occlusion = | 664 tile_priorities_updated |= layer->UpdateTiles(resourceless_software_draw); |
| 666 settings().use_occlusion_for_tile_prioritization | |
| 667 ? layer->draw_properties().occlusion_in_content_space | |
| 668 : kEmptyOcclusion; | |
| 669 tile_priorities_updated |= | |
| 670 layer->UpdateTiles(occlusion, resourceless_software_draw); | |
| 671 } | 665 } |
| 672 | 666 |
| 673 if (tile_priorities_updated) | 667 if (tile_priorities_updated) |
| 674 DidModifyTilePriorities(); | 668 DidModifyTilePriorities(); |
| 675 | 669 |
| 676 TRACE_EVENT_END1("cc", "LayerTreeImpl::UpdateTilePriorities", | 670 TRACE_EVENT_END1("cc", "LayerTreeImpl::UpdateTilePriorities", |
| 677 "layers_updated_count", layers_updated_count); | 671 "layers_updated_count", layers_updated_count); |
| 678 } | 672 } |
| 679 | 673 |
| 680 DCHECK(!needs_update_draw_properties_) << | 674 DCHECK(!needs_update_draw_properties_) << |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1622 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
| 1629 pending_page_scale_animation_ = pending_animation.Pass(); | 1623 pending_page_scale_animation_ = pending_animation.Pass(); |
| 1630 } | 1624 } |
| 1631 | 1625 |
| 1632 scoped_ptr<PendingPageScaleAnimation> | 1626 scoped_ptr<PendingPageScaleAnimation> |
| 1633 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1627 LayerTreeImpl::TakePendingPageScaleAnimation() { |
| 1634 return pending_page_scale_animation_.Pass(); | 1628 return pending_page_scale_animation_.Pass(); |
| 1635 } | 1629 } |
| 1636 | 1630 |
| 1637 } // namespace cc | 1631 } // namespace cc |
| OLD | NEW |