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

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: don't check command line if it isn't there 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..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
« ui/gl/gl_surface_egl.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