skia2/bench/ResultsWriter.cpp
scroggo f01a6c3663 In Android framework, make tools depend on jsoncpp
Always build the tools with JSON, but either build our own
or use the system's.

Rename skia_build_json_writer to skia_use_system_jsoncpp,
since we now always build with JSON.

Remove SK_BUILD_JSON_WRITER, which was only there so
we could build without JSON it in the framework.

BUG=skia:2448
R=djsollen@google.com, reed@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/303913002
2014-06-18 10:31:40 -07:00

31 lines
778 B
C++

/*
* 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;
}
}