Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 690063002: cc: Do not ignore layers without valid priorities during eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase: CreateWith{Pile => RasterSource} Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 657 }
658 658
659 PictureLayerTiling* PictureLayerImpl::GetRecycledTwinTiling( 659 PictureLayerTiling* PictureLayerImpl::GetRecycledTwinTiling(
660 const PictureLayerTiling* tiling) { 660 const PictureLayerTiling* tiling) {
661 PictureLayerImpl* recycled_twin = GetRecycledTwinLayer(); 661 PictureLayerImpl* recycled_twin = GetRecycledTwinLayer();
662 if (!recycled_twin || !recycled_twin->tilings_) 662 if (!recycled_twin || !recycled_twin->tilings_)
663 return nullptr; 663 return nullptr;
664 return recycled_twin->tilings_->TilingAtScale(tiling->contents_scale()); 664 return recycled_twin->tilings_->TilingAtScale(tiling->contents_scale());
665 } 665 }
666 666
667 TilePriority::PriorityBin PictureLayerImpl::GetMaxTilePriorityBin() const {
668 if (!HasValidTilePriorities())
669 return TilePriority::EVENTUALLY;
670 return TilePriority::NOW;
671 }
672
667 size_t PictureLayerImpl::GetMaxTilesForInterestArea() const { 673 size_t PictureLayerImpl::GetMaxTilesForInterestArea() const {
668 return layer_tree_impl()->settings().max_tiles_for_interest_area; 674 return layer_tree_impl()->settings().max_tiles_for_interest_area;
669 } 675 }
670 676
671 float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const { 677 float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const {
672 float skewport_target_time_in_frames = 678 float skewport_target_time_in_frames =
673 layer_tree_impl()->use_gpu_rasterization() 679 layer_tree_impl()->use_gpu_rasterization()
674 ? kGpuSkewportTargetTimeInFrames 680 ? kGpuSkewportTargetTimeInFrames
675 : kCpuSkewportTargetTimeInFrames; 681 : kCpuSkewportTargetTimeInFrames;
676 return skewport_target_time_in_frames * 682 return skewport_target_time_in_frames *
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 current_tiling_(0u) { 1572 current_tiling_(0u) {
1567 } 1573 }
1568 1574
1569 PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator( 1575 PictureLayerImpl::LayerEvictionTileIterator::LayerEvictionTileIterator(
1570 PictureLayerImpl* layer, 1576 PictureLayerImpl* layer,
1571 TreePriority tree_priority) 1577 TreePriority tree_priority)
1572 : layer_(layer), 1578 : layer_(layer),
1573 tree_priority_(tree_priority), 1579 tree_priority_(tree_priority),
1574 current_category_(PictureLayerTiling::EVENTUALLY), 1580 current_category_(PictureLayerTiling::EVENTUALLY),
1575 current_tiling_range_type_(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES), 1581 current_tiling_range_type_(PictureLayerTilingSet::HIGHER_THAN_HIGH_RES),
1576 current_tiling_(CurrentTilingRange().start - 1u) { 1582 current_tiling_(0u) {
1577 // TODO(vmpstr): Once tile priorities are determined by the iterators, ensure 1583 // Early out if the layer has no tilings.
1578 // that layers that don't have valid tile priorities have lowest priorities so 1584 if (!layer_->tilings_ || !layer_->tilings_->num_tilings())
1579 // they evict their tiles first (crbug.com/381704) 1585 return;
1580 DCHECK(layer_->tilings_); 1586
1587 current_tiling_ = CurrentTilingRange().start - 1u;
1581 do { 1588 do {
1582 if (!AdvanceToNextTiling()) 1589 if (!AdvanceToNextTiling())
1583 break; 1590 break;
1584 1591
1585 current_iterator_ = PictureLayerTiling::TilingEvictionTileIterator( 1592 current_iterator_ = PictureLayerTiling::TilingEvictionTileIterator(
1586 layer_->tilings_->tiling_at(CurrentTilingIndex()), 1593 layer_->tilings_->tiling_at(CurrentTilingIndex()),
1587 tree_priority, 1594 tree_priority,
1588 current_category_); 1595 current_category_);
1589 } while (!current_iterator_); 1596 } while (!current_iterator_);
1590 } 1597 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); 1712 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange();
1706 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; 1713 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start;
1707 return tiling_range.end - 1 - current_tiling_range_offset; 1714 return tiling_range.end - 1 - current_tiling_range_offset;
1708 } 1715 }
1709 } 1716 }
1710 NOTREACHED(); 1717 NOTREACHED();
1711 return 0; 1718 return 0;
1712 } 1719 }
1713 1720
1714 } // namespace cc 1721 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698