| 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 #ifndef SkError_DEFINED | 8 #ifndef SkError_DEFINED |
| 9 #define SkError_DEFINED | 9 #define SkError_DEFINED |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 * everything, but perhaps a paint can get into a bad state somehow. | 40 * everything, but perhaps a paint can get into a bad state somehow. |
| 41 */ | 41 */ |
| 42 kInvalidPaint_SkError, | 42 kInvalidPaint_SkError, |
| 43 | 43 |
| 44 /** Skia was unable to allocate memory to perform some task. | 44 /** Skia was unable to allocate memory to perform some task. |
| 45 */ | 45 */ |
| 46 kOutOfMemory_SkError, | 46 kOutOfMemory_SkError, |
| 47 | 47 |
| 48 /** Skia failed while trying to consume some external resource. | 48 /** Skia failed while trying to consume some external resource. |
| 49 */ | 49 */ |
| 50 kParseError_SkError | 50 kParseError_SkError, |
| 51 |
| 52 /** Something went wrong internally; could be resource exhaustion but |
| 53 * will often be a bug. |
| 54 */ |
| 55 kInternalError_SkError |
| 51 }; | 56 }; |
| 52 | 57 |
| 53 /** Return the current per-thread error code. Error codes are "sticky"; they | 58 /** Return the current per-thread error code. Error codes are "sticky"; they |
| 54 * are not not reset by subsequent successful operations. | 59 * are not not reset by subsequent successful operations. |
| 55 */ | 60 */ |
| 56 SkError SkGetLastError(); | 61 SkError SkGetLastError(); |
| 57 | 62 |
| 58 /** Clear the current per-thread error code back to kNoError_SkError. | 63 /** Clear the current per-thread error code back to kNoError_SkError. |
| 59 */ | 64 */ |
| 60 void SkClearLastError(); | 65 void SkClearLastError(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 77 void SkSetErrorCallback(SkErrorCallbackFunction cb, void *context); | 82 void SkSetErrorCallback(SkErrorCallbackFunction cb, void *context); |
| 78 | 83 |
| 79 /** Get a human-readable description of the last (per-thread) error that | 84 /** Get a human-readable description of the last (per-thread) error that |
| 80 * occurred. The returned error message will include not only a human | 85 * occurred. The returned error message will include not only a human |
| 81 * readable version of the error code, but also information about the | 86 * readable version of the error code, but also information about the |
| 82 * conditions that led to the error itself. | 87 * conditions that led to the error itself. |
| 83 */ | 88 */ |
| 84 const char *SkGetLastErrorString(); | 89 const char *SkGetLastErrorString(); |
| 85 | 90 |
| 86 #endif /* SkError_DEFINED */ | 91 #endif /* SkError_DEFINED */ |
| OLD | NEW |