Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: ui/gl/gl_context.h

Issue 2934733002: Workaround for Intel 6xxx clear to 0/1 bug (Closed)
Patch Set: rebase and move workarounds to gl_context Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 struct GLContextAttribs { 61 struct GLContextAttribs {
62 GpuPreference gpu_preference = PreferIntegratedGpu; 62 GpuPreference gpu_preference = PreferIntegratedGpu;
63 bool bind_generates_resource = true; 63 bool bind_generates_resource = true;
64 bool webgl_compatibility_context = false; 64 bool webgl_compatibility_context = false;
65 bool global_texture_share_group = false; 65 bool global_texture_share_group = false;
66 int client_major_es_version = 3; 66 int client_major_es_version = 3;
67 int client_minor_es_version = 0; 67 int client_minor_es_version = 0;
68 ContextPriority context_priority = ContextPriorityMedium; 68 ContextPriority context_priority = ContextPriorityMedium;
69 }; 69 };
70 70
71 struct GLWorkarounds {
72 // glClearColor does not always work on Intel 6xxx Mac drivers. See
73 // crbug.com/710443.
74 bool clearToBoundaryValuesIsBroken = false;
Zhenyao Mo 2017/06/20 21:34:17 clear_to_boundary_values_broken
jiajia.qin 2017/06/21 02:47:22 Done.
75 };
76
77 // Set the GL workarounds.
78 GL_EXPORT void SetGLWorkarounds(const GLWorkarounds& workarounds);
79
80 // Get the GL workarounds.
81 GL_EXPORT GLWorkarounds GetGLWorkarounds();
82
71 // Encapsulates an OpenGL context, hiding platform specific management. 83 // Encapsulates an OpenGL context, hiding platform specific management.
72 class GL_EXPORT GLContext : public base::RefCounted<GLContext> { 84 class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
73 public: 85 public:
74 explicit GLContext(GLShareGroup* share_group); 86 explicit GLContext(GLShareGroup* share_group);
75 87
76 // Initializes the GL context to be compatible with the given surface. The GL 88 // Initializes the GL context to be compatible with the given surface. The GL
77 // context can be made with other surface's of the same type. The compatible 89 // context can be made with other surface's of the same type. The compatible
78 // surface is only needed for certain platforms like WGL, OSMesa and GLX. It 90 // surface is only needed for certain platforms like WGL, OSMesa and GLX. It
79 // should be specific for all platforms though. 91 // should be specific for all platforms though.
80 virtual bool Initialize(GLSurface* compatible_surface, 92 virtual bool Initialize(GLSurface* compatible_surface,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // scoped_refptr containing the initialized GLContext or nullptr if 277 // scoped_refptr containing the initialized GLContext or nullptr if
266 // initialization fails. 278 // initialization fails.
267 GL_EXPORT scoped_refptr<GLContext> InitializeGLContext( 279 GL_EXPORT scoped_refptr<GLContext> InitializeGLContext(
268 scoped_refptr<GLContext> context, 280 scoped_refptr<GLContext> context,
269 GLSurface* compatible_surface, 281 GLSurface* compatible_surface,
270 const GLContextAttribs& attribs); 282 const GLContextAttribs& attribs);
271 283
272 } // namespace gl 284 } // namespace gl
273 285
274 #endif // UI_GL_GL_CONTEXT_H_ 286 #endif // UI_GL_GL_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698