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

Unified Diff: ui/gl/gl_surface_android.cc

Issue 1168993002: Update the native_viewport interface to allow specification of the surface configuration, currently… (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: ui/gl/gl_surface_android.cc
diff --git a/ui/gl/gl_surface_android.cc b/ui/gl/gl_surface_android.cc
index 1254da225bdcbed21d6fe76091e5bb6087099317..eb6b491f8399f50f5eba5c846c0d7b1bfdc2fd2e 100644
--- a/ui/gl/gl_surface_android.cc
+++ b/ui/gl/gl_surface_android.cc
@@ -31,21 +31,25 @@ bool GLSurface::InitializeOneOffInternal() {
// static
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
- gfx::AcceleratedWidget window) {
+ gfx::AcceleratedWidget window,
+ SurfaceConfiguration requested_configuration) {
abarth-chromium 2015/06/09 00:30:22 const gfx::SurfaceConfiguration& Below you use th
iansf 2015/06/09 01:52:05 Done.
CHECK_NE(kGLImplementationNone, GetGLImplementation());
if (GetGLImplementation() == kGLImplementationOSMesaGL) {
- scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless());
+ scoped_refptr<GLSurface> surface(
+ new GLSurfaceOSMesaHeadless(SurfaceConfiguration()));
if (!surface->Initialize())
return NULL;
return surface;
}
DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2);
if (window != kNullAcceleratedWidget) {
- scoped_refptr<GLSurface> surface = new NativeViewGLSurfaceEGL(window);
+ scoped_refptr<GLSurface> surface =
+ new NativeViewGLSurfaceEGL(window, requested_configuration);
if (surface->Initialize())
return surface;
} else {
- scoped_refptr<GLSurface> surface = new GLSurfaceStub();
+ scoped_refptr<GLSurface> surface =
+ new GLSurfaceStub(requested_configuration);
if (surface->Initialize())
return surface;
}
@@ -54,12 +58,13 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
// static
scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
- const gfx::Size& size) {
+ const gfx::Size& size,
+ gfx::SurfaceConfiguration requested_configuration) {
abarth-chromium 2015/06/09 00:30:22 const gfx::SurfaceConfiguration&
iansf 2015/06/09 01:52:04 Done.
CHECK_NE(kGLImplementationNone, GetGLImplementation());
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL: {
- scoped_refptr<GLSurface> surface(
- new GLSurfaceOSMesa(OSMesaSurfaceFormatBGRA, size));
+ scoped_refptr<GLSurface> surface(new GLSurfaceOSMesa(
+ OSMesaSurfaceFormatBGRA, size, requested_configuration));
if (!surface->Initialize())
return NULL;
@@ -69,9 +74,9 @@ scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
scoped_refptr<GLSurface> surface;
if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
(size.width() == 0 && size.height() == 0)) {
- surface = new SurfacelessEGL(size);
+ surface = new SurfacelessEGL(size, requested_configuration);
} else {
- surface = new PbufferGLSurfaceEGL(size);
+ surface = new PbufferGLSurfaceEGL(size, requested_configuration);
}
if (!surface->Initialize())

Powered by Google App Engine
This is Rietveld 408576698