Chromium Code Reviews| Index: ui/gl/gl_surface_egl.cc |
| diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc |
| index a2beccdfc1dbbad16a0ae675463d2c26da6f43e0..4005913c5811e3a979b2d56a12dd2946e362b8d2 100644 |
| --- a/ui/gl/gl_surface_egl.cc |
| +++ b/ui/gl/gl_surface_egl.cc |
| @@ -330,7 +330,7 @@ bool GLSurfaceEGL::IsCreateContextRobustnessSupported() { |
| GLSurfaceEGL::~GLSurfaceEGL() {} |
| -NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(gfx::AcceleratedWidget window) |
| +NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(EGLNativeWindowType window) |
| : window_(window), |
| surface_(NULL), |
| supports_post_sub_buffer_(false), |
| @@ -350,11 +350,6 @@ bool NativeViewGLSurfaceEGL::Initialize( |
| scoped_ptr<VSyncProvider> sync_provider) { |
| DCHECK(!surface_); |
| - if (window_ == kNullAcceleratedWidget) { |
|
rjkroege
2014/03/20 17:52:04
why did you take this out?
spang
2014/03/20 19:06:44
I don't believe there is a NULL value for EGLNativ
|
| - LOG(ERROR) << "Trying to create surface without window."; |
| - return false; |
| - } |
| - |
| if (!GetDisplay()) { |
| LOG(ERROR) << "Trying to create surface with invalid display."; |
| return false; |
| @@ -773,7 +768,7 @@ SurfacelessEGL::~SurfacelessEGL() { |
| // provider is not available. |
| class GLSurfaceOSMesaHeadless : public GLSurfaceOSMesa { |
| public: |
| - explicit GLSurfaceOSMesaHeadless(gfx::AcceleratedWidget window); |
| + explicit GLSurfaceOSMesaHeadless(); |
|
rjkroege
2014/03/20 17:52:04
why not EGLNativeWindow?
spang
2014/03/20 19:06:44
We could, but why pass a value that is not used?
|
| virtual bool IsOffscreen() OVERRIDE; |
| virtual bool SwapBuffers() OVERRIDE; |
| @@ -790,10 +785,8 @@ bool GLSurfaceOSMesaHeadless::IsOffscreen() { return false; } |
| bool GLSurfaceOSMesaHeadless::SwapBuffers() { return true; } |
| -GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless(gfx::AcceleratedWidget window) |
| - : GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)) { |
| - DCHECK(window); |
| -} |
| +GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless() |
| + : GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)) {} |
| GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); } |
| @@ -816,22 +809,27 @@ scoped_refptr<GLSurface> |
| GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) { |
| if (GetGLImplementation() == kGLImplementationOSMesaGL) { |
| - scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless(window)); |
| + scoped_refptr<GLSurface> surface(new GLSurfaceOSMesaHeadless()); |
| if (!surface->Initialize()) |
| return NULL; |
| return surface; |
| } |
| DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2); |
| - if (window) { |
| + if (window != kNullAcceleratedWidget) { |
| + EGLNativeWindowType egl_window; |
| scoped_refptr<NativeViewGLSurfaceEGL> surface; |
| scoped_ptr<VSyncProvider> sync_provider; |
| #if defined(USE_OZONE) |
| - window = gfx::SurfaceFactoryOzone::GetInstance()->RealizeAcceleratedWidget( |
| - window); |
| + egl_window = |
| + gfx::SurfaceFactoryOzone::GetInstance()->RealizeAcceleratedWidget( |
| + window); |
| sync_provider = |
| - gfx::SurfaceFactoryOzone::GetInstance()->CreateVSyncProvider(window); |
| + gfx::SurfaceFactoryOzone::GetInstance()->CreateVSyncProvider( |
| + egl_window); |
| +#else |
| + egl_window = window; |
| #endif |
| - surface = new NativeViewGLSurfaceEGL(window); |
| + surface = new NativeViewGLSurfaceEGL(egl_window); |
| if(surface->Initialize(sync_provider.Pass())) |
| return surface; |
| } else { |