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

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

Issue 1697613002: cc :: Move tracking of layer_property_changed to main thread (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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_host_impl_unittest.cc » ('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 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1697 1697
1698 // The next frame should start by assuming nothing has changed, and changes 1698 // The next frame should start by assuming nothing has changed, and changes
1699 // are noted as they occur. 1699 // are noted as they occur.
1700 // TODO(boliu): If we did a temporary software renderer frame, propogate the 1700 // TODO(boliu): If we did a temporary software renderer frame, propogate the
1701 // damage forward to the next frame. 1701 // damage forward to the next frame.
1702 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { 1702 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) {
1703 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> 1703 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()->
1704 DidDrawDamagedArea(); 1704 DidDrawDamagedArea();
1705 } 1705 }
1706 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); 1706 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree();
1707 active_tree_->root_layer()
1708 ->layer_tree_impl()
1709 ->property_trees()
1710 ->transform_tree.ResetChangeTracking();
1707 1711
1708 active_tree_->set_has_ever_been_drawn(true); 1712 active_tree_->set_has_ever_been_drawn(true);
1709 devtools_instrumentation::DidDrawFrame(id_); 1713 devtools_instrumentation::DidDrawFrame(id_);
1710 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( 1714 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent(
1711 rendering_stats_instrumentation_->impl_thread_rendering_stats()); 1715 rendering_stats_instrumentation_->impl_thread_rendering_stats());
1712 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); 1716 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats();
1713 } 1717 }
1714 1718
1715 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { 1719 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) {
1716 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) 1720 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i)
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1984 1988
1985 if (pending_tree_->needs_full_tree_sync()) { 1989 if (pending_tree_->needs_full_tree_sync()) {
1986 active_tree_->SetRootLayer( 1990 active_tree_->SetRootLayer(
1987 TreeSynchronizer::SynchronizeTrees(pending_tree_->root_layer(), 1991 TreeSynchronizer::SynchronizeTrees(pending_tree_->root_layer(),
1988 active_tree_->DetachLayerTree(), 1992 active_tree_->DetachLayerTree(),
1989 active_tree_.get())); 1993 active_tree_.get()));
1990 } 1994 }
1991 TreeSynchronizer::PushProperties(pending_tree_->root_layer(), 1995 TreeSynchronizer::PushProperties(pending_tree_->root_layer(),
1992 active_tree_->root_layer()); 1996 active_tree_->root_layer());
1993 pending_tree_->PushPropertiesTo(active_tree_.get()); 1997 pending_tree_->PushPropertiesTo(active_tree_.get());
1998 if (pending_tree_->root_layer()) {
1999 pending_tree_->root_layer()
2000 ->layer_tree_impl()
2001 ->property_trees()
2002 ->transform_tree.ResetChangeTracking();
2003 }
1994 2004
1995 // Now that we've synced everything from the pending tree to the active 2005 // Now that we've synced everything from the pending tree to the active
1996 // tree, rename the pending tree the recycle tree so we can reuse it on the 2006 // tree, rename the pending tree the recycle tree so we can reuse it on the
1997 // next sync. 2007 // next sync.
1998 DCHECK(!recycle_tree_); 2008 DCHECK(!recycle_tree_);
1999 pending_tree_.swap(recycle_tree_); 2009 pending_tree_.swap(recycle_tree_);
2000 2010
2001 UpdateViewportContainerSizes(); 2011 UpdateViewportContainerSizes();
2002 2012
2003 // If we commit to the active tree directly, this is already done during 2013 // If we commit to the active tree directly, this is already done during
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after
3867 return task_runner_provider_->HasImplThread(); 3877 return task_runner_provider_->HasImplThread();
3868 } 3878 }
3869 3879
3870 bool LayerTreeHostImpl::CommitToActiveTree() const { 3880 bool LayerTreeHostImpl::CommitToActiveTree() const {
3871 // In single threaded mode we skip the pending tree and commit directly to the 3881 // In single threaded mode we skip the pending tree and commit directly to the
3872 // active tree. 3882 // active tree.
3873 return !task_runner_provider_->HasImplThread(); 3883 return !task_runner_provider_->HasImplThread();
3874 } 3884 }
3875 3885
3876 } // namespace cc 3886 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698