Chromium Code Reviews| 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 m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::cr eate(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider() , m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->rendere r()->textureUploader()); |
| 597 if (hasResourceUpdates) | 597 m_currentTextureUpdateControllerOnImplThread->start(); |
| 598 m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController ::create(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvid er(), m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->ren derer()->textureUploader()); | 598 |
| 599 m_commitCompletionEventOnImplThread = completion; | 599 m_commitCompletionEventOnImplThread = completion; |
| 600 | |
| 601 m_schedulerOnImplThread->beginFrameComplete(hasResourceUpdates); | |
| 602 } | 600 } |
| 603 | 601 |
| 604 void CCThreadProxy::beginFrameAbortedOnImplThread() | 602 void CCThreadProxy::beginFrameAbortedOnImplThread() |
| 605 { | 603 { |
| 606 TRACE_EVENT0("cc", "CCThreadProxy::beginFrameAbortedOnImplThread"); | 604 TRACE_EVENT0("cc", "CCThreadProxy::beginFrameAbortedOnImplThread"); |
| 607 ASSERT(isImplThread()); | 605 ASSERT(isImplThread()); |
| 608 ASSERT(m_schedulerOnImplThread); | 606 ASSERT(m_schedulerOnImplThread); |
| 609 ASSERT(m_schedulerOnImplThread->commitPending()); | 607 ASSERT(m_schedulerOnImplThread->commitPending()); |
| 610 | 608 |
| 611 m_schedulerOnImplThread->beginFrameAborted(); | 609 m_schedulerOnImplThread->beginFrameAborted(); |
| 612 } | 610 } |
| 613 | 611 |
| 614 void CCThreadProxy::scheduledActionUpdateMoreResources(double monotonicTimeLimit ) | 612 void CCThreadProxy::scheduledActionUpdateMoreResources(double) |
|
jamesr
2012/09/17 06:57:38
why is this function still here? what's it do?
reveman
2012/09/17 15:32:52
Nothing. As I mentioned in my initial comment, the
| |
| 615 { | 613 { |
| 616 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources"); | 614 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources"); |
| 617 ASSERT(m_currentTextureUpdateControllerOnImplThread); | |
| 618 m_currentTextureUpdateControllerOnImplThread->updateMoreTextures(monotonicTi meLimit); | |
| 619 } | 615 } |
| 620 | 616 |
| 621 void CCThreadProxy::scheduledActionCommit() | 617 void CCThreadProxy::scheduledActionCommit() |
| 622 { | 618 { |
| 623 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit"); | 619 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit"); |
| 624 ASSERT(isImplThread()); | 620 ASSERT(isImplThread()); |
| 625 ASSERT(m_commitCompletionEventOnImplThread); | 621 ASSERT(m_commitCompletionEventOnImplThread); |
| 622 ASSERT(m_currentTextureUpdateControllerOnImplThread); | |
| 626 | 623 |
| 624 // Complete remaining updates. | |
| 625 m_currentTextureUpdateControllerOnImplThread->updateAllTexturesNow(); | |
| 627 m_currentTextureUpdateControllerOnImplThread.clear(); | 626 m_currentTextureUpdateControllerOnImplThread.clear(); |
| 628 | 627 |
| 629 m_layerTreeHostImpl->beginCommit(); | 628 m_layerTreeHostImpl->beginCommit(); |
| 630 | 629 |
| 631 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); | 630 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); |
| 632 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); | 631 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); |
| 633 | 632 |
| 634 if (m_resetContentsTexturesPurgedAfterCommitOnImplThread) { | 633 if (m_resetContentsTexturesPurgedAfterCommitOnImplThread) { |
| 635 m_resetContentsTexturesPurgedAfterCommitOnImplThread = false; | 634 m_resetContentsTexturesPurgedAfterCommitOnImplThread = false; |
| 636 m_layerTreeHostImpl->resetContentsTexturesPurged(); | 635 m_layerTreeHostImpl->resetContentsTexturesPurged(); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 757 } | 756 } |
| 758 | 757 |
| 759 CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapForc ed() | 758 CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapForc ed() |
| 760 { | 759 { |
| 761 return scheduledActionDrawAndSwapInternal(true); | 760 return scheduledActionDrawAndSwapInternal(true); |
| 762 } | 761 } |
| 763 | 762 |
| 764 void CCThreadProxy::updateTexturesCompleted() | 763 void CCThreadProxy::updateTexturesCompleted() |
| 765 { | 764 { |
| 766 ASSERT(isImplThread()); | 765 ASSERT(isImplThread()); |
| 767 m_schedulerOnImplThread->updateResourcesComplete(); | 766 m_schedulerOnImplThread->beginFrameComplete(false); |
| 768 } | 767 } |
| 769 | 768 |
| 770 void CCThreadProxy::didCommitAndDrawFrame() | 769 void CCThreadProxy::didCommitAndDrawFrame() |
| 771 { | 770 { |
| 772 ASSERT(isMainThread()); | 771 ASSERT(isMainThread()); |
| 773 if (!m_layerTreeHost) | 772 if (!m_layerTreeHost) |
| 774 return; | 773 return; |
| 775 m_layerTreeHost->didCommitAndDrawFrame(); | 774 m_layerTreeHost->didCommitAndDrawFrame(); |
| 776 } | 775 } |
| 777 | 776 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 913 } | 912 } |
| 914 | 913 |
| 915 void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple tion, CCRenderingStats* stats) | 914 void CCThreadProxy::implSideRenderingStatsOnImplThread(CCCompletionEvent* comple tion, CCRenderingStats* stats) |
| 916 { | 915 { |
| 917 ASSERT(isImplThread()); | 916 ASSERT(isImplThread()); |
| 918 m_layerTreeHostImpl->renderingStats(*stats); | 917 m_layerTreeHostImpl->renderingStats(*stats); |
| 919 completion->signal(); | 918 completion->signal(); |
| 920 } | 919 } |
| 921 | 920 |
| 922 } // namespace WebCore | 921 } // namespace WebCore |
| OLD | NEW |