| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 | 7 |
| 8 #include "LazyDecodeBitmap.h" | 8 #include "LazyDecodeBitmap.h" |
| 9 #include "CopyTilesRenderer.h" | 9 #include "CopyTilesRenderer.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 SkString inputFilename = SkOSPath::Basename(inputPath.c_str()); | 360 SkString inputFilename = SkOSPath::Basename(inputPath.c_str()); |
| 361 SkString outputFilename(inputFilename); | 361 SkString outputFilename(inputFilename); |
| 362 sk_tools::replace_char(&outputFilename, '.', '_'); | 362 sk_tools::replace_char(&outputFilename, '.', '_'); |
| 363 outputFilename.append(".png"); | 363 outputFilename.append(".png"); |
| 364 | 364 |
| 365 if (NULL != jsonSummaryPtr) { | 365 if (NULL != jsonSummaryPtr) { |
| 366 sk_tools::ImageDigest imageDigest(*bitmap); | 366 sk_tools::ImageDigest imageDigest(*bitmap); |
| 367 jsonSummaryPtr->add(inputFilename.c_str(), outputFilename.c_str(), i
mageDigest); | 367 jsonSummaryPtr->add(inputFilename.c_str(), outputFilename.c_str(), i
mageDigest); |
| 368 if ((NULL != mismatchPath) && !mismatchPath->isEmpty() && | 368 if ((NULL != mismatchPath) && !mismatchPath->isEmpty() && |
| 369 !jsonSummaryPtr->matchesExpectation(inputFilename.c_str(), image
Digest)) { | 369 !jsonSummaryPtr->getExpectation(inputFilename.c_str()).matches(i
mageDigest)) { |
| 370 success &= sk_tools::write_bitmap_to_disk(*bitmap, *mismatchPath
, NULL, | 370 success &= sk_tools::write_bitmap_to_disk(*bitmap, *mismatchPath
, NULL, |
| 371 outputFilename); | 371 outputFilename); |
| 372 } | 372 } |
| 373 } | 373 } |
| 374 | 374 |
| 375 if ((NULL != writePath) && !writePath->isEmpty()) { | 375 if ((NULL != writePath) && !writePath->isEmpty()) { |
| 376 success &= sk_tools::write_bitmap_to_disk(*bitmap, *writePath, NULL,
outputFilename); | 376 success &= sk_tools::write_bitmap_to_disk(*bitmap, *writePath, NULL,
outputFilename); |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 SkDELETE(bitmap); | 379 SkDELETE(bitmap); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); | 501 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); |
| 502 } | 502 } |
| 503 return 0; | 503 return 0; |
| 504 } | 504 } |
| 505 | 505 |
| 506 #if !defined SK_BUILD_FOR_IOS | 506 #if !defined SK_BUILD_FOR_IOS |
| 507 int main(int argc, char * const argv[]) { | 507 int main(int argc, char * const argv[]) { |
| 508 return tool_main(argc, (char**) argv); | 508 return tool_main(argc, (char**) argv); |
| 509 } | 509 } |
| 510 #endif | 510 #endif |
| OLD | NEW |