diff options
author | Brian Osman <brianosman@google.com> | 2016-10-25 11:10:45 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-25 15:39:51 +0000 |
commit | 0117485a4a00737a63f1e9338b4343b885b4d885 (patch) | |
tree | 10e4f0b17d1b05cfdb73ad3362be3ec26c4cbd4c /tools/viewer/sk_app | |
parent | 85c7fe8d6d87850aed83599864b63dca37af5fcf (diff) |
Fix GPU sRGB mode in viewer
Need to attach the sRGB color space to the surface to get past validation.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3905
Change-Id: Icce1c8cf35c31023c116cbcddf8848c4c92cd212
Reviewed-on: https://skia-review.googlesource.com/3905
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tools/viewer/sk_app')
-rwxr-xr-x | tools/viewer/sk_app/WindowContext.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/viewer/sk_app/WindowContext.cpp b/tools/viewer/sk_app/WindowContext.cpp index e8658806e3..a39bb20e5b 100755 --- a/tools/viewer/sk_app/WindowContext.cpp +++ b/tools/viewer/sk_app/WindowContext.cpp @@ -52,7 +52,10 @@ sk_sp<SkSurface> WindowContext::createSurface( return SkSurface::MakeRaster(info, &fSurfaceProps); } } else { - return SkSurface::MakeFromBackendRenderTarget(fContext, *rtDesc, &fSurfaceProps); + sk_sp<SkColorSpace> colorSpace = GrPixelConfigIsSRGB(rtDesc->fConfig) + ? SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named) : nullptr; + return SkSurface::MakeFromBackendRenderTarget(fContext, *rtDesc, colorSpace, + &fSurfaceProps); } } |