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

Side by Side Diff: gm/gm_expectations.cpp

Issue 15014011: GM: include filename extension (.png) of each output file in JSON summary (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: add_file_extension_to_json Created 7 years, 7 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 | gm/gmmain.cpp » ('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 "gm_expectations.h" 8 #include "gm_expectations.h"
9 #include "SkBitmapHasher.h" 9 #include "SkBitmapHasher.h"
10 #include "SkImageDecoder.h" 10 #include "SkImageDecoder.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 159
160 // JsonExpectationsSource class... 160 // JsonExpectationsSource class...
161 161
162 JsonExpectationsSource::JsonExpectationsSource(const char *jsonPath) { 162 JsonExpectationsSource::JsonExpectationsSource(const char *jsonPath) {
163 parse(jsonPath, &fJsonRoot); 163 parse(jsonPath, &fJsonRoot);
164 fJsonExpectedResults = fJsonRoot[kJsonKey_ExpectedResults]; 164 fJsonExpectedResults = fJsonRoot[kJsonKey_ExpectedResults];
165 } 165 }
166 166
167 Expectations JsonExpectationsSource::get(const char *testName) { 167 Expectations JsonExpectationsSource::get(const char *testName) {
168 return Expectations(fJsonExpectedResults[testName]); 168 SkString testNameWithExtension(testName);
169 testNameWithExtension.append(".png");
epoger 2013/05/08 19:45:08 Patchset 2 adds ".png" extension to the lines in t
170 return Expectations(fJsonExpectedResults[testNameWithExtension.c_str()]) ;
169 } 171 }
170 172
171 /*static*/ SkData* JsonExpectationsSource::readIntoSkData(SkStream &stream, size_t maxBytes) { 173 /*static*/ SkData* JsonExpectationsSource::readIntoSkData(SkStream &stream, size_t maxBytes) {
172 if (0 == maxBytes) { 174 if (0 == maxBytes) {
173 return SkData::NewEmpty(); 175 return SkData::NewEmpty();
174 } 176 }
175 char* bufStart = reinterpret_cast<char *>(sk_malloc_throw(maxBytes)); 177 char* bufStart = reinterpret_cast<char *>(sk_malloc_throw(maxBytes));
176 char* bufPtr = bufStart; 178 char* bufPtr = bufStart;
177 size_t bytesRemaining = maxBytes; 179 size_t bytesRemaining = maxBytes;
178 while (bytesRemaining > 0) { 180 while (bytesRemaining > 0) {
(...skipping 27 matching lines...) Expand all
206 Json::Reader reader; 208 Json::Reader reader;
207 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { 209 if (!reader.parse(bytes, bytes+size, *jsonRoot)) {
208 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath); 210 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath);
209 DEBUGFAIL_SEE_STDERR; 211 DEBUGFAIL_SEE_STDERR;
210 return false; 212 return false;
211 } 213 }
212 return true; 214 return true;
213 } 215 }
214 216
215 } 217 }
OLDNEW
« no previous file with comments | « no previous file | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698