From a167e74b4bb78cfbbec3d8768e5853cd0b9314ab Mon Sep 17 00:00:00 2001 From: brianosman Date: Tue, 24 May 2016 06:18:48 -0700 Subject: Remove sRGB overrides on GrTextureParams. Use GrPaint flags instead. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2002253002 Review-Url: https://codereview.chromium.org/2002253002 --- src/gpu/gl/GrGLGpu.cpp | 6 ++---- src/gpu/gl/GrGLGpu.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gpu/gl') diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 6b03df3e10..6daf955170 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -3101,7 +3101,7 @@ static void get_tex_param_swizzle(GrPixelConfig config, } } -void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, bool dstConfigAllowsSRGB, +void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, bool allowSRGBInputs, GrGLTexture* texture) { SkASSERT(texture); @@ -3141,9 +3141,7 @@ void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, bool dstCo if (this->caps()->srgbSupport()) { // By default, the decision to allow SRGB decode is based on the destination config. // A texture can override that by specifying a value in GrTextureParams. - newTexParams.fSRGBDecode = - (dstConfigAllowsSRGB || GrTextureParams::kForceAllowSRGB_SRGBMode == params.srgbMode()) - ? GR_GL_DECODE_EXT : GR_GL_SKIP_DECODE_EXT; + newTexParams.fSRGBDecode = allowSRGBInputs ? GR_GL_DECODE_EXT : GR_GL_SKIP_DECODE_EXT; if (setAll || newTexParams.fSRGBDecode != oldTexParams.fSRGBDecode) { this->setTextureUnit(unitIdx); diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index d6af67947a..0b2198a834 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -57,7 +57,7 @@ public: void discard(GrRenderTarget*) override; // Used by GrGLProgram to configure OpenGL state. - void bindTexture(int unitIdx, const GrTextureParams& params, bool dstConfigAllowsSRGB, + void bindTexture(int unitIdx, const GrTextureParams& params, bool allowSRGBInputs, GrGLTexture* texture); void bindTexelBuffer(int unitIdx, intptr_t offsetInBytes, GrPixelConfig, GrGLBuffer*); -- cgit v1.2.3