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

Unified 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: mac PATH_MAX Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/skpdiff/skpdiff_util.h » ('j') | tools/skpdiff/skpdiff_util.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpdiff/SkDiffContext.cpp
diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp
index cf2654ac054ca395933e84d677f7f146b9cd5deb..07e2a0bb880ba688ec517ad4e6633c450a654d23 100644
--- a/tools/skpdiff/SkDiffContext.cpp
+++ b/tools/skpdiff/SkDiffContext.cpp
@@ -164,14 +164,20 @@ void SkDiffContext::outputRecords(SkWStream& stream, bool useJSONP) {
while (NULL != currentRecord) {
stream.writeText(" {\n");
+ char* baselineAbsPath = get_absolute_path(currentRecord->fBaselinePath.c_str());
+ char* testAbsPath = get_absolute_path(currentRecord->fTestPath.c_str());
+
stream.writeText(" \"baselinePath\": \"");
- stream.writeText(currentRecord->fBaselinePath.c_str());
+ stream.writeText(baselineAbsPath);
stream.writeText("\",\n");
stream.writeText(" \"testPath\": \"");
- stream.writeText(currentRecord->fTestPath.c_str());
+ stream.writeText(testAbsPath);
stream.writeText("\",\n");
+ free(baselineAbsPath);
+ free(testAbsPath);
+
stream.writeText(" \"diffs\": [\n");
for (int diffIndex = 0; diffIndex < currentRecord->fDiffs.count(); diffIndex++) {
DiffData& data = currentRecord->fDiffs[diffIndex];
« no previous file with comments | « no previous file | tools/skpdiff/skpdiff_util.h » ('j') | tools/skpdiff/skpdiff_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698