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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/delay_based_time_source.h" | 9 #include "cc/delay_based_time_source.h" |
10 #include "cc/draw_quad.h" | 10 #include "cc/draw_quad.h" |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 520 } |
521 | 521 |
522 m_beginFrameCompletionEventOnImplThread = completion; | 522 m_beginFrameCompletionEventOnImplThread = completion; |
523 } | 523 } |
524 | 524 |
525 void ThreadProxy::scheduledActionBeginFrame() | 525 void ThreadProxy::scheduledActionBeginFrame() |
526 { | 526 { |
527 TRACE_EVENT0("cc", "ThreadProxy::scheduledActionBeginFrame"); | 527 TRACE_EVENT0("cc", "ThreadProxy::scheduledActionBeginFrame"); |
528 scoped_ptr<BeginFrameAndCommitState> beginFrameState(new BeginFrameAndCommit
State); | 528 scoped_ptr<BeginFrameAndCommitState> beginFrameState(new BeginFrameAndCommit
State); |
529 beginFrameState->monotonicFrameBeginTime = base::TimeTicks::Now(); | 529 beginFrameState->monotonicFrameBeginTime = base::TimeTicks::Now(); |
| 530 beginFrameState->wallClockFrameBeginTime = base::Time::Now(); |
530 beginFrameState->scrollInfo = m_layerTreeHostImpl->processScrollDeltas(); | 531 beginFrameState->scrollInfo = m_layerTreeHostImpl->processScrollDeltas(); |
531 beginFrameState->implTransform = m_layerTreeHostImpl->implTransform(); | 532 beginFrameState->implTransform = m_layerTreeHostImpl->implTransform(); |
532 DCHECK_GT(m_layerTreeHostImpl->memoryAllocationLimitBytes(), 0u); | 533 DCHECK_GT(m_layerTreeHostImpl->memoryAllocationLimitBytes(), 0u); |
533 beginFrameState->memoryAllocationLimitBytes = m_layerTreeHostImpl->memoryAll
ocationLimitBytes(); | 534 beginFrameState->memoryAllocationLimitBytes = m_layerTreeHostImpl->memoryAll
ocationLimitBytes(); |
534 Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginFrame, m_mainThr
eadWeakPtr, base::Passed(&beginFrameState))); | 535 Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginFrame, m_mainThr
eadWeakPtr, base::Passed(&beginFrameState))); |
535 | 536 |
536 if (m_beginFrameCompletionEventOnImplThread) { | 537 if (m_beginFrameCompletionEventOnImplThread) { |
537 m_beginFrameCompletionEventOnImplThread->signal(); | 538 m_beginFrameCompletionEventOnImplThread->signal(); |
538 m_beginFrameCompletionEventOnImplThread = 0; | 539 m_beginFrameCompletionEventOnImplThread = 0; |
539 } | 540 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 m_commitRequestSentToImplThread = false; | 580 m_commitRequestSentToImplThread = false; |
580 | 581 |
581 TRACE_EVENT0("cc", "EarlyOut_NotVisible"); | 582 TRACE_EVENT0("cc", "EarlyOut_NotVisible"); |
582 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::beginFrameAborted
OnImplThread, m_implThreadWeakPtr)); | 583 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::beginFrameAborted
OnImplThread, m_implThreadWeakPtr)); |
583 return; | 584 return; |
584 } | 585 } |
585 | 586 |
586 m_layerTreeHost->willBeginFrame(); | 587 m_layerTreeHost->willBeginFrame(); |
587 | 588 |
588 if (beginFrameState) | 589 if (beginFrameState) |
589 m_layerTreeHost->updateAnimations(beginFrameState->monotonicFrameBeginTi
me); | 590 m_layerTreeHost->updateAnimations(beginFrameState->monotonicFrameBeginTi
me, beginFrameState->wallClockFrameBeginTime); |
590 | 591 |
591 // Unlink any backings that the impl thread has evicted, so that we know to
re-paint | 592 // Unlink any backings that the impl thread has evicted, so that we know to
re-paint |
592 // them in updateLayers. | 593 // them in updateLayers. |
593 if (m_layerTreeHost->contentsTextureManager()) | 594 if (m_layerTreeHost->contentsTextureManager()) |
594 m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings
(); | 595 m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings
(); |
595 | 596 |
596 m_layerTreeHost->layout(); | 597 m_layerTreeHost->layout(); |
597 | 598 |
598 // Clear the commit flag after updating animations and layout here --- objec
ts that only | 599 // Clear the commit flag after updating animations and layout here --- objec
ts that only |
599 // layout when painted will trigger another setNeedsCommit inside | 600 // layout when painted will trigger another setNeedsCommit inside |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 } | 1043 } |
1043 | 1044 |
1044 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) | 1045 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) |
1045 { | 1046 { |
1046 DCHECK(isImplThread()); | 1047 DCHECK(isImplThread()); |
1047 *picture = m_layerTreeHostImpl->capturePicture(); | 1048 *picture = m_layerTreeHostImpl->capturePicture(); |
1048 completion->signal(); | 1049 completion->signal(); |
1049 } | 1050 } |
1050 | 1051 |
1051 } // namespace cc | 1052 } // namespace cc |
OLD | NEW |