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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 pending_tree()->property_trees()->effect_tree.set_needs_update(true); 2068 pending_tree()->property_trees()->effect_tree.set_needs_update(true);
2069 } 2069 }
2070 } 2070 }
2071 } 2071 }
2072 } 2072 }
2073 } 2073 }
2074 2074
2075 void LayerTreeHostImpl::ActivateSyncTree() { 2075 void LayerTreeHostImpl::ActivateSyncTree() {
2076 if (pending_tree_) { 2076 if (pending_tree_) {
2077 TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get()); 2077 TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get());
2078 active_tree_->lifecycle().AdvanceTo(LayerTreeLifecycle::kBeginningSync);
2078 2079
2079 DCHECK(pending_tree_duration_timer_); 2080 DCHECK(pending_tree_duration_timer_);
2080 // Reset will call the destructor and log the timer histogram. 2081 // Reset will call the destructor and log the timer histogram.
2081 pending_tree_duration_timer_.reset(); 2082 pending_tree_duration_timer_.reset();
2082 2083
2083 // Process any requests in the UI resource queue. The request queue is 2084 // Process any requests in the UI resource queue. The request queue is
2084 // given in LayerTreeHost::FinishCommitOnImplThread. This must take place 2085 // given in LayerTreeHost::FinishCommitOnImplThread. This must take place
2085 // before the swap. 2086 // before the swap.
2086 pending_tree_->ProcessUIResourceRequestQueue(); 2087 pending_tree_->ProcessUIResourceRequestQueue();
2087 2088
2088 if (pending_tree_->needs_full_tree_sync()) { 2089 if (pending_tree_->needs_full_tree_sync()) {
2089 TreeSynchronizer::SynchronizeTrees(pending_tree_.get(), 2090 TreeSynchronizer::SynchronizeTrees(pending_tree_.get(),
2090 active_tree_.get()); 2091 active_tree_.get());
2091 } 2092 }
2092 2093
2093 // Property trees may store damage status. We preserve the active tree 2094 PushScrollbarOpacitiesFromActiveToPending();
2094 // damage status by pushing the damage status from active tree property 2095 pending_tree_->PushPropertyTreesTo(active_tree_.get());
2095 // trees to pending tree property trees or by moving it onto the layers. 2096 active_tree_->lifecycle().AdvanceTo(
2096 if (active_tree_->property_trees()->changed) { 2097 LayerTreeLifecycle::kSyncedPropertyTrees);
2097 if (pending_tree_->property_trees()->sequence_number == 2098
2098 active_tree_->property_trees()->sequence_number)
2099 active_tree_->property_trees()->PushChangeTrackingTo(
2100 pending_tree_->property_trees());
2101 else
2102 active_tree_->MoveChangeTrackingToLayers();
2103 }
2104 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); 2099 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree());
2105 2100 active_tree_->lifecycle().AdvanceTo(
2106 PushScrollbarOpacitiesFromActiveToPending(); 2101 LayerTreeLifecycle::kSyncedLayerProperties);
2107 2102
2108 pending_tree_->PushPropertiesTo(active_tree_.get()); 2103 pending_tree_->PushPropertiesTo(active_tree_.get());
2109 if (!pending_tree_->LayerListIsEmpty()) 2104 if (!pending_tree_->LayerListIsEmpty())
2110 pending_tree_->property_trees()->ResetAllChangeTracking(); 2105 pending_tree_->property_trees()->ResetAllChangeTracking();
2111 2106
2107 active_tree_->lifecycle().AdvanceTo(LayerTreeLifecycle::kNotSyncing);
2108
2112 // Now that we've synced everything from the pending tree to the active 2109 // Now that we've synced everything from the pending tree to the active
2113 // tree, rename the pending tree the recycle tree so we can reuse it on the 2110 // tree, rename the pending tree the recycle tree so we can reuse it on the
2114 // next sync. 2111 // next sync.
2115 DCHECK(!recycle_tree_); 2112 DCHECK(!recycle_tree_);
2116 pending_tree_.swap(recycle_tree_); 2113 pending_tree_.swap(recycle_tree_);
2117 2114
2118 // If we commit to the active tree directly, this is already done during 2115 // If we commit to the active tree directly, this is already done during
2119 // commit. 2116 // commit.
2120 ActivateAnimations(); 2117 ActivateAnimations();
2121 2118
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
4333 4330
4334 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { 4331 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) {
4335 if (!element_id) 4332 if (!element_id)
4336 return; 4333 return;
4337 if (ScrollbarAnimationController* animation_controller = 4334 if (ScrollbarAnimationController* animation_controller =
4338 ScrollbarAnimationControllerForElementId(element_id)) 4335 ScrollbarAnimationControllerForElementId(element_id))
4339 animation_controller->DidScrollUpdate(); 4336 animation_controller->DidScrollUpdate();
4340 } 4337 }
4341 4338
4342 } // namespace cc 4339 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698