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

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

Issue 1975623002: cc : Add LayerToPropertyTreeIndices map to PropertyTrees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 DCHECK(frame->render_passes.empty()); 1675 DCHECK(frame->render_passes.empty());
1676 1676
1677 // The next frame should start by assuming nothing has changed, and changes 1677 // The next frame should start by assuming nothing has changed, and changes
1678 // are noted as they occur. 1678 // are noted as they occur.
1679 // TODO(boliu): If we did a temporary software renderer frame, propogate the 1679 // TODO(boliu): If we did a temporary software renderer frame, propogate the
1680 // damage forward to the next frame. 1680 // damage forward to the next frame.
1681 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { 1681 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) {
1682 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> 1682 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()->
1683 DidDrawDamagedArea(); 1683 DidDrawDamagedArea();
1684 } 1684 }
1685 active_tree_->ResetAllChangeTracking(PropertyTrees::ResetFlags::ALL_TREES); 1685 active_tree_->ResetAllChangeTracking(
1686 PropertyTrees::Types::EFFECT_AND_TRANSFORM_TREES);
1686 1687
1687 active_tree_->set_has_ever_been_drawn(true); 1688 active_tree_->set_has_ever_been_drawn(true);
1688 devtools_instrumentation::DidDrawFrame(id_); 1689 devtools_instrumentation::DidDrawFrame(id_);
1689 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( 1690 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent(
1690 rendering_stats_instrumentation_->impl_thread_rendering_stats()); 1691 rendering_stats_instrumentation_->impl_thread_rendering_stats());
1691 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); 1692 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats();
1692 } 1693 }
1693 1694
1694 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { 1695 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) {
1695 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) 1696 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i)
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1975 active_tree_->property_trees()->PushChangeTrackingTo( 1976 active_tree_->property_trees()->PushChangeTrackingTo(
1976 pending_tree_->property_trees()); 1977 pending_tree_->property_trees());
1977 else 1978 else
1978 active_tree_->MoveChangeTrackingToLayers(); 1979 active_tree_->MoveChangeTrackingToLayers();
1979 } 1980 }
1980 1981
1981 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); 1982 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree());
1982 pending_tree_->PushPropertiesTo(active_tree_.get()); 1983 pending_tree_->PushPropertiesTo(active_tree_.get());
1983 if (pending_tree_->root_layer()) 1984 if (pending_tree_->root_layer())
1984 pending_tree_->property_trees()->ResetAllChangeTracking( 1985 pending_tree_->property_trees()->ResetAllChangeTracking(
1985 PropertyTrees::ResetFlags::ALL_TREES); 1986 PropertyTrees::Types::EFFECT_AND_TRANSFORM_TREES);
1986 1987
1987 // Now that we've synced everything from the pending tree to the active 1988 // Now that we've synced everything from the pending tree to the active
1988 // tree, rename the pending tree the recycle tree so we can reuse it on the 1989 // tree, rename the pending tree the recycle tree so we can reuse it on the
1989 // next sync. 1990 // next sync.
1990 DCHECK(!recycle_tree_); 1991 DCHECK(!recycle_tree_);
1991 pending_tree_.swap(recycle_tree_); 1992 pending_tree_.swap(recycle_tree_);
1992 1993
1993 // If we commit to the active tree directly, this is already done during 1994 // If we commit to the active tree directly, this is already done during
1994 // commit. 1995 // commit.
1995 ActivateAnimations(); 1996 ActivateAnimations();
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
3980 return task_runner_provider_->HasImplThread(); 3981 return task_runner_provider_->HasImplThread();
3981 } 3982 }
3982 3983
3983 bool LayerTreeHostImpl::CommitToActiveTree() const { 3984 bool LayerTreeHostImpl::CommitToActiveTree() const {
3984 // In single threaded mode we skip the pending tree and commit directly to the 3985 // In single threaded mode we skip the pending tree and commit directly to the
3985 // active tree. 3986 // active tree.
3986 return !task_runner_provider_->HasImplThread(); 3987 return !task_runner_provider_->HasImplThread();
3987 } 3988 }
3988 3989
3989 } // namespace cc 3990 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698