| 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 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 DCHECK(frame->render_passes.empty()); | 1685 DCHECK(frame->render_passes.empty()); |
| 1686 | 1686 |
| 1687 // The next frame should start by assuming nothing has changed, and changes | 1687 // The next frame should start by assuming nothing has changed, and changes |
| 1688 // are noted as they occur. | 1688 // are noted as they occur. |
| 1689 // TODO(boliu): If we did a temporary software renderer frame, propogate the | 1689 // TODO(boliu): If we did a temporary software renderer frame, propogate the |
| 1690 // damage forward to the next frame. | 1690 // damage forward to the next frame. |
| 1691 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { | 1691 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { |
| 1692 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> | 1692 (*frame->render_surface_layer_list)[i]->render_surface()->damage_tracker()-> |
| 1693 DidDrawDamagedArea(); | 1693 DidDrawDamagedArea(); |
| 1694 } | 1694 } |
| 1695 active_tree_->ResetAllChangeTracking(PropertyTrees::ResetFlags::ALL_TREES); | 1695 active_tree_->ResetAllChangeTracking(); |
| 1696 | 1696 |
| 1697 active_tree_->set_has_ever_been_drawn(true); | 1697 active_tree_->set_has_ever_been_drawn(true); |
| 1698 devtools_instrumentation::DidDrawFrame(id_); | 1698 devtools_instrumentation::DidDrawFrame(id_); |
| 1699 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( | 1699 benchmark_instrumentation::IssueImplThreadRenderingStatsEvent( |
| 1700 rendering_stats_instrumentation_->impl_thread_rendering_stats()); | 1700 rendering_stats_instrumentation_->impl_thread_rendering_stats()); |
| 1701 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); | 1701 rendering_stats_instrumentation_->AccumulateAndClearImplThreadStats(); |
| 1702 } | 1702 } |
| 1703 | 1703 |
| 1704 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { | 1704 void LayerTreeHostImpl::DidDrawAllLayers(const FrameData& frame) { |
| 1705 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) | 1705 for (size_t i = 0; i < frame.will_draw_layers.size(); ++i) |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 pending_tree_->property_trees()); | 1986 pending_tree_->property_trees()); |
| 1987 else | 1987 else |
| 1988 active_tree_->MoveChangeTrackingToLayers(); | 1988 active_tree_->MoveChangeTrackingToLayers(); |
| 1989 } | 1989 } |
| 1990 active_tree_->property_trees()->PushOpacityIfNeeded( | 1990 active_tree_->property_trees()->PushOpacityIfNeeded( |
| 1991 pending_tree_->property_trees()); | 1991 pending_tree_->property_trees()); |
| 1992 | 1992 |
| 1993 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); | 1993 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); |
| 1994 pending_tree_->PushPropertiesTo(active_tree_.get()); | 1994 pending_tree_->PushPropertiesTo(active_tree_.get()); |
| 1995 if (pending_tree_->root_layer()) | 1995 if (pending_tree_->root_layer()) |
| 1996 pending_tree_->property_trees()->ResetAllChangeTracking( | 1996 pending_tree_->property_trees()->ResetAllChangeTracking(); |
| 1997 PropertyTrees::ResetFlags::ALL_TREES); | |
| 1998 | 1997 |
| 1999 // Now that we've synced everything from the pending tree to the active | 1998 // Now that we've synced everything from the pending tree to the active |
| 2000 // tree, rename the pending tree the recycle tree so we can reuse it on the | 1999 // tree, rename the pending tree the recycle tree so we can reuse it on the |
| 2001 // next sync. | 2000 // next sync. |
| 2002 DCHECK(!recycle_tree_); | 2001 DCHECK(!recycle_tree_); |
| 2003 pending_tree_.swap(recycle_tree_); | 2002 pending_tree_.swap(recycle_tree_); |
| 2004 | 2003 |
| 2005 // If we commit to the active tree directly, this is already done during | 2004 // If we commit to the active tree directly, this is already done during |
| 2006 // commit. | 2005 // commit. |
| 2007 ActivateAnimations(); | 2006 ActivateAnimations(); |
| (...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4004 const { | 4003 const { |
| 4005 return fixed_raster_scale_attempted_scale_change_history_.count() >= | 4004 return fixed_raster_scale_attempted_scale_change_history_.count() >= |
| 4006 kFixedRasterScaleAttemptedScaleChangeThreshold; | 4005 kFixedRasterScaleAttemptedScaleChangeThreshold; |
| 4007 } | 4006 } |
| 4008 | 4007 |
| 4009 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() { | 4008 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() { |
| 4010 fixed_raster_scale_attempted_scale_change_history_.set(0); | 4009 fixed_raster_scale_attempted_scale_change_history_.set(0); |
| 4011 } | 4010 } |
| 4012 | 4011 |
| 4013 } // namespace cc | 4012 } // namespace cc |
| OLD | NEW |