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 // This file is here so other GLES2 related files can have a common set of | 5 // This file is here so other GLES2 related files can have a common set of |
6 // includes where appropriate. | 6 // includes where appropriate. |
7 | 7 |
8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
10 | 10 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 static std::string GetQualifiedEnumString( | 199 static std::string GetQualifiedEnumString( |
200 const EnumToString* table, size_t count, uint32_t value); | 200 const EnumToString* table, size_t count, uint32_t value); |
201 | 201 |
202 static const EnumToString* const enum_to_string_table_; | 202 static const EnumToString* const enum_to_string_table_; |
203 static const size_t enum_to_string_table_len_; | 203 static const size_t enum_to_string_table_len_; |
204 | 204 |
205 int num_compressed_texture_formats_; | 205 int num_compressed_texture_formats_; |
206 int num_shader_binary_formats_; | 206 int num_shader_binary_formats_; |
207 }; | 207 }; |
208 | 208 |
| 209 enum ContextType { |
| 210 CONTEXT_TYPE_WEBGL1, |
| 211 CONTEXT_TYPE_WEBGL2, |
| 212 CONTEXT_TYPE_OPENGLES2, |
| 213 CONTEXT_TYPE_OPENGLES3 |
| 214 }; |
| 215 |
209 struct GLES2_UTILS_EXPORT ContextCreationAttribHelper { | 216 struct GLES2_UTILS_EXPORT ContextCreationAttribHelper { |
210 ContextCreationAttribHelper(); | 217 ContextCreationAttribHelper(); |
211 | 218 |
212 void Serialize(std::vector<int32_t>* attribs) const; | 219 void Serialize(std::vector<int32_t>* attribs) const; |
213 bool Parse(const std::vector<int32_t>& attribs); | 220 bool Parse(const std::vector<int32_t>& attribs); |
214 | 221 |
215 // -1 if invalid or unspecified. | 222 // -1 if invalid or unspecified. |
216 int32_t alpha_size; | 223 int32_t alpha_size; |
217 int32_t blue_size; | 224 int32_t blue_size; |
218 int32_t green_size; | 225 int32_t green_size; |
219 int32_t red_size; | 226 int32_t red_size; |
220 int32_t depth_size; | 227 int32_t depth_size; |
221 int32_t stencil_size; | 228 int32_t stencil_size; |
222 int32_t samples; | 229 int32_t samples; |
223 int32_t sample_buffers; | 230 int32_t sample_buffers; |
224 bool buffer_preserved; | 231 bool buffer_preserved; |
225 bool bind_generates_resource; | 232 bool bind_generates_resource; |
226 bool fail_if_major_perf_caveat; | 233 bool fail_if_major_perf_caveat; |
227 bool lose_context_when_out_of_memory; | 234 bool lose_context_when_out_of_memory; |
228 // 0 if not a WebGL context. | 235 ContextType context_type; |
229 unsigned webgl_version; | |
230 }; | 236 }; |
231 | 237 |
232 } // namespace gles2 | 238 } // namespace gles2 |
233 } // namespace gpu | 239 } // namespace gpu |
234 | 240 |
235 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 241 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
236 | 242 |
OLD | NEW |