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

Side by Side Diff: cc/layer_tree_host.cc

Issue 11369188: cc: Guard overdraw metrics behind the --trace-overdraw command-line flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: renderflags 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 "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
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
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
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