| 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; | 11 #if !defined(OS_WIN) |
| 12 | 12 // gcc needs this to link, but MSVC requires it not be present |
| 13 const int32 CommandHeader::kMaxSize; |
| 14 #endif |
| 13 namespace cmd { | 15 namespace cmd { |
| 14 | 16 |
| 15 const char* GetCommandName(CommandId command_id) { | 17 const char* GetCommandName(CommandId command_id) { |
| 16 static const char* const names[] = { | 18 static const char* const names[] = { |
| 17 #define COMMON_COMMAND_BUFFER_CMD_OP(name) # name, | 19 #define COMMON_COMMAND_BUFFER_CMD_OP(name) # name, |
| 18 | 20 |
| 19 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP) | 21 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP) |
| 20 | 22 |
| 21 #undef COMMON_COMMAND_BUFFER_CMD_OP | 23 #undef COMMON_COMMAND_BUFFER_CMD_OP |
| 22 }; | 24 }; |
| 23 | 25 |
| 24 int id = static_cast<int>(command_id); | 26 int id = static_cast<int>(command_id); |
| 25 return (id >= 0 && id < kNumCommands) ? names[id] : "*unknown-command*"; | 27 return (id >= 0 && id < kNumCommands) ? names[id] : "*unknown-command*"; |
| 26 } | 28 } |
| 27 | 29 |
| 28 } // namespace cmd | 30 } // namespace cmd |
| 29 } // namespace gpu | 31 } // namespace gpu |
| 30 | 32 |
| 31 | 33 |
| OLD | NEW |