| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkBitmapHasher.h" | 10 #include "SkBitmapHasher.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 skiagm::Expectations jsExpectation = gJsonExpectations->get(filename); | 213 skiagm::Expectations jsExpectation = gJsonExpectations->get(filename); |
| 214 if (jsExpectation.empty()) { | 214 if (jsExpectation.empty()) { |
| 215 if (failureArray != NULL) { | 215 if (failureArray != NULL) { |
| 216 failureArray->push_back().printf("decoded %s, but could not find exp
ectation.", | 216 failureArray->push_back().printf("decoded %s, but could not find exp
ectation.", |
| 217 filename); | 217 filename); |
| 218 } | 218 } |
| 219 return false; | 219 return false; |
| 220 } | 220 } |
| 221 | 221 |
| 222 SkHashDigest checksum; | 222 uint64_t checksum; |
| 223 if (!SkBitmapHasher::ComputeDigest(bitmap, &checksum)) { | 223 if (!SkBitmapHasher::ComputeDigest(bitmap, &checksum)) { |
| 224 if (failureArray != NULL) { | 224 if (failureArray != NULL) { |
| 225 failureArray->push_back().printf("decoded %s, but could not create a
checksum.", | 225 failureArray->push_back().printf("decoded %s, but could not create a
checksum.", |
| 226 filename); | 226 filename); |
| 227 } | 227 } |
| 228 return false; | 228 return false; |
| 229 } | 229 } |
| 230 | 230 |
| 231 if (jsExpectation.match(checksum)) { | 231 if (jsExpectation.match(checksum)) { |
| 232 return true; | 232 return true; |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 } | 565 } |
| 566 | 566 |
| 567 return failed ? -1 : 0; | 567 return failed ? -1 : 0; |
| 568 } | 568 } |
| 569 | 569 |
| 570 #if !defined SK_BUILD_FOR_IOS | 570 #if !defined SK_BUILD_FOR_IOS |
| 571 int main(int argc, char * const argv[]) { | 571 int main(int argc, char * const argv[]) { |
| 572 return tool_main(argc, (char**) argv); | 572 return tool_main(argc, (char**) argv); |
| 573 } | 573 } |
| 574 #endif | 574 #endif |
| OLD | NEW |