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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 672283003: cc: ReadyToDraw notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test. 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
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 822fcf3dc21881ff8f1ab1cc7964ac682079a3fc..5d104d4e8ed7f32e8aab5408b8c138de4fa8ddf7 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1403,10 +1403,8 @@ bool PictureLayerImpl::HasValidTilePriorities() const {
return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
}
-bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const {
- if (!layer_tree_impl()->IsPendingTree())
- return true;
-
+bool PictureLayerImpl::AllTilesRequiredAreReadyToDraw(
+ TileRequirementCheck is_tile_required_callback) const {
if (!HasValidTilePriorities())
return true;
@@ -1438,11 +1436,9 @@ 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 ((tiling->*is_tile_required_callback)(tile) &&
+ !tile->IsReadyToDraw()) {
+ TRACE_EVENT_INSTANT0("cc", "Tile required, but not ready to draw.",
TRACE_EVENT_SCOPE_THREAD);
return false;
}
@@ -1452,6 +1448,22 @@ bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const {
return true;
}
+bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const {
+ if (!layer_tree_impl()->IsPendingTree())
+ return true;
+
+ return AllTilesRequiredAreReadyToDraw(
+ &PictureLayerTiling::IsTileRequiredForActivationIfVisible);
+}
+
+bool PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw() const {
+ if (!layer_tree_impl()->IsActiveTree())
+ return true;
+
+ return AllTilesRequiredAreReadyToDraw(
+ &PictureLayerTiling::IsTileRequiredForDrawIfVisible);
+}
+
PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator()
: layer_(nullptr), current_stage_(arraysize(stages_)) {
}

Powered by Google App Engine
This is Rietveld 408576698