add gbr --config

If we want to compare CSXform vs. tagged drawing, we should be able to
compare gbr-8888 vs. esgbr.

The spin happens when dump_png() converts to Rec.2020.  This has the
"problem" that Gold and other naive image diff tools will think these
images are bytewise very different but once you look at them they'll
make sense to compare.

(You'd want to ideally diff esgbr with gbr-esrgb, but that config
asserts because it's SkColorSpaceXformCanvas doesn't like transforming
into tagged targets.)

(Yes, I chose "esgbr" to both make sense when you think about it but
also, more importantly, to be completely confusing.)

Bug: skia:8774
Change-Id: I25aae41f8d80c48528891b083d1dcac8dac0d88f
Reviewed-on: https://skia-review.googlesource.com/c/193175
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2019-02-19 06:14:39 -05:00 committed by Skia Commit-Bot
parent 009b92e3aa
commit c7a0916e54

View File

@ -860,6 +860,10 @@ static void push_sink(const SkCommandLineConfig& config, Sink* s) {
ts.tag = config.getTag();
}
static sk_sp<SkColorSpace> rgb_to_gbr() {
return SkColorSpace::MakeSRGB()->makeColorSpin();
}
static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLineConfig* config) {
if (FLAGS_gpu) {
if (const SkCommandLineConfigGpu* gpuConfig = config->asConfigGpu()) {
@ -930,6 +934,7 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi
SINK( "f16", RasterSink, kRGBA_F16_SkColorType, srgbLinear);
SINK( "srgb", RasterSink, kRGBA_8888_SkColorType, srgb );
SINK( "esrgb", RasterSink, kRGBA_F16_SkColorType, srgb );
SINK( "esgbr", RasterSink, kRGBA_F16_SkColorType, rgb_to_gbr());
SINK( "narrow", RasterSink, kRGBA_8888_SkColorType, narrow );
SINK( "enarrow", RasterSink, kRGBA_F16_SkColorType, narrow );
SINK( "p3", RasterSink, kRGBA_8888_SkColorType, p3 );
@ -943,10 +948,6 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi
return nullptr;
}
static sk_sp<SkColorSpace> rgb_to_gbr() {
return SkColorSpace::MakeSRGB()->makeColorSpin();
}
static Sink* create_via(const SkString& tag, Sink* wrapped) {
#define VIA(t, via, ...) if (tag.equals(t)) return new via(__VA_ARGS__)
VIA("gbr", ViaCSXform, wrapped, rgb_to_gbr(), true);