OLD | NEW |
---|---|
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 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1703 // are noted as they occur. | 1703 // are noted as they occur. |
1704 // TODO(boliu): If we did a temporary software renderer frame, propogate the | 1704 // TODO(boliu): If we did a temporary software renderer frame, propogate the |
1705 // damage forward to the next frame. | 1705 // damage forward to the next frame. |
1706 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { | 1706 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { |
1707 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> | 1707 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> |
1708 DidDrawDamagedArea(); | 1708 DidDrawDamagedArea(); |
1709 } | 1709 } |
1710 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); | 1710 active_tree_->root_layer()->ResetAllChangeTrackingForSubtree(); |
1711 active_tree_->property_trees()->transform_tree.ResetChangeTracking(); | 1711 active_tree_->property_trees()->transform_tree.ResetChangeTracking(); |
1712 active_tree_->property_trees()->effect_tree.ResetChangeTracking(); | 1712 active_tree_->property_trees()->effect_tree.ResetChangeTracking(); |
1713 active_tree_->property_trees()->full_tree_damaged = false; | |
1713 active_tree_->property_trees()->changed = false; | 1714 active_tree_->property_trees()->changed = false; |
ajuma
2016/03/02 14:34:10
Would it make sense to add a method to PropertyTre
jaydasika
2016/03/02 16:27:08
Done.
| |
1714 | 1715 |
1715 active_tree_->set_has_ever_been_drawn(true); | 1716 active_tree_->set_has_ever_been_drawn(true); |
1716 devtools_instrumentation::DidDrawFrame(id_); | 1717 devtools_instrumentation::DidDrawFrame(id_); |
1717 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( | 1718 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( |
1718 rendering_stats_instrumentation_->impl_thread_rendering_stats()); | 1719 rendering_stats_instrumentation_->impl_thread_rendering_stats()); |
1719 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); | 1720 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); |
1720 } | 1721 } |
1721 | 1722 |
1722 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { | 1723 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { |
1723 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) | 1724 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2005 pending_tree_->property_trees()); | 2006 pending_tree_->property_trees()); |
2006 else | 2007 else |
2007 active_tree_->root_layer()->PushLayerPropertyChangedForSubtree(); | 2008 active_tree_->root_layer()->PushLayerPropertyChangedForSubtree(); |
2008 } | 2009 } |
2009 TreeSynchronizer::PushProperties(pending_tree_->root_layer(), | 2010 TreeSynchronizer::PushProperties(pending_tree_->root_layer(), |
2010 active_tree_->root_layer()); | 2011 active_tree_->root_layer()); |
2011 pending_tree_->PushPropertiesTo(active_tree_.get()); | 2012 pending_tree_->PushPropertiesTo(active_tree_.get()); |
2012 if (pending_tree_->root_layer()) { | 2013 if (pending_tree_->root_layer()) { |
2013 pending_tree_->property_trees()->transform_tree.ResetChangeTracking(); | 2014 pending_tree_->property_trees()->transform_tree.ResetChangeTracking(); |
2014 pending_tree_->property_trees()->effect_tree.ResetChangeTracking(); | 2015 pending_tree_->property_trees()->effect_tree.ResetChangeTracking(); |
2016 pending_tree_->property_trees()->full_tree_damaged = false; | |
2015 pending_tree_->property_trees()->changed = false; | 2017 pending_tree_->property_trees()->changed = false; |
2016 } | 2018 } |
2017 | 2019 |
2018 // Now that we've synced everything from the pending tree to the active | 2020 // Now that we've synced everything from the pending tree to the active |
2019 // tree, rename the pending tree the recycle tree so we can reuse it on the | 2021 // tree, rename the pending tree the recycle tree so we can reuse it on the |
2020 // next sync. | 2022 // next sync. |
2021 DCHECK(!recycle_tree_); | 2023 DCHECK(!recycle_tree_); |
2022 pending_tree_.swap(recycle_tree_); | 2024 pending_tree_.swap(recycle_tree_); |
2023 | 2025 |
2024 UpdateViewportContainerSizes(); | 2026 UpdateViewportContainerSizes(); |
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3991 return task_runner_provider_->HasImplThread(); | 3993 return task_runner_provider_->HasImplThread(); |
3992 } | 3994 } |
3993 | 3995 |
3994 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3996 bool LayerTreeHostImpl::CommitToActiveTree() const { |
3995 // In single threaded mode we skip the pending tree and commit directly to the | 3997 // In single threaded mode we skip the pending tree and commit directly to the |
3996 // active tree. | 3998 // active tree. |
3997 return !task_runner_provider_->HasImplThread(); | 3999 return !task_runner_provider_->HasImplThread(); |
3998 } | 4000 } |
3999 | 4001 |
4000 } // namespace cc | 4002 } // namespace cc |
OLD | NEW |