Chromium Code Reviews| Index: src/gpu/gl/GrGLCaps.cpp |
| diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp |
| index ec0f6288b4b550899650208d1a64a806bacfb5b8..bb36ef74855790509f887ee1ff3f76d42032240d 100644 |
| --- a/src/gpu/gl/GrGLCaps.cpp |
| +++ b/src/gpu/gl/GrGLCaps.cpp |
| @@ -51,6 +51,8 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions, |
| fMipMapLevelAndLodControlSupport = false; |
| fRGBAToBGRAReadbackConversionsAreSlow = false; |
| fDoManualMipmapping = false; |
| + fSRGBDecodeSupport = false; |
| + fRequireDecodeForSRGB = true; |
| fBlitFramebufferFlags = kNoSupport_BlitFramebufferFlag; |
| @@ -607,6 +609,9 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, |
| fDoManualMipmapping = true; |
| } |
| + fSRGBDecodeSupport = ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode"); |
| + fRequireDecodeForSRGB = contextOptions.fRequireDecodeForSRGB; |
| + |
| // Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES compatibility have |
| // already been detected. |
| this->initConfigTable(ctxInfo, gli, shaderCaps); |
| @@ -1575,17 +1580,16 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa |
| fSRGBWriteControl = true; |
| } |
| } else { |
| - // See https://bug.skia.org/4148 for PowerVR issue. |
| - fSRGBSupport = kPowerVRRogue_GrGLRenderer != ctxInfo.renderer() && |
| - (ctxInfo.version() >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_EXT_sRGB")); |
| + fSRGBSupport = ctxInfo.version() >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_EXT_sRGB"); |
| // ES through 3.1 requires EXT_srgb_write_control to support toggling |
| // sRGB writing for destinations. |
| // See https://bug.skia.org/5329 for Adreno4xx issue. |
| fSRGBWriteControl = kAdreno4xx_GrGLRenderer != ctxInfo.renderer() && |
| ctxInfo.hasExtension("GL_EXT_sRGB_write_control"); |
| } |
| - if (!ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode")) { |
| - // To support "legacy" L32 mode, we require the ability to turn off sRGB decode: |
| + if (fRequireDecodeForSRGB && !fSRGBDecodeSupport) { |
|
bsalomon
2016/11/30 17:00:21
Should we just pass the options here rather than h
|
| + // To support "legacy" L32 mode, we require the ability to turn off sRGB decode. Clients |
| + // can opt-out of that requirement, if they intend to always do linear blending. |
| fSRGBSupport = false; |
| } |
| fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL_SRGB_ALPHA; |