Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index 67414a495789da2dd21381db670bdc0073eb0692..8cec2c910855afe3287a0a8881b940487234bcec 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -3244,7 +3244,7 @@ void GrGLGpu::bindTexture(int unitIdx, const GrSamplerParams& params, bool allow |
newTexParams.fMinFilter = glMinFilterModes[filterMode]; |
newTexParams.fMagFilter = glMagFilterModes[filterMode]; |
- if (GrPixelConfigIsSRGB(texture->config())) { |
+ if (this->glCaps().srgbDecodeSupport() && GrPixelConfigIsSRGB(texture->config())) { |
newTexParams.fSRGBDecode = allowSRGBInputs ? GR_GL_DECODE_EXT : GR_GL_SKIP_DECODE_EXT; |
if (setAll || newTexParams.fSRGBDecode != oldTexParams.fSRGBDecode) { |
this->setTextureUnit(unitIdx); |
@@ -3420,7 +3420,7 @@ void GrGLGpu::generateMipmaps(const GrSamplerParams& params, bool allowSRGBInput |
// Configure sRGB decode, if necessary. This state is the only thing needed for the driver |
// call (glGenerateMipmap) to work correctly. Our manual method dirties other state, too. |
- if (GrPixelConfigIsSRGB(texture->config())) { |
+ if (this->glCaps().srgbDecodeSupport() && GrPixelConfigIsSRGB(texture->config())) { |
GL_CALL(TexParameteri(target, GR_GL_TEXTURE_SRGB_DECODE_EXT, |
allowSRGBInputs ? GR_GL_DECODE_EXT : GR_GL_SKIP_DECODE_EXT)); |
} |