| 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 |
| 11 // the GL headers where as client side code includes the Chrome version. Also | 11 #include <KHR/khrplatform.h> |
| 12 // the unit test code must include a mock GL header. | |
| 13 #if defined(UNIT_TEST) | |
| 14 #include "../service/gl_mock.h" | |
| 15 #elif defined(GLES2_GPU_SERVICE) | |
| 16 // TODO(gman): Set this from gyp | |
| 17 // #define GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2 1 | |
| 18 #if defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) | |
| 19 #include <GLES2/gl2.h> // NOLINT | |
| 20 #else // !GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2 | |
| 21 #include <GL/glew.h> // NOLINT | |
| 22 #if defined(OS_WIN) | |
| 23 #include <GL/wglew.h> // NOLINT | |
| 24 #endif | |
| 25 #endif // !GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2 | |
| 26 #else // !GLES2_CPU_SERVICE | |
| 27 #include <GLES2/gl2types.h> // NOLINT | |
| 28 #endif // UNIT_TEST | |
| 29 | 12 |
| 30 #include <string.h> | 13 #include <string.h> |
| 31 | 14 |
| 32 #include "../common/types.h" | 15 #include "../common/types.h" |
| 33 #include "../common/bitfield_helpers.h" | 16 #include "../common/bitfield_helpers.h" |
| 34 #include "../common/cmd_buffer_common.h" | 17 #include "../common/cmd_buffer_common.h" |
| 35 #include "../common/gles2_cmd_ids.h" | 18 #include "../common/gles2_cmd_ids.h" |
| 36 | 19 |
| 20 // GL types are forward declared to avoid including the GL headers. The problem |
| 21 // is determining which GL headers to include from code that is common to the |
| 22 // client and service sides (GLES2 or one of several GL implementations). |
| 23 typedef unsigned int GLenum; |
| 24 typedef unsigned int GLbitfield; |
| 25 typedef unsigned int GLuint; |
| 26 typedef int GLint; |
| 27 typedef int GLsizei; |
| 28 typedef unsigned char GLboolean; |
| 29 typedef signed char GLbyte; |
| 30 typedef short GLshort; |
| 31 typedef unsigned char GLubyte; |
| 32 typedef unsigned short GLushort; |
| 33 typedef unsigned long GLulong; |
| 34 typedef float GLfloat; |
| 35 typedef float GLclampf; |
| 36 typedef double GLdouble; |
| 37 typedef double GLclampd; |
| 38 typedef void GLvoid; |
| 39 typedef khronos_intptr_t GLintptr; |
| 40 typedef khronos_ssize_t GLsizeiptr; |
| 41 |
| 37 namespace gpu { | 42 namespace gpu { |
| 38 namespace gles2 { | 43 namespace gles2 { |
| 39 | 44 |
| 40 #pragma pack(push, 1) | 45 #pragma pack(push, 1) |
| 41 | 46 |
| 42 namespace id_namespaces { | 47 namespace id_namespaces { |
| 43 | 48 |
| 44 // These are used when contexts share resources. | 49 // These are used when contexts share resources. |
| 45 enum IdNamespaces { | 50 enum IdNamespaces { |
| 46 kBuffers, | 51 kBuffers, |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 COMPILE_ASSERT(offsetof(GetUniformLocationBucket, location_shm_offset) == 16, | 480 COMPILE_ASSERT(offsetof(GetUniformLocationBucket, location_shm_offset) == 16, |
| 476 OffsetOf_GetUniformLocationBucket_location_shm_offset_not_16); | 481 OffsetOf_GetUniformLocationBucket_location_shm_offset_not_16); |
| 477 | 482 |
| 478 #pragma pack(pop) | 483 #pragma pack(pop) |
| 479 | 484 |
| 480 } // namespace gles2 | 485 } // namespace gles2 |
| 481 } // namespace gpu | 486 } // namespace gpu |
| 482 | 487 |
| 483 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ | 488 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_H_ |
| 484 | 489 |
| OLD | NEW |