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

Unified Diff: ui/gl/init/gl_factory_android.cc

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/init/gl_factory_android.cc
diff --git a/ui/gl/init/gl_factory_android.cc b/ui/gl/init/gl_factory_android.cc
index 739684693278773940a04d4a09e44bbed2f920b8..dbab9b003175e488e2714f66cb86b2fc041049bc 100644
--- a/ui/gl/init/gl_factory_android.cc
+++ b/ui/gl/init/gl_factory_android.cc
@@ -33,7 +33,7 @@ class GLNonOwnedContext : public GLContextReal {
// Implement GLContext.
bool Initialize(GLSurface* compatible_surface,
- GpuPreference gpu_preference) override;
+ const GLContextAttribs& attribs) override;
bool MakeCurrent(GLSurface* surface) override;
void ReleaseCurrent(GLSurface* surface) override {}
bool IsCurrent(GLSurface* surface) override { return true; }
@@ -54,7 +54,7 @@ GLNonOwnedContext::GLNonOwnedContext(GLShareGroup* share_group)
: GLContextReal(share_group), display_(nullptr) {}
bool GLNonOwnedContext::Initialize(GLSurface* compatible_surface,
- GpuPreference gpu_preference) {
+ const GLContextAttribs& attribs) {
display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY);
return true;
}
@@ -94,21 +94,21 @@ bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) {
scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group,
GLSurface* compatible_surface,
- GpuPreference gpu_preference) {
+ const GLContextAttribs& attribs) {
TRACE_EVENT0("gpu", "gl::init::CreateGLContext");
switch (GetGLImplementation()) {
case kGLImplementationMockGL:
return scoped_refptr<GLContext>(new GLContextStub(share_group));
case kGLImplementationOSMesaGL:
return InitializeGLContext(new GLContextOSMesa(share_group),
- compatible_surface, gpu_preference);
+ compatible_surface, attribs);
default:
if (compatible_surface->GetHandle()) {
return InitializeGLContext(new GLContextEGL(share_group),
- compatible_surface, gpu_preference);
+ compatible_surface, attribs);
} else {
return InitializeGLContext(new GLNonOwnedContext(share_group),
- compatible_surface, gpu_preference);
+ compatible_surface, attribs);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698