| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 // layer tree being invalidated (unliked from their backings). Kick off | 595 // layer tree being invalidated (unliked from their backings). Kick off |
| 596 // another commit to fill them again. | 596 // another commit to fill them again. |
| 597 setNeedsCommitOnImplThread(); | 597 setNeedsCommitOnImplThread(); |
| 598 } else { | 598 } else { |
| 599 // The layer tree does not reference evicted textures, so mark that we | 599 // The layer tree does not reference evicted textures, so mark that we |
| 600 // can draw this tree once this commit is complete. | 600 // can draw this tree once this commit is complete. |
| 601 if (m_layerTreeHostImpl->contentsTexturesPurged()) | 601 if (m_layerTreeHostImpl->contentsTexturesPurged()) |
| 602 m_resetContentsTexturesPurgedAfterCommitOnImplThread = true; | 602 m_resetContentsTexturesPurgedAfterCommitOnImplThread = true; |
| 603 } | 603 } |
| 604 | 604 |
| 605 bool hasResourceUpdates = !!queue->fullUploadSize(); | |
| 606 m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::cr
eate(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider()
, m_layerTreeHostImpl->resourceProvider()->textureUploader()); | 605 m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::cr
eate(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider()
, m_layerTreeHostImpl->resourceProvider()->textureUploader()); |
| 606 m_currentTextureUpdateControllerOnImplThread->start(); |
| 607 |
| 607 m_commitCompletionEventOnImplThread = completion; | 608 m_commitCompletionEventOnImplThread = completion; |
| 608 | |
| 609 m_schedulerOnImplThread->beginFrameComplete(hasResourceUpdates); | |
| 610 } | 609 } |
| 611 | 610 |
| 612 void CCThreadProxy::beginFrameAbortedOnImplThread() | 611 void CCThreadProxy::beginFrameAbortedOnImplThread() |
| 613 { | 612 { |
| 614 TRACE_EVENT0("cc", "CCThreadProxy::beginFrameAbortedOnImplThread"); | 613 TRACE_EVENT0("cc", "CCThreadProxy::beginFrameAbortedOnImplThread"); |
| 615 ASSERT(isImplThread()); | 614 ASSERT(isImplThread()); |
| 616 ASSERT(m_schedulerOnImplThread); | 615 ASSERT(m_schedulerOnImplThread); |
| 617 ASSERT(m_schedulerOnImplThread->commitPending()); | 616 ASSERT(m_schedulerOnImplThread->commitPending()); |
| 618 | 617 |
| 619 m_schedulerOnImplThread->beginFrameAborted(); | 618 m_schedulerOnImplThread->beginFrameAborted(); |
| 620 } | 619 } |
| 621 | 620 |
| 622 void CCThreadProxy::scheduledActionUpdateMoreResources(base::TimeTicks timeLimit
) | 621 void CCThreadProxy::scheduledActionUpdateMoreResources(base::TimeTicks) |
| 623 { | 622 { |
| 624 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources"); | 623 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources"); |
| 625 ASSERT(m_currentTextureUpdateControllerOnImplThread); | |
| 626 double monotonicTimeLimit = timeLimit.ToInternalValue() / static_cast<double
>(base::Time::kMicrosecondsPerSecond); | |
| 627 m_currentTextureUpdateControllerOnImplThread->performMoreUpdates(monotonicTi
meLimit); | |
| 628 } | 624 } |
| 629 | 625 |
| 630 void CCThreadProxy::scheduledActionCommit() | 626 void CCThreadProxy::scheduledActionCommit() |
| 631 { | 627 { |
| 632 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit"); | 628 TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit"); |
| 633 ASSERT(isImplThread()); | 629 ASSERT(isImplThread()); |
| 634 ASSERT(m_commitCompletionEventOnImplThread); | 630 ASSERT(m_commitCompletionEventOnImplThread); |
| 635 ASSERT(m_currentTextureUpdateControllerOnImplThread); | 631 ASSERT(m_currentTextureUpdateControllerOnImplThread); |
| 636 | 632 |
| 637 // Complete all remaining texture updates. | 633 // Complete all remaining texture updates. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 } | 765 } |
| 770 | 766 |
| 771 CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapForc
ed() | 767 CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapForc
ed() |
| 772 { | 768 { |
| 773 return scheduledActionDrawAndSwapInternal(true); | 769 return scheduledActionDrawAndSwapInternal(true); |
| 774 } | 770 } |
| 775 | 771 |
| 776 void CCThreadProxy::readyToFinalizeTextureUpdates() | 772 void CCThreadProxy::readyToFinalizeTextureUpdates() |
| 777 { | 773 { |
| 778 ASSERT(isImplThread()); | 774 ASSERT(isImplThread()); |
| 779 m_schedulerOnImplThread->updateResourcesComplete(); | 775 m_schedulerOnImplThread->beginFrameComplete(false); |
| 780 } | 776 } |
| 781 | 777 |
| 782 void CCThreadProxy::didCommitAndDrawFrame() | 778 void CCThreadProxy::didCommitAndDrawFrame() |
| 783 { | 779 { |
| 784 ASSERT(isMainThread()); | 780 ASSERT(isMainThread()); |
| 785 if (!m_layerTreeHost) | 781 if (!m_layerTreeHost) |
| 786 return; | 782 return; |
| 787 m_layerTreeHost->didCommitAndDrawFrame(); | 783 m_layerTreeHost->didCommitAndDrawFrame(); |
| 788 } | 784 } |
| 789 | 785 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() | 928 CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() |
| 933 : monotonicFrameBeginTime(0) | 929 : monotonicFrameBeginTime(0) |
| 934 { | 930 { |
| 935 } | 931 } |
| 936 | 932 |
| 937 CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() | 933 CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() |
| 938 { | 934 { |
| 939 } | 935 } |
| 940 | 936 |
| 941 } // namespace cc | 937 } // namespace cc |
| OLD | NEW |