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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 12209022: cc: add rasterize time to continuous painting graph data in impl-side-painting (Closed) Base URL: http://git.chromium.org/chromium/src.git@raster
Patch Set: assume that rasterize time is saved after paint time Created 7 years, 10 months 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
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 , m_wheelScrolling(false) 150 , m_wheelScrolling(false)
151 , m_settings(settings) 151 , m_settings(settings)
152 , m_deviceScaleFactor(1) 152 , m_deviceScaleFactor(1)
153 , m_visible(true) 153 , m_visible(true)
154 , m_managedMemoryPolicy(PrioritizedResourceManager::defaultMemoryAllocationL imit(), 154 , m_managedMemoryPolicy(PrioritizedResourceManager::defaultMemoryAllocationL imit(),
155 ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING, 155 ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING,
156 0, 156 0,
157 ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING) 157 ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING)
158 , m_pinchGestureActive(false) 158 , m_pinchGestureActive(false)
159 , m_fpsCounter(FrameRateCounter::create(m_proxy->hasImplThread())) 159 , m_fpsCounter(FrameRateCounter::create(m_proxy->hasImplThread()))
160 , m_paintTimeCounter(PaintTimeCounter::create()) 160 , m_paintTimeCounter(PaintTimeCounter::create())
egraether 2013/02/13 20:28:07 Creating PaintTimeCounter in constructor again.
161 , m_memoryHistory(MemoryHistory::create()) 161 , m_memoryHistory(MemoryHistory::create())
162 , m_debugRectHistory(DebugRectHistory::create()) 162 , m_debugRectHistory(DebugRectHistory::create())
163 , m_numImplThreadScrolls(0) 163 , m_numImplThreadScrolls(0)
164 , m_numMainThreadScrolls(0) 164 , m_numMainThreadScrolls(0)
165 , m_cumulativeNumLayersDrawn(0) 165 , m_cumulativeNumLayersDrawn(0)
166 , m_cumulativeNumMissingTiles(0) 166 , m_cumulativeNumMissingTiles(0)
167 , m_lastSentMemoryVisibleBytes(0) 167 , m_lastSentMemoryVisibleBytes(0)
168 , m_lastSentMemoryVisibleAndNearbyBytes(0) 168 , m_lastSentMemoryVisibleAndNearbyBytes(0)
169 , m_lastSentMemoryUseBytes(0) 169 , m_lastSentMemoryUseBytes(0)
170 , m_animationRegistrar(AnimationRegistrar::create()) 170 , m_animationRegistrar(AnimationRegistrar::create())
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 m_activeTree->DidBecomeActive(); 1012 m_activeTree->DidBecomeActive();
1013 1013
1014 // Reduce wasted memory now that unlinked resources are guaranteed not 1014 // Reduce wasted memory now that unlinked resources are guaranteed not
1015 // to be used. 1015 // to be used.
1016 m_client->reduceWastedContentsTextureMemoryOnImplThread(); 1016 m_client->reduceWastedContentsTextureMemoryOnImplThread();
1017 1017
1018 m_client->onCanDrawStateChanged(canDraw()); 1018 m_client->onCanDrawStateChanged(canDraw());
1019 m_client->onHasPendingTreeStateChanged(pendingTree()); 1019 m_client->onHasPendingTreeStateChanged(pendingTree());
1020 m_client->setNeedsRedrawOnImplThread(); 1020 m_client->setNeedsRedrawOnImplThread();
1021 m_client->renewTreePriority(); 1021 m_client->renewTreePriority();
1022
1023 if (m_tileManager && m_debugState.continuousPainting) {
1024 RenderingStats stats;
1025 m_tileManager->GetRenderingStats(&stats);
1026 m_paintTimeCounter->SaveRasterizeTime(stats.totalRasterizeTimeForNowBins OnPendingTree, m_activeTree->source_frame_number());
1027 }
1022 } 1028 }
1023 1029
1024 void LayerTreeHostImpl::setVisible(bool visible) 1030 void LayerTreeHostImpl::setVisible(bool visible)
1025 { 1031 {
1026 DCHECK(m_proxy->isImplThread()); 1032 DCHECK(m_proxy->isImplThread());
1027 1033
1028 if (m_visible == visible) 1034 if (m_visible == visible)
1029 return; 1035 return;
1030 m_visible = visible; 1036 m_visible = visible;
1031 didVisibilityChange(this, m_visible); 1037 didVisibilityChange(this, m_visible);
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 1759
1754 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() 1760 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture()
1755 { 1761 {
1756 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); 1762 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree();
1757 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); 1763 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
1758 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); 1764 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
1759 } 1765 }
1760 1766
1761 void LayerTreeHostImpl::setDebugState(const LayerTreeDebugState& debugState) 1767 void LayerTreeHostImpl::setDebugState(const LayerTreeDebugState& debugState)
1762 { 1768 {
1769 if (m_debugState.continuousPainting != debugState.continuousPainting)
1770 m_paintTimeCounter->ClearHistory();
1771
1763 m_debugState = debugState; 1772 m_debugState = debugState;
1764 1773
1765 if (m_tileManager) 1774 if (m_tileManager)
1766 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats ()); 1775 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats ());
1767 } 1776 }
1768 1777
1769 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) 1778 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime, con st int& commitNumber)
egraether 2013/02/13 20:28:07 Changed naming to commitNumber.
1770 { 1779 {
1771 m_paintTimeCounter->SavePaintTime(totalPaintTime); 1780 DCHECK(m_debugState.continuousPainting);
1781 m_paintTimeCounter->SavePaintTime(totalPaintTime, commitNumber);
1772 } 1782 }
1773 1783
1774 } // namespace cc 1784 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | cc/paint_time_counter.h » ('j') | cc/paint_time_counter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698