Enable RasterDecoder whenever --enable-oop-rasterization
This CL turns removes --enable-raster-decoder and turns on RasterDecoder whenever --enable-oop-rasterization is passed from the command line when starting chrome. This is not yet true for tests. We will still use RasterImplementationGLES and GLES2Decoder if attribs.enable_oop_rasterization and attribs.enable_gles2_interface. This was done to maintain coverage of both RasterImplementationGLES and RasterImplementation. I will clean this up in separate CLs as I rip out OOP-R code from GLES2{Impl,Decoder}. TBR: achuith@chromium.org, sadrul@chromium.org Bug: 789238 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: I3e0bd4606c70f4bb9c52117c5aa0baa6ded37665 Reviewed-on: https://chromium-review.googlesource.com/1031012 Commit-Queue: Jonathan Backer <backer@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Antoine Labour <piman@chromium.org> Reviewed-by: enne <enne@chromium.org> Cr-Commit-Position: refs/heads/master@{#555894}
This commit is contained in:
cc
chrome/browser/chromeos/login
content
gpu
command_buffer
config
ipc
services/ui/public/cpp/gpu
@ -54,15 +54,6 @@ class OopPixelTestBase : public testing::Test {
|
||||
virtual bool UseRasterDecoder() = 0;
|
||||
|
||||
void SetUp() override {
|
||||
// Add an OOP rasterization command line flag so that we set
|
||||
// |chromium_raster_transport| features flag.
|
||||
// TODO(vmpstr): Is there a better way to do this?
|
||||
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableOOPRasterization)) {
|
||||
base::CommandLine::ForCurrentProcess()->AppendSwitch(
|
||||
switches::kEnableOOPRasterization);
|
||||
}
|
||||
|
||||
raster_context_provider_ =
|
||||
base::MakeRefCounted<TestInProcessContextProvider>(
|
||||
/*enable_oop_rasterization=*/true,
|
||||
|
@ -45,20 +45,8 @@ class TransferCacheTest : public testing::TestWithParam<bool> {
|
||||
// Enable OOP rasterization.
|
||||
attribs.enable_oop_rasterization = true;
|
||||
attribs.enable_raster_interface = true;
|
||||
|
||||
// |true| will test RasterDecoder, |false| will test GLES2Decoder.
|
||||
attribs.enable_raster_decoder = UseRasterDecoder();
|
||||
attribs.enable_gles2_interface = !UseRasterDecoder();
|
||||
|
||||
// Add an OOP rasterization command line flag so that we set
|
||||
// |chromium_raster_transport| features flag.
|
||||
// TODO(vmpstr): Is there a better way to do this?
|
||||
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableOOPRasterization)) {
|
||||
base::CommandLine::ForCurrentProcess()->AppendSwitch(
|
||||
switches::kEnableOOPRasterization);
|
||||
}
|
||||
|
||||
context_ = std::make_unique<gpu::RasterInProcessContext>();
|
||||
auto result = context_->Initialize(
|
||||
/*service=*/nullptr, attribs, gpu::SharedMemoryLimits(),
|
||||
|
@ -66,29 +66,14 @@ std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext() {
|
||||
TestInProcessContextProvider::TestInProcessContextProvider(
|
||||
bool enable_oop_rasterization,
|
||||
bool support_gles2_interface) {
|
||||
if (support_gles2_interface) {
|
||||
// TODO(enne): make this always support oop rasterization. Some tests
|
||||
// fail to create the context when oop rasterization is turned on.
|
||||
gles2_context_ = CreateGLInProcessContext(
|
||||
&gpu_memory_buffer_manager_, &image_factory_,
|
||||
base::ThreadTaskRunnerHandle::Get(), enable_oop_rasterization);
|
||||
cache_controller_.reset(
|
||||
new viz::ContextCacheController(gles2_context_->GetImplementation(),
|
||||
base::ThreadTaskRunnerHandle::Get()));
|
||||
|
||||
raster_implementation_gles2_ =
|
||||
std::make_unique<gpu::raster::RasterImplementationGLES>(
|
||||
gles2_context_->GetImplementation(),
|
||||
gles2_context_->GetImplementation(),
|
||||
gles2_context_->GetImplementation()->command_buffer(),
|
||||
gles2_context_->GetCapabilities());
|
||||
} else {
|
||||
if (enable_oop_rasterization) {
|
||||
gpu::ContextCreationAttribs attribs;
|
||||
attribs.bind_generates_resource = false;
|
||||
attribs.enable_oop_rasterization = enable_oop_rasterization;
|
||||
attribs.enable_oop_rasterization = true;
|
||||
attribs.enable_raster_interface = true;
|
||||
attribs.enable_gles2_interface = false;
|
||||
attribs.enable_raster_decoder = true;
|
||||
// TODO(crbug.com/834313): Remove this once we start tearing down OOP-R in
|
||||
// GLES2Decoder.
|
||||
attribs.enable_gles2_interface = support_gles2_interface;
|
||||
|
||||
raster_context_.reset(new gpu::RasterInProcessContext);
|
||||
auto result = raster_context_->Initialize(
|
||||
@ -101,6 +86,19 @@ TestInProcessContextProvider::TestInProcessContextProvider(
|
||||
cache_controller_.reset(
|
||||
new viz::ContextCacheController(raster_context_->GetContextSupport(),
|
||||
base::ThreadTaskRunnerHandle::Get()));
|
||||
} else {
|
||||
gles2_context_ = CreateGLInProcessContext(
|
||||
&gpu_memory_buffer_manager_, &image_factory_,
|
||||
base::ThreadTaskRunnerHandle::Get(), enable_oop_rasterization);
|
||||
cache_controller_.reset(
|
||||
new viz::ContextCacheController(gles2_context_->GetImplementation(),
|
||||
base::ThreadTaskRunnerHandle::Get()));
|
||||
raster_implementation_gles2_ =
|
||||
std::make_unique<gpu::raster::RasterImplementationGLES>(
|
||||
gles2_context_->GetImplementation(),
|
||||
gles2_context_->GetImplementation(),
|
||||
gles2_context_->GetImplementation()->command_buffer(),
|
||||
gles2_context_->GetCapabilities());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,6 @@ void DeriveCommandLine(const GURL& start_url,
|
||||
::switches::kEnablePartialRaster,
|
||||
::switches::kEnablePinch,
|
||||
::switches::kEnablePreferCompositingToLCDText,
|
||||
::switches::kEnableRasterDecoder,
|
||||
::switches::kEnableRGBA4444Textures,
|
||||
::switches::kEnableSlimmingPaintV175,
|
||||
::switches::kEnableSlimmingPaintV2,
|
||||
|
@ -2712,7 +2712,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
switches::kEnablePreciseMemoryInfo,
|
||||
switches::kEnablePrintBrowser,
|
||||
switches::kEnablePreferCompositingToLCDText,
|
||||
switches::kEnableRasterDecoder,
|
||||
switches::kEnableRGBA4444Textures,
|
||||
switches::kEnableSkiaBenchmarking,
|
||||
switches::kEnableSlimmingPaintV175,
|
||||
|
@ -339,7 +339,7 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
nullptr);
|
||||
#endif
|
||||
|
||||
if (command_line.HasSwitch(switches::kEnableOOPRasterization)) {
|
||||
if (gpu_preferences.enable_oop_rasterization) {
|
||||
SkGraphics::Init();
|
||||
#if defined(OS_LINUX)
|
||||
// Set up the font IPC so that the GPU process can create typefaces.
|
||||
|
@ -375,16 +375,11 @@ scoped_refptr<ui::ContextProviderCommandBuffer> CreateOffscreenContext(
|
||||
attributes.lose_context_when_out_of_memory = true;
|
||||
attributes.enable_gles2_interface = support_gles2_interface;
|
||||
attributes.enable_raster_interface = support_raster_interface;
|
||||
attributes.enable_oop_rasterization = support_oop_rasterization;
|
||||
|
||||
bool enable_raster_decoder =
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableRasterDecoder);
|
||||
// --enable-raster-decoder supports raster interface, but not
|
||||
// gles2 interface
|
||||
attributes.enable_raster_decoder = enable_raster_decoder &&
|
||||
support_raster_interface &&
|
||||
!support_gles2_interface;
|
||||
// Using RasterDecoder for OOP-R backend, so we need support_raster_interface
|
||||
// and !support_gles2_interface.
|
||||
attributes.enable_oop_rasterization = support_oop_rasterization &&
|
||||
support_raster_interface &&
|
||||
!support_gles2_interface;
|
||||
|
||||
const bool automatic_flushes = false;
|
||||
return base::MakeRefCounted<ui::ContextProviderCommandBuffer>(
|
||||
|
@ -57,7 +57,6 @@ struct GPU_EXPORT ContextCreationAttribs {
|
||||
bool single_buffer = false;
|
||||
bool enable_gles2_interface = true;
|
||||
bool enable_raster_interface = false;
|
||||
bool enable_raster_decoder = false;
|
||||
bool enable_oop_rasterization = false;
|
||||
bool enable_swap_timestamps_if_supported = false;
|
||||
|
||||
|
@ -136,9 +136,6 @@ struct GPU_EXPORT GpuPreferences {
|
||||
// round intermediate values in ANGLE.
|
||||
bool emulate_shader_precision = false;
|
||||
|
||||
// Use a dedicated RasterDecoder instead of generic GLES2Decoder.
|
||||
bool enable_raster_decoder = false;
|
||||
|
||||
// ===================================
|
||||
// Settings from //ui/gl/gl_switches.h
|
||||
|
||||
@ -169,10 +166,13 @@ struct GPU_EXPORT GpuPreferences {
|
||||
// Ignores GPU blacklist.
|
||||
bool ignore_gpu_blacklist = false;
|
||||
|
||||
// Enable GPU rasterization in the GPU process.
|
||||
bool enable_oop_rasterization = false;
|
||||
|
||||
// Please update gpu_preferences_util_unittest.cc when making additions or
|
||||
// changes to this struct.
|
||||
};
|
||||
|
||||
} // namespace gpu
|
||||
|
||||
#endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PREFERENCES_H_
|
||||
#endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PREFERENCES_H_
|
||||
|
@ -1024,8 +1024,11 @@ gl::GLContext* RasterDecoderImpl::GetGLContext() {
|
||||
|
||||
Capabilities RasterDecoderImpl::GetCapabilities() {
|
||||
Capabilities caps;
|
||||
caps.gpu_rasterization = true;
|
||||
caps.supports_oop_raster = true;
|
||||
caps.gpu_rasterization =
|
||||
group_->gpu_feature_info()
|
||||
.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] ==
|
||||
kGpuFeatureStatusEnabled;
|
||||
caps.supports_oop_raster = supports_oop_raster_;
|
||||
caps.texture_target_exception_list =
|
||||
group_->gpu_preferences().texture_target_exception_list;
|
||||
caps.texture_format_bgra8888 =
|
||||
|
@ -146,8 +146,6 @@ GpuPreferences ParseGpuPreferences(const base::CommandLine* command_line) {
|
||||
command_line->HasSwitch(switches::kGLShaderIntermOutput);
|
||||
gpu_preferences.emulate_shader_precision =
|
||||
command_line->HasSwitch(switches::kEmulateShaderPrecision);
|
||||
gpu_preferences.enable_raster_decoder =
|
||||
command_line->HasSwitch(switches::kEnableRasterDecoder);
|
||||
gpu_preferences.enable_gpu_service_logging =
|
||||
command_line->HasSwitch(switches::kEnableGPUServiceLogging);
|
||||
gpu_preferences.enable_gpu_service_tracing =
|
||||
@ -158,6 +156,8 @@ GpuPreferences ParseGpuPreferences(const base::CommandLine* command_line) {
|
||||
command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds);
|
||||
gpu_preferences.ignore_gpu_blacklist =
|
||||
command_line->HasSwitch(switches::kIgnoreGpuBlacklist);
|
||||
gpu_preferences.enable_oop_rasterization =
|
||||
command_line->HasSwitch(switches::kEnableOOPRasterization);
|
||||
return gpu_preferences;
|
||||
}
|
||||
|
||||
|
@ -23,9 +23,6 @@ const char kEnableGpuRasterization[] = "enable-gpu-rasterization";
|
||||
// would have been used. Enables the chromium_raster_transport extension.
|
||||
const char kEnableOOPRasterization[] = "enable-oop-rasterization";
|
||||
|
||||
// Use a dedicated RasterDecoder instead of generic GLES2Decoder.
|
||||
const char kEnableRasterDecoder[] = "enable-raster-decoder";
|
||||
|
||||
// Passes encoded GpuPreferences to GPU process.
|
||||
const char kGpuPreferences[] = "gpu-preferences";
|
||||
|
||||
|
@ -13,7 +13,6 @@ GPU_EXPORT extern const char kDisableGpuDriverBugWorkarounds[];
|
||||
GPU_EXPORT extern const char kDisableGpuRasterization[];
|
||||
GPU_EXPORT extern const char kEnableGpuRasterization[];
|
||||
GPU_EXPORT extern const char kEnableOOPRasterization[];
|
||||
GPU_EXPORT extern const char kEnableRasterDecoder[];
|
||||
GPU_EXPORT extern const char kGpuPreferences[];
|
||||
GPU_EXPORT extern const char kIgnoreGpuBlacklist[];
|
||||
GPU_EXPORT extern const char kGpuBlacklistTestGroup[];
|
||||
|
@ -26,17 +26,14 @@ constexpr gfx::BufferUsage kBufferUsage = gfx::BufferUsage::SCANOUT;
|
||||
constexpr viz::ResourceFormat kResourceFormat = viz::RGBA_8888;
|
||||
constexpr gfx::Size kBufferSize(100, 100);
|
||||
|
||||
class RasterInProcessCommandBufferTest : public ::testing::TestWithParam<bool> {
|
||||
class RasterInProcessCommandBufferTest : public ::testing::Test {
|
||||
public:
|
||||
std::unique_ptr<RasterInProcessContext> CreateRasterInProcessContext() {
|
||||
ContextCreationAttribs attributes;
|
||||
attributes.enable_raster_interface = true;
|
||||
attributes.bind_generates_resource = false;
|
||||
|
||||
// TODO(backer): Remove this once RasterDecoder is the default
|
||||
// implementation of RasterInterface.
|
||||
attributes.enable_gles2_interface = !GetParam();
|
||||
attributes.enable_raster_decoder = GetParam();
|
||||
attributes.enable_oop_rasterization = true;
|
||||
attributes.enable_gles2_interface = false;
|
||||
attributes.enable_raster_interface = true;
|
||||
|
||||
auto context = std::make_unique<RasterInProcessContext>();
|
||||
auto result = context->Initialize(
|
||||
@ -72,7 +69,7 @@ class RasterInProcessCommandBufferTest : public ::testing::TestWithParam<bool> {
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST_P(RasterInProcessCommandBufferTest, CreateImage) {
|
||||
TEST_F(RasterInProcessCommandBufferTest, CreateImage) {
|
||||
// Calling CreateImageCHROMIUM() should allocate an image id.
|
||||
std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer1 =
|
||||
gpu_memory_buffer_manager_->CreateGpuMemoryBuffer(
|
||||
@ -99,7 +96,7 @@ TEST_P(RasterInProcessCommandBufferTest, CreateImage) {
|
||||
EXPECT_NE(image_id1, image_id2);
|
||||
}
|
||||
|
||||
TEST_P(RasterInProcessCommandBufferTest, SetColorSpaceMetadata) {
|
||||
TEST_F(RasterInProcessCommandBufferTest, SetColorSpaceMetadata) {
|
||||
GLuint texture_id =
|
||||
ri_->CreateTexture(/*use_buffer=*/true, kBufferUsage, kResourceFormat);
|
||||
|
||||
@ -119,7 +116,7 @@ TEST_P(RasterInProcessCommandBufferTest, SetColorSpaceMetadata) {
|
||||
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), ri_->GetError());
|
||||
}
|
||||
|
||||
TEST_P(RasterInProcessCommandBufferTest, TexStorage2DImage) {
|
||||
TEST_F(RasterInProcessCommandBufferTest, TexStorage2DImage) {
|
||||
// Check for GPU and driver support
|
||||
if (!context_->GetCapabilities().texture_storage_image) {
|
||||
return;
|
||||
@ -156,6 +153,4 @@ TEST_P(RasterInProcessCommandBufferTest, TexStorage2DImage) {
|
||||
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), ri_->GetError());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(P, RasterInProcessCommandBufferTest, ::testing::Bool());
|
||||
|
||||
} // namespace gpu
|
||||
|
@ -182,7 +182,6 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::ContextCreationAttribs)
|
||||
IPC_STRUCT_TRAITS_MEMBER(color_space)
|
||||
IPC_STRUCT_TRAITS_MEMBER(enable_gles2_interface)
|
||||
IPC_STRUCT_TRAITS_MEMBER(enable_raster_interface)
|
||||
IPC_STRUCT_TRAITS_MEMBER(enable_raster_decoder)
|
||||
IPC_STRUCT_TRAITS_MEMBER(enable_oop_rasterization)
|
||||
IPC_STRUCT_TRAITS_MEMBER(enable_swap_timestamps_if_supported)
|
||||
IPC_STRUCT_TRAITS_END()
|
||||
|
@ -51,7 +51,6 @@ struct GpuPreferences {
|
||||
bool enable_threaded_texture_mailboxes;
|
||||
bool gl_shader_interm_output;
|
||||
bool emulate_shader_precision;
|
||||
bool enable_raster_decoder;
|
||||
bool enable_gpu_service_logging;
|
||||
bool enable_gpu_service_tracing;
|
||||
bool use_passthrough_cmd_decoder;
|
||||
@ -60,4 +59,5 @@ struct GpuPreferences {
|
||||
|
||||
bool disable_gpu_driver_bug_workarounds;
|
||||
bool ignore_gpu_blacklist;
|
||||
bool enable_oop_rasterization;
|
||||
};
|
||||
|
@ -5,6 +5,8 @@
|
||||
#ifndef GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_
|
||||
#define GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "gpu/command_buffer/service/gpu_preferences.h"
|
||||
#include "gpu/ipc/common/gpu_preferences.mojom.h"
|
||||
#include "ui/gfx/mojo/buffer_types_struct_traits.h"
|
||||
@ -94,7 +96,6 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
|
||||
prefs.enable_threaded_texture_mailboxes();
|
||||
out->gl_shader_interm_output = prefs.gl_shader_interm_output();
|
||||
out->emulate_shader_precision = prefs.emulate_shader_precision();
|
||||
out->enable_raster_decoder = prefs.enable_raster_decoder();
|
||||
out->enable_gpu_service_logging = prefs.enable_gpu_service_logging();
|
||||
out->enable_gpu_service_tracing = prefs.enable_gpu_service_tracing();
|
||||
out->use_passthrough_cmd_decoder = prefs.use_passthrough_cmd_decoder();
|
||||
@ -114,6 +115,7 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
|
||||
out->disable_gpu_driver_bug_workarounds =
|
||||
prefs.disable_gpu_driver_bug_workarounds();
|
||||
out->ignore_gpu_blacklist = prefs.ignore_gpu_blacklist();
|
||||
out->enable_oop_rasterization = prefs.enable_oop_rasterization();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -214,9 +216,6 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
|
||||
static bool emulate_shader_precision(const gpu::GpuPreferences& prefs) {
|
||||
return prefs.emulate_shader_precision;
|
||||
}
|
||||
static bool enable_raster_decoder(const gpu::GpuPreferences& prefs) {
|
||||
return prefs.enable_raster_decoder;
|
||||
}
|
||||
static bool enable_gpu_service_logging(const gpu::GpuPreferences& prefs) {
|
||||
return prefs.enable_gpu_service_logging;
|
||||
}
|
||||
@ -241,6 +240,9 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
|
||||
static bool ignore_gpu_blacklist(const gpu::GpuPreferences& prefs) {
|
||||
return prefs.ignore_gpu_blacklist;
|
||||
}
|
||||
static bool enable_oop_rasterization(const gpu::GpuPreferences& prefs) {
|
||||
return prefs.enable_oop_rasterization;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace mojo
|
||||
|
@ -58,7 +58,6 @@ void CheckGpuPreferencesEqual(GpuPreferences left, GpuPreferences right) {
|
||||
right.enable_threaded_texture_mailboxes);
|
||||
EXPECT_EQ(left.gl_shader_interm_output, right.gl_shader_interm_output);
|
||||
EXPECT_EQ(left.emulate_shader_precision, right.emulate_shader_precision);
|
||||
EXPECT_EQ(left.enable_raster_decoder, right.enable_raster_decoder);
|
||||
EXPECT_EQ(left.enable_gpu_service_logging, right.enable_gpu_service_logging);
|
||||
EXPECT_EQ(left.enable_gpu_service_tracing, right.enable_gpu_service_tracing);
|
||||
EXPECT_EQ(left.use_passthrough_cmd_decoder,
|
||||
@ -70,6 +69,7 @@ void CheckGpuPreferencesEqual(GpuPreferences left, GpuPreferences right) {
|
||||
EXPECT_EQ(left.disable_gpu_driver_bug_workarounds,
|
||||
right.disable_gpu_driver_bug_workarounds);
|
||||
EXPECT_EQ(left.ignore_gpu_blacklist, right.ignore_gpu_blacklist);
|
||||
EXPECT_EQ(left.enable_oop_rasterization, right.enable_oop_rasterization);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@ -135,7 +135,6 @@ TEST(GpuPreferencesUtilTest, EncodeDecode) {
|
||||
GPU_PREFERENCES_FIELD(enable_threaded_texture_mailboxes, true)
|
||||
GPU_PREFERENCES_FIELD(gl_shader_interm_output, true)
|
||||
GPU_PREFERENCES_FIELD(emulate_shader_precision, true)
|
||||
GPU_PREFERENCES_FIELD(enable_raster_decoder, true)
|
||||
GPU_PREFERENCES_FIELD(enable_gpu_service_logging, true)
|
||||
GPU_PREFERENCES_FIELD(enable_gpu_service_tracing, true)
|
||||
GPU_PREFERENCES_FIELD(use_passthrough_cmd_decoder, true)
|
||||
@ -143,6 +142,7 @@ TEST(GpuPreferencesUtilTest, EncodeDecode) {
|
||||
true)
|
||||
GPU_PREFERENCES_FIELD(disable_gpu_driver_bug_workarounds, true)
|
||||
GPU_PREFERENCES_FIELD(ignore_gpu_blacklist, true)
|
||||
GPU_PREFERENCES_FIELD(enable_oop_rasterization, true)
|
||||
|
||||
input_prefs.texture_target_exception_list.emplace_back(
|
||||
gfx::BufferUsage::SCANOUT, gfx::BufferFormat::RGBA_8888);
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "gpu/command_buffer/service/transfer_buffer_manager.h"
|
||||
#include "gpu/config/gpu_crash_keys.h"
|
||||
#include "gpu/config/gpu_feature_info.h"
|
||||
#include "gpu/config/gpu_switches.h"
|
||||
#include "gpu/ipc/gpu_in_process_thread_service.h"
|
||||
#include "gpu/ipc/host/gpu_memory_buffer_support.h"
|
||||
#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
|
||||
@ -350,7 +351,11 @@ gpu::ContextResult InProcessCommandBuffer::InitializeOnGpuThread(
|
||||
command_buffer_ = std::make_unique<CommandBufferService>(
|
||||
this, transfer_buffer_manager_.get());
|
||||
|
||||
if (params.attribs.enable_raster_decoder &&
|
||||
// Check gpu_preferences() as well as attribs.enable_oop_rasterization to
|
||||
// prevent compromised renderer from unilaterally enabling RasterDecoder until
|
||||
// we have fuzzed it (https://crbug.com/829469).
|
||||
if (service_->gpu_preferences().enable_oop_rasterization &&
|
||||
params.attribs.enable_oop_rasterization &&
|
||||
params.attribs.enable_raster_interface &&
|
||||
!params.attribs.enable_gles2_interface) {
|
||||
decoder_.reset(raster::RasterDecoder::Create(this, command_buffer_.get(),
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/logging.h"
|
||||
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
|
||||
#include "gpu/command_buffer/client/raster_cmd_helper.h"
|
||||
@ -17,6 +18,7 @@
|
||||
#include "gpu/command_buffer/common/constants.h"
|
||||
#include "gpu/command_buffer/common/context_creation_attribs.h"
|
||||
#include "gpu/config/gpu_feature_info.h"
|
||||
#include "gpu/config/gpu_switches.h"
|
||||
#include "gpu/ipc/common/surface_handle.h"
|
||||
#include "gpu/skia_bindings/gles2_implementation_with_grcontext_support.h"
|
||||
|
||||
@ -57,6 +59,16 @@ ContextResult RasterInProcessContext::Initialize(
|
||||
return ContextResult::kFatalFailure;
|
||||
}
|
||||
|
||||
// TODO(backer): Remove this. Currently used to set
|
||||
// |chromium_raster_transport| features flag (https://crbug.com/786591) and
|
||||
// enable_oop_rasterization in GpuPreferences (https://crbug.com/829469).
|
||||
if (attribs.enable_oop_rasterization &&
|
||||
!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableOOPRasterization)) {
|
||||
base::CommandLine::ForCurrentProcess()->AppendSwitch(
|
||||
switches::kEnableOOPRasterization);
|
||||
}
|
||||
|
||||
command_buffer_ = std::make_unique<InProcessCommandBuffer>(service);
|
||||
auto result = command_buffer_->Initialize(
|
||||
nullptr /* surface */, true /* is_offscreen */, kNullSurfaceHandle,
|
||||
@ -94,7 +106,11 @@ ContextResult RasterInProcessContext::Initialize(
|
||||
gles2_implementation_->command_buffer(), GetCapabilities());
|
||||
helper_ = std::move(gles2_helper);
|
||||
} else {
|
||||
DCHECK(attribs.enable_raster_decoder);
|
||||
// TODO(https://crbug.com/829469): Remove check once we fuzz RasterDecoder.
|
||||
// enable_oop_rasterization is currently necessary to create RasterDecoder
|
||||
// in InProcessCommandBuffer.
|
||||
DCHECK(attribs.enable_oop_rasterization);
|
||||
|
||||
// Create the RasterCmdHelper, which writes the command buffer protocol.
|
||||
auto raster_helper =
|
||||
std::make_unique<raster::RasterCmdHelper>(command_buffer_.get());
|
||||
|
@ -613,10 +613,12 @@ void GpuChannel::OnCreateCommandBuffer(
|
||||
}
|
||||
|
||||
std::unique_ptr<CommandBufferStub> stub;
|
||||
// Check gpu_preferences() as well as attribs.enable_raster_decoder to prevent
|
||||
// compromised renderer from unilaterally enabling RasterDecoder.
|
||||
if (gpu_channel_manager_->gpu_preferences().enable_raster_decoder &&
|
||||
init_params.attribs.enable_raster_decoder &&
|
||||
|
||||
// Check gpu_preferences() as well as attribs.enable_oop_rasterization to
|
||||
// preventcompromised renderer from unilaterally enabling RasterDecoder until
|
||||
// we have fuzzed it (https://crbug.com/829469).
|
||||
if (gpu_channel_manager_->gpu_preferences().enable_oop_rasterization &&
|
||||
init_params.attribs.enable_oop_rasterization &&
|
||||
init_params.attribs.enable_raster_interface &&
|
||||
!init_params.attribs.enable_gles2_interface) {
|
||||
stub = std::make_unique<RasterCommandBufferStub>(
|
||||
|
@ -237,7 +237,7 @@ gpu::ContextResult ContextProviderCommandBuffer::BindToCurrentThread() {
|
||||
return bind_result_;
|
||||
}
|
||||
|
||||
if (attributes_.enable_raster_decoder) {
|
||||
if (attributes_.enable_oop_rasterization) {
|
||||
DCHECK(attributes_.enable_raster_interface);
|
||||
DCHECK(!attributes_.enable_gles2_interface);
|
||||
DCHECK(!support_grcontext_);
|
||||
@ -400,7 +400,6 @@ gpu::raster::RasterInterface* ContextProviderCommandBuffer::RasterInterface() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DCHECK(!attributes_.enable_raster_decoder);
|
||||
if (!gles2_impl_.get())
|
||||
return nullptr;
|
||||
|
||||
@ -424,7 +423,7 @@ class GrContext* ContextProviderCommandBuffer::GrContext() {
|
||||
if (gr_context_)
|
||||
return gr_context_->get();
|
||||
|
||||
if (attributes_.enable_raster_decoder)
|
||||
if (attributes_.enable_oop_rasterization)
|
||||
return nullptr;
|
||||
|
||||
// TODO(vmiura): crbug.com/793508 Disable access to GrContext if
|
||||
|
Reference in New Issue
Block a user