Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: tools/skpdiff/SkDiffContext.cpp

Issue 21601002: fix skpdiff viewer bug when using relative paths (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: SkString mega efficiency patch Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/skpdiff/skpdiff_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tools/skpdiff/skpdiff_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698