aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-12-01 10:42:03 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-12-01 10:42:04 -0800
commit0a2782c98c45127a10d6392c539e7bce72dc5513 (patch)
tree3153ea6fada6cd2761e0ac876cdb1c7b2fcb73a0 /src/gpu/gl
parentdd19ac7d10c7c00dd6e9b1f4c4c6aae729c7e6d4 (diff)
Revert of Enable sRGB on iOS, make sRGB decode support optional (patchset #11 id:200001 of https://codereview.chromium.org/2539993002/ )
Reason for revert: ANGLE tests are failing Original issue's description: > Two (related) changes here: > > 1) Our older iOS devices failed our sRGB tests, due to precision issues > with alpha. At this point, we only test on iPadMini 4, and that appears > not to have any problems. > > 2) iOS devices still don't have the sRGB texture decode extension. But, > some clients have no interest in mixing legacy/color-correct rendering, > and would like to use sRGB on these devices. This GrContextOptions flag > enables sRGB support in those cases. > > Adjust the test code to produce sRGB capable contexts on these devices, > but only for configs that have a color space. (See comment). > > BUG=skia:4148 > > Committed: https://skia.googlesource.com/skia/+/9db12d2341f3f8722c8b90b11dd4cce138a8a64e TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4148 Review-Url: https://codereview.chromium.org/2547603002
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp24
-rw-r--r--src/gpu/gl/GrGLCaps.h6
-rw-r--r--src/gpu/gl/GrGLGpu.cpp4
3 files changed, 10 insertions, 24 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 55647a8547..ec0f6288b4 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -51,7 +51,6 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
fMipMapLevelAndLodControlSupport = false;
fRGBAToBGRAReadbackConversionsAreSlow = false;
fDoManualMipmapping = false;
- fSRGBDecodeDisableSupport = false;
fBlitFramebufferFlags = kNoSupport_BlitFramebufferFlag;
@@ -608,11 +607,9 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fDoManualMipmapping = true;
}
- fSRGBDecodeDisableSupport = ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode");
-
// Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES compatibility have
// already been detected.
- this->initConfigTable(contextOptions, ctxInfo, gli, shaderCaps);
+ this->initConfigTable(ctxInfo, gli, shaderCaps);
this->applyOptionsOverrides(contextOptions);
shaderCaps->applyOptionsOverrides(contextOptions);
@@ -1392,8 +1389,7 @@ bool GrGLCaps::getExternalFormat(GrPixelConfig surfaceConfig, GrPixelConfig memo
return true;
}
-void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions,
- const GrGLContextInfo& ctxInfo, const GrGLInterface* gli,
+void GrGLCaps::initConfigTable(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli,
GrShaderCaps* shaderCaps) {
/*
Comments on renderability of configs on various GL versions.
@@ -1579,23 +1575,17 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions,
fSRGBWriteControl = true;
}
} else {
- fSRGBSupport = ctxInfo.version() >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_EXT_sRGB");
-#if defined(SK_CPU_X86)
- if (kPowerVRRogue_GrGLRenderer == ctxInfo.renderer()) {
- // NexusPlayer has strange bugs with sRGB (skbug.com/4148). This is a targeted fix to
- // blacklist that device (and any others that might be sharing the same driver).
- fSRGBSupport = false;
- }
-#endif
+ // 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.
// See https://bug.skia.org/5329 for Adreno4xx issue.
fSRGBWriteControl = kAdreno4xx_GrGLRenderer != ctxInfo.renderer() &&
ctxInfo.hasExtension("GL_EXT_sRGB_write_control");
}
- if (contextOptions.fRequireDecodeDisableForSRGB && !fSRGBDecodeDisableSupport) {
- // 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.
+ if (!ctxInfo.hasExtension("GL_EXT_texture_sRGB_decode")) {
+ // To support "legacy" L32 mode, we require the ability to turn off sRGB decode:
fSRGBSupport = false;
}
fConfigTable[kSRGBA_8888_GrPixelConfig].fFormats.fBaseInternalFormat = GR_GL_SRGB_ALPHA;
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index deb0889c82..5c7e028745 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -345,8 +345,6 @@ public:
bool doManualMipmapping() const { return fDoManualMipmapping; }
- bool srgbDecodeDisableSupport() const { return fSRGBDecodeDisableSupport; }
-
/**
* Returns a string containing the caps info.
*/
@@ -380,8 +378,7 @@ private:
void initBlendEqationSupport(const GrGLContextInfo&);
void initStencilFormats(const GrGLContextInfo&);
// This must be called after initFSAASupport().
- void initConfigTable(const GrContextOptions&, const GrGLContextInfo&, const GrGLInterface*,
- GrShaderCaps*);
+ void initConfigTable(const GrGLContextInfo&, const GrGLInterface*, GrShaderCaps*);
void initShaderPrecisionTable(const GrGLContextInfo&, const GrGLInterface*, GrShaderCaps*);
@@ -423,7 +420,6 @@ private:
bool fMipMapLevelAndLodControlSupport : 1;
bool fRGBAToBGRAReadbackConversionsAreSlow : 1;
bool fDoManualMipmapping : 1;
- bool fSRGBDecodeDisableSupport : 1;
uint32_t fBlitFramebufferFlags;
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 5da585fb3f..4820ca8e16 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -3243,7 +3243,7 @@ void GrGLGpu::bindTexture(int unitIdx, const GrSamplerParams& params, bool allow
newTexParams.fMinFilter = glMinFilterModes[filterMode];
newTexParams.fMagFilter = glMagFilterModes[filterMode];
- if (this->glCaps().srgbDecodeDisableSupport() && GrPixelConfigIsSRGB(texture->config())) {
+ if (GrPixelConfigIsSRGB(texture->config())) {
newTexParams.fSRGBDecode = allowSRGBInputs ? GR_GL_DECODE_EXT : GR_GL_SKIP_DECODE_EXT;
if (setAll || newTexParams.fSRGBDecode != oldTexParams.fSRGBDecode) {
this->setTextureUnit(unitIdx);
@@ -3419,7 +3419,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 (this->glCaps().srgbDecodeDisableSupport() && GrPixelConfigIsSRGB(texture->config())) {
+ if (GrPixelConfigIsSRGB(texture->config())) {
GL_CALL(TexParameteri(target, GR_GL_TEXTURE_SRGB_DECODE_EXT,
allowSRGBInputs ? GR_GL_DECODE_EXT : GR_GL_SKIP_DECODE_EXT));
}