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

Unified Diff: ui/gl/gl_context.h

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: address piman's comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: ui/gl/gl_context.h
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h
index ebc98faa88667c0317ab0bcb8f8bf107d3458b3d..542940c7683894bb857e311f97bbb53cf0102583 100644
--- a/ui/gl/gl_context.h
+++ b/ui/gl/gl_context.h
@@ -33,6 +33,12 @@ class GPUTiming;
class GPUTimingClient;
struct GLVersionInfo;
+struct GLContextAttribs {
+ GpuPreference gpu_preference = PreferIntegratedGpu;
+ bool bind_generates_resource = true;
+ bool webgl_compatibility_context = false;
+};
+
// Encapsulates an OpenGL context, hiding platform specific management.
class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
public:
@@ -42,8 +48,8 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// context can be made with other surface's of the same type. The compatible
// surface is only needed for certain platforms like WGL, OSMesa and GLX. It
// should be specific for all platforms though.
- virtual bool Initialize(
- GLSurface* compatible_surface, GpuPreference gpu_preference) = 0;
+ virtual bool Initialize(GLSurface* compatible_surface,
+ const GLContextAttribs& attribs) = 0;
// Makes the GL context and a surface current on the current thread.
virtual bool MakeCurrent(GLSurface* surface) = 0;
@@ -199,7 +205,7 @@ class GL_EXPORT GLContextReal : public GLContext {
GL_EXPORT scoped_refptr<GLContext> InitializeGLContext(
scoped_refptr<GLContext> context,
GLSurface* compatible_surface,
- GpuPreference gpu_preference);
+ const GLContextAttribs& attribs);
} // namespace gl

Powered by Google App Engine
This is Rietveld 408576698