Index: tools/skiaserve/Request.cpp |
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp |
index e3a0caa6e2dc2e1cd168c0e166c0216b36f86c3f..22fa211abceb854f2ff303072110c64b8fc481ce 100644 |
--- a/tools/skiaserve/Request.cpp |
+++ b/tools/skiaserve/Request.cpp |
@@ -174,9 +174,12 @@ ColorAndProfile ColorModes[] = { |
SkSurface* Request::createCPUSurface() { |
SkIRect bounds = this->getBounds(); |
ColorAndProfile cap = ColorModes[fColorMode]; |
- auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
+ auto colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
+ if (kRGBA_F16_SkColorType == cap.fColorType) { |
+ colorSpace = colorSpace->makeLinearGamma(); |
+ } |
SkImageInfo info = SkImageInfo::Make(bounds.width(), bounds.height(), cap.fColorType, |
- kPremul_SkAlphaType, cap.fSRGB ? srgbColorSpace : nullptr); |
+ kPremul_SkAlphaType, cap.fSRGB ? colorSpace : nullptr); |
return SkSurface::MakeRaster(info).release(); |
} |
@@ -184,9 +187,12 @@ SkSurface* Request::createGPUSurface() { |
GrContext* context = this->getContext(); |
SkIRect bounds = this->getBounds(); |
ColorAndProfile cap = ColorModes[fColorMode]; |
- auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
+ auto colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
+ if (kRGBA_F16_SkColorType == cap.fColorType) { |
+ colorSpace = colorSpace->makeLinearGamma(); |
+ } |
SkImageInfo info = SkImageInfo::Make(bounds.width(), bounds.height(), cap.fColorType, |
- kPremul_SkAlphaType, cap.fSRGB ? srgbColorSpace : nullptr); |
+ kPremul_SkAlphaType, cap.fSRGB ? colorSpace: nullptr); |
SkSurface* surface = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info).release(); |
return surface; |
} |