Skip to content

Commit

Permalink
Remove enable passthrough raster decoder flag
Browse files Browse the repository at this point in the history
This is always available, so no need for a flag or preference.

Change-Id: I21f4cadd0c3362f5e45db4b3dc29e4929ff1ddbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1496542
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Jonathan Backer <backer@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640188}
  • Loading branch information
quisquous authored and Commit Bot committed Mar 13, 2019
1 parent 223d41a commit e018ea5
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 53 deletions.
1 change: 0 additions & 1 deletion content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2991,7 +2991,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableLogging,
switches::kEnableNetworkInformationDownlinkMax,
switches::kEnableOopRasterization,
switches::kEnablePassthroughRasterDecoder,
switches::kEnablePerfetto,
switches::kEnablePluginPlaceholderTesting,
switches::kEnablePreciseMemoryInfo,
Expand Down
5 changes: 0 additions & 5 deletions content/public/browser/gpu_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ const gpu::GpuPreferences GetGpuPreferencesFromCommandLine() {

gpu_preferences.enable_oop_rasterization_ddl =
command_line->HasSwitch(switches::kEnableOopRasterizationDDL);
gpu_preferences.enable_passthrough_raster_decoder =
command_line->HasSwitch(switches::kEnablePassthroughRasterDecoder);
#if defined(OS_WIN)
gpu_preferences.enable_passthrough_raster_decoder = true;
#endif

gpu_preferences.enable_vulkan =
command_line->HasSwitch(switches::kEnableVulkan);
Expand Down
4 changes: 0 additions & 4 deletions gpu/command_buffer/service/gpu_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ const char kUseCmdDecoder[] = "use-cmd-decoder";
// Turns on rastering to SkImage with RasterDecoder.
const char kEnableRasterToSkImage[] = "enable-raster-to-sk-image";

// Enable RasterDecoder with passthrough GLES2 command decoding.
const char kEnablePassthroughRasterDecoder[] =
"enable-passthrough-raster-decoder";

// Enable Vulkan support, must also have ENABLE_VULKAN defined.
const char kEnableVulkan[] = "enable-vulkan";

Expand Down
1 change: 0 additions & 1 deletion gpu/command_buffer/service/gpu_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ GPU_EXPORT extern const char kGLShaderIntermOutput[];
GPU_EXPORT extern const char kEmulateShaderPrecision[];
GPU_EXPORT extern const char kUseCmdDecoder[];
GPU_EXPORT extern const char kEnableRasterToSkImage[];
GPU_EXPORT extern const char kEnablePassthroughRasterDecoder[];
GPU_EXPORT extern const char kEnableVulkan[];

} // namespace switches
Expand Down
1 change: 0 additions & 1 deletion gpu/config/gpu_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ struct GPU_EXPORT GpuPreferences {

bool enable_oop_rasterization_ddl = false;
bool enable_raster_to_sk_image = false;
bool enable_passthrough_raster_decoder = false;

// Start the watchdog suspended, as the app is already backgrounded and won't
// send a background/suspend signal.
Expand Down
4 changes: 0 additions & 4 deletions gpu/config/gpu_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ GpuFeatureStatus GetOopRasterizationFeatureStatus(
if (!gpu_info.oop_rasterization_supported)
return kGpuFeatureStatusDisabled;

if (gpu_preferences.use_passthrough_cmd_decoder &&
!gpu_preferences.enable_passthrough_raster_decoder)
return kGpuFeatureStatusDisabled;

if (gpu_preferences.disable_oop_rasterization)
return kGpuFeatureStatusDisabled;
else if (gpu_preferences.enable_oop_rasterization)
Expand Down
1 change: 0 additions & 1 deletion gpu/ipc/common/gpu_preferences.mojom
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ struct GpuPreferences {
bool disable_oop_rasterization;
bool enable_oop_rasterization_ddl;
bool enable_raster_to_sk_image;
bool enable_passthrough_raster_decoder;
bool watchdog_starts_backgrounded;
bool enable_vulkan;
bool enable_gpu_benchmarking_extension;
Expand Down
6 changes: 0 additions & 6 deletions gpu/ipc/common/gpu_preferences_struct_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
out->disable_oop_rasterization = prefs.disable_oop_rasterization();
out->enable_oop_rasterization_ddl = prefs.enable_oop_rasterization_ddl();
out->enable_raster_to_sk_image = prefs.enable_raster_to_sk_image();
out->enable_passthrough_raster_decoder =
prefs.enable_passthrough_raster_decoder();
out->watchdog_starts_backgrounded = prefs.watchdog_starts_backgrounded();
out->enable_vulkan = prefs.enable_vulkan();
out->enable_gpu_benchmarking_extension =
Expand Down Expand Up @@ -263,10 +261,6 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
static bool enable_raster_to_sk_image(const gpu::GpuPreferences& prefs) {
return prefs.enable_raster_to_sk_image;
}
static bool enable_passthrough_raster_decoder(
const gpu::GpuPreferences& prefs) {
return prefs.enable_passthrough_raster_decoder;
}
static bool watchdog_starts_backgrounded(const gpu::GpuPreferences& prefs) {
return prefs.watchdog_starts_backgrounded;
}
Expand Down
9 changes: 1 addition & 8 deletions gpu/ipc/in_process_command_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,7 @@ gpu::ContextResult InProcessCommandBuffer::InitializeOnGpuThread(
return ContextResult::kTransientFailure;
}

bool use_passthrough_cmd_decoder =
task_executor_->gpu_preferences().use_passthrough_cmd_decoder &&
gles2::PassthroughCommandDecoderSupported();
bool allow_raster_decoder =
!use_passthrough_cmd_decoder ||
task_executor_->gpu_preferences().enable_passthrough_raster_decoder;

if (allow_raster_decoder && params.attribs.enable_raster_interface &&
if (params.attribs.enable_raster_interface &&
!params.attribs.enable_gles2_interface) {
context_state_ = base::MakeRefCounted<SharedContextState>(
gl_share_group_, surface_, real_context, use_virtualized_gl_context_,
Expand Down
10 changes: 1 addition & 9 deletions gpu/ipc/service/gpu_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,6 @@ void GpuChannel::OnCreateCommandBuffer(
}

std::unique_ptr<CommandBufferStub> stub;
bool use_passthrough_cmd_decoder =
gpu_channel_manager_->gpu_preferences().use_passthrough_cmd_decoder &&
gles2::PassthroughCommandDecoderSupported();
bool allow_raster_decoder =
!use_passthrough_cmd_decoder ||
gpu_channel_manager_->gpu_preferences().enable_passthrough_raster_decoder;

if (init_params.attribs.context_type == CONTEXT_TYPE_WEBGPU) {
if (!gpu_channel_manager_->gpu_preferences().enable_webgpu) {
DLOG(ERROR) << "ContextResult::kFatalFailure: WebGPU not enabled";
Expand All @@ -676,8 +669,7 @@ void GpuChannel::OnCreateCommandBuffer(

stub = std::make_unique<WebGPUCommandBufferStub>(
this, init_params, command_buffer_id, sequence_id, stream_id, route_id);
} else if (allow_raster_decoder &&
init_params.attribs.enable_raster_interface &&
} else if (init_params.attribs.enable_raster_interface &&
!init_params.attribs.enable_gles2_interface) {
stub = std::make_unique<RasterCommandBufferStub>(
this, init_params, command_buffer_id, sequence_id, stream_id, route_id);
Expand Down
14 changes: 1 addition & 13 deletions services/ws/public/cpp/gpu/context_provider_command_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,6 @@ gpu::ContextResult ContextProviderCommandBuffer::BindToCurrentThread() {
return bind_result_;
}

// TODO(enne): remove the kEnablePassthroughRasterDecoder flag and
// assume it is always available.
bool enable_passthrough_raster_decoder =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnablePassthroughRasterDecoder);
#if defined(OS_WIN)
enable_passthrough_raster_decoder = true;
#endif

bool allow_raster_decoder =
!command_buffer_->channel()->gpu_info().passthrough_cmd_decoder ||
enable_passthrough_raster_decoder;
if (attributes_.context_type == gpu::CONTEXT_TYPE_WEBGPU) {
DCHECK(!attributes_.enable_raster_interface);
DCHECK(!attributes_.enable_gles2_interface);
Expand Down Expand Up @@ -189,7 +177,7 @@ gpu::ContextResult ContextProviderCommandBuffer::BindToCurrentThread() {
impl_ = nullptr;
webgpu_interface_ = std::move(webgpu_impl);
helper_ = std::move(webgpu_helper);
} else if (allow_raster_decoder && attributes_.enable_raster_interface &&
} else if (attributes_.enable_raster_interface &&
!attributes_.enable_gles2_interface) {
DCHECK(!support_grcontext_);
// The raster helper writes the command buffer protocol.
Expand Down

0 comments on commit e018ea5

Please sign in to comment.