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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 2869513002: cc: Clear checker-image tracking on navigation and visibility changes. (Closed)
Patch Set: missed pending invalidations Created 3 years, 7 months 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/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 11a354ab33e91e5fba1808882b707e6504131573..1a3e1c9263cbbc08b963015ea1c90ce139b4ab84 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -301,6 +301,12 @@ void LayerTreeHost::FinishCommitOnImplThread(
if (needs_full_tree_sync_)
TreeSynchronizer::SynchronizeTrees(root_layer(), sync_tree);
+ // Track the navigation state before pushing properties since it overwrites
+ // the |content_source_id_| on the sync tree.
+ bool did_navigate = content_source_id_ != sync_tree->content_source_id();
+ if (did_navigate)
+ host_impl->ClearImageCacheOnNavigation();
+
PushPropertiesTo(sync_tree);
sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises());
@@ -314,11 +320,6 @@ void LayerTreeHost::FinishCommitOnImplThread(
sync_tree->SetDeviceScaleFactor(device_scale_factor_);
host_impl->SetDebugState(debug_state_);
- if (did_navigate_) {
- did_navigate_ = false;
- host_impl->ClearImageCacheOnNavigation();
- }
-
sync_tree->set_ui_resource_request_queue(
ui_resource_manager_->TakeUIResourcesRequests());
@@ -878,7 +879,6 @@ void LayerTreeHost::SetRootLayer(scoped_refptr<Layer> root_layer) {
ResetGpuRasterizationTracking();
SetNeedsFullTreeSync();
- did_navigate_ = true;
}
void LayerTreeHost::RegisterViewportLayers(

Powered by Google App Engine
This is Rietveld 408576698