Apply _RELATIVE relocations ahead of others.
[chromium-blink-merge.git] / gpu / command_buffer / common / cmd_buffer_common.cc
blobf337e86dbf735548b0fab88033a43383d4c7f15a
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
3 // found in the LICENSE file.
5 // This file contains the binary format definition of the command buffer and
6 // command buffer commands.
8 #include "gpu/command_buffer/common/cmd_buffer_common.h"
10 #include "gpu/command_buffer/common/command_buffer.h"
12 namespace gpu {
13 #if !defined(_WIN32)
14 // gcc needs this to link, but MSVC requires it not be present
15 const int32 CommandHeader::kMaxSize;
16 #endif
17 namespace cmd {
19 const char* GetCommandName(CommandId command_id) {
20 static const char* const names[] = {
21 #define COMMON_COMMAND_BUFFER_CMD_OP(name) # name,
23 COMMON_COMMAND_BUFFER_CMDS(COMMON_COMMAND_BUFFER_CMD_OP)
25 #undef COMMON_COMMAND_BUFFER_CMD_OP
28 int id = static_cast<int>(command_id);
29 return (id >= 0 && id < kNumCommands) ? names[id] : "*unknown-command*";
32 } // namespace cmd
34 #if !defined(NACL_WIN64)
35 // TODO(apatrick): this is a temporary optimization while skia is calling
36 // RendererGLContext::MakeCurrent prior to every GL call. It saves returning 6
37 // ints redundantly when only the error is needed for the CommandBufferProxy
38 // implementation.
39 error::Error CommandBuffer::GetLastError() {
40 return GetLastState().error;
42 #endif
44 } // namespace gpu