OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm_expectations.h" | 8 #include "gm_expectations.h" |
9 #include "SkBitmapHasher.h" | 9 #include "SkBitmapHasher.h" |
10 #include "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 Json::Value jsonTypeValuePair; | 102 Json::Value jsonTypeValuePair; |
103 if (fIsValid) { | 103 if (fIsValid) { |
104 jsonTypeValuePair.append(Json::Value(kJsonKey_Hashtype_Bitmap_64bitM
D5)); | 104 jsonTypeValuePair.append(Json::Value(kJsonKey_Hashtype_Bitmap_64bitM
D5)); |
105 jsonTypeValuePair.append(Json::UInt64(fHashDigest)); | 105 jsonTypeValuePair.append(Json::UInt64(fHashDigest)); |
106 } else { | 106 } else { |
107 jsonTypeValuePair.append(Json::Value("INVALID")); | 107 jsonTypeValuePair.append(Json::Value("INVALID")); |
108 } | 108 } |
109 return jsonTypeValuePair; | 109 return jsonTypeValuePair; |
110 } | 110 } |
111 | 111 |
| 112 SkString GmResultDigest::getHashType() const { |
| 113 // TODO(epoger): The current implementation assumes that the |
| 114 // result digest is always of type kJsonKey_Hashtype_Bitmap_64bitMD5 |
| 115 return SkString(kJsonKey_Hashtype_Bitmap_64bitMD5); |
| 116 } |
| 117 |
| 118 SkString GmResultDigest::getDigestValue() const { |
| 119 // TODO(epoger): The current implementation assumes that the |
| 120 // result digest is always of type kJsonKey_Hashtype_Bitmap_64bitMD5 |
| 121 SkString retval; |
| 122 retval.appendU64(fHashDigest); |
| 123 return retval; |
| 124 } |
| 125 |
112 | 126 |
113 // Expectations class... | 127 // Expectations class... |
114 | 128 |
115 Expectations::Expectations(bool ignoreFailure) { | 129 Expectations::Expectations(bool ignoreFailure) { |
116 fIgnoreFailure = ignoreFailure; | 130 fIgnoreFailure = ignoreFailure; |
117 } | 131 } |
118 | 132 |
119 Expectations::Expectations(const SkBitmap& bitmap, bool ignoreFailure) { | 133 Expectations::Expectations(const SkBitmap& bitmap, bool ignoreFailure) { |
120 fBitmap = bitmap; | 134 fBitmap = bitmap; |
121 fIgnoreFailure = ignoreFailure; | 135 fIgnoreFailure = ignoreFailure; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 Json::Reader reader; | 263 Json::Reader reader; |
250 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { | 264 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { |
251 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath); | 265 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath); |
252 DEBUGFAIL_SEE_STDERR; | 266 DEBUGFAIL_SEE_STDERR; |
253 return false; | 267 return false; |
254 } | 268 } |
255 return true; | 269 return true; |
256 } | 270 } |
257 | 271 |
258 } | 272 } |
OLD | NEW |