| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 SkDebugf("Number of pixels with max diff of %i is %i\n", i, diff
s[i]); | 347 SkDebugf("Number of pixels with max diff of %i is %i\n", i, diff
s[i]); |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 | 351 |
| 352 if (FLAGS_writeWholeImage) { | 352 if (FLAGS_writeWholeImage) { |
| 353 sk_tools::force_all_opaque(*bitmap); | 353 sk_tools::force_all_opaque(*bitmap); |
| 354 | 354 |
| 355 SkString inputFilename = SkOSPath::Basename(inputPath.c_str()); | 355 SkString inputFilename = SkOSPath::Basename(inputPath.c_str()); |
| 356 SkString outputFilename(inputFilename); | 356 SkString outputFilename(inputFilename); |
| 357 sk_tools::replace_char(&outputFilename, '.', '_'); | 357 outputFilename.replace('.', '_'); |
| 358 outputFilename.append(".png"); | 358 outputFilename.append(".png"); |
| 359 | 359 |
| 360 if (jsonSummaryPtr) { | 360 if (jsonSummaryPtr) { |
| 361 sk_tools::ImageDigest imageDigest(*bitmap); | 361 sk_tools::ImageDigest imageDigest(*bitmap); |
| 362 jsonSummaryPtr->add(inputFilename.c_str(), outputFilename.c_str(), i
mageDigest); | 362 jsonSummaryPtr->add(inputFilename.c_str(), outputFilename.c_str(), i
mageDigest); |
| 363 if ((mismatchPath) && !mismatchPath->isEmpty() && | 363 if ((mismatchPath) && !mismatchPath->isEmpty() && |
| 364 !jsonSummaryPtr->getExpectation(inputFilename.c_str()).matches(i
mageDigest)) { | 364 !jsonSummaryPtr->getExpectation(inputFilename.c_str()).matches(i
mageDigest)) { |
| 365 success &= sk_tools::write_bitmap_to_disk(*bitmap, *mismatchPath
, NULL, | 365 success &= sk_tools::write_bitmap_to_disk(*bitmap, *mismatchPath
, NULL, |
| 366 outputFilename); | 366 outputFilename); |
| 367 } | 367 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); | 506 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); |
| 507 } | 507 } |
| 508 return 0; | 508 return 0; |
| 509 } | 509 } |
| 510 | 510 |
| 511 #if !defined SK_BUILD_FOR_IOS | 511 #if !defined SK_BUILD_FOR_IOS |
| 512 int main(int argc, char * const argv[]) { | 512 int main(int argc, char * const argv[]) { |
| 513 return tool_main(argc, (char**) argv); | 513 return tool_main(argc, (char**) argv); |
| 514 } | 514 } |
| 515 #endif | 515 #endif |
| OLD | NEW |