OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
7 | 7 |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <queue> | 11 #include <queue> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "../common/gles2_cmd_utils.h" | 16 #include "../common/gles2_cmd_utils.h" |
17 #include "../common/scoped_ptr.h" | 17 #include "../common/scoped_ptr.h" |
18 #include "../client/gles2_cmd_helper.h" | 18 #include "../client/gles2_cmd_helper.h" |
19 #include "../client/ring_buffer.h" | 19 #include "../client/ring_buffer.h" |
20 #include "gles2_impl_export.h" | |
21 | 20 |
22 #if !defined(NDEBUG) && !defined(__native_client__) && !defined(GLES2_CONFORMANC
E_TESTS) // NOLINT | 21 #if !defined(NDEBUG) && !defined(__native_client__) && !defined(GLES2_CONFORMANC
E_TESTS) // NOLINT |
23 #if defined(GLES2_INLINE_OPTIMIZATION) | 22 #if defined(GLES2_INLINE_OPTIMIZATION) |
24 // TODO(gman): Replace with macros that work with inline optmization. | 23 // TODO(gman): Replace with macros that work with inline optmization. |
25 #define GPU_CLIENT_SINGLE_THREAD_CHECK() | 24 #define GPU_CLIENT_SINGLE_THREAD_CHECK() |
26 #define GPU_CLIENT_LOG(args) | 25 #define GPU_CLIENT_LOG(args) |
27 #define GPU_CLIENT_LOG_CODE_BLOCK(code) | 26 #define GPU_CLIENT_LOG_CODE_BLOCK(code) |
28 #define GPU_CLIENT_DCHECK_CODE_BLOCK(code) | 27 #define GPU_CLIENT_DCHECK_CODE_BLOCK(code) |
29 #else | 28 #else |
30 #include "base/logging.h" | 29 #include "base/logging.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Marks an id as used for glBind functions. id = 0 does nothing. | 97 // Marks an id as used for glBind functions. id = 0 does nothing. |
99 virtual bool MarkAsUsedForBind(GLuint id) = 0; | 98 virtual bool MarkAsUsedForBind(GLuint id) = 0; |
100 }; | 99 }; |
101 | 100 |
102 // This class emulates GLES2 over command buffers. It can be used by a client | 101 // This class emulates GLES2 over command buffers. It can be used by a client |
103 // program so that the program does not need deal with shared memory and command | 102 // program so that the program does not need deal with shared memory and command |
104 // buffer management. See gl2_lib.h. Note that there is a performance gain to | 103 // buffer management. See gl2_lib.h. Note that there is a performance gain to |
105 // be had by changing your code to use command buffers directly by using the | 104 // be had by changing your code to use command buffers directly by using the |
106 // GLES2CmdHelper but that entails changing your code to use and deal with | 105 // GLES2CmdHelper but that entails changing your code to use and deal with |
107 // shared memory and synchronization issues. | 106 // shared memory and synchronization issues. |
108 class GLES2_IMPL_EXPORT GLES2Implementation { | 107 class GLES2Implementation { |
109 public: | 108 public: |
110 // Stores client side cached GL state. | 109 // Stores client side cached GL state. |
111 struct GLState { | 110 struct GLState { |
112 GLState() | 111 GLState() |
113 : max_combined_texture_image_units(0), | 112 : max_combined_texture_image_units(0), |
114 max_cube_map_texture_size(0), | 113 max_cube_map_texture_size(0), |
115 max_fragment_uniform_vectors(0), | 114 max_fragment_uniform_vectors(0), |
116 max_renderbuffer_size(0), | 115 max_renderbuffer_size(0), |
117 max_texture_image_units(0), | 116 max_texture_image_units(0), |
118 max_texture_size(0), | 117 max_texture_size(0), |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 | 548 |
550 inline bool GLES2Implementation::GetTexParameterivHelper( | 549 inline bool GLES2Implementation::GetTexParameterivHelper( |
551 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 550 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
552 return false; | 551 return false; |
553 } | 552 } |
554 | 553 |
555 } // namespace gles2 | 554 } // namespace gles2 |
556 } // namespace gpu | 555 } // namespace gpu |
557 | 556 |
558 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 557 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
OLD | NEW |