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

Unified Diff: gm/gmmain.cpp

Issue 15883004: GM: create GmResultDigest that encapsulates digest type ("bitmap-64bitMD5") and value (12345) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: add_isValid 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 side-by-side diff with in-line comments
Download patch
Index: gm/gmmain.cpp
===================================================================
--- gm/gmmain.cpp (revision 9256)
+++ gm/gmmain.cpp (working copy)
@@ -18,7 +18,6 @@
#include "gm_expectations.h"
#include "system_preferences.h"
#include "SkBitmap.h"
-#include "SkBitmapHasher.h"
#include "SkColorPriv.h"
#include "SkCommandLineFlags.h"
#include "SkData.h"
@@ -750,12 +749,7 @@
const char *renderModeDescriptor,
bool addToJsonSummary) {
ErrorCombination errors;
- SkHashDigest actualBitmapHash;
- // TODO(epoger): Better handling for error returned by ComputeDigest()?
- // For now, we just report a digest of 0 in error cases, like before.
- if (!SkBitmapHasher::ComputeDigest(actualBitmap, &actualBitmapHash)) {
- actualBitmapHash = 0;
- }
+ GmResultDigest actualResultDigest(actualBitmap);
SkString shortNamePlusConfig = make_shortname_plus_config(shortName, configName);
SkString completeNameString(shortNamePlusConfig);
completeNameString.append(renderModeDescriptor);
@@ -765,7 +759,7 @@
if (expectations.empty()) {
errors.add(kMissingExpectations_ErrorType);
- } else if (!expectations.match(actualBitmapHash)) {
+ } else if (!expectations.match(actualResultDigest)) {
addToJsonSummary = true;
// The error mode we record depends on whether this was running
// in a non-standard renderMode.
@@ -794,7 +788,7 @@
RecordTestResults(errors, shortNamePlusConfig, renderModeDescriptor);
if (addToJsonSummary) {
- add_actual_results_to_json_summary(completeName, actualBitmapHash, errors,
+ add_actual_results_to_json_summary(completeName, actualResultDigest, errors,
expectations.ignoreFailure());
add_expected_results_to_json_summary(completeName, expectations);
}
@@ -807,10 +801,10 @@
* depending on errors encountered.
*/
void add_actual_results_to_json_summary(const char testName[],
- const SkHashDigest& actualResult,
+ const GmResultDigest &actualResultDigest,
ErrorCombination errors,
bool ignoreFailure) {
- Json::Value jsonActualResults = ActualResultAsJsonValue(actualResult);
+ Json::Value jsonActualResults = actualResultDigest.asJsonTypeValuePair();
if (errors.isEmpty()) {
this->fJsonActualResults_Succeeded[testName] = jsonActualResults;
} else {
@@ -896,13 +890,8 @@
} else {
// If we are running without expectations, we still want to
// record the actual results.
- SkHashDigest actualBitmapHash;
- // TODO(epoger): Better handling for error returned by ComputeDigest()?
- // For now, we just report a digest of 0 in error cases, like before.
- if (!SkBitmapHasher::ComputeDigest(actualBitmap, &actualBitmapHash)) {
- actualBitmapHash = 0;
- }
- add_actual_results_to_json_summary(nameWithExtension.c_str(), actualBitmapHash,
+ GmResultDigest actualResultDigest(actualBitmap);
+ add_actual_results_to_json_summary(nameWithExtension.c_str(), actualResultDigest,
ErrorCombination(kMissingExpectations_ErrorType),
false);
RecordTestResults(ErrorCombination(kMissingExpectations_ErrorType),
« no previous file with comments | « gm/gm_expectations.cpp ('k') | gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698