OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file contains the binary format definition of the command buffer and | 5 // This file contains the binary format definition of the command buffer and |
6 // command buffer commands. | 6 // command buffer commands. |
7 | 7 |
8 #include "gpu/command_buffer/common/cmd_buffer_common.h" | 8 #include "gpu/command_buffer/common/cmd_buffer_common.h" |
9 | 9 |
10 namespace gpu { | 10 namespace gpu { |
| 11 const int32 CommandHeader::kMaxSize = (1 << 21) - 1; |
| 12 |
11 namespace cmd { | 13 namespace cmd { |
12 | 14 |
13 const char* GetCommandName(CommandId command_id) { | 15 const char* GetCommandName(CommandId command_id) { |
14 static const char* const names[] = { | 16 static const char* const names[] = { |
15 #define COMMON_COMMAND_BUFFER_CMD_OP(name) # name, | 17 #define COMMON_COMMAND_BUFFER_CMD_OP(name) # name, |
16 | 18 |
17 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP) | 19 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP) |
18 | 20 |
19 #undef COMMON_COMMAND_BUFFER_CMD_OP | 21 #undef COMMON_COMMAND_BUFFER_CMD_OP |
20 }; | 22 }; |
21 | 23 |
22 int id = static_cast<int>(command_id); | 24 int id = static_cast<int>(command_id); |
23 return (id >= 0 && id < kNumCommands) ? names[id] : "*unknown-command*"; | 25 return (id >= 0 && id < kNumCommands) ? names[id] : "*unknown-command*"; |
24 } | 26 } |
25 | 27 |
26 } // namespace cmd | 28 } // namespace cmd |
27 } // namespace gpu | 29 } // namespace gpu |
28 | 30 |
29 | 31 |
OLD | NEW |