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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2873313004: Harmonize LayerTreeHost/LayerTreeHostImpl synchronization steps (Closed)
Patch Set: Ace of rebase 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
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after
2076 pending_tree()->property_trees()->effect_tree.set_needs_update(true); 2076 pending_tree()->property_trees()->effect_tree.set_needs_update(true);
2077 } 2077 }
2078 } 2078 }
2079 } 2079 }
2080 } 2080 }
2081 } 2081 }
2082 2082
2083 void LayerTreeHostImpl::ActivateSyncTree() { 2083 void LayerTreeHostImpl::ActivateSyncTree() {
2084 if (pending_tree_) { 2084 if (pending_tree_) {
2085 TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get()); 2085 TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get());
2086 active_tree_->lifecycle().AdvanceTo(LayerTreeLifecycle::kBeginningSync);
2086 2087
2087 DCHECK(pending_tree_duration_timer_); 2088 DCHECK(pending_tree_duration_timer_);
2088 // Reset will call the destructor and log the timer histogram. 2089 // Reset will call the destructor and log the timer histogram.
2089 pending_tree_duration_timer_.reset(); 2090 pending_tree_duration_timer_.reset();
2090 2091
2091 // Process any requests in the UI resource queue. The request queue is 2092 // Process any requests in the UI resource queue. The request queue is
2092 // given in LayerTreeHost::FinishCommitOnImplThread. This must take place 2093 // given in LayerTreeHost::FinishCommitOnImplThread. This must take place
2093 // before the swap. 2094 // before the swap.
2094 pending_tree_->ProcessUIResourceRequestQueue(); 2095 pending_tree_->ProcessUIResourceRequestQueue();
2095 2096
2096 if (pending_tree_->needs_full_tree_sync()) { 2097 if (pending_tree_->needs_full_tree_sync()) {
2097 TreeSynchronizer::SynchronizeTrees(pending_tree_.get(), 2098 TreeSynchronizer::SynchronizeTrees(pending_tree_.get(),
2098 active_tree_.get()); 2099 active_tree_.get());
2099 } 2100 }
2100 2101
2101 // Property trees may store damage status. We preserve the active tree 2102 PushScrollbarOpacitiesFromActiveToPending();
2102 // damage status by pushing the damage status from active tree property 2103 pending_tree_->PushPropertyTreesTo(active_tree_.get());
2103 // trees to pending tree property trees or by moving it onto the layers. 2104 active_tree_->lifecycle().AdvanceTo(
2104 if (active_tree_->property_trees()->changed) { 2105 LayerTreeLifecycle::kSyncedPropertyTrees);
2105 if (pending_tree_->property_trees()->sequence_number == 2106
2106 active_tree_->property_trees()->sequence_number)
2107 active_tree_->property_trees()->PushChangeTrackingTo(
2108 pending_tree_->property_trees());
2109 else
2110 active_tree_->MoveChangeTrackingToLayers();
2111 }
2112 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); 2107 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree());
2113 2108 active_tree_->lifecycle().AdvanceTo(
2114 PushScrollbarOpacitiesFromActiveToPending(); 2109 LayerTreeLifecycle::kSyncedLayerProperties);
2115 2110
2116 pending_tree_->PushPropertiesTo(active_tree_.get()); 2111 pending_tree_->PushPropertiesTo(active_tree_.get());
2117 if (!pending_tree_->LayerListIsEmpty()) 2112 if (!pending_tree_->LayerListIsEmpty())
2118 pending_tree_->property_trees()->ResetAllChangeTracking(); 2113 pending_tree_->property_trees()->ResetAllChangeTracking();
2119 2114
2115 active_tree_->lifecycle().AdvanceTo(LayerTreeLifecycle::kNotSyncing);
2116
2120 // Now that we've synced everything from the pending tree to the active 2117 // Now that we've synced everything from the pending tree to the active
2121 // tree, rename the pending tree the recycle tree so we can reuse it on the 2118 // tree, rename the pending tree the recycle tree so we can reuse it on the
2122 // next sync. 2119 // next sync.
2123 DCHECK(!recycle_tree_); 2120 DCHECK(!recycle_tree_);
2124 pending_tree_.swap(recycle_tree_); 2121 pending_tree_.swap(recycle_tree_);
2125 2122
2126 // If we commit to the active tree directly, this is already done during 2123 // If we commit to the active tree directly, this is already done during
2127 // commit. 2124 // commit.
2128 ActivateAnimations(); 2125 ActivateAnimations();
2129 2126
(...skipping 2215 matching lines...) Expand 10 before | Expand all | Expand 10 after
4345 4342
4346 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { 4343 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) {
4347 if (!element_id) 4344 if (!element_id)
4348 return; 4345 return;
4349 if (ScrollbarAnimationController* animation_controller = 4346 if (ScrollbarAnimationController* animation_controller =
4350 ScrollbarAnimationControllerForElementId(element_id)) 4347 ScrollbarAnimationControllerForElementId(element_id))
4351 animation_controller->DidScrollUpdate(); 4348 animation_controller->DidScrollUpdate();
4352 } 4349 }
4353 4350
4354 } // namespace cc 4351 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698