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->updateMoreTextures(monotonicTi
meLimit); |
619 } | 618 } |
620 | 619 |
621 void CCThreadProxy::scheduledActionCommit() | 620 void CCThreadProxy::scheduledActionCommit() |
622 { | 621 { |
623 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit"); | 622 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit"); |
624 ASSERT(isImplThread()); | 623 ASSERT(isImplThread()); |
625 ASSERT(m_commitCompletionEventOnImplThread); | 624 ASSERT(m_commitCompletionEventOnImplThread); |
| 625 ASSERT(m_currentTextureUpdateControllerOnImplThread); |
626 | 626 |
| 627 // Complete all remaining texture updates. |
| 628 m_currentTextureUpdateControllerOnImplThread->updateAllTexturesNow(); |
627 m_currentTextureUpdateControllerOnImplThread.clear(); | 629 m_currentTextureUpdateControllerOnImplThread.clear(); |
628 | 630 |
629 m_layerTreeHostImpl->beginCommit(); | 631 m_layerTreeHostImpl->beginCommit(); |
630 | 632 |
631 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); | 633 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); |
632 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); | 634 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); |
633 | 635 |
634 if (m_resetContentsTexturesPurgedAfterCommitOnImplThread) { | 636 if (m_resetContentsTexturesPurgedAfterCommitOnImplThread) { |
635 m_resetContentsTexturesPurgedAfterCommitOnImplThread = false; | 637 m_resetContentsTexturesPurgedAfterCommitOnImplThread = false; |
636 m_layerTreeHostImpl->resetContentsTexturesPurged(); | 638 m_layerTreeHostImpl->resetContentsTexturesPurged(); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 } | 915 } |
914 | 916 |
915 void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple
tion, CCRenderingStats* stats) | 917 void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple
tion, CCRenderingStats* stats) |
916 { | 918 { |
917 ASSERT(isImplThread()); | 919 ASSERT(isImplThread()); |
918 m_layerTreeHostImpl->renderingStats(*stats); | 920 m_layerTreeHostImpl->renderingStats(*stats); |
919 completion->signal(); | 921 completion->signal(); |
920 } | 922 } |
921 | 923 |
922 } // namespace cc | 924 } // namespace cc |
OLD | NEW |