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

Side by Side Diff: gm/gm_expectations.h

Issue 14265010: Make SkSHA1 and SkM5 use common SkDigestHash result type (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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
OLDNEW
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 #ifndef gm_expectations_DEFINED 7 #ifndef gm_expectations_DEFINED
8 #define gm_expectations_DEFINED 8 #define gm_expectations_DEFINED
9 9
10 #include <stdarg.h> 10 #include <stdarg.h>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 fIgnoreFailure = ignoreFailure; 87 fIgnoreFailure = ignoreFailure;
88 } 88 }
89 89
90 /** 90 /**
91 * Expect exactly one image (appropriate for the case when we 91 * Expect exactly one image (appropriate for the case when we
92 * are comparing against a single PNG file). 92 * are comparing against a single PNG file).
93 */ 93 */
94 Expectations(const SkBitmap& bitmap, bool ignoreFailure=kDefaultIgnoreFa ilure) { 94 Expectations(const SkBitmap& bitmap, bool ignoreFailure=kDefaultIgnoreFa ilure) {
95 fBitmap = bitmap; 95 fBitmap = bitmap;
96 fIgnoreFailure = ignoreFailure; 96 fIgnoreFailure = ignoreFailure;
97 SkHashDigest digest; 97 SkUInt64HashDigest digest;
98 // TODO(epoger): Better handling for error returned by ComputeDigest ()? 98 // TODO(epoger): Better handling for error returned by ComputeDigest ()?
99 // For now, we just report a digest of 0 in error cases, like before . 99 // For now, we just report a digest of 0 in error cases, like before .
100 if (!SkBitmapHasher::ComputeDigest(bitmap, &digest)) { 100 if (!SkBitmapHasher::ComputeDigest(bitmap, &digest)) {
101 digest = 0; 101 digest = 0;
102 } 102 }
103 fAllowedChecksums.push_back() = digest; 103 fAllowedChecksums.push_back() = digest;
104 } 104 }
105 105
106 /** 106 /**
107 * Create Expectations from a JSON element as found within the 107 * Create Expectations from a JSON element as found within the
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 363 }
364 return true; 364 return true;
365 } 365 }
366 366
367 Json::Value fJsonRoot; 367 Json::Value fJsonRoot;
368 Json::Value fJsonExpectedResults; 368 Json::Value fJsonExpectedResults;
369 }; 369 };
370 370
371 } 371 }
372 #endif 372 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698