diff options
author | brianosman <brianosman@google.com> | 2016-06-13 07:59:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-13 07:59:48 -0700 |
commit | fe19987e5499650e8637a8d109f19b8156601660 (patch) | |
tree | b1ac8ff2e2b2ef8798f3db5f0f5b97a440f16cf3 /src/gpu/GrTexture.cpp | |
parent | 25d57db23445b5602d968fecf015fa8c36246e4a (diff) |
Better (?) interface for controlling sRGB-ness of mipmaps on GrTexture
Switch to new SkSourceGammaTreatment type. Move to a separate setter,
rather than an optional argument to dirty. Set the flag correctly after
uploading CPU-built mips.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2058143002
Review-Url: https://codereview.chromium.org/2058143002
Diffstat (limited to 'src/gpu/GrTexture.cpp')
-rw-r--r-- | src/gpu/GrTexture.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp index 9209dbd053..683458182e 100644 --- a/src/gpu/GrTexture.cpp +++ b/src/gpu/GrTexture.cpp @@ -18,7 +18,7 @@ #include "SkMipMap.h" #include "SkTypes.h" -void GrTexture::dirtyMipMaps(bool mipMapsDirty, bool sRGBCorrect) { +void GrTexture::dirtyMipMaps(bool mipMapsDirty) { if (mipMapsDirty) { if (kValid_MipMapsStatus == fMipMapsStatus) { fMipMapsStatus = kAllocated_MipMapsStatus; @@ -26,7 +26,6 @@ void GrTexture::dirtyMipMaps(bool mipMapsDirty, bool sRGBCorrect) { } else { const bool sizeChanged = kNotAllocated_MipMapsStatus == fMipMapsStatus; fMipMapsStatus = kValid_MipMapsStatus; - fMipMapsAreSRGBCorrect = sRGBCorrect; if (sizeChanged) { // This must not be called until after changing fMipMapsStatus. this->didChangeGpuMemorySize(); @@ -90,16 +89,15 @@ GrSurfaceOrigin resolve_origin(const GrSurfaceDesc& desc) { GrTexture::GrTexture(GrGpu* gpu, const GrSurfaceDesc& desc, GrSLType samplerType, bool wasMipMapDataProvided) : INHERITED(gpu, desc) - , fSamplerType(samplerType) { + , fSamplerType(samplerType) + // Gamma treatment is explicitly set after creation via GrTexturePriv + , fGammaTreatment(SkSourceGammaTreatment::kIgnore) { if (wasMipMapDataProvided) { fMipMapsStatus = kValid_MipMapsStatus; fMaxMipMapLevel = SkMipMap::ComputeLevelCount(fDesc.fWidth, fDesc.fHeight); - // At the moment, the CPU code for generating mipmaps doesn't account for sRGB: - fMipMapsAreSRGBCorrect = false; } else { fMipMapsStatus = kNotAllocated_MipMapsStatus; fMaxMipMapLevel = 0; - fMipMapsAreSRGBCorrect = false; } } |