Commit 2a2f503f authored by Nathan Zabriskie's avatar Nathan Zabriskie Committed by Commit Bot

Prep to disable GLInterface on shared main thread context

To support RasterImplementation on the shared main thread context we need
to remove all references to ContextGL on that context. This CL prepares
to fully disable ContextGL() on the shared context. A follow up CL
will change |support_gles2_interface| = false which will actually
disable it. New requisite API's should be added to RasterInterface
instead of GLES2Interface. During the transition to OOPR canvas we will
support RasterImplementationGLES but that class will be deprecated once
we fully transition to RasterImplementation at which point ContextGL and
GRContext will no longer be accessible on the shared main thread context.

Bug: 1018898
Change-Id: I85b2bc50c937d715a248a0c451278624f8d3e7b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2116782Reviewed-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@{#756048}
parent 69b66d52
...@@ -335,6 +335,7 @@ scoped_refptr<viz::ContextProviderCommandBuffer> CreateOffscreenContext( ...@@ -335,6 +335,7 @@ scoped_refptr<viz::ContextProviderCommandBuffer> CreateOffscreenContext(
attributes.lose_context_when_out_of_memory = true; attributes.lose_context_when_out_of_memory = true;
attributes.enable_gles2_interface = support_gles2_interface; attributes.enable_gles2_interface = support_gles2_interface;
attributes.enable_raster_interface = support_raster_interface; attributes.enable_raster_interface = support_raster_interface;
attributes.enable_grcontext = support_grcontext;
// Using RasterDecoder for OOP-R backend, so we need support_raster_interface // Using RasterDecoder for OOP-R backend, so we need support_raster_interface
// and !support_gles2_interface. // and !support_gles2_interface.
attributes.enable_oop_rasterization = support_oop_rasterization && attributes.enable_oop_rasterization = support_oop_rasterization &&
...@@ -1220,8 +1221,8 @@ scoped_refptr<viz::ContextProviderCommandBuffer> ...@@ -1220,8 +1221,8 @@ scoped_refptr<viz::ContextProviderCommandBuffer>
RenderThreadImpl::SharedMainThreadContextProvider() { RenderThreadImpl::SharedMainThreadContextProvider() {
DCHECK(IsMainThread()); DCHECK(IsMainThread());
if (shared_main_thread_contexts_ && if (shared_main_thread_contexts_ &&
shared_main_thread_contexts_->ContextGL()->GetGraphicsResetStatusKHR() == shared_main_thread_contexts_->RasterInterface()
GL_NO_ERROR) ->GetGraphicsResetStatusKHR() == GL_NO_ERROR)
return shared_main_thread_contexts_; return shared_main_thread_contexts_;
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host( scoped_refptr<gpu::GpuChannelHost> gpu_channel_host(
......
...@@ -62,6 +62,7 @@ struct GPU_EXPORT ContextCreationAttribs { ...@@ -62,6 +62,7 @@ struct GPU_EXPORT ContextCreationAttribs {
bool own_offscreen_surface = false; bool own_offscreen_surface = false;
bool single_buffer = false; bool single_buffer = false;
bool enable_gles2_interface = true; bool enable_gles2_interface = true;
bool enable_grcontext = false;
bool enable_raster_interface = false; bool enable_raster_interface = false;
bool enable_oop_rasterization = false; bool enable_oop_rasterization = false;
bool enable_swap_timestamps_if_supported = false; bool enable_swap_timestamps_if_supported = false;
......
...@@ -192,6 +192,7 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::ContextCreationAttribs) ...@@ -192,6 +192,7 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::ContextCreationAttribs)
IPC_STRUCT_TRAITS_MEMBER(single_buffer) IPC_STRUCT_TRAITS_MEMBER(single_buffer)
IPC_STRUCT_TRAITS_MEMBER(color_space) IPC_STRUCT_TRAITS_MEMBER(color_space)
IPC_STRUCT_TRAITS_MEMBER(enable_gles2_interface) IPC_STRUCT_TRAITS_MEMBER(enable_gles2_interface)
IPC_STRUCT_TRAITS_MEMBER(enable_grcontext)
IPC_STRUCT_TRAITS_MEMBER(enable_raster_interface) IPC_STRUCT_TRAITS_MEMBER(enable_raster_interface)
IPC_STRUCT_TRAITS_MEMBER(enable_oop_rasterization) IPC_STRUCT_TRAITS_MEMBER(enable_oop_rasterization)
IPC_STRUCT_TRAITS_MEMBER(enable_swap_timestamps_if_supported) IPC_STRUCT_TRAITS_MEMBER(enable_swap_timestamps_if_supported)
......
...@@ -735,7 +735,8 @@ void GpuChannel::OnCreateCommandBuffer( ...@@ -735,7 +735,8 @@ void GpuChannel::OnCreateCommandBuffer(
stub = std::make_unique<WebGPUCommandBufferStub>( stub = std::make_unique<WebGPUCommandBufferStub>(
this, init_params, command_buffer_id, sequence_id, stream_id, route_id); this, init_params, command_buffer_id, sequence_id, stream_id, route_id);
} else if (init_params.attribs.enable_raster_interface && } else if (init_params.attribs.enable_raster_interface &&
!init_params.attribs.enable_gles2_interface) { !init_params.attribs.enable_gles2_interface &&
!init_params.attribs.enable_grcontext) {
stub = std::make_unique<RasterCommandBufferStub>( stub = std::make_unique<RasterCommandBufferStub>(
this, init_params, command_buffer_id, sequence_id, stream_id, route_id); this, init_params, command_buffer_id, sequence_id, stream_id, route_id);
} else { } else {
......
...@@ -184,7 +184,8 @@ gpu::ContextResult ContextProviderCommandBuffer::BindToCurrentThread() { ...@@ -184,7 +184,8 @@ gpu::ContextResult ContextProviderCommandBuffer::BindToCurrentThread() {
webgpu_interface_ = std::move(webgpu_impl); webgpu_interface_ = std::move(webgpu_impl);
helper_ = std::move(webgpu_helper); helper_ = std::move(webgpu_helper);
} else if (attributes_.enable_raster_interface && } else if (attributes_.enable_raster_interface &&
!attributes_.enable_gles2_interface) { !attributes_.enable_gles2_interface &&
!attributes_.enable_grcontext) {
DCHECK(!support_grcontext_); DCHECK(!support_grcontext_);
// The raster helper writes the command buffer protocol. // The raster helper writes the command buffer protocol.
auto raster_helper = auto raster_helper =
......
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