本文整理汇总了C++中CCCompletionEvent类的典型用法代码示例。如果您正苦于以下问题:C++ CCCompletionEvent类的具体用法?C++ CCCompletionEvent怎么用?C++ CCCompletionEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCCompletionEvent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: forceSerializeOnSwapBuffers
void CCThreadProxy::forceSerializeOnSwapBuffers()
{
DebugScopedSetMainThreadBlocked mainThreadBlocked;
CCCompletionEvent completion;
CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::forceSerializeOnSwapBuffersOnImplThread, &completion));
completion.wait();
}
示例2: start
void CCThreadProxy::start()
{
// Create LayerTreeHostImpl.
CCCompletionEvent completion;
ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::initializeImplOnCCThread, AllowCrossThreadAccess(&completion)));
completion.wait();
}
示例3: TRACE_EVENT
bool CCThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect)
{
TRACE_EVENT("CCThreadPRoxy::compositeAndReadback", this, 0);
ASSERT(isMainThread());
ASSERT(m_layerTreeHost);
// If a commit is pending, perform the commit first.
if (m_commitRequested) {
// This bit of code is uglier than it should be because returning
// pointers via the CCThread task model is really messy. Effectively, we
// are making a blocking call to createBeginFrameAndCommitTaskOnImplThread,
// and trying to get the CCMainThread::Task it returns so we can run it.
OwnPtr<CCMainThread::Task> beginFrameAndCommitTask;
{
CCMainThread::Task* taskPtr = 0;
CCCompletionEvent completion;
s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::obtainBeginFrameAndCommitTaskFromCCThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&taskPtr)));
completion.wait();
beginFrameAndCommitTask = adoptPtr(taskPtr);
}
beginFrameAndCommitTask->performTask();
}
// Draw using the new tree and read back the results.
bool success = false;
CCCompletionEvent completion;
s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::drawLayersAndReadbackOnImplThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&success), AllowCrossThreadAccess(pixels), rect));
completion.wait();
return success;
}
示例4: TRACE_EVENT0
bool CCThreadProxy::recreateContext()
{
TRACE_EVENT0("cc", "CCThreadProxy::recreateContext");
ASSERT(isMainThread());
// Try to create the context.
OwnPtr<CCGraphicsContext> context = m_layerTreeHost->createContext();
if (!context)
return false;
if (m_layerTreeHost->needsSharedContext())
if (!WebSharedGraphicsContext3D::createCompositorThreadContext())
return false;
// Make a blocking call to recreateContextOnImplThread. The results of that
// call are pushed into the recreateSucceeded and capabilities local
// variables.
CCCompletionEvent completion;
bool recreateSucceeded = false;
RendererCapabilities capabilities;
DebugScopedSetMainThreadBlocked mainThreadBlocked;
CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::recreateContextOnImplThread,
&completion,
context.leakPtr(),
&recreateSucceeded,
&capabilities));
completion.wait();
if (recreateSucceeded)
m_RendererCapabilitiesMainThreadCopy = capabilities;
return recreateSucceeded;
}
示例5: ASSERT
void CCThreadProxy::finishAllRendering()
{
ASSERT(CCProxy::isMainThread());
// Make sure all GL drawing is finished on the impl thread.
CCCompletionEvent completion;
s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::finishAllRenderingOnImplThread, AllowCrossThreadAccess(&completion)));
completion.wait();
}
示例6: ASSERT
void CCThreadProxy::finishAllRendering()
{
ASSERT(CCProxy::isMainThread());
// Make sure all GL drawing is finished on the impl thread.
DebugScopedSetMainThreadBlocked mainThreadBlocked;
CCCompletionEvent completion;
CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::finishAllRenderingOnImplThread, &completion));
completion.wait();
}
示例7: m_thread
CCThreadImpl::CCThreadImpl(WebThread* thread)
: m_thread(thread)
{
// Get the threadId for the newly-created thread by running a task
// on that thread, blocking on the result.
m_threadID = currentThread();
CCCompletionEvent completion;
m_thread->postTask(new GetThreadIDTask(&m_threadID, &completion));
completion.wait();
}
示例8: TRACE_EVENT
void CCThreadProxy::stop()
{
TRACE_EVENT("CCThreadProxy::stop", this, 0);
ASSERT(isMainThread());
// Synchronously deletes the impl.
CCCompletionEvent completion;
ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::layerTreeHostClosedOnCCThread, AllowCrossThreadAccess(&completion)));
completion.wait();
ASSERT(!m_layerTreeHostImpl); // verify that the impl deleted.
m_layerTreeHost = 0;
}
示例9: ASSERT
void CCThreadProxy::beginFrameAndCommit(double frameBeginTime)
{
ASSERT(isMainThread());
if (!m_layerTreeHost)
return;
TRACE_EVENT("CCThreadProxy::requestFrameAndCommit", this, 0);
{
TRACE_EVENT("CCLayerTreeHost::animateAndLayout", this, 0);
m_layerTreeHost->animateAndLayout(frameBeginTime);
}
m_commitPending = false;
// Blocking call to CCThreadProxy::performCommit
CCCompletionEvent completion;
ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::commitOnCCThread, AllowCrossThreadAccess(&completion)));
completion.wait();
}