Index: content/renderer/renderer_blink_platform_impl.cc |
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc |
index ac93eff747211717a90f164d9d32fcd69ffad88f..d231017f5b3d8aae786ad78b75eb0724e60f883e 100644 |
--- a/content/renderer/renderer_blink_platform_impl.cc |
+++ b/content/renderer/renderer_blink_platform_impl.cc |
@@ -1035,20 +1035,22 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider( |
return nullptr; |
} |
+ content::WebGraphicsContext3DProviderImpl* share_provider_impl = |
+ static_cast<content::WebGraphicsContext3DProviderImpl*>(share_provider); |
+ ContextProviderCommandBuffer* share_context = nullptr; |
+ |
// WebGL contexts must fail creation if the share group is lost. |
- if (share_provider && |
- share_provider->contextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR) { |
- std::string error_message( |
- "OffscreenContext Creation failed, Shared context is lost"); |
- gl_info->errorMessage = WebString::fromUTF8(error_message); |
- return nullptr; |
+ if (share_provider_impl) { |
+ auto* gl = share_provider_impl->contextGL(); |
+ if (gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR) { |
+ std::string error_message( |
+ "OffscreenContext Creation failed, Shared context is lost"); |
+ gl_info->errorMessage = WebString::fromUTF8(error_message); |
+ return nullptr; |
+ } |
+ share_context = share_provider_impl->context_provider(); |
} |
- WebGraphicsContext3DCommandBufferImpl* share_context = |
- share_provider ? static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
- share_provider->context3d()) |
- : nullptr; |
- |
// This is an offscreen context, which doesn't use the default frame buffer, |
// so don't request any alpha, depth, stencil, antialiasing. |
gpu::gles2::ContextCreationAttribHelper attributes; |
@@ -1067,7 +1069,6 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider( |
else if (web_attributes.webGLVersion == 2) |
attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL2; |
- bool share_resources = false; |
bool automatic_flushes = true; |
// Prefer discrete GPU for WebGL. |
gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; |
@@ -1077,8 +1078,9 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider( |
base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( |
gpu::kNullSurfaceHandle, GURL(top_document_web_url), |
gpu_channel_host.get(), attributes, gpu_preference, |
- share_resources, automatic_flushes, share_context)), |
- gpu::SharedMemoryLimits(), RENDERER_MAINTHREAD_CONTEXT)); |
+ automatic_flushes)), |
+ gpu::SharedMemoryLimits(), share_context, |
+ RENDERER_MAINTHREAD_CONTEXT)); |
if (!provider->BindToCurrentThread()) { |
// Collect Graphicsinfo if there is a context failure or it is failed |
// purposefully in case of layout tests. |
@@ -1092,7 +1094,7 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider( |
blink::WebGraphicsContext3DProvider* |
RendererBlinkPlatformImpl::createSharedOffscreenGraphicsContext3DProvider() { |
- scoped_refptr<cc_blink::ContextProviderWebContext> provider = |
+ scoped_refptr<ContextProviderCommandBuffer> provider = |
RenderThreadImpl::current()->SharedMainThreadContextProvider(); |
if (!provider) |
return nullptr; |