Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: ui/gl/gl_surface_win.cc

Issue 435383002: adds WARP support to Chromium, for Metro mode only, on Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move kViewerConnect Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3cde3ea9c7645ffd1dd9d20cf5ae19f603ccd9be 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,10 @@ scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
}
EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11))
- return EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE;
-
- return EGL_DEFAULT_DISPLAY;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp))
+ return GetDC(NULL);
Ken Russell (switch to Gerrit) 2014/09/02 23:57:29 Is GetDC(NULL) the correct return value when --dis
luken 2014/09/03 00:58:07 It turns out that ANGLE always wants a valid Devic
+ return EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE;
}
} // namespace gfx
« ui/base/ui_base_switches.cc ('K') | « ui/gl/gl_surface_egl.cc ('k') | ui/gl/gl_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698