aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-16 15:00:11 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-16 15:00:11 +0000
commit1e391b587085587d8b95038dac20063b40d47dd0 (patch)
treea1f42eb2cc3f7ec575cdfb802af754d22eded3c5 /tools
parentfe070ba6d82a4c77b02d33a46db21acf01050383 (diff)
Update skpdiff to include a name with each file.
R=caryclark@google.com Review URL: https://codereview.chromium.org/27512002 git-svn-id: http://skia.googlecode.com/svn/trunk@11808 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rw-r--r--tools/skpdiff/SkDiffContext.cpp14
-rw-r--r--tools/skpdiff/viewer.html2
-rw-r--r--tools/skpdiff/viewer_style.css9
3 files changed, 23 insertions, 2 deletions
diff --git a/tools/skpdiff/SkDiffContext.cpp b/tools/skpdiff/SkDiffContext.cpp
index f551ff3508..88941cab0f 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");
diff --git a/tools/skpdiff/viewer.html b/tools/skpdiff/viewer.html
index f4b8fd7fc9..1d3793bbf5 100644
--- a/tools/skpdiff/viewer.html
+++ b/tools/skpdiff/viewer.html
@@ -33,6 +33,7 @@
<thead>
<tr>
<td ng-show="isDynamic">Rebaseline?</td>
+ <td>Name</td>
<td>Expected Image</td>
<td>Actual Image</td>
<td>Results</td>
@@ -51,6 +52,7 @@
ng-click="selectedRebaseline($index, $event)"
ng-class="{lastselected: lastSelectedIndex == $index}" />
</td>
+ <td class="common-name">{{ record.commonName }}</td>
<td>
<swap-img left-src="{{ record.baselinePath }}"
right-src="{{ record.testPath }}"
diff --git a/tools/skpdiff/viewer_style.css b/tools/skpdiff/viewer_style.css
index e172667061..1e4420fe85 100644
--- a/tools/skpdiff/viewer_style.css
+++ b/tools/skpdiff/viewer_style.css
@@ -5,7 +5,7 @@ body, img, div {
}
table {
- width:100%;
+ width: auto;
border-collapse: collapse;
border-spacing: 0;
padding: 8px;
@@ -13,7 +13,7 @@ table {
td {
border-top: 1px solid #DDD;
- padding: 8px;
+ padding: 16px;
}
thead > tr > td {
border: none;
@@ -73,6 +73,11 @@ input[type="checkbox"].lastselected {
background: -webkit-linear-gradient(top, #96c56f 0%,#a9db80 100%);
}
+.common-name {
+ vertical-align: top;
+}
+
+
.gm-image {
border: 1px dotted black;
}