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 8c29342ab408e2f0e10fb0ff370807d449c5646c..5376b6ceb9abf7bb5016ae8c3fc31c9266d57e17 100644 |
| --- a/ui/gl/gl_surface_egl.cc |
| +++ b/ui/gl/gl_surface_egl.cc |
| @@ -25,6 +25,10 @@ |
| #include "ui/gl/gl_switches.h" |
| #include "ui/gl/scoped_make_current.h" |
| +#if defined(OS_ANDROID) |
| +#include "ui/gl/android/surface_factory_android.h" |
| +#endif |
| + |
| #if defined(USE_X11) |
| extern "C" { |
| #include <X11/Xlib.h> |
| @@ -647,7 +651,15 @@ GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window) { |
| if(surface->Initialize(sync_provider)) |
| return surface; |
| } else { |
| - scoped_refptr<GLSurface> surface = new GLSurfaceStub(); |
| + scoped_refptr<GLSurface> surface; |
| + |
| +#if defined(OS_ANDROID) |
| + if (SurfaceFactoryAndroid* factory = SurfaceFactoryAndroid::GetInstance()) |
| + surface = factory->CreateNonOwnedViewSurface(); |
|
no sievers
2013/08/06 20:31:29
null check factory or tests will crash
boliu
2013/08/06 21:10:06
That's what the if is for :)
|
| +#endif |
| + |
| + if (!surface) |
| + surface = new GLSurfaceStub(); |
| if (surface->Initialize()) |
| return surface; |
| } |