| 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 232f991e9b508206930090a52dd9cbdb3609b276..08143319d5f0def8345bde39c1c572e826549534 100644
|
| --- a/content/renderer/renderer_blink_platform_impl.cc
|
| +++ b/content/renderer/renderer_blink_platform_impl.cc
|
| @@ -1014,7 +1014,8 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
|
| const blink::Platform::ContextAttributes& web_attributes,
|
| const blink::WebURL& top_document_web_url,
|
| blink::WebGraphicsContext3DProvider* share_provider,
|
| - blink::Platform::GraphicsInfo* gl_info) {
|
| + blink::Platform::GraphicsInfo* gl_info,
|
| + blink::Platform::WillBindToCurrentThread will_bind_to_current_thread) {
|
| DCHECK(gl_info);
|
| if (!RenderThreadImpl::current()) {
|
| std::string error_message("Failed to run in Current RenderThreadImpl");
|
| @@ -1036,6 +1037,9 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
|
| static_cast<content::WebGraphicsContext3DProviderImpl*>(share_provider);
|
| ContextProviderCommandBuffer* share_context = nullptr;
|
|
|
| + if (will_bind_to_current_thread == blink::Platform::DoNotBindToCurrentThread)
|
| + DCHECK(!share_provider_impl);
|
| +
|
| // WebGL contexts must fail creation if the share group is lost.
|
| if (share_provider_impl) {
|
| auto* gl = share_provider_impl->contextGL();
|
| @@ -1078,11 +1082,13 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
|
| GURL(top_document_web_url), gpu_preference, automatic_flushes,
|
| gpu::SharedMemoryLimits(), attributes, share_context,
|
| command_buffer_metrics::OFFSCREEN_CONTEXT_FOR_WEBGL));
|
| - if (!provider->BindToCurrentThread()) {
|
| - // Collect Graphicsinfo if there is a context failure or it is failed
|
| - // purposefully in case of layout tests.
|
| - Collect3DContextInformationOnFailure(gl_info, gpu_info);
|
| - return nullptr;
|
| + if (will_bind_to_current_thread == blink::Platform::BindToCurrentThread) {
|
| + if (!provider->BindToCurrentThread()) {
|
| + // Collect Graphicsinfo if there is a context failure or it is failed
|
| + // purposefully in case of layout tests.
|
| + Collect3DContextInformationOnFailure(gl_info, gpu_info);
|
| + return nullptr;
|
| + }
|
| }
|
| return new WebGraphicsContext3DProviderImpl(std::move(provider));
|
| }
|
|
|