Test sRGB with non-linear blending using new "srgbnl" sink
BUG=skia: Change-Id: Ief7516c1505f8e447f83121ed4ba75b9fa9ba75b Reviewed-on: https://skia-review.googlesource.com/8976 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
parent
39b101b13d
commit
d222830941
27
dm/DM.cpp
27
dm/DM.cpp
@ -866,19 +866,24 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi
|
||||
|
||||
if (FLAGS_cpu) {
|
||||
auto srgbColorSpace = SkColorSpace::MakeSRGB();
|
||||
auto srgbColorSpaceNonLinearBlending = SkColorSpace::MakeRGB(
|
||||
SkColorSpace::kSRGB_RenderTargetGamma,
|
||||
SkColorSpace::kSRGB_Gamut,
|
||||
SkColorSpace::kNonLinearBlending_ColorSpaceFlag);
|
||||
auto srgbLinearColorSpace = SkColorSpace::MakeSRGBLinear();
|
||||
|
||||
SINK("565", RasterSink, kRGB_565_SkColorType);
|
||||
SINK("8888", RasterSink, kN32_SkColorType);
|
||||
SINK("srgb", RasterSink, kN32_SkColorType, srgbColorSpace);
|
||||
SINK("f16", RasterSink, kRGBA_F16_SkColorType, srgbLinearColorSpace);
|
||||
SINK("pdf", PDFSink);
|
||||
SINK("skp", SKPSink);
|
||||
SINK("pipe", PipeSink);
|
||||
SINK("svg", SVGSink);
|
||||
SINK("null", NullSink);
|
||||
SINK("xps", XPSSink);
|
||||
SINK("pdfa", PDFSink, true);
|
||||
SINK("565", RasterSink, kRGB_565_SkColorType);
|
||||
SINK("8888", RasterSink, kN32_SkColorType);
|
||||
SINK("srgb", RasterSink, kN32_SkColorType, srgbColorSpace);
|
||||
SINK("srgbnl", RasterSink, kN32_SkColorType, srgbColorSpaceNonLinearBlending);
|
||||
SINK("f16", RasterSink, kRGBA_F16_SkColorType, srgbLinearColorSpace);
|
||||
SINK("pdf", PDFSink);
|
||||
SINK("skp", SKPSink);
|
||||
SINK("pipe", PipeSink);
|
||||
SINK("svg", SVGSink);
|
||||
SINK("null", NullSink);
|
||||
SINK("xps", XPSSink);
|
||||
SINK("pdfa", PDFSink, true);
|
||||
SINK("jsdebug", DebugSink);
|
||||
}
|
||||
#undef SINK
|
||||
|
@ -50,6 +50,7 @@ def dm_flags(bot):
|
||||
configs.extend(['f16'])
|
||||
configs.extend(['sp-8888', '2ndpic-8888']) # Test niche uses of SkPicture.
|
||||
configs.extend(['lite-8888']) # Experimental display list.
|
||||
configs.extend(['srgbnl'])
|
||||
|
||||
if '-TSAN' not in bot:
|
||||
if ('TegraK1' in bot or
|
||||
|
@ -237,6 +237,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -118,6 +118,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -118,6 +118,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -235,6 +235,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -237,6 +237,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -118,6 +118,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -235,6 +235,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -275,6 +275,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -241,6 +241,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -237,6 +237,7 @@
|
||||
"sp-8888",
|
||||
"2ndpic-8888",
|
||||
"lite-8888",
|
||||
"srgbnl",
|
||||
"serialize-8888",
|
||||
"tiles_rt-8888",
|
||||
"pic-8888",
|
||||
|
@ -49,6 +49,7 @@ static const struct {
|
||||
{ "esinstdit4", "gpu", "api=gles,inst=true,samples=4,dit=true" },
|
||||
{ "gpuf16", "gpu", "color=f16" },
|
||||
{ "gpusrgb", "gpu", "color=srgb" },
|
||||
{ "gpusrgbnl", "gpu", "color=srgbnl" },
|
||||
{ "glsrgb", "gpu", "api=gl,color=srgb" },
|
||||
{ "glwide", "gpu", "api=gl,color=f16_wide" },
|
||||
{ "glnarrow", "gpu", "api=gl,color=f16_narrow" },
|
||||
@ -290,10 +291,16 @@ static bool parse_option_gpu_color(const SkString& value,
|
||||
return false;
|
||||
}
|
||||
|
||||
// First, figure out color gamut that we'll work in (default to sRGB)
|
||||
const bool linearGamma = commands[0].equals("f16");
|
||||
*outColorSpace = linearGamma ? SkColorSpace::MakeSRGBLinear()
|
||||
: SkColorSpace::MakeSRGB();
|
||||
const bool nonLinearBlending = commands[0].equals("srgbnl");
|
||||
SkColorSpace::Gamut gamut = SkColorSpace::kSRGB_Gamut;
|
||||
SkColorSpace::RenderTargetGamma gamma = linearGamma ? SkColorSpace::kLinear_RenderTargetGamma
|
||||
: SkColorSpace::kSRGB_RenderTargetGamma;
|
||||
SkColorSpace::ColorSpaceFlags flags =
|
||||
nonLinearBlending ? SkColorSpace::kNonLinearBlending_ColorSpaceFlag
|
||||
: (SkColorSpace::ColorSpaceFlags) 0;
|
||||
*outColorSpace = SkColorSpace::MakeRGB(gamma, gamut, flags);
|
||||
|
||||
if (commands.count() == 2) {
|
||||
if (commands[1].equals("srgb")) {
|
||||
// sRGB gamut (which is our default)
|
||||
@ -306,10 +313,7 @@ static bool parse_option_gpu_color(const SkString& value,
|
||||
};
|
||||
SkMatrix44 wideGamutRGBMatrix(SkMatrix44::kUninitialized_Constructor);
|
||||
wideGamutRGBMatrix.set3x3RowMajorf(gWideGamutRGB_toXYZD50);
|
||||
*outColorSpace = SkColorSpace::MakeRGB(linearGamma
|
||||
? SkColorSpace::kLinear_RenderTargetGamma
|
||||
: SkColorSpace::kSRGB_RenderTargetGamma,
|
||||
wideGamutRGBMatrix);
|
||||
*outColorSpace = SkColorSpace::MakeRGB(gamma, wideGamutRGBMatrix, flags);
|
||||
} else if (commands[1].equals("narrow")) {
|
||||
// NarrowGamut RGB (an artifically smaller than sRGB gamut)
|
||||
SkColorSpacePrimaries primaries ={
|
||||
@ -320,10 +324,7 @@ static bool parse_option_gpu_color(const SkString& value,
|
||||
};
|
||||
SkMatrix44 narrowGamutRGBMatrix(SkMatrix44::kUninitialized_Constructor);
|
||||
primaries.toXYZD50(&narrowGamutRGBMatrix);
|
||||
*outColorSpace = SkColorSpace::MakeRGB(linearGamma
|
||||
? SkColorSpace::kLinear_RenderTargetGamma
|
||||
: SkColorSpace::kSRGB_RenderTargetGamma,
|
||||
narrowGamutRGBMatrix);
|
||||
*outColorSpace = SkColorSpace::MakeRGB(gamma, narrowGamutRGBMatrix, flags);
|
||||
} else {
|
||||
// Unknown color gamut
|
||||
return false;
|
||||
@ -335,7 +336,7 @@ static bool parse_option_gpu_color(const SkString& value,
|
||||
*outColorType = kRGBA_F16_SkColorType;
|
||||
return true;
|
||||
}
|
||||
if (commands[0].equals("srgb")) {
|
||||
if (commands[0].equals("srgb") || commands[0].equals("srgbnl")) {
|
||||
*outColorType = kRGBA_8888_SkColorType;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user