| OLD | NEW |
| 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 /* | 8 /* |
| 9 * Error codes used by gmmain.cpp. | 9 * Error codes used by gmmain.cpp. |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 #ifndef gm_error_DEFINED | 12 #ifndef gm_error_DEFINED |
| 13 #define gm_error_DEFINED | 13 #define gm_error_DEFINED |
| 14 | 14 |
| 15 #include "gm.h" | 15 #include "gm.h" |
| 16 | 16 |
| 17 namespace skiagm { | 17 namespace skiagm { |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * The complete list of error types we might encounter in GM. | 20 * The complete list of error types we might encounter in GM. |
| 21 */ | 21 */ |
| 22 enum ErrorType { | 22 enum ErrorType { |
| 23 // Even though kNoGpuContext_ErrorType only occurs when SK_SUPPORT_GPU | 23 // Even though kNoGpuContext_ErrorType only occurs when SK_SUPPORT_GPU |
| 24 // is turned on, we always include this type in our enum so that | 24 // is turned on, we always include this type in our enum so that |
| 25 // reports will be consistent whether SK_SUPPORT_GPU is turned on | 25 // reports will be consistent whether SK_SUPPORT_GPU is turned on |
| 26 // or off (as long as the number of these errors is 0). | 26 // or off (as long as the number of these errors is 0). |
| 27 kNoGpuContext_ErrorType, | 27 kNoGpuContext_ErrorType, |
| 28 | 28 |
| 29 kIntentionallySkipped_ErrorType, |
| 29 kRenderModeMismatch_ErrorType, | 30 kRenderModeMismatch_ErrorType, |
| 30 kExpectationsMismatch_ErrorType, | 31 kExpectationsMismatch_ErrorType, |
| 31 kMissingExpectations_ErrorType, | 32 kMissingExpectations_ErrorType, |
| 32 kWritingReferenceImage_ErrorType, | 33 kWritingReferenceImage_ErrorType, |
| 33 kLast_ErrorType = kWritingReferenceImage_ErrorType | 34 kLast_ErrorType = kWritingReferenceImage_ErrorType |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 /** | 37 /** |
| 37 * Returns the name of the given ErrorType. | 38 * Returns the name of the given ErrorType. |
| 38 */ | 39 */ |
| 39 static const char *getErrorTypeName(ErrorType type) { | 40 static const char *getErrorTypeName(ErrorType type) { |
| 40 switch(type) { | 41 switch(type) { |
| 41 case kNoGpuContext_ErrorType: | 42 case kNoGpuContext_ErrorType: |
| 42 return "NoGpuContext"; | 43 return "NoGpuContext"; |
| 44 case kIntentionallySkipped_ErrorType: |
| 45 return "IntentionallySkipped"; |
| 43 case kRenderModeMismatch_ErrorType: | 46 case kRenderModeMismatch_ErrorType: |
| 44 return "RenderModeMismatch"; | 47 return "RenderModeMismatch"; |
| 45 case kExpectationsMismatch_ErrorType: | 48 case kExpectationsMismatch_ErrorType: |
| 46 return "ExpectationsMismatch"; | 49 return "ExpectationsMismatch"; |
| 47 case kMissingExpectations_ErrorType: | 50 case kMissingExpectations_ErrorType: |
| 48 return "MissingExpectations"; | 51 return "MissingExpectations"; |
| 49 case kWritingReferenceImage_ErrorType: | 52 case kWritingReferenceImage_ErrorType: |
| 50 return "WritingReferenceImage"; | 53 return "WritingReferenceImage"; |
| 51 } | 54 } |
| 52 // control should never reach here | 55 // control should never reach here |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 115 |
| 113 private: | 116 private: |
| 114 int fBitfield; | 117 int fBitfield; |
| 115 }; | 118 }; |
| 116 | 119 |
| 117 // No errors at all. | 120 // No errors at all. |
| 118 const static ErrorCombination kEmpty_ErrorCombination; | 121 const static ErrorCombination kEmpty_ErrorCombination; |
| 119 } | 122 } |
| 120 | 123 |
| 121 #endif // ifndef gm_error_DEFINED | 124 #endif // ifndef gm_error_DEFINED |
| OLD | NEW |