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) {
enable_unsafe_es3_apis_switch_ =
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
// 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,
......@@ -1181,8 +1178,7 @@ void FeatureInfo::InitializeFeatures() {
}
}
if (enable_gl_path_rendering_switch_ &&
!workarounds_.disable_gl_path_rendering &&
if (!workarounds_.disable_gl_path_rendering &&
extensions.Contains("GL_NV_path_rendering")) {
bool has_dsa = gl_version_info_->IsAtLeastGL(4, 5) ||
extensions.Contains("GL_EXT_direct_state_access");
......@@ -1200,8 +1196,7 @@ void FeatureInfo::InitializeFeatures() {
}
}
if (enable_gl_path_rendering_switch_ &&
!workarounds_.disable_gl_path_rendering &&
if (!workarounds_.disable_gl_path_rendering &&
extensions.Contains("GL_NV_framebuffer_mixed_samples")) {
AddExtensionString("GL_CHROMIUM_framebuffer_mixed_samples");
feature_flags_.chromium_framebuffer_mixed_samples = true;
......
......@@ -184,9 +184,6 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
bool unsafe_es3_apis_enabled_;
// Whether the command line switch kEnableGLPathRendering is passed in.
bool enable_gl_path_rendering_switch_;
bool disable_shader_translator_;
scoped_ptr<gfx::GLVersionInfo> gl_version_info_;
......
......@@ -1272,18 +1272,8 @@ TEST_P(FeatureInfoTest, BlendEquationAdvancedDisabled) {
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) {
base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
SetupInitExpectationsWithGLVersionAndCommandLine(
"GL_ARB_compatibility GL_NV_path_rendering GL_EXT_direct_state_access",
"", "4.3", command_line);
......@@ -1293,7 +1283,6 @@ TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering) {
TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering2) {
base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
SetupInitExpectationsWithGLVersionAndCommandLine(
"GL_NV_path_rendering", "", "OpenGL ES 3.1", command_line);
EXPECT_TRUE(info_->feature_flags().chromium_path_rendering);
......@@ -1302,7 +1291,6 @@ TEST_P(FeatureInfoTest, InitializeCHROMIUM_path_rendering2) {
TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering) {
base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
SetupInitExpectationsWithGLVersionAndCommandLine("GL_ARB_compatibility", "",
"4.3", command_line);
EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
......@@ -1312,7 +1300,6 @@ TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering) {
TEST_P(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering2) {
base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
SetupInitExpectationsWithGLVersionAndCommandLine(
"GL_ARB_compatibility GL_NV_path_rendering", "", "4.3", command_line);
EXPECT_FALSE(info_->feature_flags().chromium_path_rendering);
......
......@@ -194,9 +194,7 @@ class GLES2DecoderTestWithCHROMIUMPathRendering : public GLES2DecoderTest {
init.request_depth = true;
init.bind_generates_resource = true;
init.extensions = "GL_NV_path_rendering";
base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
InitDecoderWithCommandLine(init, &command_line);
InitDecoder(init);
EXPECT_CALL(*gl_, GenPathsNV(1))
.WillOnce(Return(kServicePathId))
......@@ -555,9 +553,7 @@ class GLES2DecoderTestWithCHROMIUMFramebufferMixedSamples
init.request_depth = true;
init.bind_generates_resource = true;
init.extensions = "GL_NV_path_rendering GL_NV_framebuffer_mixed_samples ";
base::CommandLine command_line(0, NULL);
command_line.AppendSwitch(switches::kEnableGLPathRendering);
InitDecoderWithCommandLine(init, &command_line);
InitDecoder(init);
}
};
......
......@@ -71,11 +71,6 @@ const char kGLShaderIntermOutput[] = "gl-shader-interm-output";
// round intermediate values in ANGLE.
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[] = {
kCompileShaderAlwaysSucceeds,
kDisableGLErrorLimit,
......@@ -95,7 +90,6 @@ const char* kGpuSwitches[] = {
kEnableSubscribeUniformExtension,
kGLShaderIntermOutput,
kEmulateShaderPrecision,
kEnableGLPathRendering,
};
const int kNumGpuSwitches = arraysize(kGpuSwitches);
......
......@@ -30,7 +30,6 @@ GPU_EXPORT extern const char kEnableSubscribeUniformExtension[];
GPU_EXPORT extern const char kEnableThreadedTextureMailboxes[];
GPU_EXPORT extern const char kGLShaderIntermOutput[];
GPU_EXPORT extern const char kEmulateShaderPrecision[];
GPU_EXPORT extern const char kEnableGLPathRendering[];
GPU_EXPORT extern const char* kGpuSwitches[];
GPU_EXPORT extern const int kNumGpuSwitches;
......
......@@ -2160,11 +2160,7 @@ class ProgramManagerWithPathRenderingTest
testing::tuple<const char*, const char*>> {
protected:
void SetUp() override {
base::CommandLine command_line(*base::CommandLine::ForCurrentProcess());
command_line.AppendSwitch(switches::kEnableGLPathRendering);
FeatureInfo* feature_info = new FeatureInfo(command_line);
SetUpBase(testing::get<0>(GetParam()), testing::get<1>(GetParam()),
feature_info);
SetUpBase(testing::get<0>(GetParam()), testing::get<1>(GetParam()));
}
static const char* kFragmentInput1Name;
static const char* kFragmentInput2Name;
......
......@@ -25,9 +25,7 @@ class CHROMIUMFramebufferMixedSamplesTest : public testing::Test {
const GLuint kHeight = 100;
void SetUp() override {
base::CommandLine command_line(*base::CommandLine::ForCurrentProcess());
command_line.AppendSwitch(switches::kEnableGLPathRendering);
gl_.InitializeWithCommandLine(GLManager::Options(), &command_line);
gl_.Initialize(GLManager::Options());
}
void TearDown() override { gl_.Destroy(); }
......
......@@ -38,10 +38,8 @@ class CHROMIUMPathRenderingTest : public testing::Test {
void SetUp() override {
GLManager::Options options;
base::CommandLine command_line(*base::CommandLine::ForCurrentProcess());
command_line.AppendSwitch(switches::kEnableGLPathRendering);
InitializeContextFeatures(&options);
gl_.InitializeWithCommandLine(options, &command_line);
gl_.Initialize(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