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

Unified Diff: cc/trees/layer_tree_host_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index a2f4f32c8b4138d6f1b5dab0fd6a95d9e71d09b9..4c312e7a92e42ecdb83f9ab37b80d9ebc9ea2033 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1177,7 +1177,8 @@ void LayerTreeHostImpl::DidInitializeVisibleTile() {
}
void LayerTreeHostImpl::GetPictureLayerImplPairs(
- std::vector<PictureLayerImpl::Pair>* layer_pairs) const {
+ std::vector<PictureLayerImpl::Pair>* layer_pairs,
+ bool need_valid_tile_priorities) const {
DCHECK(layer_pairs->empty());
for (std::vector<PictureLayerImpl*>::const_iterator it =
picture_layers_.begin();
@@ -1185,24 +1186,25 @@ void LayerTreeHostImpl::GetPictureLayerImplPairs(
++it) {
PictureLayerImpl* layer = *it;
- // TODO(vmpstr): Iterators and should handle this instead. crbug.com/381704
- if (!layer->HasValidTilePriorities())
+ if (!layer->IsOnActiveOrPendingTree() ||
+ (need_valid_tile_priorities && !layer->HasValidTilePriorities()))
continue;
PictureLayerImpl* twin_layer = layer->GetPendingOrActiveTwinLayer();
// Ignore the twin layer when tile priorities are invalid.
- // TODO(vmpstr): Iterators should handle this instead. crbug.com/381704
- if (twin_layer && !twin_layer->HasValidTilePriorities())
+ if (need_valid_tile_priorities && twin_layer &&
+ !twin_layer->HasValidTilePriorities())
twin_layer = NULL;
// If the current tree is ACTIVE_TREE, then always generate a layer_pair.
// If current tree is PENDING_TREE, then only generate a layer_pair if
// there is no twin layer.
if (layer->GetTree() == ACTIVE_TREE) {
- DCHECK(!twin_layer || twin_layer->GetTree() == PENDING_TREE);
+ DCHECK_IMPLIES(twin_layer, twin_layer->GetTree() == PENDING_TREE);
layer_pairs->push_back(PictureLayerImpl::Pair(layer, twin_layer));
} else if (!twin_layer) {
+ DCHECK(layer->GetTree() == PENDING_TREE);
layer_pairs->push_back(PictureLayerImpl::Pair(NULL, layer));
}
}
@@ -1212,7 +1214,7 @@ void LayerTreeHostImpl::BuildRasterQueue(RasterTilePriorityQueue* queue,
TreePriority tree_priority) {
TRACE_EVENT0("cc", "LayerTreeHostImpl::BuildRasterQueue");
picture_layer_pairs_.clear();
- GetPictureLayerImplPairs(&picture_layer_pairs_);
+ GetPictureLayerImplPairs(&picture_layer_pairs_, true);
queue->Build(picture_layer_pairs_, tree_priority);
}
@@ -1220,7 +1222,7 @@ void LayerTreeHostImpl::BuildEvictionQueue(EvictionTilePriorityQueue* queue,
TreePriority tree_priority) {
TRACE_EVENT0("cc", "LayerTreeHostImpl::BuildEvictionQueue");
picture_layer_pairs_.clear();
- GetPictureLayerImplPairs(&picture_layer_pairs_);
+ GetPictureLayerImplPairs(&picture_layer_pairs_, false);
queue->Build(picture_layer_pairs_, tree_priority);
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698