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

Unified Diff: gm/gamut.cpp

Issue 2389983002: Refactored SkColorSpace and added in a Lab PCS GM (Closed)
Patch Set: migrated call from SkColorSpace_Base::makeLinearGamma() to SkColorSpace_XYZ::makeLinearGamma() 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 | « dm/DMSrcSink.cpp ('k') | gm/labpcsdemo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gamut.cpp
diff --git a/gm/gamut.cpp b/gm/gamut.cpp
index 707da29f64bdfa009ff80020b4910ae3b129b7ef..3c64915561df393e379bf4b9f76d86d64f2ef4b0 100644
--- a/gm/gamut.cpp
+++ b/gm/gamut.cpp
@@ -127,20 +127,25 @@ static void draw_gamut_grid(SkCanvas* canvas, SkTArray<SkAutoTDelete<CellRendere
// Use the original canvas' color type, but account for gamma requirements
SkImageInfo origInfo = canvas->imageInfo();
- auto srgbCS = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
- auto wideCS = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma,
- wideGamutRGB_toXYZD50);
+ sk_sp<SkColorSpace> srgbCS;
+ sk_sp<SkColorSpace> wideCS;
switch (origInfo.colorType()) {
case kRGBA_8888_SkColorType:
case kBGRA_8888_SkColorType:
+ srgbCS = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
+ wideCS = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma,
+ wideGamutRGB_toXYZD50);
break;
case kRGBA_F16_SkColorType:
- srgbCS = as_CSB(srgbCS.get())->makeLinearGamma();
- wideCS = as_CSB(wideCS.get())->makeLinearGamma();
+ srgbCS = SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Named);
+ wideCS = SkColorSpace::NewRGB(SkColorSpace::kLinear_RenderTargetGamma,
+ wideGamutRGB_toXYZD50);
break;
default:
return;
}
+ SkASSERT(srgbCS);
+ SkASSERT(wideCS);
// Make our two working surfaces (one sRGB, one Adobe)
SkImageInfo srgbGamutInfo = SkImageInfo::Make(gRectSize, gRectSize, origInfo.colorType(),
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | gm/labpcsdemo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698