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 defines the GLES2 command buffer commands. | 5 // This file defines the GLES2 command buffer commands. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 7 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
8 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 8 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
9 | 9 |
10 // This is here because service side code must include the system's version of | 10 // This is here because service side code must include the system's version of |
11 // the GL headers where as client side code includes the Chrome version. | 11 // the GL headers where as client side code includes the Chrome version. Also |
12 #ifdef GLES2_GPU_SERVICE | 12 // the unit test code must include a mock GL header. |
| 13 #if defined(UNIT_TEST) |
| 14 #include "gpu/command_buffer/service/gl_mock.h" |
| 15 #elif defined(GLES2_GPU_SERVICE) |
13 #include <GL/glew.h> | 16 #include <GL/glew.h> |
14 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
15 #include <GL/wglew.h> | 18 #include <GL/wglew.h> |
16 #endif | 19 #endif |
17 #else | 20 #else |
18 #include <GLES2/gl2types.h> | 21 #include <GLES2/gl2types.h> |
19 #endif | 22 #endif |
20 | 23 |
21 #include "base/basictypes.h" | 24 #include "base/basictypes.h" |
22 #include "gpu/command_buffer/common/types.h" | 25 #include "gpu/command_buffer/common/types.h" |
23 #include "gpu/command_buffer/common/bitfield_helpers.h" | 26 #include "gpu/command_buffer/common/bitfield_helpers.h" |
24 #include "gpu/command_buffer/common/cmd_buffer_common.h" | 27 #include "gpu/command_buffer/common/cmd_buffer_common.h" |
25 #include "gpu/command_buffer/common/gles2_cmd_ids.h" | 28 #include "gpu/command_buffer/common/gles2_cmd_ids.h" |
26 | 29 |
27 namespace gpu { | 30 namespace gpu { |
28 namespace gles2 { | 31 namespace gles2 { |
29 | 32 |
| 33 #pragma pack(push, 1) |
| 34 |
30 #include "gpu/command_buffer/common/gles2_cmd_format_autogen.h" | 35 #include "gpu/command_buffer/common/gles2_cmd_format_autogen.h" |
31 | 36 |
32 // These are hand written commands. | 37 // These are hand written commands. |
33 // TODO(gman): Attempt to make these auto-generated. | 38 // TODO(gman): Attempt to make these auto-generated. |
34 | 39 |
35 struct GetAttribLocation { | 40 struct GetAttribLocation { |
36 typedef GetAttribLocation ValueType; | 41 typedef GetAttribLocation ValueType; |
37 static const CommandId kCmdId = kGetAttribLocation; | 42 static const CommandId kCmdId = kGetAttribLocation; |
38 static const cmd::ArgFlags kArgFlags = cmd::kFixed; | 43 static const cmd::ArgFlags kArgFlags = cmd::kFixed; |
39 | 44 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, program) == 4, | 271 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, program) == 4, |
267 OffsetOf_GetUniformLocationImmediate_program_not_4); | 272 OffsetOf_GetUniformLocationImmediate_program_not_4); |
268 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, location_shm_id) == 8, | 273 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, location_shm_id) == 8, |
269 OffsetOf_GetUniformLocationImmediate_location_shm_id_not_8); | 274 OffsetOf_GetUniformLocationImmediate_location_shm_id_not_8); |
270 COMPILE_ASSERT( | 275 COMPILE_ASSERT( |
271 offsetof(GetUniformLocationImmediate, location_shm_offset) == 12, | 276 offsetof(GetUniformLocationImmediate, location_shm_offset) == 12, |
272 OffsetOf_GetUniformLocationImmediate_location_shm_offset_not_12); | 277 OffsetOf_GetUniformLocationImmediate_location_shm_offset_not_12); |
273 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16, | 278 COMPILE_ASSERT(offsetof(GetUniformLocationImmediate, data_size) == 16, |
274 OffsetOf_GetUniformLocationImmediate_data_size_not_16); | 279 OffsetOf_GetUniformLocationImmediate_data_size_not_16); |
275 | 280 |
| 281 #pragma pack(pop) |
276 | 282 |
277 } // namespace gles2 | 283 } // namespace gles2 |
278 } // namespace gpu | 284 } // namespace gpu |
279 | 285 |
280 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 286 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
281 | 287 |
OLD | NEW |