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 108969dedc6d9ba0d18887361e174964473b85a6..3ed0aeebfffe76207ba59d15e1b4c94b33bde6fb 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -1131,6 +1131,9 @@ void LayerTreeHostImpl::BlockNotifyReadyToActivateForTesting(bool block) { |
} |
void LayerTreeHostImpl::DidInitializeVisibleTileForTesting() { |
+ // Add arbitrary damage, to trigger prepare-to-draws. |
+ // Here, setting damage as viewport size, used only for testing. |
+ SetFullRootLayerDamage(); |
DidInitializeVisibleTile(); |
} |
@@ -1206,9 +1209,6 @@ void LayerTreeHostImpl::DidModifyTilePriorities() { |
} |
void LayerTreeHostImpl::DidInitializeVisibleTile() { |
- // TODO(reveman): Determine tiles that changed and only damage |
- // what's necessary. |
- SetFullRootLayerDamage(); |
if (client_ && !client_->IsInsideDraw()) |
client_->DidInitializeVisibleTileOnImplThread(); |
} |
@@ -1217,6 +1217,19 @@ void LayerTreeHostImpl::NotifyReadyToActivate() { |
client_->NotifyReadyToActivate(); |
} |
+void LayerTreeHostImpl::NotifyTileInitialized(const Tile* tile) { |
+ if (!active_tree_) |
+ return; |
+ |
+ LayerImpl* layer_impl = |
+ active_tree_->FindActiveTreeLayerById(tile->layer_id()); |
+ if (layer_impl) { |
+ gfx::RectF layer_damage_rect = |
+ gfx::ScaleRect(tile->content_rect(), 1.f / tile->contents_scale()); |
+ layer_impl->AddDamageRect(layer_damage_rect); |
+ } |
+} |
+ |
void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
SetManagedMemoryPolicy(policy, zero_budget_); |
} |