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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2873313004: Harmonize LayerTreeHost/LayerTreeHostImpl synchronization steps (Closed)
Patch Set: Fix merge conflict with https://codereview.chromium.org/2877033002 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_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 94d52bc4c717933db54f59c621e1dd06b22ba948..61a19b0436259e04563e9a568e7ec8a5aed68921 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2075,6 +2075,7 @@ void LayerTreeHostImpl::PushScrollbarOpacitiesFromActiveToPending() {
void LayerTreeHostImpl::ActivateSyncTree() {
if (pending_tree_) {
TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get());
+ active_tree_->lifecycle().AdvanceTo(LayerTreeLifecycle::kBeginningSync);
DCHECK(pending_tree_duration_timer_);
// Reset will call the destructor and log the timer histogram.
@@ -2090,25 +2091,21 @@ void LayerTreeHostImpl::ActivateSyncTree() {
active_tree_.get());
}
- // Property trees may store damage status. We preserve the active tree
- // damage status by pushing the damage status from active tree property
- // trees to pending tree property trees or by moving it onto the layers.
- if (active_tree_->property_trees()->changed) {
- if (pending_tree_->property_trees()->sequence_number ==
- active_tree_->property_trees()->sequence_number)
- active_tree_->property_trees()->PushChangeTrackingTo(
- pending_tree_->property_trees());
- else
- active_tree_->MoveChangeTrackingToLayers();
- }
- TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree());
-
PushScrollbarOpacitiesFromActiveToPending();
+ pending_tree_->PushPropertyTreesTo(active_tree_.get());
+ active_tree_->lifecycle().AdvanceTo(
+ LayerTreeLifecycle::kSyncedPropertyTrees);
+
+ TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree());
+ active_tree_->lifecycle().AdvanceTo(
+ LayerTreeLifecycle::kSyncedLayerProperties);
pending_tree_->PushPropertiesTo(active_tree_.get());
if (!pending_tree_->LayerListIsEmpty())
pending_tree_->property_trees()->ResetAllChangeTracking();
+ active_tree_->lifecycle().AdvanceTo(LayerTreeLifecycle::kNotSyncing);
+
// Now that we've synced everything from the pending tree to the active
// tree, rename the pending tree the recycle tree so we can reuse it on the
// next sync.

Powered by Google App Engine
This is Rietveld 408576698