| 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 | 7 |
| 8 #include <cstring> | |
| 9 | |
| 10 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 11 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
| 12 | 10 |
| 13 #include "SkImageDiffer.h" | 11 #include "SkImageDiffer.h" |
| 14 | |
| 15 #include "skpdiff_util.h" | 12 #include "skpdiff_util.h" |
| 16 | 13 |
| 17 | 14 |
| 18 SkImageDiffer::SkImageDiffer() | 15 SkImageDiffer::SkImageDiffer() |
| 19 : fIsGood(true) { | 16 : fIsGood(true) { |
| 20 | 17 |
| 21 } | 18 } |
| 22 | 19 |
| 23 SkImageDiffer::~SkImageDiffer() { | 20 SkImageDiffer::~SkImageDiffer() { |
| 24 | 21 |
| 25 } | 22 } |
| 26 | 23 |
| 27 int SkImageDiffer::queueDiffOfFile(const char baseline[], const char test[]) { | 24 int SkImageDiffer::queueDiffOfFile(const char baseline[], const char test[]) { |
| 28 SkBitmap baselineBitmap; | 25 SkBitmap baselineBitmap; |
| 29 SkBitmap testBitmap; | 26 SkBitmap testBitmap; |
| 30 if (!SkImageDecoder::DecodeFile(baseline, &baselineBitmap)) { | 27 if (!SkImageDecoder::DecodeFile(baseline, &baselineBitmap)) { |
| 31 SkDebugf("Failed to load bitmap \"%s\"\n", baseline); | 28 SkDebugf("Failed to load bitmap \"%s\"\n", baseline); |
| 32 return -1; | 29 return -1; |
| 33 } | 30 } |
| 34 if (!SkImageDecoder::DecodeFile(test, &testBitmap)) { | 31 if (!SkImageDecoder::DecodeFile(test, &testBitmap)) { |
| 35 SkDebugf("Failed to load bitmap \"%s\"\n", test); | 32 SkDebugf("Failed to load bitmap \"%s\"\n", test); |
| 36 return -1; | 33 return -1; |
| 37 } | 34 } |
| 38 return this->queueDiff(&baselineBitmap, &testBitmap); | 35 return this->queueDiff(&baselineBitmap, &testBitmap); |
| 39 } | 36 } |
| OLD | NEW |