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 "cc/thread_proxy.h" | 5 #include "cc/thread_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/delay_based_time_source.h" | 10 #include "cc/delay_based_time_source.h" |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 } | 556 } |
557 | 557 |
558 m_beginFrameCompletionEventOnImplThread = completion; | 558 m_beginFrameCompletionEventOnImplThread = completion; |
559 } | 559 } |
560 | 560 |
561 void ThreadProxy::scheduledActionBeginFrame() | 561 void ThreadProxy::scheduledActionBeginFrame() |
562 { | 562 { |
563 TRACE_EVENT0("cc", "ThreadProxy::scheduledActionBeginFrame"); | 563 TRACE_EVENT0("cc", "ThreadProxy::scheduledActionBeginFrame"); |
564 scoped_ptr<BeginFrameAndCommitState> beginFrameState(new BeginFrameAndCommit
State); | 564 scoped_ptr<BeginFrameAndCommitState> beginFrameState(new BeginFrameAndCommit
State); |
565 beginFrameState->monotonicFrameBeginTime = base::TimeTicks::Now(); | 565 beginFrameState->monotonicFrameBeginTime = base::TimeTicks::Now(); |
| 566 beginFrameState->wallClockFrameBeginTime = base::Time::Now(); |
566 beginFrameState->scrollInfo = m_layerTreeHostImpl->processScrollDeltas(); | 567 beginFrameState->scrollInfo = m_layerTreeHostImpl->processScrollDeltas(); |
567 beginFrameState->implTransform = m_layerTreeHostImpl->activeTree()->ImplTran
sform(); | 568 beginFrameState->implTransform = m_layerTreeHostImpl->activeTree()->ImplTran
sform(); |
568 DCHECK_GT(m_layerTreeHostImpl->memoryAllocationLimitBytes(), 0u); | 569 DCHECK_GT(m_layerTreeHostImpl->memoryAllocationLimitBytes(), 0u); |
569 beginFrameState->memoryAllocationLimitBytes = m_layerTreeHostImpl->memoryAll
ocationLimitBytes(); | 570 beginFrameState->memoryAllocationLimitBytes = m_layerTreeHostImpl->memoryAll
ocationLimitBytes(); |
570 Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginFrame, m_mainThr
eadWeakPtr, base::Passed(&beginFrameState))); | 571 Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginFrame, m_mainThr
eadWeakPtr, base::Passed(&beginFrameState))); |
571 | 572 |
572 if (m_beginFrameCompletionEventOnImplThread) { | 573 if (m_beginFrameCompletionEventOnImplThread) { |
573 m_beginFrameCompletionEventOnImplThread->signal(); | 574 m_beginFrameCompletionEventOnImplThread->signal(); |
574 m_beginFrameCompletionEventOnImplThread = 0; | 575 m_beginFrameCompletionEventOnImplThread = 0; |
575 } | 576 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 m_commitRequestSentToImplThread = false; | 616 m_commitRequestSentToImplThread = false; |
616 | 617 |
617 TRACE_EVENT0("cc", "EarlyOut_NotVisible"); | 618 TRACE_EVENT0("cc", "EarlyOut_NotVisible"); |
618 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::beginFrameAborted
OnImplThread, m_implThreadWeakPtr)); | 619 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::beginFrameAborted
OnImplThread, m_implThreadWeakPtr)); |
619 return; | 620 return; |
620 } | 621 } |
621 | 622 |
622 m_layerTreeHost->willBeginFrame(); | 623 m_layerTreeHost->willBeginFrame(); |
623 | 624 |
624 if (beginFrameState) | 625 if (beginFrameState) |
625 m_layerTreeHost->updateAnimations(beginFrameState->monotonicFrameBeginTi
me); | 626 m_layerTreeHost->updateAnimations(beginFrameState->monotonicFrameBeginTi
me, beginFrameState->wallClockFrameBeginTime); |
626 | 627 |
627 // Unlink any backings that the impl thread has evicted, so that we know to
re-paint | 628 // Unlink any backings that the impl thread has evicted, so that we know to
re-paint |
628 // them in updateLayers. | 629 // them in updateLayers. |
629 if (m_layerTreeHost->contentsTextureManager()) | 630 if (m_layerTreeHost->contentsTextureManager()) |
630 m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings
(); | 631 m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings
(); |
631 | 632 |
632 m_layerTreeHost->layout(); | 633 m_layerTreeHost->layout(); |
633 | 634 |
634 // Clear the commit flag after updating animations and layout here --- objec
ts that only | 635 // Clear the commit flag after updating animations and layout here --- objec
ts that only |
635 // layout when painted will trigger another setNeedsCommit inside | 636 // layout when painted will trigger another setNeedsCommit inside |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 | 1175 |
1175 void ThreadProxy::renewTreePriorityOnImplThread() | 1176 void ThreadProxy::renewTreePriorityOnImplThread() |
1176 { | 1177 { |
1177 DCHECK(m_renewTreePriorityOnImplThreadPending); | 1178 DCHECK(m_renewTreePriorityOnImplThreadPending); |
1178 m_renewTreePriorityOnImplThreadPending = false; | 1179 m_renewTreePriorityOnImplThreadPending = false; |
1179 | 1180 |
1180 renewTreePriority(); | 1181 renewTreePriority(); |
1181 } | 1182 } |
1182 | 1183 |
1183 } // namespace cc | 1184 } // namespace cc |
OLD | NEW |