Chromium Code Reviews| 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 77c484fd1a4a6bef187c2bec963533ec8a750c4f..d5bfdc7602c3d67ca695fd6983c63acf806ed101 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -1265,7 +1265,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(); |
| @@ -1273,15 +1274,15 @@ 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. |
| @@ -1291,6 +1292,7 @@ void LayerTreeHostImpl::GetPictureLayerImplPairs( |
| DCHECK(!twin_layer || twin_layer->GetTree() == PENDING_TREE); |
|
vmpstr
2014/11/04 18:15:16
while here, can you change this to DCHECK_IMPLIES(
USE eero AT chromium.org
2014/11/06 15:23:07
Done.
|
| 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)); |
| } |
| } |
| @@ -1300,7 +1302,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); |
| } |
| @@ -1308,7 +1310,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_, true); |
|
vmpstr
2014/11/04 18:15:16
false here?
USE eero AT chromium.org
2014/11/06 15:23:07
Yes.
|
| queue->Build(picture_layer_pairs_, tree_priority); |
| } |