| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 | 32 |
| 33 // This file contains the binary format definition of the command buffer and | 33 // This file contains the binary format definition of the command buffer and |
| 34 // command buffer commands. | 34 // command buffer commands. |
| 35 | 35 |
| 36 #include "gpu/command_buffer/common/cmd_buffer_common.h" | 36 #include "gpu/command_buffer/common/cmd_buffer_common.h" |
| 37 | 37 |
| 38 namespace command_buffer { | 38 namespace gpu { |
| 39 namespace cmd { | 39 namespace cmd { |
| 40 | 40 |
| 41 const char* GetCommandName(CommandId command_id) { | 41 const char* GetCommandName(CommandId command_id) { |
| 42 static const char* const names[] = { | 42 static const char* const names[] = { |
| 43 #define COMMON_COMMAND_BUFFER_CMD_OP(name) # name, | 43 #define COMMON_COMMAND_BUFFER_CMD_OP(name) # name, |
| 44 | 44 |
| 45 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP) | 45 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP) |
| 46 | 46 |
| 47 #undef COMMON_COMMAND_BUFFER_CMD_OP | 47 #undef COMMON_COMMAND_BUFFER_CMD_OP |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 int id = static_cast<int>(command_id); | 50 int id = static_cast<int>(command_id); |
| 51 return (id >= 0 && id < kNumCommands) ? names[id] : "*unknown-command*"; | 51 return (id >= 0 && id < kNumCommands) ? names[id] : "*unknown-command*"; |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace cmd | 54 } // namespace cmd |
| 55 } // namespace command_buffer | 55 } // namespace gpu |
| 56 | 56 |
| 57 | 57 |
| OLD | NEW |