Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index 7528f5da0483d16724a19d4d712a509b08a84b9f..f742efe70d1b829fb4135ce4d21b93426cad3dfb 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -898,7 +898,6 @@ |
case kRGBA_8888_GrPixelConfig: |
case kBGRA_8888_GrPixelConfig: |
case kSRGBA_8888_GrPixelConfig: |
- case kSBGRA_8888_GrPixelConfig: |
case kRGBA_float_GrPixelConfig: |
return 4; |
default: |
@@ -2102,15 +2101,13 @@ |
SkSTArray<8, const GrTextureAccess*> textureAccesses; |
program->setData(*args.fPrimitiveProcessor, pipeline, &textureAccesses); |
- GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTarget()); |
- bool allowSRGB = GrAllowSRGBForDestinationPixelConfig(glRT->config()); |
- |
int numTextureAccesses = textureAccesses.count(); |
for (int i = 0; i < numTextureAccesses; i++) { |
- this->bindTexture(i, textureAccesses[i]->getParams(), allowSRGB, |
+ this->bindTexture(i, textureAccesses[i]->getParams(), |
static_cast<GrGLTexture*>(textureAccesses[i]->getTexture())); |
} |
+ GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTarget()); |
this->flushStencil(pipeline.getStencil()); |
this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->origin()); |
this->flushHWAAState(glRT, pipeline.isHWAntialiasState(), !pipeline.getStencil().isDisabled()); |
@@ -2619,16 +2616,6 @@ |
tempDrawInfo->fSwizzle = GrSwizzle::BGRA(); |
tempDrawInfo->fReadConfig = kRGBA_8888_GrPixelConfig; |
ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); |
- } else if (readConfig == kSBGRA_8888_GrPixelConfig && |
- this->glCaps().isConfigRenderable(kSRGBA_8888_GrPixelConfig, false) && |
- this->readPixelsSupported(kSRGBA_8888_GrPixelConfig, kSRGBA_8888_GrPixelConfig)) { |
- // We're trying to read sBGRA but it's not supported. If sRGBA is renderable and |
- // we can read it back, then do a swizzling draw to a sRGBA and read it back (which |
- // will effectively be sBGRA). |
- tempDrawInfo->fTempSurfaceDesc.fConfig = kSRGBA_8888_GrPixelConfig; |
- tempDrawInfo->fSwizzle = GrSwizzle::BGRA(); |
- tempDrawInfo->fReadConfig = kSRGBA_8888_GrPixelConfig; |
- ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference); |
} else if (readConfig == kAlpha_8_GrPixelConfig) { |
// onReadPixels implements a fallback for cases where we are want to read kAlpha_8, |
// it's unsupported, but 32bit RGBA reads are supported. |
@@ -3321,8 +3308,7 @@ |
} |
} |
-void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, bool dstConfigAllowsSRGB, |
- GrGLTexture* texture) { |
+void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* texture) { |
SkASSERT(texture); |
#ifdef SK_DEBUG |
@@ -3357,19 +3343,6 @@ |
const GrGLTexture::TexParams& oldTexParams = texture->getCachedTexParams(×tamp); |
bool setAll = timestamp < this->getResetTimestamp(); |
GrGLTexture::TexParams newTexParams; |
- |
- 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; |
- |
- if (setAll || newTexParams.fSRGBDecode != oldTexParams.fSRGBDecode) { |
- this->setTextureUnit(unitIdx); |
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_SRGB_DECODE_EXT, newTexParams.fSRGBDecode)); |
- } |
- } |
static GrGLenum glMinFilterModes[] = { |
GR_GL_NEAREST, |
@@ -4038,7 +4011,7 @@ |
GrGLTexture* srcTex = static_cast<GrGLTexture*>(src->asTexture()); |
GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode); |
- this->bindTexture(0, params, true, srcTex); |
+ this->bindTexture(0, params, srcTex); |
GrGLIRect dstVP; |
this->bindSurfaceFBOForCopy(dst, GR_GL_FRAMEBUFFER, &dstVP, kDst_TempFBOTarget); |