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

Unified Diff: gm/gm_error.h

Issue 12851022: gm: display summary of all results by ErrorType (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: synced_to_r8509 Created 7 years, 9 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
« no previous file with comments | « no previous file | gm/gmmain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gm_error.h
===================================================================
--- gm/gm_error.h (revision 8509)
+++ gm/gm_error.h (working copy)
@@ -9,15 +9,23 @@
* Error codes used by gmmain.cpp.
*/
+#ifndef gm_error_DEFINED
+#define gm_error_DEFINED
+
+#include "gm.h"
+
namespace skiagm {
/**
* The complete list of error types we might encounter in GM.
*/
enum ErrorType {
-#if SK_SUPPORT_GPU
+ // Even though kNoGpuContext_ErrorType only occurs when SK_SUPPORT_GPU
+ // is turned on, we always include this type in our enum so that
+ // reports will be consistent whether SK_SUPPORT_GPU is turned on
+ // or off (as long as the number of these errors is 0).
kNoGpuContext_ErrorType,
-#endif
+
kImageMismatch_ErrorType,
kMissingExpectations_ErrorType,
kWritingReferenceImage_ErrorType,
@@ -25,6 +33,25 @@
};
/**
+ * Returns the name of the given ErrorType.
+ */
+ const char *getErrorTypeName(ErrorType type) {
+ switch(type) {
+ case kNoGpuContext_ErrorType:
+ return "NoGpuContext";
+ case kImageMismatch_ErrorType:
+ return "ImageMismatch";
+ case kMissingExpectations_ErrorType:
+ return "MissingExpectations";
+ case kWritingReferenceImage_ErrorType:
+ return "WritingReferenceImage";
+ }
+ // control should never reach here
+ SkDEBUGFAIL("getErrorTypeName() called with unknown type");
+ return "Unknown";
+ }
+
+ /**
* A combination of 0 or more ErrorTypes.
*/
class ErrorCombination {
@@ -87,3 +114,5 @@
// No errors at all.
const static ErrorCombination kEmpty_ErrorCombination;
}
+
+#endif // ifndef gm_error_DEFINED
« no previous file with comments | « no previous file | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698