diff options
author | 2016-03-25 06:01:59 -0700 | |
---|---|---|
committer | 2016-03-25 06:01:59 -0700 | |
commit | 64d094d7756534a9b9b0997aab225d9ceba098b6 (patch) | |
tree | b1297062c16726548ee940466da4e2fee17887e6 /src/gpu/GrYUVProvider.cpp | |
parent | 73233a75752733db16870259cc06b2a5230c8ff8 (diff) |
Require sRGB write control for sRGB support. Add flag to GrPaint to suppress linear -> sRGB conversion on write. Use that to fix YUV conversion, which directly produces sRGB data. (Technically, it produces data in whatever the color space of the JPEG might be).
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1830303002
Review URL: https://codereview.chromium.org/1830303002
Diffstat (limited to 'src/gpu/GrYUVProvider.cpp')
-rw-r--r-- | src/gpu/GrYUVProvider.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp index f35c6dfe9b..90d553758f 100644 --- a/src/gpu/GrYUVProvider.cpp +++ b/src/gpu/GrYUVProvider.cpp @@ -123,6 +123,9 @@ GrTexture* GrYUVProvider::refAsTexture(GrContext* ctx, const GrSurfaceDesc& desc SkASSERT(renderTarget); GrPaint paint; + // We may be decoding an sRGB image, but the result of our linear math on the YUV planes + // is already in sRGB in that case. Don't convert (which will make the image too bright). + paint.setDisableOutputConversionToSRGB(true); SkAutoTUnref<const GrFragmentProcessor> yuvToRgbProcessor( GrYUVEffect::CreateYUVToRGB(yuvTextures[0], yuvTextures[1], |