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" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 if (alphaMaskPending | 115 if (alphaMaskPending |
116 && SkImageDiffer::RESULT_CORRECT != diffData.fResult.result | 116 && SkImageDiffer::RESULT_CORRECT != diffData.fResult.result |
117 && !diffData.fResult.poiAlphaMask.empty() | 117 && !diffData.fResult.poiAlphaMask.empty() |
118 && !newRecord->fCommonName.isEmpty()) { | 118 && !newRecord->fCommonName.isEmpty()) { |
119 | 119 |
120 newRecord->fDifferencePath = SkOSPath::SkPathJoin(fDifferenceDir.c_s
tr(), | 120 newRecord->fDifferencePath = SkOSPath::SkPathJoin(fDifferenceDir.c_s
tr(), |
121 newRecord->fCommon
Name.c_str()); | 121 newRecord->fCommon
Name.c_str()); |
122 | 122 |
123 // compute the image diff and output it | 123 // compute the image diff and output it |
124 SkBitmap copy; | 124 SkBitmap copy; |
125 diffData.fResult.poiAlphaMask.copyTo(©, kN32_SkColorType); | 125 diffData.fResult.poiAlphaMask.copyTo(©, kPMColor_SkColorType); |
126 SkImageEncoder::EncodeFile(newRecord->fDifferencePath.c_str(), copy, | 126 SkImageEncoder::EncodeFile(newRecord->fDifferencePath.c_str(), copy, |
127 SkImageEncoder::kPNG_Type, 100); | 127 SkImageEncoder::kPNG_Type, 100); |
128 | 128 |
129 // cleanup the existing bitmap to free up resources; | 129 // cleanup the existing bitmap to free up resources; |
130 diffData.fResult.poiAlphaMask.reset(); | 130 diffData.fResult.poiAlphaMask.reset(); |
131 | 131 |
132 alphaMaskPending = false; | 132 alphaMaskPending = false; |
133 } | 133 } |
134 } | 134 } |
135 } | 135 } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 for (int i = 0; i < cntColumns; i++) { | 351 for (int i = 0; i < cntColumns; i++) { |
352 SkString str; | 352 SkString str; |
353 str.printf(", %f", values[i]); | 353 str.printf(", %f", values[i]); |
354 stream.writeText(str.c_str()); | 354 stream.writeText(str.c_str()); |
355 } | 355 } |
356 stream.writeText("\n"); | 356 stream.writeText("\n"); |
357 | 357 |
358 currentRecord = iter2.next(); | 358 currentRecord = iter2.next(); |
359 } | 359 } |
360 } | 360 } |
OLD | NEW |