also tag DM results with color and alpha type

This can be nice to slice by, and helps if you can't exactly remember
the difference between things like "glesrgb" and "glessrgb".

Change-Id: Ib54d29f4c2066e01bd7c4f0b445507f7a65f4f40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/198180
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
Mike Klein 2019-03-06 09:57:49 -06:00 committed by Skia Commit-Bot
parent cb4eb612f0
commit 0abbaca9a5
3 changed files with 12 additions and 3 deletions

View File

@ -1251,7 +1251,6 @@ struct Task {
const char* ext,
SkStream* data, size_t len,
const SkBitmap* bitmap) {
SkColorSpace* cs = bitmap ? bitmap->info().colorSpace() : nullptr;
JsonWriter::BitmapResult result;
result.name = task.src->name();
@ -1259,9 +1258,13 @@ struct Task {
result.sourceType = task.src.tag;
result.sourceOptions = task.src.options;
result.ext = ext;
result.gamut = identify_gamut(cs);
result.transferFn = identify_transfer_fn(cs);
result.md5 = md5;
if (bitmap) {
result.gamut = identify_gamut (bitmap->colorSpace());
result.transferFn = identify_transfer_fn (bitmap->colorSpace());
result.colorType = sk_tool_utils::colortype_name(bitmap->colorType ());
result.alphaType = sk_tool_utils::alphatype_name(bitmap->alphaType ());
}
JsonWriter::AddBitmapResult(result);
// If an MD5 is uninteresting, we want it noted in the JSON file,

View File

@ -85,6 +85,8 @@ void JsonWriter::DumpJson() {
writer.appendString("ext" , gBitmapResults[i].ext.c_str());
writer.appendString("gamut", gBitmapResults[i].gamut.c_str());
writer.appendString("transfer_fn", gBitmapResults[i].transferFn.c_str());
writer.appendString("color_type", gBitmapResults[i].colorType.c_str());
writer.appendString("alpha_type", gBitmapResults[i].alphaType.c_str());
writer.endObject(); // options
writer.appendString("md5", gBitmapResults[i].md5.c_str());
@ -147,6 +149,8 @@ bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) {
br.ext = options["ext"].as<StringValue>().begin();
br.gamut = options["gamut"].as<StringValue>().begin();
br.transferFn = options["transfer_fn"].as<StringValue>().begin();
br.colorType = options["color_type"].as<StringValue>().begin();
br.alphaType = options["alpha_type"].as<StringValue>().begin();
br.md5 = (*r)["md5"].as<StringValue>().begin();
if (const StringValue* so = key["source_options"]) {

View File

@ -31,6 +31,8 @@ public:
SkString ext; // Extension of file we wrote: "png", "pdf", ...
SkString gamut;
SkString transferFn;
SkString colorType;
SkString alphaType;
};
/**