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

Side by Side Diff: gm/gm_expectations.cpp

Issue 17157005: Reland r9682, using new SkString::appendU64() (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: use_appendU64 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 SkString retval;
122 retval.appendU64(fHashDigest);
123 return retval;
124 }
125
112 126
113 // Expectations class... 127 // Expectations class...
114 128
115 Expectations::Expectations(bool ignoreFailure) { 129 Expectations::Expectations(bool ignoreFailure) {
116 fIgnoreFailure = ignoreFailure; 130 fIgnoreFailure = ignoreFailure;
117 } 131 }
118 132
119 Expectations::Expectations(const SkBitmap& bitmap, bool ignoreFailure) { 133 Expectations::Expectations(const SkBitmap& bitmap, bool ignoreFailure) {
120 fBitmap = bitmap; 134 fBitmap = bitmap;
121 fIgnoreFailure = ignoreFailure; 135 fIgnoreFailure = ignoreFailure;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 Json::Reader reader; 263 Json::Reader reader;
250 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { 264 if (!reader.parse(bytes, bytes+size, *jsonRoot)) {
251 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath); 265 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath);
252 DEBUGFAIL_SEE_STDERR; 266 DEBUGFAIL_SEE_STDERR;
253 return false; 267 return false;
254 } 268 }
255 return true; 269 return true;
256 } 270 }
257 271
258 } 272 }
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