OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 , m_commitRequested(false) | 67 , m_commitRequested(false) |
68 , m_contextLost(false) | 68 , m_contextLost(false) |
69 , m_layerTreeHost(layerTreeHost) | 69 , m_layerTreeHost(layerTreeHost) |
70 , m_compositorIdentifier(-1) | 70 , m_compositorIdentifier(-1) |
71 , m_layerRendererInitialized(false) | 71 , m_layerRendererInitialized(false) |
72 , m_started(false) | 72 , m_started(false) |
73 , m_texturesAcquired(true) | 73 , m_texturesAcquired(true) |
74 , m_mainThreadProxy(CCScopedThreadProxy::create(CCProxy::mainThread())) | 74 , m_mainThreadProxy(CCScopedThreadProxy::create(CCProxy::mainThread())) |
75 , m_beginFrameCompletionEventOnImplThread(0) | 75 , m_beginFrameCompletionEventOnImplThread(0) |
76 , m_readbackRequestOnImplThread(0) | 76 , m_readbackRequestOnImplThread(0) |
77 , m_finishAllRenderingCompletionEventOnImplThread(0) | |
78 , m_commitCompletionEventOnImplThread(0) | 77 , m_commitCompletionEventOnImplThread(0) |
79 , m_textureAcquisitionCompletionEventOnImplThread(0) | 78 , m_textureAcquisitionCompletionEventOnImplThread(0) |
80 , m_nextFrameIsNewlyCommittedFrameOnImplThread(false) | 79 , m_nextFrameIsNewlyCommittedFrameOnImplThread(false) |
81 { | 80 { |
82 TRACE_EVENT("CCThreadProxy::CCThreadProxy", this, 0); | 81 TRACE_EVENT("CCThreadProxy::CCThreadProxy", this, 0); |
83 ASSERT(isMainThread()); | 82 ASSERT(isMainThread()); |
84 } | 83 } |
85 | 84 |
86 CCThreadProxy::~CCThreadProxy() | 85 CCThreadProxy::~CCThreadProxy() |
87 { | 86 { |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 if (m_layerRendererInitialized) | 412 if (m_layerRendererInitialized) |
414 m_layerTreeHostImpl->layerRenderer()->doNoOp(); | 413 m_layerTreeHostImpl->layerRenderer()->doNoOp(); |
415 completion->signal(); | 414 completion->signal(); |
416 } | 415 } |
417 | 416 |
418 | 417 |
419 void CCThreadProxy::finishAllRenderingOnImplThread(CCCompletionEvent* completion
) | 418 void CCThreadProxy::finishAllRenderingOnImplThread(CCCompletionEvent* completion
) |
420 { | 419 { |
421 TRACE_EVENT("CCThreadProxy::finishAllRenderingOnImplThread", this, 0); | 420 TRACE_EVENT("CCThreadProxy::finishAllRenderingOnImplThread", this, 0); |
422 ASSERT(isImplThread()); | 421 ASSERT(isImplThread()); |
423 ASSERT(!m_finishAllRenderingCompletionEventOnImplThread); | 422 m_layerTreeHostImpl->finishAllRendering(); |
424 m_finishAllRenderingCompletionEventOnImplThread = completion; | 423 completion->signal(); |
425 | |
426 m_schedulerOnImplThread->setNeedsForcedRedraw(); | |
427 } | 424 } |
428 | 425 |
429 void CCThreadProxy::forceBeginFrameOnImplThread(CCCompletionEvent* completion) | 426 void CCThreadProxy::forceBeginFrameOnImplThread(CCCompletionEvent* completion) |
430 { | 427 { |
431 TRACE_EVENT0("cc", "CCThreadProxy::forceBeginFrameOnImplThread"); | 428 TRACE_EVENT0("cc", "CCThreadProxy::forceBeginFrameOnImplThread"); |
432 ASSERT(!m_beginFrameCompletionEventOnImplThread); | 429 ASSERT(!m_beginFrameCompletionEventOnImplThread); |
433 | 430 |
434 if (m_schedulerOnImplThread->commitPending()) { | 431 if (m_schedulerOnImplThread->commitPending()) { |
435 completion->signal(); | 432 completion->signal(); |
436 return; | 433 return; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 m_layerTreeHostImpl->readback(m_readbackRequestOnImplThread->pixels,
m_readbackRequestOnImplThread->rect); | 642 m_layerTreeHostImpl->readback(m_readbackRequestOnImplThread->pixels,
m_readbackRequestOnImplThread->rect); |
646 m_readbackRequestOnImplThread->success = !m_layerTreeHostImpl->isCon
textLost(); | 643 m_readbackRequestOnImplThread->success = !m_layerTreeHostImpl->isCon
textLost(); |
647 } | 644 } |
648 m_readbackRequestOnImplThread->completion.signal(); | 645 m_readbackRequestOnImplThread->completion.signal(); |
649 m_readbackRequestOnImplThread = 0; | 646 m_readbackRequestOnImplThread = 0; |
650 } | 647 } |
651 | 648 |
652 if (drawFrame) | 649 if (drawFrame) |
653 result.didSwap = m_layerTreeHostImpl->swapBuffers(); | 650 result.didSwap = m_layerTreeHostImpl->swapBuffers(); |
654 | 651 |
655 // Process any finish request | |
656 if (m_finishAllRenderingCompletionEventOnImplThread) { | |
657 m_layerTreeHostImpl->finishAllRendering(); | |
658 m_finishAllRenderingCompletionEventOnImplThread->signal(); | |
659 m_finishAllRenderingCompletionEventOnImplThread = 0; | |
660 } | |
661 | |
662 // Tell the main thread that the the newly-commited frame was drawn. | 652 // Tell the main thread that the the newly-commited frame was drawn. |
663 if (m_nextFrameIsNewlyCommittedFrameOnImplThread) { | 653 if (m_nextFrameIsNewlyCommittedFrameOnImplThread) { |
664 m_nextFrameIsNewlyCommittedFrameOnImplThread = false; | 654 m_nextFrameIsNewlyCommittedFrameOnImplThread = false; |
665 m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::did
CommitAndDrawFrame)); | 655 m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::did
CommitAndDrawFrame)); |
666 } | 656 } |
667 | 657 |
668 return result; | 658 return result; |
669 } | 659 } |
670 | 660 |
671 void CCThreadProxy::acquireLayerTextures() | 661 void CCThreadProxy::acquireLayerTextures() |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->con
tentsTextureAllocator()); | 857 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->con
tentsTextureAllocator()); |
868 *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(c
ontextPtr)); | 858 *recreateSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(adoptRef(c
ontextPtr)); |
869 if (*recreateSucceeded) { | 859 if (*recreateSucceeded) { |
870 *capabilities = m_layerTreeHostImpl->layerRendererCapabilities(); | 860 *capabilities = m_layerTreeHostImpl->layerRendererCapabilities(); |
871 m_schedulerOnImplThread->didRecreateContext(); | 861 m_schedulerOnImplThread->didRecreateContext(); |
872 } | 862 } |
873 completion->signal(); | 863 completion->signal(); |
874 } | 864 } |
875 | 865 |
876 } // namespace WebCore | 866 } // namespace WebCore |
OLD | NEW |