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

Side by Side Diff: cc/thread_proxy.cc

Issue 11028021: cc: Improve frame/commit accounting (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Make it work in single tread mode. Get rid of active concept. Created 8 years, 2 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 "config.h" 5 #include "config.h"
6 6
7 #include "CCThreadProxy.h" 7 #include "CCThreadProxy.h"
8 8
9 #include "CCDelayBasedTimeSource.h" 9 #include "CCDelayBasedTimeSource.h"
10 #include "CCDrawQuad.h" 10 #include "CCDrawQuad.h"
11 #include "CCFrameRateController.h" 11 #include "CCFrameRateController.h"
12 #include "CCFrameRateCounter.h"
12 #include "CCGraphicsContext.h" 13 #include "CCGraphicsContext.h"
13 #include "CCInputHandler.h" 14 #include "CCInputHandler.h"
14 #include "CCLayerTreeHost.h" 15 #include "CCLayerTreeHost.h"
15 #include "CCScheduler.h" 16 #include "CCScheduler.h"
16 #include "CCScopedThreadProxy.h" 17 #include "CCScopedThreadProxy.h"
17 #include "CCThreadTask.h" 18 #include "CCThreadTask.h"
18 #include "TraceEvent.h" 19 #include "TraceEvent.h"
19 #include <public/WebSharedGraphicsContext3D.h> 20 #include <public/WebSharedGraphicsContext3D.h>
20 #include <wtf/CurrentTime.h> 21 #include <wtf/CurrentTime.h>
21 22
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::didComp leteSwapBuffers)); 312 m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::didComp leteSwapBuffers));
312 } 313 }
313 314
314 void CCThreadProxy::onVSyncParametersChanged(double monotonicTimebase, double in tervalInSeconds) 315 void CCThreadProxy::onVSyncParametersChanged(double monotonicTimebase, double in tervalInSeconds)
315 { 316 {
316 ASSERT(isImplThread()); 317 ASSERT(isImplThread());
317 TRACE_EVENT2("cc", "CCThreadProxy::onVSyncParametersChanged", "monotonicTime base", monotonicTimebase, "intervalInSeconds", intervalInSeconds); 318 TRACE_EVENT2("cc", "CCThreadProxy::onVSyncParametersChanged", "monotonicTime base", monotonicTimebase, "intervalInSeconds", intervalInSeconds);
318 base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimeb ase * base::Time::kMicrosecondsPerSecond); 319 base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimeb ase * base::Time::kMicrosecondsPerSecond);
319 base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSecon ds * base::Time::kMicrosecondsPerSecond); 320 base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSecon ds * base::Time::kMicrosecondsPerSecond);
320 m_schedulerOnImplThread->setTimebaseAndInterval(timebase, interval); 321 m_schedulerOnImplThread->setTimebaseAndInterval(timebase, interval);
322 m_layerTreeHostImpl->fpsCounter()->setTimebaseAndInterval(timebase, interval );
321 } 323 }
322 324
323 void CCThreadProxy::onCanDrawStateChanged(bool canDraw) 325 void CCThreadProxy::onCanDrawStateChanged(bool canDraw)
324 { 326 {
325 ASSERT(isImplThread()); 327 ASSERT(isImplThread());
326 TRACE_EVENT1("cc", "CCThreadProxy::onCanDrawStateChanged", "canDraw", canDra w); 328 TRACE_EVENT1("cc", "CCThreadProxy::onCanDrawStateChanged", "canDraw", canDra w);
327 m_schedulerOnImplThread->setCanDraw(canDraw); 329 m_schedulerOnImplThread->setCanDraw(canDraw);
328 } 330 }
329 331
330 void CCThreadProxy::setNeedsCommitOnImplThread() 332 void CCThreadProxy::setNeedsCommitOnImplThread()
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 void CCThreadProxy::initializeRendererOnImplThread(CCCompletionEvent* completion , bool* initializeSucceeded, RendererCapabilities* capabilities) 890 void CCThreadProxy::initializeRendererOnImplThread(CCCompletionEvent* completion , bool* initializeSucceeded, RendererCapabilities* capabilities)
889 { 891 {
890 TRACE_EVENT0("cc", "CCThreadProxy::initializeRendererOnImplThread"); 892 TRACE_EVENT0("cc", "CCThreadProxy::initializeRendererOnImplThread");
891 ASSERT(isImplThread()); 893 ASSERT(isImplThread());
892 ASSERT(m_contextBeforeInitializationOnImplThread.get()); 894 ASSERT(m_contextBeforeInitializationOnImplThread.get());
893 *initializeSucceeded = m_layerTreeHostImpl->initializeRenderer(m_contextBefo reInitializationOnImplThread.Pass()); 895 *initializeSucceeded = m_layerTreeHostImpl->initializeRenderer(m_contextBefo reInitializationOnImplThread.Pass());
894 if (*initializeSucceeded) { 896 if (*initializeSucceeded) {
895 *capabilities = m_layerTreeHostImpl->rendererCapabilities(); 897 *capabilities = m_layerTreeHostImpl->rendererCapabilities();
896 m_schedulerOnImplThread->setSwapBuffersCompleteSupported( 898 m_schedulerOnImplThread->setSwapBuffersCompleteSupported(
897 capabilities->usingSwapCompleteCallback); 899 capabilities->usingSwapCompleteCallback);
900 onVSyncParametersChanged(0, 1/60.0);
898 } 901 }
899 902
900 completion->signal(); 903 completion->signal();
901 } 904 }
902 905
903 void CCThreadProxy::layerTreeHostClosedOnImplThread(CCCompletionEvent* completio n) 906 void CCThreadProxy::layerTreeHostClosedOnImplThread(CCCompletionEvent* completio n)
904 { 907 {
905 TRACE_EVENT0("cc", "CCThreadProxy::layerTreeHostClosedOnImplThread"); 908 TRACE_EVENT0("cc", "CCThreadProxy::layerTreeHostClosedOnImplThread");
906 ASSERT(isImplThread()); 909 ASSERT(isImplThread());
907 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->res ourceProvider()); 910 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->res ourceProvider());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() 948 CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState()
946 : monotonicFrameBeginTime(0) 949 : monotonicFrameBeginTime(0)
947 { 950 {
948 } 951 }
949 952
950 CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() 953 CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState()
951 { 954 {
952 } 955 }
953 956
954 } // namespace cc 957 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698