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

Side by Side Diff: cc/layer_tree_host_impl.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 | « cc/layer_tree_host.cc ('k') | cc/overdraw_metrics.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_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 calculateRenderSurfaceLayerList(*frame.renderSurfaceLayerList); 377 calculateRenderSurfaceLayerList(*frame.renderSurfaceLayerList);
378 378
379 TRACE_EVENT1("cc", "LayerTreeHostImpl::calculateRenderPasses", "renderSurfac eLayerList.size()", static_cast<long long unsigned>(frame.renderSurfaceLayerList ->size())); 379 TRACE_EVENT1("cc", "LayerTreeHostImpl::calculateRenderPasses", "renderSurfac eLayerList.size()", static_cast<long long unsigned>(frame.renderSurfaceLayerList ->size()));
380 380
381 // Create the render passes in dependency order. 381 // Create the render passes in dependency order.
382 for (int surfaceIndex = frame.renderSurfaceLayerList->size() - 1; surfaceInd ex >= 0 ; --surfaceIndex) { 382 for (int surfaceIndex = frame.renderSurfaceLayerList->size() - 1; surfaceInd ex >= 0 ; --surfaceIndex) {
383 LayerImpl* renderSurfaceLayer = (*frame.renderSurfaceLayerList)[surfaceI ndex]; 383 LayerImpl* renderSurfaceLayer = (*frame.renderSurfaceLayerList)[surfaceI ndex];
384 renderSurfaceLayer->renderSurface()->appendRenderPasses(frame); 384 renderSurfaceLayer->renderSurface()->appendRenderPasses(frame);
385 } 385 }
386 386
387 bool recordMetricsForFrame = base::debug::TraceLog::GetInstance() && base::d ebug::TraceLog::GetInstance()->IsEnabled(); 387 bool recordMetricsForFrame = Settings::traceOverdraw() && base::debug::Trace Log::GetInstance() && base::debug::TraceLog::GetInstance()->IsEnabled();
388 OcclusionTrackerImpl occlusionTracker(m_rootLayerImpl->renderSurface()->cont entRect(), recordMetricsForFrame); 388 OcclusionTrackerImpl occlusionTracker(m_rootLayerImpl->renderSurface()->cont entRect(), recordMetricsForFrame);
389 occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingS ize); 389 occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingS ize);
390 390
391 if (settings().showOccludingRects) 391 if (settings().showOccludingRects)
392 occlusionTracker.setOccludingScreenSpaceRectsContainer(&frame.occludingS creenSpaceRects); 392 occlusionTracker.setOccludingScreenSpaceRectsContainer(&frame.occludingS creenSpaceRects);
393 393
394 // Add quads to the Render passes in FrontToBack order to allow for testing occlusion and performing culling during the tree walk. 394 // Add quads to the Render passes in FrontToBack order to allow for testing occlusion and performing culling during the tree walk.
395 typedef LayerIterator<LayerImpl, std::vector<LayerImpl*>, RenderSurfaceImpl, LayerIteratorActions::FrontToBack> LayerIteratorType; 395 typedef LayerIterator<LayerImpl, std::vector<LayerImpl*>, RenderSurfaceImpl, LayerIteratorActions::FrontToBack> LayerIteratorType;
396 396
397 // Typically when we are missing a texture and use a checkerboard quad, we s till draw the frame. However when the layer being 397 // Typically when we are missing a texture and use a checkerboard quad, we s till draw the frame. However when the layer being
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1488 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1489 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1489 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1490 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1490 if (scrollbarController && scrollbarController->animate(monotonicTime))
1491 m_client->setNeedsRedrawOnImplThread(); 1491 m_client->setNeedsRedrawOnImplThread();
1492 1492
1493 for (size_t i = 0; i < layer->children().size(); ++i) 1493 for (size_t i = 0; i < layer->children().size(); ++i)
1494 animateScrollbarsRecursive(layer->children()[i], time); 1494 animateScrollbarsRecursive(layer->children()[i], time);
1495 } 1495 }
1496 1496
1497 } // namespace cc 1497 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host.cc ('k') | cc/overdraw_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698