| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
| 10 #include "SkOSFile.h" | 10 #include "SkOSFile.h" |
| 11 #include "SkRunnable.h" | 11 #include "SkRunnable.h" |
| 12 #include "SkSize.h" | 12 #include "SkSize.h" |
| 13 #include "SkStream.h" | 13 #include "SkStream.h" |
| 14 #include "SkTDict.h" | 14 #include "SkTDict.h" |
| 15 #include "SkTaskGroup.h" | 15 #include "SkTaskGroup.h" |
| 16 | 16 |
| 17 // from the tools directory for replace_char(...) | 17 // from the tools directory for replace_char(...) |
| 18 #include "picture_utils.h" | 18 #include "picture_utils.h" |
| 19 | 19 |
| 20 #include "SkDiffContext.h" | 20 #include "SkDiffContext.h" |
| 21 #include "SkImageDiffer.h" | 21 #include "SkImageDiffer.h" |
| 22 #include "skpdiff_util.h" | 22 #include "skpdiff_util.h" |
| 23 | 23 |
| 24 SkDiffContext::SkDiffContext() { | 24 SkDiffContext::SkDiffContext() { |
| 25 fDiffers = NULL; | 25 fDiffers = nullptr; |
| 26 fDifferCount = 0; | 26 fDifferCount = 0; |
| 27 } | 27 } |
| 28 | 28 |
| 29 SkDiffContext::~SkDiffContext() { | 29 SkDiffContext::~SkDiffContext() { |
| 30 if (fDiffers) { | 30 if (fDiffers) { |
| 31 delete[] fDiffers; | 31 delete[] fDiffers; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 void SkDiffContext::setAlphaMaskDir(const SkString& path) { | 35 void SkDiffContext::setAlphaMaskDir(const SkString& path) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 void SkDiffContext::setLongNames(const bool useLongNames) { | 53 void SkDiffContext::setLongNames(const bool useLongNames) { |
| 54 longNames = useLongNames; | 54 longNames = useLongNames; |
| 55 } | 55 } |
| 56 | 56 |
| 57 void SkDiffContext::setDiffers(const SkTDArray<SkImageDiffer*>& differs) { | 57 void SkDiffContext::setDiffers(const SkTDArray<SkImageDiffer*>& differs) { |
| 58 // Delete whatever the last array of differs was | 58 // Delete whatever the last array of differs was |
| 59 if (fDiffers) { | 59 if (fDiffers) { |
| 60 delete[] fDiffers; | 60 delete[] fDiffers; |
| 61 fDiffers = NULL; | 61 fDiffers = nullptr; |
| 62 fDifferCount = 0; | 62 fDifferCount = 0; |
| 63 } | 63 } |
| 64 | 64 |
| 65 // Copy over the new differs | 65 // Copy over the new differs |
| 66 fDifferCount = differs.count(); | 66 fDifferCount = differs.count(); |
| 67 fDiffers = new SkImageDiffer* [fDifferCount]; | 67 fDiffers = new SkImageDiffer* [fDifferCount]; |
| 68 differs.copy(fDiffers); | 68 differs.copy(fDiffers); |
| 69 } | 69 } |
| 70 | 70 |
| 71 static SkString get_common_prefix(const SkString& a, const SkString& b) { | 71 static SkString get_common_prefix(const SkString& a, const SkString& b) { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 for (int i = 0; i < cntColumns; i++) { | 420 for (int i = 0; i < cntColumns; i++) { |
| 421 SkString str; | 421 SkString str; |
| 422 str.printf(", %f", values[i]); | 422 str.printf(", %f", values[i]); |
| 423 stream.writeText(str.c_str()); | 423 stream.writeText(str.c_str()); |
| 424 } | 424 } |
| 425 stream.writeText("\n"); | 425 stream.writeText("\n"); |
| 426 | 426 |
| 427 currentRecord = iter2.next(); | 427 currentRecord = iter2.next(); |
| 428 } | 428 } |
| 429 } | 429 } |
| OLD | NEW |