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" |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 m_resetContentsTexturesPurgedAfterCommitOnImplThread = true; | 586 m_resetContentsTexturesPurgedAfterCommitOnImplThread = true; |
587 } else if (m_layerTreeHostImpl->contentsTexturesPurged()) { | 587 } else if (m_layerTreeHostImpl->contentsTexturesPurged()) { |
588 // We purged the content textures on the impl thread between the time we | 588 // We purged the content textures on the impl thread between the time we |
589 // posted the beginFrame task and now, meaning we have a bunch of | 589 // posted the beginFrame task and now, meaning we have a bunch of |
590 // uploads that are now invalid. Clear the uploads (they all go to | 590 // uploads that are now invalid. Clear the uploads (they all go to |
591 // content textures), and kick another commit to fill them again. | 591 // content textures), and kick another commit to fill them again. |
592 queue->clearUploads(); | 592 queue->clearUploads(); |
593 setNeedsCommitOnImplThread(); | 593 setNeedsCommitOnImplThread(); |
594 } | 594 } |
595 | 595 |
596 bool hasResourceUpdates = queue->hasMoreUpdates(); | 596 bool hasResourceUpdates = !!queue->fullUploadSize(); |
597 if (hasResourceUpdates) | 597 m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::cr
eate(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider()
, m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->rendere
r()->textureUploader()); |
598 m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController
::create(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvid
er(), m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->ren
derer()->textureUploader()); | |
599 m_commitCompletionEventOnImplThread = completion; | 598 m_commitCompletionEventOnImplThread = completion; |
600 | 599 |
601 m_schedulerOnImplThread->beginFrameComplete(hasResourceUpdates); | 600 m_schedulerOnImplThread->beginFrameComplete(hasResourceUpdates); |
602 } | 601 } |
603 | 602 |
604 void CCThreadProxy::beginFrameAbortedOnImplThread() | 603 void CCThreadProxy::beginFrameAbortedOnImplThread() |
605 { | 604 { |
606 TRACE_EVENT0("cc", "CCThreadProxy::beginFrameAbortedOnImplThread"); | 605 TRACE_EVENT0("cc", "CCThreadProxy::beginFrameAbortedOnImplThread"); |
607 ASSERT(isImplThread()); | 606 ASSERT(isImplThread()); |
608 ASSERT(m_schedulerOnImplThread); | 607 ASSERT(m_schedulerOnImplThread); |
609 ASSERT(m_schedulerOnImplThread->commitPending()); | 608 ASSERT(m_schedulerOnImplThread->commitPending()); |
610 | 609 |
611 m_schedulerOnImplThread->beginFrameAborted(); | 610 m_schedulerOnImplThread->beginFrameAborted(); |
612 } | 611 } |
613 | 612 |
614 void CCThreadProxy::scheduledActionUpdateMoreResources(double monotonicTimeLimit
) | 613 void CCThreadProxy::scheduledActionUpdateMoreResources(double monotonicTimeLimit
) |
615 { | 614 { |
616 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources"); | 615 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources"); |
617 ASSERT(m_currentTextureUpdateControllerOnImplThread); | 616 ASSERT(m_currentTextureUpdateControllerOnImplThread); |
618 m_currentTextureUpdateControllerOnImplThread->updateMoreTextures(monotonicTi
meLimit); | 617 m_currentTextureUpdateControllerOnImplThread->performMoreUpdates( |
| 618 monotonicTimeLimit); |
619 } | 619 } |
620 | 620 |
621 void CCThreadProxy::scheduledActionCommit() | 621 void CCThreadProxy::scheduledActionCommit() |
622 { | 622 { |
623 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit"); | 623 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit"); |
624 ASSERT(isImplThread()); | 624 ASSERT(isImplThread()); |
625 ASSERT(m_commitCompletionEventOnImplThread); | 625 ASSERT(m_commitCompletionEventOnImplThread); |
| 626 ASSERT(m_currentTextureUpdateControllerOnImplThread); |
626 | 627 |
| 628 // Complete all remaining texture updates. |
| 629 m_currentTextureUpdateControllerOnImplThread->finalize(); |
627 m_currentTextureUpdateControllerOnImplThread.clear(); | 630 m_currentTextureUpdateControllerOnImplThread.clear(); |
628 | 631 |
629 m_layerTreeHostImpl->beginCommit(); | 632 m_layerTreeHostImpl->beginCommit(); |
630 | 633 |
631 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); | 634 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); |
632 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); | 635 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); |
633 | 636 |
634 if (m_resetContentsTexturesPurgedAfterCommitOnImplThread) { | 637 if (m_resetContentsTexturesPurgedAfterCommitOnImplThread) { |
635 m_resetContentsTexturesPurgedAfterCommitOnImplThread = false; | 638 m_resetContentsTexturesPurgedAfterCommitOnImplThread = false; |
636 m_layerTreeHostImpl->resetContentsTexturesPurged(); | 639 m_layerTreeHostImpl->resetContentsTexturesPurged(); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapIfPo
ssible() | 757 CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapIfPo
ssible() |
755 { | 758 { |
756 return scheduledActionDrawAndSwapInternal(false); | 759 return scheduledActionDrawAndSwapInternal(false); |
757 } | 760 } |
758 | 761 |
759 CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapForc
ed() | 762 CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapForc
ed() |
760 { | 763 { |
761 return scheduledActionDrawAndSwapInternal(true); | 764 return scheduledActionDrawAndSwapInternal(true); |
762 } | 765 } |
763 | 766 |
764 void CCThreadProxy::updateTexturesCompleted() | 767 void CCThreadProxy::readyToFinalizeTextureUpdates() |
765 { | 768 { |
766 ASSERT(isImplThread()); | 769 ASSERT(isImplThread()); |
767 m_schedulerOnImplThread->updateResourcesComplete(); | 770 m_schedulerOnImplThread->updateResourcesComplete(); |
768 } | 771 } |
769 | 772 |
770 void CCThreadProxy::didCommitAndDrawFrame() | 773 void CCThreadProxy::didCommitAndDrawFrame() |
771 { | 774 { |
772 ASSERT(isMainThread()); | 775 ASSERT(isMainThread()); |
773 if (!m_layerTreeHost) | 776 if (!m_layerTreeHost) |
774 return; | 777 return; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 } | 916 } |
914 | 917 |
915 void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple
tion, CCRenderingStats* stats) | 918 void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple
tion, CCRenderingStats* stats) |
916 { | 919 { |
917 ASSERT(isImplThread()); | 920 ASSERT(isImplThread()); |
918 m_layerTreeHostImpl->renderingStats(*stats); | 921 m_layerTreeHostImpl->renderingStats(*stats); |
919 completion->signal(); | 922 completion->signal(); |
920 } | 923 } |
921 | 924 |
922 } // namespace cc | 925 } // namespace cc |
OLD | NEW |