Chromium Code Reviews| Index: cc/layer_tree_host_impl.cc |
| diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc |
| index 607a50c2344ce9bc1810702f5238d2507b535de4..d760db2c645163de7d4defffae94998af8581d3e 100644 |
| --- a/cc/layer_tree_host_impl.cc |
| +++ b/cc/layer_tree_host_impl.cc |
| @@ -148,7 +148,6 @@ LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTre |
| ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING) |
| , m_pinchGestureActive(false) |
| , m_fpsCounter(FrameRateCounter::create(m_proxy->hasImplThread())) |
| - , m_paintTimeCounter(PaintTimeCounter::create()) |
|
nduca
2013/02/13 08:12:21
why do you defer the creation of the counter? It s
|
| , m_memoryHistory(MemoryHistory::create()) |
| , m_debugRectHistory(DebugRectHistory::create()) |
| , m_numImplThreadScrolls(0) |
| @@ -1009,6 +1008,13 @@ void LayerTreeHostImpl::activatePendingTree() |
| m_client->onHasPendingTreeStateChanged(pendingTree()); |
| m_client->setNeedsRedrawOnImplThread(); |
| m_client->renewTreePriority(); |
| + |
| + if (m_tileManager && m_debugState.continuousPainting) { |
| + DCHECK(m_paintTimeCounter.get()); |
| + RenderingStats stats; |
| + m_tileManager->GetRenderingStats(&stats); |
| + m_paintTimeCounter->SaveRasterizeTime(stats.totalRasterizeTimeForNowBinsOnPendingTree, m_activeTree->source_frame_number()); |
| + } |
| } |
| void LayerTreeHostImpl::setVisible(bool visible) |
| @@ -1723,15 +1729,23 @@ skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() |
| void LayerTreeHostImpl::setDebugState(const LayerTreeDebugState& debugState) |
| { |
| + if (m_debugState.continuousPainting != debugState.continuousPainting) { |
| + if (!m_paintTimeCounter.get()) |
| + m_paintTimeCounter = PaintTimeCounter::create(); |
| + m_paintTimeCounter->ClearHistory(); |
| + } |
| + |
| m_debugState = debugState; |
| if (m_tileManager) |
| m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats()); |
| } |
| -void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) |
| +void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime, const int& frameNumber) |
| { |
| - m_paintTimeCounter->SavePaintTime(totalPaintTime); |
| + DCHECK(m_debugState.continuousPainting); |
| + DCHECK(m_paintTimeCounter.get()); |
| + m_paintTimeCounter->SavePaintTime(totalPaintTime, frameNumber); |
|
nduca
2013/02/13 08:12:21
maybe we should use the word commitNumber here and
|
| } |
| } // namespace cc |