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 fd8a50772a6372fc9bf87184205683a4e89f5edd..64daf4324882168a665459f93970c6c5203a1adb 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -1368,12 +1368,10 @@ bool PictureLayerImpl::HasValidTilePriorities() const { |
| return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
| } |
| -bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
| - TRACE_EVENT0("cc", |
| - "PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw"); |
| - if (!layer_tree_impl()->IsPendingTree()) |
| - return true; |
| - |
| +bool PictureLayerImpl::AllTilesRequiredAreReadyToDraw( |
| + const char* action_name, |
|
vmpstr
2014/10/24 18:02:23
I don't think we need this. I'm not a fan of passi
ernstm
2014/10/27 21:13:56
Done.
|
| + const base::Callback<bool(PictureLayerTiling* tiling, const Tile*)>& |
| + IsTileRequiredCallback) const { |
| if (!HasValidTilePriorities()) |
| return true; |
| @@ -1405,12 +1403,12 @@ 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", |
| - TRACE_EVENT_SCOPE_THREAD); |
| + if (IsTileRequiredCallback.Run(tiling, tile) && !tile->IsReadyToDraw()) { |
| + std::string event_name = "Tiles required for " + |
|
vmpstr
2014/10/24 18:02:23
This would be constructed even when tracing is not
ernstm
2014/10/27 21:13:56
Done.
|
| + std::string(action_name) + |
| + " not ready to draw."; |
| + TRACE_EVENT_INSTANT0( |
| + "cc", event_name.c_str(), TRACE_EVENT_SCOPE_THREAD); |
| return false; |
| } |
| } |
| @@ -1419,6 +1417,37 @@ bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
| return true; |
| } |
| +bool PictureLayerImpl::IsTileRequiredForActivation(PictureLayerTiling* tiling, |
| + const Tile* tile) { |
| + return tiling->IsTileRequiredForActivation(tile); |
| +} |
| + |
| +bool PictureLayerImpl::IsTileRequiredForDraw(PictureLayerTiling* tiling, |
| + const Tile* tile) { |
| + return tiling->IsTileRequiredForDraw(tile); |
| +} |
| + |
| +bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
| + TRACE_EVENT0("cc", |
| + "PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw"); |
| + |
| + if (!layer_tree_impl()->IsPendingTree()) |
| + return true; |
| + |
| + return AllTilesRequiredAreReadyToDraw( |
| + "activation", base::Bind(&PictureLayerImpl::IsTileRequiredForActivation)); |
| +} |
| + |
| +bool PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw() const { |
| + TRACE_EVENT0("cc", "PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw"); |
| + |
| + if (!layer_tree_impl()->IsActiveTree()) |
| + return true; |
| + |
| + return AllTilesRequiredAreReadyToDraw( |
| + "draw", base::Bind(&PictureLayerImpl::IsTileRequiredForDraw)); |
| +} |
| + |
| PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator() |
| : layer_(nullptr), current_stage_(arraysize(stages_)) { |
| } |