| Index: cc/single_thread_proxy.cc
|
| diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
|
| index 1301355238382193e31001ec65177f698221ca64..aa86d5fb7c0e08c08d25462167c56d8b18b01e38 100644
|
| --- a/cc/single_thread_proxy.cc
|
| +++ b/cc/single_thread_proxy.cc
|
| @@ -139,6 +139,14 @@ bool SingleThreadProxy::recreateOutputSurface()
|
| scoped_ptr<OutputSurface> outputSurface = m_layerTreeHost->createOutputSurface();
|
| if (!outputSurface.get())
|
| return false;
|
| + WebKit::WebGraphicsContext3D* offscreenContext3d = NULL;
|
| + GrContext* offscreenGrContext = NULL;
|
| + if (m_RendererCapabilitiesForMainThread.usingOffscreenContext3d && m_layerTreeHost->needsOffscreenContext()) {
|
| + offscreenContext3d = m_layerTreeHost->client()->OffscreenContext3dForMainThread();
|
| + if (!offscreenContext3d)
|
| + return false;
|
| + offscreenGrContext = m_layerTreeHost->client()->OffscreenGrContextForMainThread();
|
| + }
|
|
|
| bool initialized;
|
| {
|
| @@ -148,6 +156,7 @@ bool SingleThreadProxy::recreateOutputSurface()
|
| initialized = m_layerTreeHostImpl->initializeRenderer(outputSurface.Pass());
|
| if (initialized) {
|
| m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererCapabilities();
|
| + m_layerTreeHostImpl->resourceProvider()->setOffscreenContexts(offscreenContext3d, offscreenGrContext);
|
| }
|
| }
|
|
|
| @@ -196,8 +205,7 @@ void SingleThreadProxy::doCommit(scoped_ptr<ResourceUpdateQueue> queue)
|
| NULL,
|
| Proxy::mainThread(),
|
| queue.Pass(),
|
| - m_layerTreeHostImpl->resourceProvider(),
|
| - hasImplThread());
|
| + m_layerTreeHostImpl->resourceProvider());
|
| updateController->finalize();
|
|
|
| m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
|
| @@ -382,6 +390,13 @@ bool SingleThreadProxy::commitAndComposite()
|
| if (!m_layerTreeHost->initializeRendererIfNeeded())
|
| return false;
|
|
|
| + WebKit::WebGraphicsContext3D* offscreenContext3d = NULL;
|
| + GrContext* offscreenGrContext = NULL;
|
| + if (m_RendererCapabilitiesForMainThread.usingOffscreenContext3d && m_layerTreeHost->needsOffscreenContext()) {
|
| + offscreenContext3d = m_layerTreeHost->client()->OffscreenContext3dForMainThread();
|
| + offscreenGrContext = m_layerTreeHost->client()->OffscreenGrContextForMainThread();
|
| + }
|
| +
|
| m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings();
|
|
|
| scoped_ptr<ResourceUpdateQueue> queue = make_scoped_ptr(new ResourceUpdateQueue);
|
| @@ -389,18 +404,20 @@ bool SingleThreadProxy::commitAndComposite()
|
|
|
| m_layerTreeHost->willCommit();
|
| doCommit(queue.Pass());
|
| - bool result = doComposite();
|
| + bool result = doComposite(offscreenContext3d, offscreenGrContext);
|
| m_layerTreeHost->didBeginFrame();
|
| return result;
|
| }
|
|
|
| -bool SingleThreadProxy::doComposite()
|
| + bool SingleThreadProxy::doComposite(WebKit::WebGraphicsContext3D* offscreenContext3d, GrContext* offscreenGrContext)
|
| {
|
| DCHECK(!m_outputSurfaceLost);
|
| {
|
| DebugScopedSetImplThread impl(this);
|
| base::AutoReset<bool> markInside(&m_insideDraw, true);
|
|
|
| + m_layerTreeHostImpl->resourceProvider()->setOffscreenContexts(offscreenContext3d, offscreenGrContext);
|
| +
|
| if (!m_layerTreeHostImpl->visible())
|
| return false;
|
|
|
|
|