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..74282e19e38ecef991111f5d158d1296551c80fc 100644 |
| --- a/ui/gl/gl_bindings.cc |
| +++ b/ui/gl/gl_bindings.cc |
| @@ -41,15 +41,17 @@ std::string DriverWGL::GetPlatformExtensions() { |
| #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || defined(USE_OZONE) |
| std::string DriverEGL::GetPlatformExtensions() { |
| - EGLDisplay display = |
| #if defined(OS_WIN) |
| - GLSurfaceEGL::GetPlatformDisplay(GetPlatformDefaultEGLNativeDisplay()); |
| + EGLDisplay display = GLSurfaceEGL::InitializeDisplay(); |
| + if (display == EGL_NO_DISPLAY) |
| + return ""; |
|
Jamie Madill
2015/04/20 18:33:11
I wasn't sure if I should put the NO_DISPLAY check
Zhenyao Mo
2015/04/20 19:51:47
If display isn't valid, eglQueryString just return
Jamie Madill
2015/04/20 20:20:09
One difference - if display is EGL_NO_DISPLAY and
|
| #else |
| - g_driver_egl.fn.eglGetDisplayFn(GetPlatformDefaultEGLNativeDisplay()); |
| -#endif |
| - |
| + EGLDisplay display = |
| + g_driver_egl.fn.eglGetDisplayFn(GetPlatformDefaultEGLNativeDisplay()); |
| DCHECK(g_driver_egl.fn.eglInitializeFn); |
| g_driver_egl.fn.eglInitializeFn(display, NULL, NULL); |
| +#endif |
| + |
| DCHECK(g_driver_egl.fn.eglQueryStringFn); |
| const char* str = g_driver_egl.fn.eglQueryStringFn(display, EGL_EXTENSIONS); |
| return str ? std::string(str) : ""; |