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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |