| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 */ | 151 */ |
| 152 bool match(GmResultDigest resultDigest) const; | 152 bool match(GmResultDigest resultDigest) const; |
| 153 | 153 |
| 154 /** | 154 /** |
| 155 * If this Expectation is based on a single SkBitmap, return a | 155 * If this Expectation is based on a single SkBitmap, return a |
| 156 * pointer to that SkBitmap. Otherwise (if the Expectation is | 156 * pointer to that SkBitmap. Otherwise (if the Expectation is |
| 157 * empty, or if it was based on a list of checksums rather | 157 * empty, or if it was based on a list of checksums rather |
| 158 * than a single bitmap), returns NULL. | 158 * than a single bitmap), returns NULL. |
| 159 */ | 159 */ |
| 160 const SkBitmap *asBitmap() const { | 160 const SkBitmap *asBitmap() const { |
| 161 return (SkBitmap::kNo_Config == fBitmap.config()) ? NULL : &fBitmap; | 161 return (kUnknown_SkColorType == fBitmap.colorType()) ? NULL : &fBitm
ap; |
| 162 } | 162 } |
| 163 | 163 |
| 164 #ifdef SK_BUILD_JSON_WRITER | 164 #ifdef SK_BUILD_JSON_WRITER |
| 165 /** | 165 /** |
| 166 * Return a JSON representation of the expectations. | 166 * Return a JSON representation of the expectations. |
| 167 */ | 167 */ |
| 168 Json::Value asJsonValue() const; | 168 Json::Value asJsonValue() const; |
| 169 #endif | 169 #endif |
| 170 | 170 |
| 171 private: | 171 private: |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 */ | 234 */ |
| 235 static bool Parse(const char *jsonPath, Json::Value *jsonRoot); | 235 static bool Parse(const char *jsonPath, Json::Value *jsonRoot); |
| 236 | 236 |
| 237 Json::Value fJsonRoot; | 237 Json::Value fJsonRoot; |
| 238 Json::Value fJsonExpectedResults; | 238 Json::Value fJsonExpectedResults; |
| 239 }; | 239 }; |
| 240 #endif // SK_BUILD_JSON_WRITER | 240 #endif // SK_BUILD_JSON_WRITER |
| 241 | 241 |
| 242 } | 242 } |
| 243 #endif | 243 #endif |
| OLD | NEW |