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

Unified Diff: tools/skpdiff/SkDiffContext.cpp

Issue 27512002: Update skpdiff to include a name with each file. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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/viewer.html » ('j') | no next file with comments »
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 f551ff350809c7fab0cb590c1c150ec304f5221c..88941cab0f2e207ca074e18f4f9259a6faabab01 100644
--- a/tools/skpdiff/SkDiffContext.cpp
+++ b/tools/skpdiff/SkDiffContext.cpp
@@ -167,6 +167,20 @@ void SkDiffContext::outputRecords(SkWStream& stream, bool useJSONP) {
SkString baselineAbsPath = get_absolute_path(currentRecord->fBaselinePath);
SkString testAbsPath = get_absolute_path(currentRecord->fTestPath);
+ // strip off directory structure and find the common part of the filename
+ SkString baseName = SkOSPath::SkBasename(baselineAbsPath.c_str());
+ SkString testName = SkOSPath::SkBasename(testAbsPath.c_str());
+ for (size_t x = 0; x < baseName.size(); ++x) {
+ if (baseName[x] != testName[x]) {
+ baseName.insertUnichar(x, '\n');
+ break;
+ }
+ }
+
+ stream.writeText(" \"commonName\": \"");
+ stream.writeText(baseName.c_str());
+ stream.writeText("\",\n");
+
stream.writeText(" \"baselinePath\": \"");
stream.writeText(baselineAbsPath.c_str());
stream.writeText("\",\n");
« no previous file with comments | « no previous file | tools/skpdiff/viewer.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698