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

Side by Side Diff: cc/layer_tree_host.cc

Issue 11312129: cc: Turn overdraw metrics on only when about:tracing is recording. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698