| Index: cc/single_thread_proxy.cc
 | 
| diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
 | 
| index 40b7ad2019677ff864d42c238e8f7b056bc63b71..2794497fe756cc681d3ee27dcbf3a0d56de5bbf6 100644
 | 
| --- a/cc/single_thread_proxy.cc
 | 
| +++ b/cc/single_thread_proxy.cc
 | 
| @@ -13,6 +13,7 @@
 | 
|  #include "cc/prioritized_resource_manager.h"
 | 
|  #include "cc/resource_update_controller.h"
 | 
|  #include "cc/thread.h"
 | 
| +#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
 | 
|  
 | 
|  namespace cc {
 | 
|  
 | 
| @@ -139,6 +140,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 || !offscreenContext3d->makeContextCurrent())
 | 
| +            return false;
 | 
| +        offscreenGrContext = m_layerTreeHost->client()->offscreenGrContextForMainThread();
 | 
| +    }
 | 
|  
 | 
|      bool initialized;
 | 
|      {
 | 
| @@ -148,6 +157,7 @@ bool SingleThreadProxy::recreateOutputSurface()
 | 
|          initialized = m_layerTreeHostImpl->initializeRenderer(outputSurface.Pass());
 | 
|          if (initialized) {
 | 
|              m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererCapabilities();
 | 
| +            m_layerTreeHostImpl->resourceProvider()->setGaneshContexts(offscreenContext3d, offscreenGrContext);
 | 
|          }
 | 
|      }
 | 
|  
 | 
| @@ -196,8 +206,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());
 | 
| @@ -368,6 +377,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);
 | 
| @@ -375,18 +391,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()->setGaneshContexts(offscreenContext3d, offscreenGrContext);
 | 
| +
 | 
|          if (!m_layerTreeHostImpl->visible())
 | 
|              return false;
 | 
|  
 | 
| 
 |