Chromium Code Reviews| 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 c21815c08abcc013b64b1e43cc08fb8f21012986..f08291301591a7c37b80348c5c1342781b2997c1 100644 |
| --- a/gpu/command_buffer/service/feature_info.cc |
| +++ b/gpu/command_buffer/service/feature_info.cc |
| @@ -231,20 +231,23 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) { |
| command_line->HasSwitch(switches::kDisableGLSLTranslator); |
| unsafe_es3_apis_enabled_ = false; |
| -} |
| -bool FeatureInfo::Initialize() { |
| - disallowed_features_ = DisallowedFeatures(); |
| - InitializeFeatures(); |
| - return true; |
| + // Default context_type_ to a GLES2 Context. |
| + context_type_ = CONTEXT_TYPE_OPENGLES2; |
| } |
| -bool FeatureInfo::Initialize(const DisallowedFeatures& disallowed_features) { |
| +bool FeatureInfo::Initialize(ContextType context_type, |
| + const DisallowedFeatures& disallowed_features) { |
| disallowed_features_ = disallowed_features; |
| + context_type_ = context_type; |
| InitializeFeatures(); |
| return true; |
| } |
| +bool FeatureInfo::InitializeForTesting() { |
| + return Initialize(CONTEXT_TYPE_OPENGLES2, DisallowedFeatures()); |
| +} |
| + |
| bool IsGL_REDSupportedOnFBOs() { |
| // Skia uses GL_RED with frame buffers, unfortunately, Mesa claims to support |
| // GL_EXT_texture_rg, but it doesn't support it on frame buffers. To fix |
| @@ -1122,6 +1125,23 @@ void FeatureInfo::InitializeFeatures() { |
| // but we emulate ES 3.0 on top of Desktop GL 4.2+. |
| feature_flags_.emulate_primitive_restart_fixed_index = true; |
| } |
| + |
| + if (workarounds_.disable_msaa_on_non_webgl_contexts) { |
|
Zhenyao Mo
2015/09/30 23:50:12
This is inconsistent with the rest of the code. B
ericrk
2015/10/01 17:13:11
yup, good point - restructured this.
|
| + // crbug.com/527565 - On some GPUs, MSAA does not perform acceptably for |
| + // rasterization. We disable it on non-WebGL contexts. For WebGL contexts |
| + // we leave it up to the site to decide whether to enable MSAA. |
| + switch (context_type_) { |
| + case CONTEXT_TYPE_WEBGL1: |
| + case CONTEXT_TYPE_WEBGL2: |
| + // WebGL contexts, ignore this flag. |
| + break; |
| + case CONTEXT_TYPE_OPENGLES2: |
| + case CONTEXT_TYPE_OPENGLES3: |
| + // Non-WebGL context, disable multisampling. |
| + feature_flags_.chromium_framebuffer_multisample = false; |
| + feature_flags_.multisampled_render_to_texture = false; |
| + } |
| + } |
| } |
| bool FeatureInfo::IsES3Capable() const { |