Index: src/views/SkWindow.cpp |
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp |
index e578b1a01fac03c601e3f2c8ba4ddeba74338d18..6e1ebf7a7592a2e0a9f2beba017ff461abf4acf5 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 |