Chromium Code Reviews| Index: ui/gl/gl_bindings.cc |
| diff --git a/ui/gl/gl_bindings.cc b/ui/gl/gl_bindings.cc |
| index 83b6b594e2dbbd2d967e6f551f173b7422f9983c..cfd8c5106805ccb11e7cf9b1dd087cd948e1f66e 100644 |
| --- a/ui/gl/gl_bindings.cc |
| +++ b/ui/gl/gl_bindings.cc |
| @@ -43,13 +43,17 @@ std::string DriverWGL::GetPlatformExtensions() { |
| std::string DriverEGL::GetPlatformExtensions() { |
| EGLDisplay display = |
| #if defined(OS_WIN) |
| - GLSurfaceEGL::GetPlatformDisplay(GetPlatformDefaultEGLNativeDisplay()); |
| + GLSurfaceEGL::InitializeDisplay(); |
| + if (display == EGL_NO_DISPLAY) |
| + return ""; |
| #else |
| - g_driver_egl.fn.eglGetDisplayFn(GetPlatformDefaultEGLNativeDisplay()); |
| -#endif |
| - |
| + g_driver_egl.fn.eglGetDisplayFn(GetPlatformDefaultEGLNativeDisplay()); |
| + if (display == EGL_NO_DISPLAY) |
| + return ""; |
| DCHECK(g_driver_egl.fn.eglInitializeFn); |
| g_driver_egl.fn.eglInitializeFn(display, NULL, NULL); |
|
piman
2015/04/23 21:03:30
It would be easier to follow if both OS_WIN and !O
|
| +#endif |
| + |
| DCHECK(g_driver_egl.fn.eglQueryStringFn); |
| const char* str = g_driver_egl.fn.eglQueryStringFn(display, EGL_EXTENSIONS); |
| return str ? std::string(str) : ""; |
| @@ -57,6 +61,7 @@ std::string DriverEGL::GetPlatformExtensions() { |
| // static |
| std::string DriverEGL::GetClientExtensions() { |
| + DCHECK(g_driver_egl.fn.eglQueryStringFn); |
| const char* str = |
| g_driver_egl.fn.eglQueryStringFn(EGL_NO_DISPLAY, EGL_EXTENSIONS); |
| return str ? std::string(str) : ""; |