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

Side by Side Diff: cc/single_thread_proxy.cc

Issue 11198005: NOT READY FOR REVIEW - switch to a subscriber model for rendering stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing file. 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/single_thread_proxy.h ('k') | cc/thread_proxy.h » ('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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/single_thread_proxy.h" 7 #include "cc/single_thread_proxy.h"
8 8
9 #include "cc/rendering_stats_subscriber.h"
10 #include <wtf/CurrentTime.h>
11
12 using namespace WTF;
9 #include "base/debug/trace_event.h" 13 #include "base/debug/trace_event.h"
10 #include "cc/draw_quad.h" 14 #include "cc/draw_quad.h"
11 #include "cc/graphics_context.h" 15 #include "cc/graphics_context.h"
12 #include "cc/layer_tree_host.h" 16 #include "cc/layer_tree_host.h"
13 #include "cc/resource_update_controller.h" 17 #include "cc/resource_update_controller.h"
14 18
15 namespace cc { 19 namespace cc {
16 20
17 scoped_ptr<Proxy> SingleThreadProxy::create(LayerTreeHost* layerTreeHost) 21 scoped_ptr<Proxy> SingleThreadProxy::create(LayerTreeHost* layerTreeHost)
18 { 22 {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return initialized; 151 return initialized;
148 } 152 }
149 153
150 void SingleThreadProxy::renderingStats(RenderingStats* stats) 154 void SingleThreadProxy::renderingStats(RenderingStats* stats)
151 { 155 {
152 stats->totalCommitTimeInSeconds = m_totalCommitTime.InSecondsF(); 156 stats->totalCommitTimeInSeconds = m_totalCommitTime.InSecondsF();
153 stats->totalCommitCount = m_totalCommitCount; 157 stats->totalCommitCount = m_totalCommitCount;
154 m_layerTreeHostImpl->renderingStats(stats); 158 m_layerTreeHostImpl->renderingStats(stats);
155 } 159 }
156 160
161 void SingleThreadProxy::startRecordingRenderingStats()
162 {
163 // This subscriber will collect total commit time and total commit count.
164 m_renderingStatsSubscriber = RenderingStatsSubscriber::create();
165 m_layerTreeHostImpl->startRecordingRenderingStats();
166 }
167
168 void SingleThreadProxy::stopRecordingRenderingStats(RenderingStats* stats)
169 {
170 // TODO(vollick): populate stats based on the subscriber here.
171 m_renderingStatsSubscriber.reset();
172 m_layerTreeHostImpl->stopRecordingRenderingStats(stats);
173 }
174
157 const RendererCapabilities& SingleThreadProxy::rendererCapabilities() const 175 const RendererCapabilities& SingleThreadProxy::rendererCapabilities() const
158 { 176 {
159 DCHECK(m_rendererInitialized); 177 DCHECK(m_rendererInitialized);
160 // Note: this gets called during the commit by the "impl" thread 178 // Note: this gets called during the commit by the "impl" thread
161 return m_RendererCapabilitiesForMainThread; 179 return m_RendererCapabilitiesForMainThread;
162 } 180 }
163 181
164 void SingleThreadProxy::loseContext() 182 void SingleThreadProxy::loseContext()
165 { 183 {
166 DCHECK(Proxy::isMainThread()); 184 DCHECK(Proxy::isMainThread());
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 409
392 void SingleThreadProxy::didSwapFrame() 410 void SingleThreadProxy::didSwapFrame()
393 { 411 {
394 if (m_nextFrameIsNewlyCommittedFrame) { 412 if (m_nextFrameIsNewlyCommittedFrame) {
395 m_nextFrameIsNewlyCommittedFrame = false; 413 m_nextFrameIsNewlyCommittedFrame = false;
396 m_layerTreeHost->didCommitAndDrawFrame(); 414 m_layerTreeHost->didCommitAndDrawFrame();
397 } 415 }
398 } 416 }
399 417
400 } 418 }
OLDNEW
« no previous file with comments | « cc/single_thread_proxy.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698