| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 return m_commitRequested; | 433 return m_commitRequested; |
| 434 } | 434 } |
| 435 | 435 |
| 436 void ThreadProxy::setNeedsRedrawOnImplThread() | 436 void ThreadProxy::setNeedsRedrawOnImplThread() |
| 437 { | 437 { |
| 438 DCHECK(isImplThread()); | 438 DCHECK(isImplThread()); |
| 439 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedrawOnImplThread"); | 439 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedrawOnImplThread"); |
| 440 m_schedulerOnImplThread->setNeedsRedraw(); | 440 m_schedulerOnImplThread->setNeedsRedraw(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 void ThreadProxy::setNeedsRedrawOnVisibleTextureUploadOnImplThread() |
| 444 { |
| 445 DCHECK(isImplThread()); |
| 446 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedrawOnVisibleTextureUploadOnImplTh
read"); |
| 447 m_schedulerOnImplThread->setNeedsRedrawOnVisibleTextureUpload(); |
| 448 } |
| 449 |
| 443 void ThreadProxy::mainThreadHasStoppedFlinging() | 450 void ThreadProxy::mainThreadHasStoppedFlinging() |
| 444 { | 451 { |
| 445 if (m_inputHandlerOnImplThread) | 452 if (m_inputHandlerOnImplThread) |
| 446 m_inputHandlerOnImplThread->mainThreadHasStoppedFlinging(); | 453 m_inputHandlerOnImplThread->mainThreadHasStoppedFlinging(); |
| 447 } | 454 } |
| 448 | 455 |
| 449 void ThreadProxy::start() | 456 void ThreadProxy::start() |
| 450 { | 457 { |
| 451 DCHECK(isMainThread()); | 458 DCHECK(isMainThread()); |
| 452 DCHECK(Proxy::implThread()); | 459 DCHECK(Proxy::implThread()); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 | 727 |
| 721 m_nextFrameIsNewlyCommittedFrameOnImplThread = true; | 728 m_nextFrameIsNewlyCommittedFrameOnImplThread = true; |
| 722 | 729 |
| 723 m_commitCompletionEventOnImplThread->signal(); | 730 m_commitCompletionEventOnImplThread->signal(); |
| 724 m_commitCompletionEventOnImplThread = 0; | 731 m_commitCompletionEventOnImplThread = 0; |
| 725 | 732 |
| 726 // SetVisible kicks off the next scheduler action, so this must be last. | 733 // SetVisible kicks off the next scheduler action, so this must be last. |
| 727 m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible()); | 734 m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible()); |
| 728 } | 735 } |
| 729 | 736 |
| 737 void ThreadProxy::scheduledActionCheckForNewTextures() |
| 738 { |
| 739 DCHECK(isImplThread()); |
| 740 TRACE_EVENT0("cc", "ThreadProxy::scheduledActionCheckForNewTextures"); |
| 741 m_layerTreeHostImpl->checkForCompletedSetPixels(); |
| 742 } |
| 743 |
| 730 void ThreadProxy::scheduledActionActivatePendingTreeIfNeeded() | 744 void ThreadProxy::scheduledActionActivatePendingTreeIfNeeded() |
| 731 { | 745 { |
| 746 DCHECK(isImplThread()); |
| 747 TRACE_EVENT0("cc", "ThreadProxy::scheduledActionActivatePendingTreeIfNeeded"
); |
| 732 m_layerTreeHostImpl->activatePendingTreeIfNeeded(); | 748 m_layerTreeHostImpl->activatePendingTreeIfNeeded(); |
| 733 } | 749 } |
| 734 | 750 |
| 735 void ThreadProxy::scheduledActionBeginContextRecreation() | 751 void ThreadProxy::scheduledActionBeginContextRecreation() |
| 736 { | 752 { |
| 737 DCHECK(isImplThread()); | 753 DCHECK(isImplThread()); |
| 738 Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginContextRecreatio
n, m_mainThreadWeakPtr)); | 754 Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginContextRecreatio
n, m_mainThreadWeakPtr)); |
| 739 } | 755 } |
| 740 | 756 |
| 741 ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal
(bool forcedDraw) | 757 ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal
(bool forcedDraw) |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 } | 1061 } |
| 1046 | 1062 |
| 1047 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) | 1063 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) |
| 1048 { | 1064 { |
| 1049 DCHECK(isImplThread()); | 1065 DCHECK(isImplThread()); |
| 1050 *picture = m_layerTreeHostImpl->capturePicture(); | 1066 *picture = m_layerTreeHostImpl->capturePicture(); |
| 1051 completion->signal(); | 1067 completion->signal(); |
| 1052 } | 1068 } |
| 1053 | 1069 |
| 1054 } // namespace cc | 1070 } // namespace cc |
| OLD | NEW |