| 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 char* baselineAbsPath = get_absolute_path(currentRecord->fBaselinePa
th.c_str()); |
| 168 char* testAbsPath = get_absolute_path(currentRecord->fTestPath.c_str
()); |
| 169 |
| 167 stream.writeText(" \"baselinePath\": \""); | 170 stream.writeText(" \"baselinePath\": \""); |
| 168 stream.writeText(currentRecord->fBaselinePath.c_str()); | 171 stream.writeText(baselineAbsPath); |
| 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); |
| 173 stream.writeText("\",\n"); | 176 stream.writeText("\",\n"); |
| 174 | 177 |
| 178 free(baselineAbsPath); |
| 179 free(testAbsPath); |
| 180 |
| 175 stream.writeText(" \"diffs\": [\n"); | 181 stream.writeText(" \"diffs\": [\n"); |
| 176 for (int diffIndex = 0; diffIndex < currentRecord->fDiffs.count(); d
iffIndex++) { | 182 for (int diffIndex = 0; diffIndex < currentRecord->fDiffs.count(); d
iffIndex++) { |
| 177 DiffData& data = currentRecord->fDiffs[diffIndex]; | 183 DiffData& data = currentRecord->fDiffs[diffIndex]; |
| 178 stream.writeText(" {\n"); | 184 stream.writeText(" {\n"); |
| 179 | 185 |
| 180 stream.writeText(" \"differName\": \""); | 186 stream.writeText(" \"differName\": \""); |
| 181 stream.writeText(data.fDiffName); | 187 stream.writeText(data.fDiffName); |
| 182 stream.writeText("\",\n"); | 188 stream.writeText("\",\n"); |
| 183 | 189 |
| 184 stream.writeText(" \"result\": "); | 190 stream.writeText(" \"result\": "); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 for (int i = 0; i < cntColumns; i++) { | 287 for (int i = 0; i < cntColumns; i++) { |
| 282 SkString str; | 288 SkString str; |
| 283 str.printf(", %f", values[i]); | 289 str.printf(", %f", values[i]); |
| 284 stream.writeText(str.c_str()); | 290 stream.writeText(str.c_str()); |
| 285 } | 291 } |
| 286 stream.writeText("\n"); | 292 stream.writeText("\n"); |
| 287 | 293 |
| 288 currentRecord = currentRecord->fNext; | 294 currentRecord = currentRecord->fNext; |
| 289 } | 295 } |
| 290 } | 296 } |
| OLD | NEW |