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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 DiffRecord* currentRecord = fRecords; | 157 DiffRecord* currentRecord = fRecords; |
158 if (useJSONP) { | 158 if (useJSONP) { |
159 stream.writeText("var SkPDiffRecords = {\n"); | 159 stream.writeText("var SkPDiffRecords = {\n"); |
160 } else { | 160 } else { |
161 stream.writeText("{\n"); | 161 stream.writeText("{\n"); |
162 } | 162 } |
163 stream.writeText(" \"records\": [\n"); | 163 stream.writeText(" \"records\": [\n"); |
164 while (NULL != currentRecord) { | 164 while (NULL != currentRecord) { |
165 stream.writeText(" {\n"); | 165 stream.writeText(" {\n"); |
166 | 166 |
| 167 SkString baselineAbsPath = get_absolute_path(currentRecord->fBaselin
ePath); |
| 168 SkString testAbsPath = get_absolute_path(currentRecord->fTestPath); |
| 169 |
167 stream.writeText(" \"baselinePath\": \""); | 170 stream.writeText(" \"baselinePath\": \""); |
168 stream.writeText(currentRecord->fBaselinePath.c_str()); | 171 stream.writeText(baselineAbsPath.c_str()); |
169 stream.writeText("\",\n"); | 172 stream.writeText("\",\n"); |
170 | 173 |
171 stream.writeText(" \"testPath\": \""); | 174 stream.writeText(" \"testPath\": \""); |
172 stream.writeText(currentRecord->fTestPath.c_str()); | 175 stream.writeText(testAbsPath.c_str()); |
173 stream.writeText("\",\n"); | 176 stream.writeText("\",\n"); |
174 | 177 |
175 stream.writeText(" \"diffs\": [\n"); | 178 stream.writeText(" \"diffs\": [\n"); |
176 for (int diffIndex = 0; diffIndex < currentRecord->fDiffs.count(); d
iffIndex++) { | 179 for (int diffIndex = 0; diffIndex < currentRecord->fDiffs.count(); d
iffIndex++) { |
177 DiffData& data = currentRecord->fDiffs[diffIndex]; | 180 DiffData& data = currentRecord->fDiffs[diffIndex]; |
178 stream.writeText(" {\n"); | 181 stream.writeText(" {\n"); |
179 | 182 |
180 stream.writeText(" \"differName\": \""); | 183 stream.writeText(" \"differName\": \""); |
181 stream.writeText(data.fDiffName); | 184 stream.writeText(data.fDiffName); |
182 stream.writeText("\",\n"); | 185 stream.writeText("\",\n"); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 for (int i = 0; i < cntColumns; i++) { | 284 for (int i = 0; i < cntColumns; i++) { |
282 SkString str; | 285 SkString str; |
283 str.printf(", %f", values[i]); | 286 str.printf(", %f", values[i]); |
284 stream.writeText(str.c_str()); | 287 stream.writeText(str.c_str()); |
285 } | 288 } |
286 stream.writeText("\n"); | 289 stream.writeText("\n"); |
287 | 290 |
288 currentRecord = currentRecord->fNext; | 291 currentRecord = currentRecord->fNext; |
289 } | 292 } |
290 } | 293 } |
OLD | NEW |