Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Side by Side Diff: tools/skimage_main.cpp

Issue 15883004: GM: create GmResultDigest that encapsulates digest type ("bitmap-64bitMD5") and value (12345) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/utils/SkBitmapHasher.h ('K') | « tests/BitmapHasherTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« src/utils/SkBitmapHasher.h ('K') | « tests/BitmapHasherTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698