diff options
author | egraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 23:10:08 +0000 |
---|---|---|
committer | egraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 23:10:08 +0000 |
commit | 90f52dcaaa23401ab60bbb7f689d98c73aa04f09 (patch) | |
tree | 54d613c9fe014d08a8a34db42cb8d8aaa8100932 | |
parent | 7aad021400abc8e5495c333f77e06b73bddbb722 (diff) | |
download | chromium_src-90f52dcaaa23401ab60bbb7f689d98c73aa04f09.zip chromium_src-90f52dcaaa23401ab60bbb7f689d98c73aa04f09.tar.gz chromium_src-90f52dcaaa23401ab60bbb7f689d98c73aa04f09.tar.bz2 |
cc: Fix paint time collection for continuous painting mode
This change moves the recordRenderingStats setting to LayerTreeDebugState and adds the new accessor LayerTreeDebugState::recordRenderingStats() that takes continuousPainting into account.
BUG=174354
Review URL: https://chromiumcodereview.appspot.com/12209018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181080 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | cc/layer_tree_debug_state.cc | 16 | ||||
-rw-r--r-- | cc/layer_tree_debug_state.h | 6 | ||||
-rw-r--r-- | cc/layer_tree_host.cc | 6 | ||||
-rw-r--r-- | cc/layer_tree_host_impl.cc | 2 | ||||
-rw-r--r-- | cc/layer_tree_settings.cc | 1 | ||||
-rw-r--r-- | cc/layer_tree_settings.h | 1 | ||||
-rw-r--r-- | content/renderer/gpu/render_widget_compositor.cc | 3 | ||||
-rw-r--r-- | webkit/compositor_bindings/web_layer_tree_view_impl.cc | 2 |
8 files changed, 27 insertions, 10 deletions
diff --git a/cc/layer_tree_debug_state.cc b/cc/layer_tree_debug_state.cc index c978f4f..0f68b6a 100644 --- a/cc/layer_tree_debug_state.cc +++ b/cc/layer_tree_debug_state.cc @@ -21,11 +21,20 @@ LayerTreeDebugState::LayerTreeDebugState() , showReplicaScreenSpaceRects(false) , showOccludingRects(false) , showNonOccludingRects(false) - , slowDownRasterScaleFactor(0) { } + , slowDownRasterScaleFactor(0) + , m_recordRenderingStats(false) { } LayerTreeDebugState::~LayerTreeDebugState() { } +void LayerTreeDebugState::setRecordRenderingStats(bool enabled) { + m_recordRenderingStats = enabled; +} + +bool LayerTreeDebugState::recordRenderingStats() const { + return m_recordRenderingStats || continuousPainting; +} + bool LayerTreeDebugState::showHudInfo() const { return showFPSCounter || showPlatformLayerTree || continuousPainting || showHudRects(); } @@ -50,7 +59,8 @@ bool LayerTreeDebugState::equal(const LayerTreeDebugState& a, const LayerTreeDeb a.showReplicaScreenSpaceRects == b.showReplicaScreenSpaceRects && a.showOccludingRects == b.showOccludingRects && a.showNonOccludingRects == b.showNonOccludingRects && - a.slowDownRasterScaleFactor == b.slowDownRasterScaleFactor); + a.slowDownRasterScaleFactor == b.slowDownRasterScaleFactor && + a.m_recordRenderingStats == b.m_recordRenderingStats); } LayerTreeDebugState LayerTreeDebugState::unite(const LayerTreeDebugState& a, const LayerTreeDebugState& b) { @@ -72,6 +82,8 @@ LayerTreeDebugState LayerTreeDebugState::unite(const LayerTreeDebugState& a, con if (b.slowDownRasterScaleFactor) r.slowDownRasterScaleFactor = b.slowDownRasterScaleFactor; + r.m_recordRenderingStats |= b.m_recordRenderingStats; + return r; } diff --git a/cc/layer_tree_debug_state.h b/cc/layer_tree_debug_state.h index 2c18ba1..9abda30 100644 --- a/cc/layer_tree_debug_state.h +++ b/cc/layer_tree_debug_state.h @@ -29,12 +29,18 @@ class CC_EXPORT LayerTreeDebugState { int slowDownRasterScaleFactor; + void setRecordRenderingStats(bool); + bool recordRenderingStats() const; + bool showHudInfo() const; bool showHudRects() const; bool hudNeedsFont() const; static bool equal(const LayerTreeDebugState& a, const LayerTreeDebugState& b); static LayerTreeDebugState unite(const LayerTreeDebugState& a, const LayerTreeDebugState& b); + +private: + bool m_recordRenderingStats; }; } // namespace cc diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc index cc08d55..3af415a 100644 --- a/cc/layer_tree_host.cc +++ b/cc/layer_tree_host.cc @@ -406,7 +406,7 @@ void LayerTreeHost::didDeferCommit() void LayerTreeHost::renderingStats(RenderingStats* stats) const { - CHECK(m_settings.recordRenderingStats); + CHECK(m_debugState.recordRenderingStats()); *stats = m_renderingStats; m_proxy->renderingStats(stats); } @@ -697,7 +697,7 @@ bool LayerTreeHost::paintMasksForRenderSurface(Layer* renderSurfaceLayer, Resour // in code, we already know that at least something will be drawn into this render surface, so the // mask and replica should be painted. - RenderingStats* stats = m_settings.recordRenderingStats ? &m_renderingStats : NULL; + RenderingStats* stats = m_debugState.recordRenderingStats() ? &m_renderingStats : NULL; bool needMoreUpdates = false; Layer* maskLayer = renderSurfaceLayer->maskLayer(); @@ -726,7 +726,7 @@ bool LayerTreeHost::paintLayerContents(const LayerList& renderSurfaceLayerList, prioritizeTextures(renderSurfaceLayerList, occlusionTracker.overdrawMetrics()); - RenderingStats* stats = m_settings.recordRenderingStats ? &m_renderingStats : NULL; + RenderingStats* stats = m_debugState.recordRenderingStats() ? &m_renderingStats : NULL; LayerIteratorType end = LayerIteratorType::end(&renderSurfaceLayerList); for (LayerIteratorType it = LayerIteratorType::begin(&renderSurfaceLayerList); it != end; ++it) { diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc index cef29de..691c0ae 100644 --- a/cc/layer_tree_host_impl.cc +++ b/cc/layer_tree_host_impl.cc @@ -1057,7 +1057,7 @@ bool LayerTreeHostImpl::initializeRenderer(scoped_ptr<OutputSurface> outputSurfa return false; if (m_settings.implSidePainting) - m_tileManager.reset(new TileManager(this, resourceProvider.get(), m_settings.numRasterThreads, m_settings.recordRenderingStats, m_settings.useCheapnessEstimator)); + m_tileManager.reset(new TileManager(this, resourceProvider.get(), m_settings.numRasterThreads, m_debugState.recordRenderingStats(), m_settings.useCheapnessEstimator)); if (outputSurface->Capabilities().has_parent_compositor) m_renderer = DelegatingRenderer::Create(this, outputSurface.get(), resourceProvider.get()); diff --git a/cc/layer_tree_settings.cc b/cc/layer_tree_settings.cc index 1f01424..f350943 100644 --- a/cc/layer_tree_settings.cc +++ b/cc/layer_tree_settings.cc @@ -29,7 +29,6 @@ LayerTreeSettings::LayerTreeSettings() , shouldClearRootRenderPass(true) , useLinearFadeScrollbarAnimator(false) , calculateTopControlsPosition(false) - , recordRenderingStats(false) , useCheapnessEstimator(false) , minimumContentsScale(0.0625f) , lowResContentsScaleFactor(0.125f) diff --git a/cc/layer_tree_settings.h b/cc/layer_tree_settings.h index ff8c574..e26df6c 100644 --- a/cc/layer_tree_settings.h +++ b/cc/layer_tree_settings.h @@ -32,7 +32,6 @@ class CC_EXPORT LayerTreeSettings { bool shouldClearRootRenderPass; bool useLinearFadeScrollbarAnimator; bool calculateTopControlsPosition; - bool recordRenderingStats; bool useCheapnessEstimator; float minimumContentsScale; float lowResContentsScaleFactor; diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 32ac46a..d13dff2 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -60,7 +60,8 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create( settings.implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch( cc::switches::kEnableImplSidePainting); - settings.recordRenderingStats = web_settings.recordRenderingStats; + settings.initialDebugState.setRecordRenderingStats( + web_settings.recordRenderingStats); settings.useCheapnessEstimator = CommandLine::ForCurrentProcess()->HasSwitch( cc::switches::kUseCheapnessEstimator); diff --git a/webkit/compositor_bindings/web_layer_tree_view_impl.cc b/webkit/compositor_bindings/web_layer_tree_view_impl.cc index b7a7101..7d66385 100644 --- a/webkit/compositor_bindings/web_layer_tree_view_impl.cc +++ b/webkit/compositor_bindings/web_layer_tree_view_impl.cc @@ -53,7 +53,7 @@ bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformLayerTree; settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders; settings.implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kEnableImplSidePainting); - settings.recordRenderingStats = webSettings.recordRenderingStats; + settings.initialDebugState.setRecordRenderingStats(webSettings.recordRenderingStats); settings.useCheapnessEstimator = CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCheapnessEstimator); settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableTopControlsPositionCalculation); |