Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 681 } | 681 } |
| 682 | 682 |
| 683 PictureLayerTiling* PictureLayerImpl::GetRecycledTwinTiling( | 683 PictureLayerTiling* PictureLayerImpl::GetRecycledTwinTiling( |
| 684 const PictureLayerTiling* tiling) { | 684 const PictureLayerTiling* tiling) { |
| 685 PictureLayerImpl* recycled_twin = GetRecycledTwinLayer(); | 685 PictureLayerImpl* recycled_twin = GetRecycledTwinLayer(); |
| 686 if (!recycled_twin || !recycled_twin->tilings_) | 686 if (!recycled_twin || !recycled_twin->tilings_) |
| 687 return nullptr; | 687 return nullptr; |
| 688 return recycled_twin->tilings_->TilingAtScale(tiling->contents_scale()); | 688 return recycled_twin->tilings_->TilingAtScale(tiling->contents_scale()); |
| 689 } | 689 } |
| 690 | 690 |
| 691 TilePriority::PriorityBin PictureLayerImpl::GetMaxTilePriorityBin() const { | |
| 692 if (!HasValidTilePriorities()) | |
| 693 return TilePriority::EVENTUALLY; | |
| 694 return TilePriority::NOW; | |
| 695 } | |
| 696 | |
| 691 size_t PictureLayerImpl::GetMaxTilesForInterestArea() const { | 697 size_t PictureLayerImpl::GetMaxTilesForInterestArea() const { |
| 692 return layer_tree_impl()->settings().max_tiles_for_interest_area; | 698 return layer_tree_impl()->settings().max_tiles_for_interest_area; |
| 693 } | 699 } |
| 694 | 700 |
| 695 float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const { | 701 float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const { |
| 696 float skewport_target_time_in_frames = | 702 float skewport_target_time_in_frames = |
| 697 layer_tree_impl()->use_gpu_rasterization() | 703 layer_tree_impl()->use_gpu_rasterization() |
| 698 ? kGpuSkewportTargetTimeInFrames | 704 ? kGpuSkewportTargetTimeInFrames |
| 699 : kCpuSkewportTargetTimeInFrames; | 705 : kCpuSkewportTargetTimeInFrames; |
| 700 return skewport_target_time_in_frames * | 706 return skewport_target_time_in_frames * |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1585 | 1591 |
| 1586 PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator( | 1592 PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator( |
| 1587 PictureLayerImpl* layer, | 1593 PictureLayerImpl* layer, |
| 1588 TreePriority tree_priority) | 1594 TreePriority tree_priority) |
| 1589 : layer_(layer), | 1595 : layer_(layer), |
| 1590 tree_priority_(tree_priority), | 1596 tree_priority_(tree_priority), |
| 1591 current_category_(PictureLayerTiling::EVENTUALLY), | 1597 current_category_(PictureLayerTiling::EVENTUALLY), |
| 1592 current_tiling_range_type_(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES), | 1598 current_tiling_range_type_(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES), |
| 1593 current_tiling_(CurrentTilingRange().start - 1u) { | 1599 current_tiling_(CurrentTilingRange().start - 1u) { |
| 1594 // TODO(vmpstr): Once tile priorities are determined by the iterators, ensure | 1600 // TODO(vmpstr): Once tile priorities are determined by the iterators, ensure |
| 1595 // that layers that don't have valid tile priorities have lowest priorities so | 1601 // that layers that don't have valid tile priorities have lowest priorities so |
|
vmpstr
2014/11/08 00:18:42
This TODO can go away.
USE eero AT chromium.org
2014/11/10 09:53:07
Done.
| |
| 1596 // they evict their tiles first (crbug.com/381704) | 1602 // they evict their tiles first (crbug.com/381704) |
| 1597 DCHECK(layer_->tilings_); | 1603 DCHECK(layer_->tilings_); |
|
vmpstr
2014/11/08 00:18:42
I'm a bit worried that if we're adding layers with
USE eero AT chromium.org
2014/11/10 09:53:07
Done. I have not hit that case, but that does not
| |
| 1598 do { | 1604 do { |
| 1599 if (!AdvanceToNextTiling()) | 1605 if (!AdvanceToNextTiling()) |
| 1600 break; | 1606 break; |
| 1601 | 1607 |
| 1602 current_iterator_ = PictureLayerTiling::TilingEvictionTileIterator( | 1608 current_iterator_ = PictureLayerTiling::TilingEvictionTileIterator( |
| 1603 layer_->tilings_->tiling_at(CurrentTilingIndex()), | 1609 layer_->tilings_->tiling_at(CurrentTilingIndex()), |
| 1604 tree_priority, | 1610 tree_priority, |
| 1605 current_category_); | 1611 current_category_); |
| 1606 } while (!current_iterator_); | 1612 } while (!current_iterator_); |
| 1607 } | 1613 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1722 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1728 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
| 1723 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1729 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
| 1724 return tiling_range.end - 1 - current_tiling_range_offset; | 1730 return tiling_range.end - 1 - current_tiling_range_offset; |
| 1725 } | 1731 } |
| 1726 } | 1732 } |
| 1727 NOTREACHED(); | 1733 NOTREACHED(); |
| 1728 return 0; | 1734 return 0; |
| 1729 } | 1735 } |
| 1730 | 1736 |
| 1731 } // namespace cc | 1737 } // namespace cc |
| OLD | NEW |