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

Unified Diff: gm/gm_expectations.h

Issue 14284018: GM: specify that currently used checksums are CityHashes of SkBitmaps (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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
Index: gm/gm_expectations.h
===================================================================
--- gm/gm_expectations.h (revision 8850)
+++ gm/gm_expectations.h (working copy)
@@ -32,16 +32,17 @@
#define DEBUGFAIL_SEE_STDERR SkDEBUGFAIL("see stderr for message")
+// EPOGER: move these into a .cpp file so we know nobody else uses them?
const static char kJsonKey_ActualResults[] = "actual-results";
const static char kJsonKey_ActualResults_Failed[] = "failed";
const static char kJsonKey_ActualResults_FailureIgnored[]= "failure-ignored";
const static char kJsonKey_ActualResults_NoComparison[] = "no-comparison";
const static char kJsonKey_ActualResults_Succeeded[] = "succeeded";
-const static char kJsonKey_ActualResults_AnyStatus_Checksum[] = "checksum";
+const static char kJsonKey_ActualResults_AnyStatus_BitmapCityhash[] = "bitmap-cityhash";
const static char kJsonKey_ExpectedResults[] = "expected-results";
-const static char kJsonKey_ExpectedResults_Checksums[] = "checksums";
-const static char kJsonKey_ExpectedResults_IgnoreFailure[] = "ignore-failure";
+const static char kJsonKey_ExpectedResults_AllowedBitmapCityhashes[] = "allowed-bitmap-cityhashes";
+const static char kJsonKey_ExpectedResults_IgnoreFailure[] = "ignore-failure";
namespace skiagm {
@@ -100,7 +101,7 @@
if (!SkBitmapHasher::ComputeDigest(bitmap, &digest)) {
digest = 0;
}
- fAllowedChecksums.push_back() = digest;
+ fAllowedBitmapCityhashes.push_back() = digest;
}
/**
@@ -128,13 +129,13 @@
fIgnoreFailure = ignoreFailure.asBool();
}
- Json::Value allowedChecksums = jsonElement[kJsonKey_ExpectedResults_Checksums];
+ Json::Value allowedChecksums = jsonElement[kJsonKey_ExpectedResults_AllowedBitmapCityhashes];
if (allowedChecksums.isNull()) {
// ok, we'll just assume there aren't any expected checksums to compare against
} else if (!allowedChecksums.isArray()) {
gm_fprintf(stderr, "found non-array json value"
" for key '%s' in element '%s'\n",
- kJsonKey_ExpectedResults_Checksums,
+ kJsonKey_ExpectedResults_AllowedBitmapCityhashes,
jsonElement.toStyledString().c_str());
DEBUGFAIL_SEE_STDERR;
} else {
@@ -146,7 +147,7 @@
jsonElement.toStyledString().c_str());
DEBUGFAIL_SEE_STDERR;
} else {
- fAllowedChecksums.push_back() = asChecksum(checksumElement);
+ fAllowedBitmapCityhashes.push_back() = asChecksum(checksumElement);
}
}
}
@@ -161,7 +162,7 @@
/**
* Returns true iff there are no allowed checksums.
*/
- bool empty() const { return this->fAllowedChecksums.empty(); }
+ bool empty() const { return this->fAllowedBitmapCityhashes.empty(); }
/**
* Returns true iff actualChecksum matches any allowedChecksum,
@@ -169,8 +170,8 @@
* that separately.)
*/
bool match(Checksum actualChecksum) const {
- for (int i=0; i < this->fAllowedChecksums.count(); i++) {
- Checksum allowedChecksum = this->fAllowedChecksums[i];
+ for (int i=0; i < this->fAllowedBitmapCityhashes.count(); i++) {
+ Checksum allowedChecksum = this->fAllowedBitmapCityhashes[i];
if (allowedChecksum == actualChecksum) {
return true;
}
@@ -195,9 +196,9 @@
*/
Json::Value allowedChecksumsAsJson() const {
Json::Value allowedChecksumArray;
- if (!this->fAllowedChecksums.empty()) {
- for (int i=0; i < this->fAllowedChecksums.count(); i++) {
- Checksum allowedChecksum = this->fAllowedChecksums[i];
+ if (!this->fAllowedBitmapCityhashes.empty()) {
+ for (int i=0; i < this->fAllowedBitmapCityhashes.count(); i++) {
+ Checksum allowedChecksum = this->fAllowedBitmapCityhashes[i];
allowedChecksumArray.append(asJsonValue(allowedChecksum));
}
}
@@ -207,7 +208,7 @@
private:
const static bool kDefaultIgnoreFailure = false;
- SkTArray<Checksum> fAllowedChecksums;
+ SkTArray<Checksum> fAllowedBitmapCityhashes;
bool fIgnoreFailure;
SkBitmap fBitmap;
};

Powered by Google App Engine
This is Rietveld 408576698