| 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.cpp, or eliminate on
e of the two. | 7 * TODO(epoger): Combine this with tools/image_expectations.cpp, or eliminate on
e of the two. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #include "gm_expectations.h" | 10 #include "gm_expectations.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 Json::Value jsonExpectations; | 188 Json::Value jsonExpectations; |
| 189 jsonExpectations[kJsonKey_ExpectedResults_AllowedDigests] = allowedDiges
tArray; | 189 jsonExpectations[kJsonKey_ExpectedResults_AllowedDigests] = allowedDiges
tArray; |
| 190 jsonExpectations[kJsonKey_ExpectedResults_IgnoreFailure] = this->ignore
Failure(); | 190 jsonExpectations[kJsonKey_ExpectedResults_IgnoreFailure] = this->ignore
Failure(); |
| 191 return jsonExpectations; | 191 return jsonExpectations; |
| 192 } | 192 } |
| 193 | 193 |
| 194 // IndividualImageExpectationsSource class... | 194 // IndividualImageExpectationsSource class... |
| 195 | 195 |
| 196 Expectations IndividualImageExpectationsSource::get(const char *testName) co
nst { | 196 Expectations IndividualImageExpectationsSource::get(const char *testName) co
nst { |
| 197 SkString path = SkOSPath::SkPathJoin(fRootDir.c_str(), testName); | 197 SkString path = SkOSPath::Join(fRootDir.c_str(), testName); |
| 198 SkBitmap referenceBitmap; | 198 SkBitmap referenceBitmap; |
| 199 bool decodedReferenceBitmap = | 199 bool decodedReferenceBitmap = |
| 200 SkImageDecoder::DecodeFile(path.c_str(), &referenceBitmap, kN32_SkCo
lorType, | 200 SkImageDecoder::DecodeFile(path.c_str(), &referenceBitmap, kN32_SkCo
lorType, |
| 201 SkImageDecoder::kDecodePixels_Mode, NULL)
; | 201 SkImageDecoder::kDecodePixels_Mode, NULL)
; |
| 202 if (decodedReferenceBitmap) { | 202 if (decodedReferenceBitmap) { |
| 203 return Expectations(referenceBitmap); | 203 return Expectations(referenceBitmap); |
| 204 } else { | 204 } else { |
| 205 return Expectations(); | 205 return Expectations(); |
| 206 } | 206 } |
| 207 } | 207 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 230 size_t size = dataRef.get()->size(); | 230 size_t size = dataRef.get()->size(); |
| 231 Json::Reader reader; | 231 Json::Reader reader; |
| 232 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { | 232 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { |
| 233 SkDebugf("error parsing JSON file %s\n", jsonPath); | 233 SkDebugf("error parsing JSON file %s\n", jsonPath); |
| 234 DEBUGFAIL_SEE_STDERR; | 234 DEBUGFAIL_SEE_STDERR; |
| 235 return false; | 235 return false; |
| 236 } | 236 } |
| 237 return true; | 237 return true; |
| 238 } | 238 } |
| 239 } | 239 } |
| OLD | NEW |