Chromium Code Reviews| Index: ui/gl/gl_surface_win.cc |
| diff --git a/ui/gl/gl_surface_win.cc b/ui/gl/gl_surface_win.cc |
| index 000110368d94a0cbe547213979675b1fcffef10c..e16464315d608130e7df5a3907fba9d9158f423d 100644 |
| --- a/ui/gl/gl_surface_win.cc |
| +++ b/ui/gl/gl_surface_win.cc |
| @@ -25,6 +25,15 @@ |
| #define EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE \ |
| reinterpret_cast<EGLNativeDisplayType>(-2) |
| #endif |
| +#if !defined(EGL_PLATFORM_ANGLE_ANGLE) |
| +#define EGL_PLATFORM_ANGLE_ANGLE 0x3201 |
| +#endif |
| +#if !defined(EGL_PLATFORM_ANGLE_TYPE_ANGLE) |
| +#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3202 |
| +#endif |
| +#if !defined(EGL_PLATFORM_ANGLE_TYPE_D3D11_WARP_ANGLE) |
| +#define EGL_PLATFORM_ANGLE_TYPE_D3D11_WARP_ANGLE 0x3206 |
| +#endif |
| namespace gfx { |
| @@ -294,10 +303,23 @@ scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( |
| } |
| EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
| - if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11)) |
|
Geoff Lang
2014/08/27 21:05:05
It reverted to D3D9 because this logic was removed
luken
2014/08/28 23:50:33
Done.
|
| - return EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; |
| + return GetDC(NULL); |
| +} |
| + |
| +static const EGLint kDisplayAttribsWarp[] { |
| + EGL_PLATFORM_ANGLE_TYPE_ANGLE, |
| + EGL_PLATFORM_ANGLE_TYPE_D3D11_WARP_ANGLE, |
| + EGL_NONE |
| +}; |
| + |
| +const EGLenum GetPlatformDefaultEGLNativePlatform() { |
| + return EGL_PLATFORM_ANGLE_ANGLE; |
| +} |
| - return EGL_DEFAULT_DISPLAY; |
| +const EGLint* GetPlatformDefaultEGLNativeDisplayAttributes() { |
| + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp)) |
| + return kDisplayAttribsWarp; |
| + return NULL; |
|
Geoff Lang
2014/08/27 21:05:05
Not supplying a platform type to eglGetPlatformDis
luken
2014/08/28 23:50:33
Done.
|
| } |
| } // namespace gfx |