Index: gm/gmmain.cpp |
=================================================================== |
--- gm/gmmain.cpp (revision 8826) |
+++ gm/gmmain.cpp (working copy) |
@@ -714,11 +714,10 @@ |
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. |
+ BITMAP_HASH_TYPE actualBitmapHash; |
if (!SkBitmapHasher::ComputeDigest(actualBitmap, &actualBitmapHash)) { |
- actualBitmapHash = 0; |
+ // TODO(epoger): Better handling for error returned by ComputeDigest()? |
+ // For now, we just leave actualBitmapHash empty. |
} |
SkString completeNameString = baseNameString; |
completeNameString.append(renderModeDescriptor); |
@@ -768,7 +767,7 @@ |
* depending on status. |
*/ |
void add_actual_results_to_json_summary(const char testName[], |
- const SkHashDigest& actualBitmapHash, |
+ const BITMAP_HASH_TYPE& actualBitmapHash, |
ErrorCombination result, |
bool ignoreFailure) { |
Json::Value actualResults; |
@@ -864,11 +863,10 @@ |
} 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. |
+ BITMAP_HASH_TYPE actualBitmapHash; |
if (!SkBitmapHasher::ComputeDigest(actualBitmap, &actualBitmapHash)) { |
- actualBitmapHash = 0; |
+ // TODO(epoger): Better handling for error returned by ComputeDigest()? |
+ // For now, we just leave actualBitmapHash empty. |
} |
add_actual_results_to_json_summary(name.c_str(), actualBitmapHash, |
ErrorCombination(kMissingExpectations_ErrorType), |
@@ -1591,6 +1589,12 @@ |
return total; |
} |
+// Set this temporary macro to print out timing info. |
+#define EPOGER_TIMER |
+#ifdef EPOGER_TIMER |
+#include "SkTime.h" |
+#endif |
+ |
int tool_main(int argc, char** argv); |
int tool_main(int argc, char** argv) { |
@@ -1598,6 +1602,10 @@ |
gPrintInstCount = true; |
#endif |
+#ifdef EPOGER_TIMER |
+ SkMSec startTime = SkTime::GetMSecs(); |
+#endif |
+ |
SkGraphics::Init(); |
// we don't need to see this during a run |
gSkSuppressFontCachePurgeSpew = true; |
@@ -1846,6 +1854,10 @@ |
} |
int expectedNumberOfTests = gmsRun * (configs.count() + modes.count()); |
+#ifdef EPOGER_TIMER |
+ SkMSec middleTime = SkTime::GetMSecs(); |
+#endif |
+ |
// Output summary to stdout. |
if (FLAGS_verbose) { |
gm_fprintf(stdout, "Ran %d GMs\n", gmsRun); |
@@ -1867,6 +1879,23 @@ |
} |
#endif |
+#ifdef EPOGER_TIMER |
+ Json::Value actualResults; |
+ actualResults[kJsonKey_ActualResults_Failed] = |
+ gmmain.fJsonActualResults_Failed; |
+ actualResults[kJsonKey_ActualResults_FailureIgnored] = |
+ gmmain.fJsonActualResults_FailureIgnored; |
+ actualResults[kJsonKey_ActualResults_NoComparison] = |
+ gmmain.fJsonActualResults_NoComparison; |
+ actualResults[kJsonKey_ActualResults_Succeeded] = |
+ gmmain.fJsonActualResults_Succeeded; |
+ Json::Value root; |
+ root[kJsonKey_ActualResults] = actualResults; |
+ root[kJsonKey_ExpectedResults] = gmmain.fJsonExpectedResults; |
+ std::string jsonStdString = root.toStyledString(); |
+ printf("%s\n", jsonStdString.c_str()); |
+#endif |
+ |
if (FLAGS_writeJsonSummaryPath.count() == 1) { |
Json::Value actualResults; |
actualResults[kJsonKey_ActualResults_Failed] = |
@@ -1904,6 +1933,12 @@ |
#endif |
SkGraphics::Term(); |
+#ifdef EPOGER_TIMER |
+ SkMSec endTime = SkTime::GetMSecs(); |
+ printf("EPOGER timings: start-middle=%d msecs, start-end=%d msecs\n", |
+ (middleTime - startTime), (endTime - startTime)); |
+#endif |
+ |
return (reportError) ? -1 : 0; |
} |