| Index: gpu/command_buffer/service/feature_info.cc
|
| diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
|
| index 766f7687d240255869a7cf88b5886e6907d38694..b4b9cc895748b2fab5d8a822d1475081918d8fd2 100644
|
| --- a/gpu/command_buffer/service/feature_info.cc
|
| +++ b/gpu/command_buffer/service/feature_info.cc
|
| @@ -172,7 +172,8 @@ FeatureInfo::FeatureFlags::FeatureFlags()
|
| chromium_image_ycbcr_422(false),
|
| enable_subscribe_uniform(false),
|
| emulate_primitive_restart_fixed_index(false),
|
| - ext_render_buffer_format_bgra8888(false) {}
|
| + ext_render_buffer_format_bgra8888(false),
|
| + ext_blend_func_extended(false) {}
|
|
|
| FeatureInfo::Workarounds::Workarounds() :
|
| #define GPU_OP(type, name) name(false),
|
| @@ -222,7 +223,8 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) {
|
|
|
| // 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, etc.
|
| + // target context GLSL, implement emulation of OpenGL ES features on OpenGL,
|
| + // etc.
|
| // The flag here is for testing only.
|
| disable_shader_translator_ =
|
| command_line->HasSwitch(switches::kDisableGLSLTranslator);
|
| @@ -1069,15 +1071,20 @@ void FeatureInfo::InitializeFeatures() {
|
| }
|
| }
|
|
|
| + bool has_opengl_program_interface_query =
|
| + gl_version_info_->IsAtLeastGL(4, 3) ||
|
| + extensions.Contains("GL_ARB_program_interface_query");
|
| +
|
| if (enable_gl_path_rendering_switch_ &&
|
| !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");
|
| - bool has_piq = gl_version_info_->IsAtLeastGL(4, 3) ||
|
| - extensions.Contains("GL_ARB_program_interface_query");
|
| + bool has_opengl_direct_state_access =
|
| + gl_version_info_->IsAtLeastGL(4, 5) ||
|
| + extensions.Contains("GL_EXT_direct_state_access");
|
| if (gl_version_info_->IsAtLeastGLES(3, 1) ||
|
| - (gl_version_info_->IsAtLeastGL(3, 2) && has_dsa && has_piq)) {
|
| + (gl_version_info_->IsAtLeastGL(3, 2) &&
|
| + has_opengl_direct_state_access &&
|
| + has_opengl_program_interface_query)) {
|
| AddExtensionString("GL_CHROMIUM_path_rendering");
|
| feature_flags_.chromium_path_rendering = true;
|
| validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM);
|
| @@ -1108,6 +1115,37 @@ void FeatureInfo::InitializeFeatures() {
|
| }
|
| UMA_HISTOGRAM_BOOLEAN("GPU.TextureRG", feature_flags_.ext_texture_rg);
|
|
|
| + bool has_opengl_dual_source_blending =
|
| + gl_version_info_->IsAtLeastGL(3, 3) ||
|
| + (gl_version_info_->IsAtLeastGL(3, 2) &&
|
| + extensions.Contains("GL_ARB_blend_func_extended"));
|
| + if ((gl_version_info_->IsAtLeastGL(3, 2) && has_opengl_dual_source_blending &&
|
| + has_opengl_program_interface_query && !disable_shader_translator_) ||
|
| + (gl_version_info_->IsAtLeastGLES(3, 1) &&
|
| + extensions.Contains("GL_EXT_blend_func_extended"))) {
|
| + // Note: to simplify the code, we do not expose EXT_blend_func_extended
|
| + // unless the service
|
| + // context supports program interface query. This means the theoretical ES
|
| + // 2.0 or ES 3.0
|
| + // implementation with EXT_blend_func_extended is not sufficient.
|
| + feature_flags_.ext_blend_func_extended = true;
|
| + AddExtensionString("GL_EXT_blend_func_extended");
|
| +
|
| + // NOTE: SRC_ALPHA_SATURATE is valid for ES2 src blend factor.
|
| + // SRC_ALPHA_SATURATE is valid for ES3 src and dst blend factor.
|
| + validators_.dst_blend_factor.AddValue(GL_SRC_ALPHA_SATURATE_EXT);
|
| +
|
| + validators_.src_blend_factor.AddValue(GL_SRC1_ALPHA_EXT);
|
| + validators_.dst_blend_factor.AddValue(GL_SRC1_ALPHA_EXT);
|
| + validators_.src_blend_factor.AddValue(GL_SRC1_COLOR_EXT);
|
| + validators_.dst_blend_factor.AddValue(GL_SRC1_COLOR_EXT);
|
| + validators_.src_blend_factor.AddValue(GL_ONE_MINUS_SRC1_COLOR_EXT);
|
| + validators_.dst_blend_factor.AddValue(GL_ONE_MINUS_SRC1_COLOR_EXT);
|
| + validators_.src_blend_factor.AddValue(GL_ONE_MINUS_SRC1_ALPHA_EXT);
|
| + validators_.dst_blend_factor.AddValue(GL_ONE_MINUS_SRC1_ALPHA_EXT);
|
| + validators_.g_l_state.AddValue(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT);
|
| + }
|
| +
|
| #if !defined(OS_MACOSX)
|
| if (workarounds_.ignore_egl_sync_failures) {
|
| gfx::GLFenceEGL::SetIgnoreFailures();
|
|
|