diff options
author | djsollen <djsollen@google.com> | 2015-04-03 07:24:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-03 07:24:48 -0700 |
commit | 54416de52381ac11dd755100a8025debf595873a (patch) | |
tree | bcbc883686b9e1827eeeb9965d9254585354d17e /dm/DMJsonWriter.cpp | |
parent | 0a7e69cb9b4e3929d659891d152a2c0b59bff4e0 (diff) |
Update DM to allow Src's to have optional options.
Review URL: https://codereview.chromium.org/1059513002
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 c017dde5b5..c8334c5cce 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["key"]["source_options"] = gBitmapResults[i].sourceOptions.c_str(); + result["options"]["ext"] = gBitmapResults[i].ext.c_str(); + result["md5"] = gBitmapResults[i].md5.c_str(); root["results"].append(result); } @@ -104,11 +105,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.sourceOptions = r["key"]["source_options"].asCString(); + br.ext = r["options"]["ext"].asCString(); + br.md5 = r["md5"].asCString(); callback(br); } return true; |