Add gamma_correct option field to dm.json
E.g.
{
"max_rss_MB" : 23,
"results" : [
{
"key" : {
"config" : "pdf",
"name" : "gamma",
"source_type" : "gm"
},
"md5" : "c5dfb531f4d76c77c3305b6a04733262",
"options" : {
"ext" : "pdf",
"gamma_correct" : false
}
},
{
"key" : {
"config" : "8888",
"name" : "gamma",
"source_type" : "gm"
},
"md5" : "6177860ed24106446d3a9087527e67bf",
"options" : {
"ext" : "png",
"gamma_correct" : false
}
},
{
"key" : {
"config" : "f16",
"name" : "gamma",
"source_type" : "gm"
},
"md5" : "213f80145953ecd4c71e0612447b2ad9",
"options" : {
"ext" : "png",
"gamma_correct" : true
}
}
]
}
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1741973002
Review URL: https://codereview.chromium.org/1741973002
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 48aaea7..9173bb7 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1053,12 +1053,19 @@
const char* ext,
SkStream* data, size_t len,
const SkBitmap* bitmap) {
+ bool gammaCorrect = false;
+ if (bitmap) {
+ gammaCorrect = bitmap->profileType() == kSRGB_SkColorProfileType
+ || bitmap-> colorType() == kRGBA_F16_SkColorType;
+ }
+
JsonWriter::BitmapResult result;
result.name = task.src->name();
result.config = task.sink.tag;
result.sourceType = task.src.tag;
result.sourceOptions = task.src.options;
result.ext = ext;
+ result.gammaCorrect = gammaCorrect;
result.md5 = md5;
JsonWriter::AddBitmapResult(result);