Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1278)

Unified Diff: dm/DMWriteTask.cpp

Issue 586533005: Add a "mode" tag to key in DM json output. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMWriteTask.cpp
diff --git a/dm/DMWriteTask.cpp b/dm/DMWriteTask.cpp
index fd8396cce12c199276d0960727b186128a946f42..08feb98431242216eef3f7f047093803a52bb0a1 100644
--- a/dm/DMWriteTask.cpp
+++ b/dm/DMWriteTask.cpp
@@ -78,10 +78,11 @@ static SkString get_md5(const void* ptr, size_t len) {
}
struct JsonData {
- SkString name; // E.g. "ninepatch-stretch", "desk-gws_skp"
- SkString config; // "gpu", "8888"
- SkString sourceType; // "GM", "SKP"
- SkString md5; // In ASCII, so 32 bytes long.
+ SkString name; // E.g. "ninepatch-stretch", "desk-gws_skp"
+ SkString config; // "gpu", "8888"
+ SkString mode; // "direct", "default-tilegrid", "pipe"
+ SkString sourceType; // "GM", "SKP"
+ SkString md5; // In ASCII, so 32 bytes long.
};
SkTArray<JsonData> gJsonData;
SK_DECLARE_STATIC_MUTEX(gJsonDataLock);
@@ -94,7 +95,14 @@ void WriteTask::draw() {
: get_md5(fBitmap.getPixels(), fBitmap.getSize());
}
- JsonData entry = { fBaseName, fSuffixes[0], fSourceType, md5 };
+ SkASSERT(fSuffixes.count() > 0);
+ SkString config = fSuffixes.back();
+ SkString mode("direct");
+ if (fSuffixes.count() > 1) {
+ mode = fSuffixes.fromBack(1);
+ }
+
+ JsonData entry = { fBaseName, config, mode, fSourceType, md5 };
{
SkAutoMutexAcquire lock(&gJsonDataLock);
gJsonData.push_back(entry);
@@ -176,6 +184,7 @@ void WriteTask::DumpJson() {
Json::Value result;
result["key"]["name"] = gJsonData[i].name.c_str();
result["key"]["config"] = gJsonData[i].config.c_str();
+ result["key"]["mode"] = gJsonData[i].mode.c_str();
result["options"]["source_type"] = gJsonData[i].sourceType.c_str();
result["md5"] = gJsonData[i].md5.c_str();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698