OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ | 5 #ifndef GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ |
6 #define GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ | 6 #define GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 namespace gpu { | 11 namespace gpu { |
12 | 12 |
13 typedef int32_t CommandBufferOffset; | 13 typedef int32_t CommandBufferOffset; |
14 const CommandBufferOffset kInvalidCommandBufferOffset = -1; | 14 const CommandBufferOffset kInvalidCommandBufferOffset = -1; |
15 | 15 |
16 namespace error { | 16 namespace error { |
17 enum Error { | 17 enum Error { |
18 kNoError, | 18 kNoError, |
19 kInvalidSize, | 19 kInvalidSize, |
20 kOutOfBounds, | 20 kOutOfBounds, |
21 kUnknownCommand, | 21 kUnknownCommand, |
22 kInvalidArguments, | 22 kInvalidArguments, |
23 kLostContext, | 23 kLostContext, |
24 kGenericError, | 24 kGenericError, |
25 kDeferCommandUntilLater, | 25 kDeferCommandUntilLater, |
26 kErrorLast = kDeferCommandUntilLater, | 26 kDeferLaterCommands, |
| 27 kErrorLast = kDeferLaterCommands, |
27 }; | 28 }; |
28 | 29 |
29 // Return true if the given error code is an actual error. | 30 // Return true if the given error code is an actual error. |
30 inline bool IsError(Error error) { | 31 inline bool IsError(Error error) { |
31 return error != kNoError && error != kDeferCommandUntilLater; | 32 return error != kNoError && error != kDeferCommandUntilLater && |
| 33 error != kDeferLaterCommands; |
32 } | 34 } |
33 | 35 |
34 // Provides finer grained information about why the context was lost. | 36 // Provides finer grained information about why the context was lost. |
35 enum ContextLostReason { | 37 enum ContextLostReason { |
36 // This context definitely provoked the loss of context. | 38 // This context definitely provoked the loss of context. |
37 kGuilty, | 39 kGuilty, |
38 | 40 |
39 // This context definitely did not provoke the loss of context. | 41 // This context definitely did not provoke the loss of context. |
40 kInnocent, | 42 kInnocent, |
41 | 43 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 IN_PROCESS, | 79 IN_PROCESS, |
78 MOJO, | 80 MOJO, |
79 MOJO_LOCAL, | 81 MOJO_LOCAL, |
80 | 82 |
81 NUM_COMMAND_BUFFER_NAMESPACES | 83 NUM_COMMAND_BUFFER_NAMESPACES |
82 }; | 84 }; |
83 | 85 |
84 } // namespace gpu | 86 } // namespace gpu |
85 | 87 |
86 #endif // GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ | 88 #endif // GPU_COMMAND_BUFFER_COMMON_CONSTANTS_H_ |
OLD | NEW |