From 35b784d48f59be3a3ee28d9d73e03c7f8835d2f9 Mon Sep 17 00:00:00 2001 From: brianosman Date: Thu, 5 May 2016 11:52:53 -0700 Subject: Bring back sRGB-write-control as a caps bit. We're not going to support this on Vulkan (yet), but want to still have it as an option for GL. (The fallback alternative for our YUV use case involves injecting expensive fragment shader code, which we'd like to avoid). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1955603003 Review-Url: https://codereview.chromium.org/1955603003 --- src/gpu/gl/GrGLCaps.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gpu/gl/GrGLCaps.cpp') diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 9b12ce69c5..ebfbf6a065 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -1457,8 +1457,7 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa fConfigTable[kBGRA_8888_GrPixelConfig].fSwizzle = GrSwizzle::RGBA(); // We only enable srgb support if both textures and FBOs support srgb, - // *and* we can disable sRGB decode-on-read, to support "legacy" mode, - // *and* we can disable sRGB encode-on-write. + // *and* we can disable sRGB decode-on-read, to support "legacy" mode. if (kGL_GrGLStandard == standard) { if (ctxInfo.version() >= GR_GL_VER(3,0)) { fSRGBSupport = true; @@ -1469,13 +1468,14 @@ void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterfa } } // All the above srgb extensions support toggling srgb writes + 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")); // ES through 3.1 requires EXT_srgb_write_control to support toggling // sRGB writing for destinations. - fSRGBSupport = fSRGBSupport && ctxInfo.hasExtension("GL_EXT_sRGB_write_control"); + fSRGBWriteControl = 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: -- cgit v1.2.3