| Index: tools/flags/SkCommonFlagsConfig.cpp
|
| diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
|
| index 0e911402fb41e08da47e03af0c4d9ee327744d21..26cbc5b8febaa6d095f17bcdf2f05bfc00eed267 100644
|
| --- a/tools/flags/SkCommonFlagsConfig.cpp
|
| +++ b/tools/flags/SkCommonFlagsConfig.cpp
|
| @@ -281,7 +281,9 @@ static bool parse_option_gpu_color(const SkString& value,
|
| }
|
|
|
| // First, figure out color gamut that we'll work in (default to sRGB)
|
| - sk_sp<SkColorSpace> colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
|
| + const bool linearGamma = commands[0].equals("f16");
|
| + *outColorSpace = SkColorSpace::NewNamed(linearGamma ? SkColorSpace::kSRGBLinear_Named
|
| + : SkColorSpace::kSRGB_Named);
|
| if (commands.count() == 2) {
|
| if (commands[1].equals("srgb")) {
|
| // sRGB gamut (which is our default)
|
| @@ -294,8 +296,10 @@ static bool parse_option_gpu_color(const SkString& value,
|
| };
|
| SkMatrix44 wideGamutRGBMatrix(SkMatrix44::kUninitialized_Constructor);
|
| wideGamutRGBMatrix.set3x3RowMajorf(gWideGamutRGB_toXYZD50);
|
| - colorSpace = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma,
|
| - wideGamutRGBMatrix);
|
| + *outColorSpace = SkColorSpace::NewRGB(linearGamma
|
| + ? SkColorSpace::kLinear_RenderTargetGamma
|
| + : SkColorSpace::kSRGB_RenderTargetGamma,
|
| + wideGamutRGBMatrix);
|
| } else {
|
| // Unknown color gamut
|
| return false;
|
| @@ -305,12 +309,10 @@ static bool parse_option_gpu_color(const SkString& value,
|
| // Now pick a color type
|
| if (commands[0].equals("f16")) {
|
| *outColorType = kRGBA_F16_SkColorType;
|
| - *outColorSpace = as_CSB(colorSpace)->makeLinearGamma();
|
| return true;
|
| }
|
| if (commands[0].equals("srgb")) {
|
| *outColorType = kRGBA_8888_SkColorType;
|
| - *outColorSpace = colorSpace;
|
| return true;
|
| }
|
| return false;
|
|
|