Commit 3f4b6302 authored by kkinnunen's avatar kkinnunen Committed by Commit bot

command_buffer: Enable gl path rendering by default

Enable gl path rendering by default if it is supported by the
hardware.

Skia will use it when GPU rasterization MSAA codepath is used.

BUG=344330

Review URL: https://codereview.chromium.org/1626363002

Cr-Commit-Position: refs/heads/master@{#371753}
parent 50b90332
...@@ -225,9 +225,6 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) { ...@@ -225,9 +225,6 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
enable_unsafe_es3_apis_switch_ = enable_unsafe_es3_apis_switch_ =
command_line->HasSwitch(switches::kEnableUnsafeES3APIs); command_line->HasSwitch(switches::kEnableUnsafeES3APIs);
enable_gl_path_rendering_switch_ =
command_line->HasSwitch(switches::kEnableGLPathRendering);
// The shader translator is needed to translate from WebGL-conformant GLES SL // The shader translator is needed to translate from WebGL-conformant GLES SL
// to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to
// target context GLSL, implement emulation of OpenGL ES features on OpenGL, // target context GLSL, implement emulation of OpenGL ES features on OpenGL,
...@@ -1181,8 +1178,7 @@ void FeatureInfo::InitializeFeatures() { ...@@ -1181,8 +1178,7 @@ void FeatureInfo::InitializeFeatures() {
} }
} }
if (enable_gl_path_rendering_switch_ && if (!workarounds_.disable_gl_path_rendering &&
!workarounds_.disable_gl_path_rendering &&
extensions.Contains("GL_NV_path_rendering")) { extensions.Contains("GL_NV_path_rendering")) {
bool has_dsa = gl_version_info_->IsAtLeastGL(4, 5) || bool has_dsa = gl_version_info_->IsAtLeastGL(4, 5) ||
extensions.Contains("GL_EXT_direct_state_access"); extensions.Contains("GL_EXT_direct_state_access");
...@@ -1200,8 +1196,7 @@ void FeatureInfo::InitializeFeatures() { ...@@ -1200,8 +1196,7 @@ void FeatureInfo::InitializeFeatures() {
} }
} }
if (enable_gl_path_rendering_switch_ && if (!workarounds_.disable_gl_path_rendering &&
!workarounds_.disable_gl_path_rendering &&
extensions.Contains("GL_NV_framebuffer_mixed_samples")) { extensions.Contains("GL_NV_framebuffer_mixed_samples")) {
AddExtensionString("GL_CHROMIUM_framebuffer_mixed_samples"); AddExtensionString("GL_CHROMIUM_framebuffer_mixed_samples");
feature_flags_.chromium_framebuffer_mixed_samples = true; feature_flags_.chromium_framebuffer_mixed_samples = true;
......
...@@ -184,9 +184,6 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> { ...@@ -184,9 +184,6 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
bool unsafe_es3_apis_enabled_; bool unsafe_es3_apis_enabled_;
// Whether the command line switch kEnableGLPathRendering is passed in.
bool enable_gl_path_rendering_switch_;
bool disable_shader_translator_; bool disable_shader_translator_;
scoped_ptr<gfx::GLVersionInfo> gl_version_info_; scoped_ptr<gfx::GLVersionInfo> gl_version_info_;
......
...@@ -1272,18 +1272,8 @@ TEST_P(FeatureInfoTest, BlendEquationAdvancedDisabled) { ...@@ -1272,18 +1272,8 @@ TEST_P(FeatureInfoTest, BlendEquationAdvancedDisabled) {
EXPECT_FALSE(info_->feature_flags().blend_equation_advanced_coherent); EXPECT_FALSE(info_->feature_flags().blend_equation_advanced_coherent);
} }
TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering_no_cmdline_switch) {
SetupInitExpectationsWithGLVersion(
"GL_ARB_compatibility GL_NV_path_rendering GL_EXT_direct_state_access",
"", "4.3");
EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
EXPECT_THAT(info_->extensions(),
Not(HasSubstr("GL_CHROMIUM_path_rendering")));
}
TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering) { TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering) {
base::CommandLine command_line(0, NULL); base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
SetupInitExpectationsWithGLVersionAndCommandLine( SetupInitExpectationsWithGLVersionAndCommandLine(
"GL_ARB_compatibility GL_NV_path_rendering GL_EXT_direct_state_access", "GL_ARB_compatibility GL_NV_path_rendering GL_EXT_direct_state_access",
"", "4.3", command_line); "", "4.3", command_line);
...@@ -1293,7 +1283,6 @@ TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering) { ...@@ -1293,7 +1283,6 @@ TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering) {
TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering2) { TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering2) {
base::CommandLine command_line(0, NULL); base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
SetupInitExpectationsWithGLVersionAndCommandLine( SetupInitExpectationsWithGLVersionAndCommandLine(
"GL_NV_path_rendering", "", "OpenGL ES 3.1", command_line); "GL_NV_path_rendering", "", "OpenGL ES 3.1", command_line);
EXPECT_TRUE(info_->feature_flags().chromium_path_rendering); EXPECT_TRUE(info_->feature_flags().chromium_path_rendering);
...@@ -1302,7 +1291,6 @@ TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering2) { ...@@ -1302,7 +1291,6 @@ TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering2) {
TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering) { TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering) {
base::CommandLine command_line(0, NULL); base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
SetupInitExpectationsWithGLVersionAndCommandLine("GL_ARB_compatibility", "", SetupInitExpectationsWithGLVersionAndCommandLine("GL_ARB_compatibility", "",
"4.3", command_line); "4.3", command_line);
EXPECT_FALSE(info_->feature_flags().chromium_path_rendering); EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
...@@ -1312,7 +1300,6 @@ TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering) { ...@@ -1312,7 +1300,6 @@ TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering) {
TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering2) { TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering2) {
base::CommandLine command_line(0, NULL); base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
SetupInitExpectationsWithGLVersionAndCommandLine( SetupInitExpectationsWithGLVersionAndCommandLine(
"GL_ARB_compatibility GL_NV_path_rendering", "", "4.3", command_line); "GL_ARB_compatibility GL_NV_path_rendering", "", "4.3", command_line);
EXPECT_FALSE(info_->feature_flags().chromium_path_rendering); EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
......
...@@ -194,9 +194,7 @@ class GLES2DecoderTestWithCHROMIUMPathRendering : public GLES2DecoderTest { ...@@ -194,9 +194,7 @@ class GLES2DecoderTestWithCHROMIUMPathRendering : public GLES2DecoderTest {
init.request_depth = true; init.request_depth = true;
init.bind_generates_resource = true; init.bind_generates_resource = true;
init.extensions = "GL_NV_path_rendering"; init.extensions = "GL_NV_path_rendering";
base::CommandLine command_line(0, NULL); InitDecoder(init);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
InitDecoderWithCommandLine(init, &command_line);
EXPECT_CALL(*gl_, GenPathsNV(1)) EXPECT_CALL(*gl_, GenPathsNV(1))
.WillOnce(Return(kServicePathId)) .WillOnce(Return(kServicePathId))
...@@ -555,9 +553,7 @@ class GLES2DecoderTestWithCHROMIUMFramebufferMixedSamples ...@@ -555,9 +553,7 @@ class GLES2DecoderTestWithCHROMIUMFramebufferMixedSamples
init.request_depth = true; init.request_depth = true;
init.bind_generates_resource = true; init.bind_generates_resource = true;
init.extensions = "GL_NV_path_rendering GL_NV_framebuffer_mixed_samples "; init.extensions = "GL_NV_path_rendering GL_NV_framebuffer_mixed_samples ";
base::CommandLine command_line(0, NULL); InitDecoder(init);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
InitDecoderWithCommandLine(init, &command_line);
} }
}; };
......
...@@ -71,11 +71,6 @@ const char kGLShaderIntermOutput[] = "gl-shader-interm-output"; ...@@ -71,11 +71,6 @@ const char kGLShaderIntermOutput[] = "gl-shader-interm-output";
// round intermediate values in ANGLE. // round intermediate values in ANGLE.
const char kEmulateShaderPrecision[] = "emulate-shader-precision"; const char kEmulateShaderPrecision[] = "emulate-shader-precision";
// Enables using path rendering implementation implemented currently
// in NV_path_rendering OpenGL extension. Requires compatible hardware
// and driver. This is used in GPU rasterization.
const char kEnableGLPathRendering[] = "enable-gl-path-rendering";
const char* kGpuSwitches[] = { const char* kGpuSwitches[] = {
kCompileShaderAlwaysSucceeds, kCompileShaderAlwaysSucceeds,
kDisableGLErrorLimit, kDisableGLErrorLimit,
...@@ -95,7 +90,6 @@ const char* kGpuSwitches[] = { ...@@ -95,7 +90,6 @@ const char* kGpuSwitches[] = {
kEnableSubscribeUniformExtension, kEnableSubscribeUniformExtension,
kGLShaderIntermOutput, kGLShaderIntermOutput,
kEmulateShaderPrecision, kEmulateShaderPrecision,
kEnableGLPathRendering,
}; };
const int kNumGpuSwitches = arraysize(kGpuSwitches); const int kNumGpuSwitches = arraysize(kGpuSwitches);
......
...@@ -30,7 +30,6 @@ GPU_EXPORT extern const char kEnableSubscribeUniformExtension[]; ...@@ -30,7 +30,6 @@ GPU_EXPORT extern const char kEnableSubscribeUniformExtension[];
GPU_EXPORT extern const char kEnableThreadedTextureMailboxes[]; GPU_EXPORT extern const char kEnableThreadedTextureMailboxes[];
GPU_EXPORT extern const char kGLShaderIntermOutput[]; GPU_EXPORT extern const char kGLShaderIntermOutput[];
GPU_EXPORT extern const char kEmulateShaderPrecision[]; GPU_EXPORT extern const char kEmulateShaderPrecision[];
GPU_EXPORT extern const char kEnableGLPathRendering[];
GPU_EXPORT extern const char* kGpuSwitches[]; GPU_EXPORT extern const char* kGpuSwitches[];
GPU_EXPORT extern const int kNumGpuSwitches; GPU_EXPORT extern const int kNumGpuSwitches;
......
...@@ -2160,11 +2160,7 @@ class ProgramManagerWithPathRenderingTest ...@@ -2160,11 +2160,7 @@ class ProgramManagerWithPathRenderingTest
testing::tuple<const char*, const char*>> { testing::tuple<const char*, const char*>> {
protected: protected:
void SetUp() override { void SetUp() override {
base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); SetUpBase(testing::get<0>(GetParam()), testing::get<1>(GetParam()));
command_line.AppendSwitch(switches::kEnableGLPathRendering);
FeatureInfo* feature_info = new FeatureInfo(command_line);
SetUpBase(testing::get<0>(GetParam()), testing::get<1>(GetParam()),
feature_info);
} }
static const char* kFragmentInput1Name; static const char* kFragmentInput1Name;
static const char* kFragmentInput2Name; static const char* kFragmentInput2Name;
......
...@@ -25,9 +25,7 @@ class CHROMIUMFramebufferMixedSamplesTest : public testing::Test { ...@@ -25,9 +25,7 @@ class CHROMIUMFramebufferMixedSamplesTest : public testing::Test {
const GLuint kHeight = 100; const GLuint kHeight = 100;
void SetUp() override { void SetUp() override {
base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); gl_.Initialize(GLManager::Options());
command_line.AppendSwitch(switches::kEnableGLPathRendering);
gl_.InitializeWithCommandLine(GLManager::Options(), &command_line);
} }
void TearDown() override { gl_.Destroy(); } void TearDown() override { gl_.Destroy(); }
......
...@@ -38,10 +38,8 @@ class CHROMIUMPathRenderingTest : public testing::Test { ...@@ -38,10 +38,8 @@ class CHROMIUMPathRenderingTest : public testing::Test {
void SetUp() override { void SetUp() override {
GLManager::Options options; GLManager::Options options;
base::CommandLine command_line(*base::CommandLine::ForCurrentProcess());
command_line.AppendSwitch(switches::kEnableGLPathRendering);
InitializeContextFeatures(&options); InitializeContextFeatures(&options);
gl_.InitializeWithCommandLine(options, &command_line); gl_.Initialize(options);
} }
virtual void InitializeContextFeatures(GLManager::Options* options) { virtual void InitializeContextFeatures(GLManager::Options* options) {
......
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