diff options
Diffstat (limited to 'dm/DMJsonWriter.cpp')
-rw-r--r-- | dm/DMJsonWriter.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/dm/DMJsonWriter.cpp b/dm/DMJsonWriter.cpp index 5317567d68..24b8a58724 100644 --- a/dm/DMJsonWriter.cpp +++ b/dm/DMJsonWriter.cpp @@ -52,11 +52,12 @@ void JsonWriter::DumpJson() { SkAutoMutexAcquire lock(&gBitmapResultLock); for (int i = 0; i < gBitmapResults.count(); i++) { Json::Value result; - result["key"]["name"] = gBitmapResults[i].name.c_str(); - result["key"]["config"] = gBitmapResults[i].config.c_str(); - result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); - result["options"]["ext"] = gBitmapResults[i].ext.c_str(); - result["md5"] = gBitmapResults[i].md5.c_str(); + result["key"]["name"] = gBitmapResults[i].name.c_str(); + result["key"]["config"] = gBitmapResults[i].config.c_str(); + result["key"]["source_type"] = gBitmapResults[i].sourceType.c_str(); + result["options"]["ext"] = gBitmapResults[i].ext.c_str(); + result["options"]["gamma_correct"] = gBitmapResults[i].gammaCorrect; + result["md5"] = gBitmapResults[i].md5.c_str(); // Source options only need to be part of the key if they exist. // Source type by source type, we either always set options or never set options. @@ -110,11 +111,12 @@ bool JsonWriter::ReadJson(const char* path, void(*callback)(BitmapResult)) { BitmapResult br; for (unsigned i = 0; i < results.size(); i++) { const Json::Value& r = results[i]; - br.name = r["key"]["name"].asCString(); - br.config = r["key"]["config"].asCString(); - br.sourceType = r["key"]["source_type"].asCString(); - br.ext = r["options"]["ext"].asCString(); - br.md5 = r["md5"].asCString(); + br.name = r["key"]["name"].asCString(); + br.config = r["key"]["config"].asCString(); + br.sourceType = r["key"]["source_type"].asCString(); + br.ext = r["options"]["ext"].asCString(); + br.gammaCorrect = r["options"]["gamma_correct"].asBool(); + br.md5 = r["md5"].asCString(); if (!r["key"]["source_options"].isNull()) { br.sourceOptions = r["key"]["source_options"].asCString(); |