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