OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "skdiff.h" | 7 #include "skdiff.h" |
8 #include "skdiff_html.h" | 8 #include "skdiff_html.h" |
9 #include "skdiff_utils.h" | 9 #include "skdiff_utils.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 415 |
416 drp->fBase.fFilename = *baseFiles[i]; | 416 drp->fBase.fFilename = *baseFiles[i]; |
417 drp->fBase.fFullPath = basePath; | 417 drp->fBase.fFullPath = basePath; |
418 drp->fBase.fStatus = DiffResource::kExists_Status; | 418 drp->fBase.fStatus = DiffResource::kExists_Status; |
419 | 419 |
420 drp->fComparison.fFilename = *comparisonFiles[j]; | 420 drp->fComparison.fFilename = *comparisonFiles[j]; |
421 drp->fComparison.fFullPath = comparisonPath; | 421 drp->fComparison.fFullPath = comparisonPath; |
422 drp->fComparison.fStatus = DiffResource::kExists_Status; | 422 drp->fComparison.fStatus = DiffResource::kExists_Status; |
423 | 423 |
424 SkAutoDataUnref baseFileBits(read_file(drp->fBase.fFullPath.c_str())
); | 424 SkAutoDataUnref baseFileBits(read_file(drp->fBase.fFullPath.c_str())
); |
425 if (NULL != baseFileBits) { | 425 if (baseFileBits) { |
426 drp->fBase.fStatus = DiffResource::kRead_Status; | 426 drp->fBase.fStatus = DiffResource::kRead_Status; |
427 } | 427 } |
428 SkAutoDataUnref comparisonFileBits(read_file(drp->fComparison.fFullP
ath.c_str())); | 428 SkAutoDataUnref comparisonFileBits(read_file(drp->fComparison.fFullP
ath.c_str())); |
429 if (NULL != comparisonFileBits) { | 429 if (comparisonFileBits) { |
430 drp->fComparison.fStatus = DiffResource::kRead_Status; | 430 drp->fComparison.fStatus = DiffResource::kRead_Status; |
431 } | 431 } |
432 if (NULL == baseFileBits || NULL == comparisonFileBits) { | 432 if (NULL == baseFileBits || NULL == comparisonFileBits) { |
433 if (NULL == baseFileBits) { | 433 if (NULL == baseFileBits) { |
434 drp->fBase.fStatus = DiffResource::kCouldNotRead_Status; | 434 drp->fBase.fStatus = DiffResource::kCouldNotRead_Status; |
435 VERBOSE_STATUS("READ FAIL", ANSI_COLOR_RED, baseFiles[i]); | 435 VERBOSE_STATUS("READ FAIL", ANSI_COLOR_RED, baseFiles[i]); |
436 } | 436 } |
437 if (NULL == comparisonFileBits) { | 437 if (NULL == comparisonFileBits) { |
438 drp->fComparison.fStatus = DiffResource::kCouldNotRead_Statu
s; | 438 drp->fComparison.fStatus = DiffResource::kCouldNotRead_Statu
s; |
439 VERBOSE_STATUS("READ FAIL", ANSI_COLOR_RED, comparisonFiles[
j]); | 439 VERBOSE_STATUS("READ FAIL", ANSI_COLOR_RED, comparisonFiles[
j]); |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 // range [0...255] are wrapped (mod 256). Do the conversion ourselves, to | 794 // range [0...255] are wrapped (mod 256). Do the conversion ourselves, to |
795 // make sure that we only return 0 when there were no failures. | 795 // make sure that we only return 0 when there were no failures. |
796 return (num_failing_results > 255) ? 255 : num_failing_results; | 796 return (num_failing_results > 255) ? 255 : num_failing_results; |
797 } | 797 } |
798 | 798 |
799 #if !defined SK_BUILD_FOR_IOS | 799 #if !defined SK_BUILD_FOR_IOS |
800 int main(int argc, char * const argv[]) { | 800 int main(int argc, char * const argv[]) { |
801 return tool_main(argc, (char**) argv); | 801 return tool_main(argc, (char**) argv); |
802 } | 802 } |
803 #endif | 803 #endif |
OLD | NEW |