Add "Narrow" RGB gamut to DM
This is an artificially small color space, for testing rendering with values that fall outside of [0,1]. All of the saturated sRGB colors used in our tests will end up landing outside of [0,1] in this space, so we can verify that nothing that crashes, or produces wildly incorrect results. Of course, many GMs *do* produce wildly incorrect results, but I need to catalog all of those and start figuring out why. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3532 Change-Id: Idb44ee6250f2d7198e634755cd2b1f3bc8f15412 Reviewed-on: https://skia-review.googlesource.com/3532 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
af017418b3
commit
4a6b28ef76
@ -79,7 +79,8 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) {
|
||||
"nonrendering", "null", "nullgpu", "nvpr16", "nvpr4", "nvprdit16", "nvprdit4", "pdf", "skp",
|
||||
"svg", "xps", "angle_d3d11_es2", "angle_gl_es2", "commandbuffer", "mesa", "hwui", "gpuf16",
|
||||
"gpusrgb", "gl", "glnvpr4", "glnvprdit4", "glsrgb", "glmsaa4", "vk", "glinst", "glinst4",
|
||||
"glinstdit4", "glinst16", "glinstdit16", "esinst", "esinst4", "esinstdit4", "glwide"
|
||||
"glinstdit4", "glinst16", "glinstdit16", "esinst", "esinst4", "esinstdit4", "glwide",
|
||||
"glnarrow"
|
||||
});
|
||||
|
||||
SkCommandLineConfigArray configs;
|
||||
@ -134,6 +135,11 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) {
|
||||
REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()->gammaIsLinear());
|
||||
REPORTER_ASSERT(reporter, as_CSB(configs[41]->asConfigGpu()->getColorSpace())->toXYZD50() !=
|
||||
as_CSB(srgbColorSpace)->toXYZD50());
|
||||
REPORTER_ASSERT(reporter, configs[42]->asConfigGpu()->getColorType() == kRGBA_F16_SkColorType);
|
||||
REPORTER_ASSERT(reporter, configs[42]->asConfigGpu()->getColorSpace());
|
||||
REPORTER_ASSERT(reporter, configs[42]->asConfigGpu()->getColorSpace()->gammaIsLinear());
|
||||
REPORTER_ASSERT(reporter, as_CSB(configs[42]->asConfigGpu()->getColorSpace())->toXYZD50() !=
|
||||
as_CSB(srgbColorSpace)->toXYZD50());
|
||||
REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getContextType() ==
|
||||
GrContextFactory::kGL_ContextType);
|
||||
REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getUseInstanced());
|
||||
|
@ -54,6 +54,7 @@ static const struct {
|
||||
{ "gpusrgb", "gpu", "color=srgb" },
|
||||
{ "glsrgb", "gpu", "api=gl,color=srgb" },
|
||||
{ "glwide", "gpu", "api=gl,color=f16_wide" },
|
||||
{ "glnarrow", "gpu", "api=gl,color=f16_narrow" },
|
||||
{ "gpudft", "gpu", "dit=true" },
|
||||
{ "gpudebug", "gpu", "api=debug" },
|
||||
{ "gpunull", "gpu", "api=null" },
|
||||
@ -132,6 +133,7 @@ static const char configExtendedHelp[] =
|
||||
"\t Options:\n"
|
||||
"\t\tsrgb\t\t\tsRGB gamut.\n"
|
||||
"\t\twide\t\t\tWide Gamut RGB.\n"
|
||||
"\t\tnarrow\t\t\tNarrow Gamut RGB.\n"
|
||||
"\tdit\ttype: bool\tdefault: false.\n"
|
||||
"\t Use device independent text.\n"
|
||||
"\tnvpr\ttype: bool\tdefault: false.\n"
|
||||
@ -296,6 +298,18 @@ static bool parse_option_gpu_color(const SkString& value,
|
||||
wideGamutRGBMatrix.set3x3RowMajorf(gWideGamutRGB_toXYZD50);
|
||||
colorSpace = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma,
|
||||
wideGamutRGBMatrix);
|
||||
} else if (commands[1].equals("narrow")) {
|
||||
// NarrowGamut RGB (an artifically smaller than sRGB gamut)
|
||||
SkColorSpacePrimaries primaries ={
|
||||
0.54f, 0.33f, // Rx, Ry
|
||||
0.33f, 0.50f, // Gx, Gy
|
||||
0.25f, 0.20f, // Bx, By
|
||||
0.3127f, 0.3290f, // Wx, Wy
|
||||
};
|
||||
SkMatrix44 narrowGamutRGBMatrix(SkMatrix44::kUninitialized_Constructor);
|
||||
primaries.toXYZD50(&narrowGamutRGBMatrix);
|
||||
colorSpace = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma,
|
||||
narrowGamutRGBMatrix);
|
||||
} else {
|
||||
// Unknown color gamut
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user