Chromium Code Reviews| Index: cc/layers/picture_layer_impl.cc |
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
| index c3c7ca021104ba5f2468b233838d45beee16c845..aaf3481ffa7b66449fae4362768f13699a794799 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -1405,12 +1405,9 @@ bool PictureLayerImpl::HasValidTilePriorities() const { |
| return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
| } |
| -bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
| - TRACE_EVENT0("cc", |
| - "PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw"); |
| - if (!layer_tree_impl()->IsPendingTree()) |
| - return true; |
| - |
| +template <typename F> |
|
vmpstr
2014/11/03 23:07:00
nit: I think F == bool (*)(PictureLayerTiling*, co
ernstm
2014/11/04 00:21:55
Done. This is what I originally wanted to do, but
|
| +bool PictureLayerImpl::AllTilesRequiredAreReadyToDraw( |
| + const F& is_tile_required_callback) const { |
| if (!HasValidTilePriorities()) |
| return true; |
| @@ -1442,11 +1439,8 @@ bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
| // be out of date. It is updated in the raster/eviction iterators. |
| // TODO(vmpstr): Remove the comment once you can't access this information |
| // from the tile. |
| - if (tiling->IsTileRequiredForActivation(tile) && !tile->IsReadyToDraw()) { |
| - TRACE_EVENT_INSTANT0("cc", |
| - "PictureLayerImpl::" |
| - "AllTilesRequiredForActivationAreReadyToDraw not " |
| - "ready to activate", |
| + if (is_tile_required_callback(tiling, tile) && !tile->IsReadyToDraw()) { |
| + TRACE_EVENT_INSTANT0("cc", "Tile required, but not ready to draw.", |
| TRACE_EVENT_SCOPE_THREAD); |
| return false; |
| } |
| @@ -1456,6 +1450,37 @@ bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
| return true; |
| } |
| +namespace { |
|
vmpstr
2014/11/03 23:07:00
nit: I prefer anonymous namespace to be at the top
ernstm
2014/11/04 00:21:55
Done.
|
| +bool IsTileRequiredForActivationIfVisible(PictureLayerTiling* tiling, |
| + const Tile* tile) { |
| + return tiling->IsTileRequiredForActivationIfVisible(tile); |
| +} |
| + |
| +bool IsTileRequiredForDrawIfVisible(PictureLayerTiling* tiling, |
| + const Tile* tile) { |
| + return tiling->IsTileRequiredForDrawIfVisible(tile); |
| +} |
| +} // namespace |
| + |
| +bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
| + TRACE_EVENT0("cc", |
| + "PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw"); |
| + |
| + if (!layer_tree_impl()->IsPendingTree()) |
| + return true; |
| + |
| + return AllTilesRequiredAreReadyToDraw(&IsTileRequiredForActivationIfVisible); |
| +} |
| + |
| +bool PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw() const { |
| + TRACE_EVENT0("cc", "PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw"); |
| + |
| + if (!layer_tree_impl()->IsActiveTree()) |
| + return true; |
| + |
| + return AllTilesRequiredAreReadyToDraw(&IsTileRequiredForDrawIfVisible); |
| +} |
| + |
| PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator() |
| : layer_(nullptr), current_stage_(arraysize(stages_)) { |
| } |