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 UI_GL_GL_CONTEXT_H_ | 5 #ifndef UI_GL_GL_CONTEXT_H_ |
6 #define UI_GL_GL_CONTEXT_H_ | 6 #define UI_GL_GL_CONTEXT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 21 matching lines...) Expand all Loading... |
32 class DebugGLApi; | 32 class DebugGLApi; |
33 struct DriverGL; | 33 struct DriverGL; |
34 class GLApi; | 34 class GLApi; |
35 class GLSurface; | 35 class GLSurface; |
36 class GPUTiming; | 36 class GPUTiming; |
37 class GPUTimingClient; | 37 class GPUTimingClient; |
38 struct GLVersionInfo; | 38 struct GLVersionInfo; |
39 class RealGLApi; | 39 class RealGLApi; |
40 class TraceGLApi; | 40 class TraceGLApi; |
41 | 41 |
| 42 // Where available, choose a GL context priority for devices that support it. |
| 43 // Currently this requires the EGL_IMG_context_priority extension that is |
| 44 // present on Daydream ready Android devices. Default is Medium, and the |
| 45 // attribute is ignored if the extension is missing. |
| 46 // |
| 47 // "High" priority must only be used for special cases with strong realtime |
| 48 // requirements, it is incompatible with other critical system GL work such as |
| 49 // the GVR library's asynchronous reprojection for VR viewing. Please avoid |
| 50 // using it for any GL contexts that may be used during VR presentation, |
| 51 // see crbug.com/727800. |
| 52 // |
| 53 // Instead, consider using "Low" priority for possibly-slow GL work such as |
| 54 // user WebGL content. |
42 enum ContextPriority { | 55 enum ContextPriority { |
43 ContextPriorityLow, | 56 ContextPriorityLow, |
44 ContextPriorityMedium, | 57 ContextPriorityMedium, |
45 ContextPriorityHigh | 58 ContextPriorityHigh |
46 }; | 59 }; |
47 | 60 |
48 struct GLContextAttribs { | 61 struct GLContextAttribs { |
49 GpuPreference gpu_preference = PreferIntegratedGpu; | 62 GpuPreference gpu_preference = PreferIntegratedGpu; |
50 bool bind_generates_resource = true; | 63 bool bind_generates_resource = true; |
51 bool webgl_compatibility_context = false; | 64 bool webgl_compatibility_context = false; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // scoped_refptr containing the initialized GLContext or nullptr if | 260 // scoped_refptr containing the initialized GLContext or nullptr if |
248 // initialization fails. | 261 // initialization fails. |
249 GL_EXPORT scoped_refptr<GLContext> InitializeGLContext( | 262 GL_EXPORT scoped_refptr<GLContext> InitializeGLContext( |
250 scoped_refptr<GLContext> context, | 263 scoped_refptr<GLContext> context, |
251 GLSurface* compatible_surface, | 264 GLSurface* compatible_surface, |
252 const GLContextAttribs& attribs); | 265 const GLContextAttribs& attribs); |
253 | 266 |
254 } // namespace gl | 267 } // namespace gl |
255 | 268 |
256 #endif // UI_GL_GL_CONTEXT_H_ | 269 #endif // UI_GL_GL_CONTEXT_H_ |
OLD | NEW |