| OLD | NEW |
| 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 Loading... |
| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 void CCThreadProxy::initializeRendererOnImplThread(CCCompletionEvent* completion
, bool* initializeSucceeded, RendererCapabilities* capabilities) | 894 void CCThreadProxy::initializeRendererOnImplThread(CCCompletionEvent* completion
, bool* initializeSucceeded, RendererCapabilities* capabilities) |
| 893 { | 895 { |
| 894 TRACE_EVENT0("cc", "CCThreadProxy::initializeRendererOnImplThread"); | 896 TRACE_EVENT0("cc", "CCThreadProxy::initializeRendererOnImplThread"); |
| 895 ASSERT(isImplThread()); | 897 ASSERT(isImplThread()); |
| 896 ASSERT(m_contextBeforeInitializationOnImplThread.get()); | 898 ASSERT(m_contextBeforeInitializationOnImplThread.get()); |
| 897 *initializeSucceeded = m_layerTreeHostImpl->initializeRenderer(m_contextBefo
reInitializationOnImplThread.Pass()); | 899 *initializeSucceeded = m_layerTreeHostImpl->initializeRenderer(m_contextBefo
reInitializationOnImplThread.Pass()); |
| 898 if (*initializeSucceeded) { | 900 if (*initializeSucceeded) { |
| 899 *capabilities = m_layerTreeHostImpl->rendererCapabilities(); | 901 *capabilities = m_layerTreeHostImpl->rendererCapabilities(); |
| 900 m_schedulerOnImplThread->setSwapBuffersCompleteSupported( | 902 m_schedulerOnImplThread->setSwapBuffersCompleteSupported( |
| 901 capabilities->usingSwapCompleteCallback); | 903 capabilities->usingSwapCompleteCallback); |
| 904 onVSyncParametersChanged(0, 1/60.0); |
| 902 } | 905 } |
| 903 | 906 |
| 904 completion->signal(); | 907 completion->signal(); |
| 905 } | 908 } |
| 906 | 909 |
| 907 void CCThreadProxy::layerTreeHostClosedOnImplThread(CCCompletionEvent* completio
n) | 910 void CCThreadProxy::layerTreeHostClosedOnImplThread(CCCompletionEvent* completio
n) |
| 908 { | 911 { |
| 909 TRACE_EVENT0("cc", "CCThreadProxy::layerTreeHostClosedOnImplThread"); | 912 TRACE_EVENT0("cc", "CCThreadProxy::layerTreeHostClosedOnImplThread"); |
| 910 ASSERT(isImplThread()); | 913 ASSERT(isImplThread()); |
| 911 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->res
ourceProvider()); | 914 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->res
ourceProvider()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() | 952 CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() |
| 950 : monotonicFrameBeginTime(0) | 953 : monotonicFrameBeginTime(0) |
| 951 { | 954 { |
| 952 } | 955 } |
| 953 | 956 |
| 954 CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() | 957 CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() |
| 955 { | 958 { |
| 956 } | 959 } |
| 957 | 960 |
| 958 } // namespace cc | 961 } // namespace cc |
| OLD | NEW |