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
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp
index e578b1a..6e1ebf7 100644
--- a/src/views/SkWindow.cpp
+++ b/src/views/SkWindow.cpp
@@ -352,7 +352,10 @@
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