diff options
author | 2016-08-22 08:23:09 -0700 | |
---|---|---|
committer | 2016-08-22 08:23:09 -0700 | |
commit | 7fd64e7e67dfb74a10ab1b9c7cce2cc568d37fd2 (patch) | |
tree | ec64829eccec29cc0ad90c7900df587c8e35e0e3 /src/views | |
parent | 88bba1618c6f939e2b11207f015e12d1c4614810 (diff) |
Supply a color space in sRGB/F16 mode of SampleApp
Ganesh now uses this to decide if it should perform gamma-correct
rendering, so the color space is necessary to get correct results in
S32/F16.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2266763004
Review-Url: https://codereview.chromium.org/2266763004
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/SkWindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp index e578b1a01f..6e1ebf7a75 100644 --- a/src/views/SkWindow.cpp +++ b/src/views/SkWindow.cpp @@ -352,7 +352,10 @@ sk_sp<SkSurface> SkWindow::makeGpuBackedSurface(const AttachmentInfo& attachment GR_GL_GetIntegerv(interface, GR_GL_FRAMEBUFFER_BINDING, &buffer); desc.fRenderTargetHandle = buffer; - return SkSurface::MakeFromBackendRenderTarget(grContext, desc, &fSurfaceProps); + sk_sp<SkColorSpace> colorSpace = + grContext->caps()->srgbSupport() && SkImageInfoIsGammaCorrect(info()) + ? SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) : nullptr; + return SkSurface::MakeFromBackendRenderTarget(grContext, desc, colorSpace, &fSurfaceProps); } #endif |