| 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 * TODO(epoger): Combine this with tools/image_expectations.h, or eliminate one
of the two. | 7 * TODO(epoger): Combine this with tools/image_expectations.h, or eliminate one
of the two. |
| 8 */ | 8 */ |
| 9 #ifndef gm_expectations_DEFINED | 9 #ifndef gm_expectations_DEFINED |
| 10 #define gm_expectations_DEFINED | 10 #define gm_expectations_DEFINED |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 * Returns true iff resultDigest matches any allowed result, | 140 * Returns true iff resultDigest matches any allowed result, |
| 141 * regardless of fIgnoreFailure. (The caller can check | 141 * regardless of fIgnoreFailure. (The caller can check |
| 142 * that separately.) | 142 * that separately.) |
| 143 */ | 143 */ |
| 144 bool match(GmResultDigest resultDigest) const; | 144 bool match(GmResultDigest resultDigest) const; |
| 145 | 145 |
| 146 /** | 146 /** |
| 147 * If this Expectation is based on a single SkBitmap, return a | 147 * If this Expectation is based on a single SkBitmap, return a |
| 148 * pointer to that SkBitmap. Otherwise (if the Expectation is | 148 * pointer to that SkBitmap. Otherwise (if the Expectation is |
| 149 * empty, or if it was based on a list of checksums rather | 149 * empty, or if it was based on a list of checksums rather |
| 150 * than a single bitmap), returns NULL. | 150 * than a single bitmap), returns nullptr. |
| 151 */ | 151 */ |
| 152 const SkBitmap *asBitmap() const { | 152 const SkBitmap *asBitmap() const { |
| 153 return (kUnknown_SkColorType == fBitmap.colorType()) ? NULL : &fBitm
ap; | 153 return (kUnknown_SkColorType == fBitmap.colorType()) ? nullptr : &fB
itmap; |
| 154 } | 154 } |
| 155 | 155 |
| 156 /** | 156 /** |
| 157 * Return a JSON representation of the expectations. | 157 * Return a JSON representation of the expectations. |
| 158 */ | 158 */ |
| 159 Json::Value asJsonValue() const; | 159 Json::Value asJsonValue() const; |
| 160 | 160 |
| 161 private: | 161 private: |
| 162 const static bool kDefaultIgnoreFailure = false; | 162 const static bool kDefaultIgnoreFailure = false; |
| 163 | 163 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 * Returns true if successful. | 220 * Returns true if successful. |
| 221 */ | 221 */ |
| 222 static bool Parse(const char *jsonPath, Json::Value *jsonRoot); | 222 static bool Parse(const char *jsonPath, Json::Value *jsonRoot); |
| 223 | 223 |
| 224 Json::Value fJsonRoot; | 224 Json::Value fJsonRoot; |
| 225 Json::Value fJsonExpectedResults; | 225 Json::Value fJsonExpectedResults; |
| 226 }; | 226 }; |
| 227 | 227 |
| 228 } | 228 } |
| 229 #endif | 229 #endif |
| OLD | NEW |