Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: tools/render_pictures_main.cpp

Issue 493363002: create sk_tools::Expectation class, similar to skiagm::Expectations class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: properly handle ignoreFailure using sk_tools::Expectation class, with unittest to exercise Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/image_expectations.cpp ('k') | tools/tests/render_pictures_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « tools/image_expectations.cpp ('k') | tools/tests/render_pictures_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698