Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Unified Diff: tools/skiaserve/Request.cpp

Issue 2412613005: Removed makeLinearGamma() from the public API for SkColorSpace (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/flags/SkCommonFlagsConfig.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skiaserve/Request.cpp
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index ef1f75759585e8099555f83e490e1903c44a7184..d27f2c07926f3a7b639d3400331e2d5c308e83c9 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -174,10 +174,9 @@ ColorAndProfile ColorModes[] = {
SkSurface* Request::createCPUSurface() {
SkIRect bounds = this->getBounds();
ColorAndProfile cap = ColorModes[fColorMode];
- auto colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
- if (kRGBA_F16_SkColorType == cap.fColorType) {
- colorSpace = colorSpace->makeLinearGamma();
- }
+ auto colorSpace = kRGBA_F16_SkColorType == cap.fColorType
+ ? SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Named)
+ : SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
SkImageInfo info = SkImageInfo::Make(bounds.width(), bounds.height(), cap.fColorType,
kPremul_SkAlphaType, cap.fSRGB ? colorSpace : nullptr);
return SkSurface::MakeRaster(info).release();
@@ -187,10 +186,9 @@ SkSurface* Request::createGPUSurface() {
GrContext* context = this->getContext();
SkIRect bounds = this->getBounds();
ColorAndProfile cap = ColorModes[fColorMode];
- auto colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
- if (kRGBA_F16_SkColorType == cap.fColorType) {
- colorSpace = colorSpace->makeLinearGamma();
- }
+ auto colorSpace = kRGBA_F16_SkColorType == cap.fColorType
+ ? SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Named)
+ : SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
SkImageInfo info = SkImageInfo::Make(bounds.width(), bounds.height(), cap.fColorType,
kPremul_SkAlphaType, cap.fSRGB ? colorSpace: nullptr);
SkSurface* surface = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info).release();
« no previous file with comments | « tools/flags/SkCommonFlagsConfig.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698