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 CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 virtual WGC3Denum getGraphicsResetStatusARB(); | 155 virtual WGC3Denum getGraphicsResetStatusARB(); |
156 | 156 |
157 private: | 157 private: |
158 // These are the same error codes as used by EGL. | 158 // These are the same error codes as used by EGL. |
159 enum Error { | 159 enum Error { |
160 SUCCESS = 0x3000, | 160 SUCCESS = 0x3000, |
161 BAD_ATTRIBUTE = 0x3004, | 161 BAD_ATTRIBUTE = 0x3004, |
162 CONTEXT_LOST = 0x300E | 162 CONTEXT_LOST = 0x300E |
163 }; | 163 }; |
164 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in | |
165 // the 16-bit range are the same as used by EGL. Those outside the 16-bit | |
166 // range are unique to Chromium. Attributes are matched using a closest fit | |
167 // algorithm. | |
168 // Changes to this enum should also be copied to | |
169 // gpu/command_buffer/common/gles2_cmd_utils.cc and to | |
170 // gpu/command_buffer/client/gl_in_process_context.cc | |
171 enum Attribute { | |
172 ALPHA_SIZE = 0x3021, | |
173 BLUE_SIZE = 0x3022, | |
174 GREEN_SIZE = 0x3023, | |
175 RED_SIZE = 0x3024, | |
176 DEPTH_SIZE = 0x3025, | |
177 STENCIL_SIZE = 0x3026, | |
178 SAMPLES = 0x3031, | |
179 SAMPLE_BUFFERS = 0x3032, | |
180 HEIGHT = 0x3056, | |
181 WIDTH = 0x3057, | |
182 NONE = 0x3038, // Attrib list = terminator | |
183 SHARE_RESOURCES = 0x10000, | |
184 BIND_GENERATES_RESOURCES = 0x10001, | |
185 FAIL_IF_MAJOR_PERF_CAVEAT = 0x10002, | |
186 LOSE_CONTEXT_WHEN_OUT_OF_MEMORY = 0x10003, | |
187 }; | |
188 | 164 |
189 // Initialize the underlying GL context. May be called multiple times; second | 165 // Initialize the underlying GL context. May be called multiple times; second |
190 // and subsequent calls are ignored. Must be called from the thread that is | 166 // and subsequent calls are ignored. Must be called from the thread that is |
191 // going to use this object to issue GL commands (which might not be the main | 167 // going to use this object to issue GL commands (which might not be the main |
192 // thread). | 168 // thread). |
193 bool MaybeInitializeGL(); | 169 bool MaybeInitializeGL(); |
194 | 170 |
195 bool InitializeCommandBuffer(bool onscreen, | 171 bool InitializeCommandBuffer(bool onscreen, |
196 WebGraphicsContext3DCommandBufferImpl* share_context); | 172 WebGraphicsContext3DCommandBufferImpl* share_context); |
197 | 173 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 scoped_ptr<gpu::gles2::GLES2Implementation> real_gl_; | 210 scoped_ptr<gpu::gles2::GLES2Implementation> real_gl_; |
235 scoped_ptr<gpu::gles2::GLES2Interface> trace_gl_; | 211 scoped_ptr<gpu::gles2::GLES2Interface> trace_gl_; |
236 Error last_error_; | 212 Error last_error_; |
237 SharedMemoryLimits mem_limits_; | 213 SharedMemoryLimits mem_limits_; |
238 scoped_refptr<ShareGroup> share_group_; | 214 scoped_refptr<ShareGroup> share_group_; |
239 }; | 215 }; |
240 | 216 |
241 } // namespace content | 217 } // namespace content |
242 | 218 |
243 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 219 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |