Commit b3c1c639 authored by Nathan Zabriskie's avatar Nathan Zabriskie Committed by Commit Bot

Respect OOPR settings when creating worker context

In Canvas OOPR mode we want all contexts in the renderer process to use
RasterInterface/OOP resources (minus WebGL contexts). This CL uses the
kCanvasOopRasterization feature flag when creating worker thread
contexts to match the context settings for the shared main thread
context.

Bug: 1018894
Change-Id: I7ba0b565c7901e42b5545aff80ded0a395e203ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399573Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Nathan Zabriskie <nazabris@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#805918}
parent aea155f4
...@@ -741,6 +741,10 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider( ...@@ -741,6 +741,10 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider(
attributes.sample_buffers = 0; attributes.sample_buffers = 0;
attributes.bind_generates_resource = false; attributes.bind_generates_resource = false;
attributes.enable_raster_interface = web_attributes.enable_raster_interface; attributes.enable_raster_interface = web_attributes.enable_raster_interface;
attributes.enable_oop_rasterization =
attributes.enable_raster_interface &&
base::FeatureList::IsEnabled(features::kCanvasOopRasterization);
attributes.enable_gles2_interface = !attributes.enable_oop_rasterization;
attributes.gpu_preference = web_attributes.prefer_low_power_gpu attributes.gpu_preference = web_attributes.prefer_low_power_gpu
? gl::GpuPreference::kLowPower ? gl::GpuPreference::kLowPower
...@@ -753,6 +757,8 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider( ...@@ -753,6 +757,8 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider(
constexpr bool automatic_flushes = true; constexpr bool automatic_flushes = true;
constexpr bool support_locking = false; constexpr bool support_locking = false;
bool use_grcontext =
!attributes.enable_oop_rasterization && web_attributes.support_grcontext;
scoped_refptr<viz::ContextProviderCommandBuffer> provider( scoped_refptr<viz::ContextProviderCommandBuffer> provider(
new viz::ContextProviderCommandBuffer( new viz::ContextProviderCommandBuffer(
...@@ -760,7 +766,7 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider( ...@@ -760,7 +766,7 @@ RendererBlinkPlatformImpl::CreateOffscreenGraphicsContext3DProvider(
RenderThreadImpl::current()->GetGpuMemoryBufferManager(), RenderThreadImpl::current()->GetGpuMemoryBufferManager(),
kGpuStreamIdDefault, kGpuStreamPriorityDefault, kGpuStreamIdDefault, kGpuStreamPriorityDefault,
gpu::kNullSurfaceHandle, GURL(top_document_web_url), gpu::kNullSurfaceHandle, GURL(top_document_web_url),
automatic_flushes, support_locking, web_attributes.support_grcontext, automatic_flushes, support_locking, use_grcontext,
gpu::SharedMemoryLimits(), attributes, gpu::SharedMemoryLimits(), attributes,
viz::command_buffer_metrics::ContextType::WEBGL)); viz::command_buffer_metrics::ContextType::WEBGL));
return std::make_unique<WebGraphicsContext3DProviderImpl>( return std::make_unique<WebGraphicsContext3DProviderImpl>(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment