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

Side by Side Diff: gm/gm_expectations.cpp

Issue 17365002: GM: add --writeChecksumBasedFilenames option (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: sync_to_r9681 Created 7 years, 6 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 | « gm/gm_expectations.h ('k') | 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 Json::Value jsonTypeValuePair; 102 Json::Value jsonTypeValuePair;
103 if (fIsValid) { 103 if (fIsValid) {
104 jsonTypeValuePair.append(Json::Value(kJsonKey_Hashtype_Bitmap_64bitM D5)); 104 jsonTypeValuePair.append(Json::Value(kJsonKey_Hashtype_Bitmap_64bitM D5));
105 jsonTypeValuePair.append(Json::UInt64(fHashDigest)); 105 jsonTypeValuePair.append(Json::UInt64(fHashDigest));
106 } else { 106 } else {
107 jsonTypeValuePair.append(Json::Value("INVALID")); 107 jsonTypeValuePair.append(Json::Value("INVALID"));
108 } 108 }
109 return jsonTypeValuePair; 109 return jsonTypeValuePair;
110 } 110 }
111 111
112 SkString GmResultDigest::getHashType() const {
113 // TODO(epoger): The current implementation assumes that the
114 // result digest is always of type kJsonKey_Hashtype_Bitmap_64bitMD5
115 return SkString(kJsonKey_Hashtype_Bitmap_64bitMD5);
116 }
117
118 SkString GmResultDigest::getDigestValue() const {
119 // TODO(epoger): The current implementation assumes that the
120 // result digest is always of type kJsonKey_Hashtype_Bitmap_64bitMD5
121 //
122 // TODO(epoger): If SkString had an appendU64() method, it would be
123 // more efficient to use that here... but it doesn't.
124 SkString retval;
125 retval.printf("%lu", fHashDigest);
126 return retval;
127 }
128
112 129
113 // Expectations class... 130 // Expectations class...
114 131
115 Expectations::Expectations(bool ignoreFailure) { 132 Expectations::Expectations(bool ignoreFailure) {
116 fIgnoreFailure = ignoreFailure; 133 fIgnoreFailure = ignoreFailure;
117 } 134 }
118 135
119 Expectations::Expectations(const SkBitmap& bitmap, bool ignoreFailure) { 136 Expectations::Expectations(const SkBitmap& bitmap, bool ignoreFailure) {
120 fBitmap = bitmap; 137 fBitmap = bitmap;
121 fIgnoreFailure = ignoreFailure; 138 fIgnoreFailure = ignoreFailure;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 Json::Reader reader; 266 Json::Reader reader;
250 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { 267 if (!reader.parse(bytes, bytes+size, *jsonRoot)) {
251 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath); 268 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath);
252 DEBUGFAIL_SEE_STDERR; 269 DEBUGFAIL_SEE_STDERR;
253 return false; 270 return false;
254 } 271 }
255 return true; 272 return true;
256 } 273 }
257 274
258 } 275 }
OLDNEW
« no previous file with comments | « gm/gm_expectations.h ('k') | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698