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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/layer_tree_host.h" | 7 #include "cc/layer_tree_host.h" |
8 | 8 |
9 #include "Region.h" | 9 #include "Region.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 } | 661 } |
662 return needMoreUpdates; | 662 return needMoreUpdates; |
663 } | 663 } |
664 | 664 |
665 bool LayerTreeHost::paintLayerContents(const LayerList& renderSurfaceLayerList,
ResourceUpdateQueue& queue) | 665 bool LayerTreeHost::paintLayerContents(const LayerList& renderSurfaceLayerList,
ResourceUpdateQueue& queue) |
666 { | 666 { |
667 // Use FrontToBack to allow for testing occlusion and performing culling dur
ing the tree walk. | 667 // Use FrontToBack to allow for testing occlusion and performing culling dur
ing the tree walk. |
668 typedef LayerIterator<Layer, LayerList, RenderSurface, LayerIteratorActions:
:FrontToBack> LayerIteratorType; | 668 typedef LayerIterator<Layer, LayerList, RenderSurface, LayerIteratorActions:
:FrontToBack> LayerIteratorType; |
669 | 669 |
670 bool needMoreUpdates = false; | 670 bool needMoreUpdates = false; |
671 bool recordMetricsForFrame = true; // FIXME: In the future, disable this whe
n about:tracing is off. | 671 bool recordMetricsForFrame = base::debug::TraceLog::GetInstance() && base::d
ebug::TraceLog::GetInstance()->IsEnabled(); |
672 OcclusionTracker occlusionTracker(m_rootLayer->renderSurface()->contentRect(
), recordMetricsForFrame); | 672 OcclusionTracker occlusionTracker(m_rootLayer->renderSurface()->contentRect(
), recordMetricsForFrame); |
673 occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingS
ize); | 673 occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingS
ize); |
674 | 674 |
675 prioritizeTextures(renderSurfaceLayerList, occlusionTracker.overdrawMetrics(
)); | 675 prioritizeTextures(renderSurfaceLayerList, occlusionTracker.overdrawMetrics(
)); |
676 | 676 |
677 LayerIteratorType end = LayerIteratorType::end(&renderSurfaceLayerList); | 677 LayerIteratorType end = LayerIteratorType::end(&renderSurfaceLayerList); |
678 for (LayerIteratorType it = LayerIteratorType::begin(&renderSurfaceLayerList
); it != end; ++it) { | 678 for (LayerIteratorType it = LayerIteratorType::begin(&renderSurfaceLayerList
); it != end; ++it) { |
679 occlusionTracker.enterLayer(it); | 679 occlusionTracker.enterLayer(it); |
680 | 680 |
681 if (it.representsTargetRenderSurface()) { | 681 if (it.representsTargetRenderSurface()) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 else | 840 else |
841 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); | 841 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); |
842 } | 842 } |
843 } | 843 } |
844 | 844 |
845 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 845 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
846 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 846 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
847 } | 847 } |
848 | 848 |
849 } // namespace cc | 849 } // namespace cc |
OLD | NEW |