| Index: gm/gm_expectations.cpp
|
| diff --git a/gm/gm_expectations.cpp b/gm/gm_expectations.cpp
|
| index 28493ddd9e9c26f5fa5d5596c8da53432902d527..d2d629e8d3d6f61c0c72497d0415742ea710a5c1 100644
|
| --- a/gm/gm_expectations.cpp
|
| +++ b/gm/gm_expectations.cpp
|
| @@ -31,6 +31,7 @@ const static char kJsonKey_Hashtype_Bitmap_64bitMD5[] = "bitmap-64bitMD5";
|
|
|
| namespace skiagm {
|
|
|
| +#ifdef SK_BUILD_JSON_WRITER
|
| Json::Value CreateJsonTree(Json::Value expectedResults,
|
| Json::Value actualResultsFailed,
|
| Json::Value actualResultsFailureIgnored,
|
| @@ -46,7 +47,7 @@ namespace skiagm {
|
| root[kJsonKey_ExpectedResults] = expectedResults;
|
| return root;
|
| }
|
| -
|
| +#endif
|
|
|
| // GmResultDigest class...
|
|
|
| @@ -54,6 +55,7 @@ namespace skiagm {
|
| fIsValid = SkBitmapHasher::ComputeDigest(bitmap, &fHashDigest);
|
| }
|
|
|
| +#ifdef SK_BUILD_JSON_WRITER
|
| GmResultDigest::GmResultDigest(const Json::Value &jsonTypeValuePair) {
|
| fIsValid = false;
|
| if (!jsonTypeValuePair.isArray()) {
|
| @@ -78,6 +80,7 @@ namespace skiagm {
|
| }
|
| }
|
| }
|
| +#endif
|
|
|
| bool GmResultDigest::isValid() const {
|
| return fIsValid;
|
| @@ -89,6 +92,7 @@ namespace skiagm {
|
| return (this->fIsValid && other.fIsValid && (this->fHashDigest == other.fHashDigest));
|
| }
|
|
|
| +#ifdef SK_BUILD_JSON_WRITER
|
| Json::Value GmResultDigest::asJsonTypeValuePair() const {
|
| // TODO(epoger): The current implementation assumes that the
|
| // result digest is always of type kJsonKey_Hashtype_Bitmap_64bitMD5
|
| @@ -101,6 +105,7 @@ namespace skiagm {
|
| }
|
| return jsonTypeValuePair;
|
| }
|
| +#endif
|
|
|
| SkString GmResultDigest::getHashType() const {
|
| // TODO(epoger): The current implementation assumes that the
|
| @@ -135,6 +140,7 @@ namespace skiagm {
|
| fAllowedResultDigests.push_back(bitmapAndDigest.fDigest);
|
| }
|
|
|
| +#ifdef SK_BUILD_JSON_WRITER
|
| Expectations::Expectations(Json::Value jsonElement) {
|
| if (jsonElement.empty()) {
|
| fIgnoreFailure = kDefaultIgnoreFailure;
|
| @@ -167,6 +173,7 @@ namespace skiagm {
|
| }
|
| }
|
| }
|
| +#endif
|
|
|
| bool Expectations::match(GmResultDigest actualGmResultDigest) const {
|
| for (int i=0; i < this->fAllowedResultDigests.count(); i++) {
|
| @@ -178,6 +185,7 @@ namespace skiagm {
|
| return false;
|
| }
|
|
|
| +#ifdef SK_BUILD_JSON_WRITER
|
| Json::Value Expectations::asJsonValue() const {
|
| Json::Value allowedDigestArray;
|
| if (!this->fAllowedResultDigests.empty()) {
|
| @@ -191,7 +199,7 @@ namespace skiagm {
|
| jsonExpectations[kJsonKey_ExpectedResults_IgnoreFailure] = this->ignoreFailure();
|
| return jsonExpectations;
|
| }
|
| -
|
| +#endif
|
|
|
| // IndividualImageExpectationsSource class...
|
|
|
| @@ -211,6 +219,7 @@ namespace skiagm {
|
| }
|
|
|
|
|
| +#ifdef SK_BUILD_JSON_WRITER
|
| // JsonExpectationsSource class...
|
|
|
| JsonExpectationsSource::JsonExpectationsSource(const char *jsonPath) {
|
| @@ -240,5 +249,5 @@ namespace skiagm {
|
| }
|
| return true;
|
| }
|
| -
|
| +#endif
|
| }
|
|
|