summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/skia/bench/ResultsWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/skia/bench/ResultsWriter.cpp')
-rw-r--r--chromium/third_party/skia/bench/ResultsWriter.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/chromium/third_party/skia/bench/ResultsWriter.cpp b/chromium/third_party/skia/bench/ResultsWriter.cpp
new file mode 100644
index 00000000000..08f11c190fb
--- /dev/null
+++ b/chromium/third_party/skia/bench/ResultsWriter.cpp
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Helper functions for result writing operations.
+ */
+
+#include "ResultsWriter.h"
+
+Json::Value* SkFindNamedNode(Json::Value* root, const char name[]) {
+ Json::Value* search_results = NULL;
+ for(Json::Value::iterator iter = root->begin();
+ iter!= root->end(); ++iter) {
+ if(SkString(name).equals((*iter)["name"].asCString())) {
+ search_results = &(*iter);
+ break;
+ }
+ }
+
+ if(search_results != NULL) {
+ return search_results;
+ } else {
+ Json::Value* new_val = &(root->append(Json::Value()));
+ (*new_val)["name"] = name;
+ return new_val;
+ }
+}
+