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 |
11 #include <stddef.h> | 11 #include <stddef.h> |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
14 #include <limits> | 14 #include <limits> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/numerics/safe_math.h" | 19 #include "base/numerics/safe_math.h" |
20 #include "gpu/command_buffer/common/gles2_utils_export.h" | 20 #include "gpu/command_buffer/common/gles2_utils_export.h" |
| 21 #include "ui/gfx/geometry/size.h" |
| 22 #include "ui/gl/gpu_preference.h" |
21 | 23 |
22 namespace gpu { | 24 namespace gpu { |
23 namespace gles2 { | 25 namespace gles2 { |
24 | 26 |
25 // Does a multiply and checks for overflow. If the multiply did not overflow | 27 // Does a multiply and checks for overflow. If the multiply did not overflow |
26 // returns true. | 28 // returns true. |
27 | 29 |
28 // Multiplies 2 32 bit unsigned numbers checking for overflow. | 30 // Multiplies 2 32 bit unsigned numbers checking for overflow. |
29 // If there was no overflow returns true. | 31 // If there was no overflow returns true. |
30 inline bool SafeMultiplyUint32(uint32_t a, uint32_t b, uint32_t* dst) { | 32 inline bool SafeMultiplyUint32(uint32_t a, uint32_t b, uint32_t* dst) { |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 CONTEXT_TYPE_OPENGLES3, | 302 CONTEXT_TYPE_OPENGLES3, |
301 CONTEXT_TYPE_LAST = CONTEXT_TYPE_OPENGLES3 | 303 CONTEXT_TYPE_LAST = CONTEXT_TYPE_OPENGLES3 |
302 }; | 304 }; |
303 | 305 |
304 struct GLES2_UTILS_EXPORT ContextCreationAttribHelper { | 306 struct GLES2_UTILS_EXPORT ContextCreationAttribHelper { |
305 ContextCreationAttribHelper(); | 307 ContextCreationAttribHelper(); |
306 ContextCreationAttribHelper(const ContextCreationAttribHelper& other); | 308 ContextCreationAttribHelper(const ContextCreationAttribHelper& other); |
307 | 309 |
308 bool Parse(const std::vector<int32_t>& attribs); | 310 bool Parse(const std::vector<int32_t>& attribs); |
309 | 311 |
| 312 gfx::Size offscreen_framebuffer_size; |
| 313 gl::GpuPreference gpu_preference; |
310 // -1 if invalid or unspecified. | 314 // -1 if invalid or unspecified. |
311 int32_t alpha_size; | 315 int32_t alpha_size; |
312 int32_t blue_size; | 316 int32_t blue_size; |
313 int32_t green_size; | 317 int32_t green_size; |
314 int32_t red_size; | 318 int32_t red_size; |
315 int32_t depth_size; | 319 int32_t depth_size; |
316 int32_t stencil_size; | 320 int32_t stencil_size; |
317 int32_t samples; | 321 int32_t samples; |
318 int32_t sample_buffers; | 322 int32_t sample_buffers; |
319 bool buffer_preserved; | 323 bool buffer_preserved; |
320 bool bind_generates_resource; | 324 bool bind_generates_resource; |
321 bool fail_if_major_perf_caveat; | 325 bool fail_if_major_perf_caveat; |
322 bool lose_context_when_out_of_memory; | 326 bool lose_context_when_out_of_memory; |
323 bool should_use_native_gmb_for_backbuffer; | 327 bool should_use_native_gmb_for_backbuffer; |
324 | 328 |
325 ContextType context_type; | 329 ContextType context_type; |
326 }; | 330 }; |
327 | 331 |
328 } // namespace gles2 | 332 } // namespace gles2 |
329 } // namespace gpu | 333 } // namespace gpu |
330 | 334 |
331 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 335 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
332 | 336 |
OLD | NEW |