Index: src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp |
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp |
index bd0108407f076d5fce9ee45e2dcba8c80939107a..e6717a9e4d4579d737e68e8d062dd6f08066678b 100644 |
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp |
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp |
@@ -87,25 +87,31 @@ bool GrGLSLFragmentShaderBuilder::hasFragmentPosition() const { |
} |
bool GrGLSLFragmentShaderBuilder::enableFeature(GLSLFeature feature) { |
+ const GrGLSLCaps& glslCaps = *fProgramBuilder->glslCaps(); |
switch (feature) { |
- case kStandardDerivatives_GLSLFeature: { |
- if (!fProgramBuilder->glslCaps()->shaderDerivativeSupport()) { |
+ case kStandardDerivatives_GLSLFeature: |
+ if (!glslCaps.shaderDerivativeSupport()) { |
return false; |
} |
- const char* extension = fProgramBuilder->glslCaps()->shaderDerivativeExtensionString(); |
- if (extension) { |
+ if (const char* extension = glslCaps.shaderDerivativeExtensionString()) { |
this->addFeature(1 << kStandardDerivatives_GLSLFeature, extension); |
} |
return true; |
- } |
- case kPixelLocalStorage_GLSLFeature: { |
- if (fProgramBuilder->glslCaps()->pixelLocalStorageSize() <= 0) { |
+ case kPixelLocalStorage_GLSLFeature: |
+ if (glslCaps.pixelLocalStorageSize() <= 0) { |
return false; |
} |
this->addFeature(1 << kPixelLocalStorage_GLSLFeature, |
"GL_EXT_shader_pixel_local_storage"); |
return true; |
- } |
+ case kMultisampleInterpolation_GLSLFeature: |
+ if (!glslCaps.multisampleInterpolationSupport()) { |
+ return false; |
+ } |
+ if (const char* extension = glslCaps.multisampleInterpolationExtensionString()) { |
+ this->addFeature(1 << kMultisampleInterpolation_GLSLFeature, extension); |
+ } |
+ return true; |
default: |
SkFAIL("Unexpected GLSLFeature requested."); |
return false; |