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

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: Rebase to 182752 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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 m_activeTree->DidBecomeActive(); 1016 m_activeTree->DidBecomeActive();
1017 1017
1018 // Reduce wasted memory now that unlinked resources are guaranteed not 1018 // Reduce wasted memory now that unlinked resources are guaranteed not
1019 // to be used. 1019 // to be used.
1020 m_client->reduceWastedContentsTextureMemoryOnImplThread(); 1020 m_client->reduceWastedContentsTextureMemoryOnImplThread();
1021 1021
1022 m_client->onCanDrawStateChanged(canDraw()); 1022 m_client->onCanDrawStateChanged(canDraw());
1023 m_client->onHasPendingTreeStateChanged(pendingTree()); 1023 m_client->onHasPendingTreeStateChanged(pendingTree());
1024 m_client->setNeedsRedrawOnImplThread(); 1024 m_client->setNeedsRedrawOnImplThread();
1025 m_client->renewTreePriority(); 1025 m_client->renewTreePriority();
1026
1027 if (m_tileManager && m_debugState.continuousPainting) {
1028 RenderingStats stats;
1029 m_tileManager->GetRenderingStats(&stats);
1030 m_paintTimeCounter->SaveRasterizeTime(stats.totalRasterizeTimeForNowBins OnPendingTree, m_activeTree->source_frame_number());
1031 }
1026 } 1032 }
1027 1033
1028 void LayerTreeHostImpl::setVisible(bool visible) 1034 void LayerTreeHostImpl::setVisible(bool visible)
1029 { 1035 {
1030 DCHECK(m_proxy->isImplThread()); 1036 DCHECK(m_proxy->isImplThread());
1031 1037
1032 if (m_visible == visible) 1038 if (m_visible == visible)
1033 return; 1039 return;
1034 m_visible = visible; 1040 m_visible = visible;
1035 didVisibilityChange(this, m_visible); 1041 didVisibilityChange(this, m_visible);
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 1767
1762 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() 1768 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture()
1763 { 1769 {
1764 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); 1770 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree();
1765 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); 1771 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
1766 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); 1772 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
1767 } 1773 }
1768 1774
1769 void LayerTreeHostImpl::setDebugState(const LayerTreeDebugState& debugState) 1775 void LayerTreeHostImpl::setDebugState(const LayerTreeDebugState& debugState)
1770 { 1776 {
1777 if (m_debugState.continuousPainting != debugState.continuousPainting)
1778 m_paintTimeCounter->ClearHistory();
1779
1771 m_debugState = debugState; 1780 m_debugState = debugState;
1772 1781
1773 if (m_tileManager) 1782 if (m_tileManager)
1774 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats ()); 1783 m_tileManager->SetRecordRenderingStats(m_debugState.recordRenderingStats ());
1775 } 1784 }
1776 1785
1777 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime) 1786 void LayerTreeHostImpl::savePaintTime(const base::TimeDelta& totalPaintTime, con st int& commitNumber)
1778 { 1787 {
1779 m_paintTimeCounter->SavePaintTime(totalPaintTime); 1788 DCHECK(m_debugState.continuousPainting);
1789 m_paintTimeCounter->SavePaintTime(totalPaintTime, commitNumber);
1780 } 1790 }
1781 1791
1782 } // namespace cc 1792 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698