Index: ui/gl/gl_surface_egl.cc |
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc |
index 976052a2f4602ad05430fb227670fdda2897bd30..026bc89b4ade8d50f6bd9cd1f06b4c473e952c2e 100644 |
--- a/ui/gl/gl_surface_egl.cc |
+++ b/ui/gl/gl_surface_egl.cc |
@@ -29,6 +29,7 @@ |
#if defined(USE_X11) |
extern "C" { |
#include <X11/Xlib.h> |
+#define Status int |
} |
#endif |
@@ -38,6 +39,7 @@ extern "C" { |
#endif |
#if defined(USE_X11) && !defined(OS_CHROMEOS) |
+#include "ui/base/x/x11_util_internal.h" |
#include "ui/gfx/x/x11_switches.h" |
#endif |
@@ -76,6 +78,11 @@ extern "C" { |
#define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320E |
#endif /* EGL_ANGLE_platform_angle_opengl */ |
+#ifndef EGL_ANGLE_x11_visual |
+#define EGL_ANGLE_x11_visual 1 |
+#define EGL_X11_VISUAL_ID_ANGLE 0x33A3 |
+#endif /* EGL_ANGLE_x11_visual */ |
+ |
using ui::GetLastEGLErrorString; |
namespace gfx { |
@@ -149,6 +156,13 @@ EGLDisplay GetPlatformANGLEDisplay(EGLNativeDisplayType native_display, |
display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE); |
} |
+#if defined(USE_X11) && !defined(OS_CHROMEOS) |
+ Visual* visual; |
+ ui::ChooseVisualForWindow(&visual, nullptr); |
+ display_attribs.push_back(EGL_X11_VISUAL_ID_ANGLE); |
Ken Russell (switch to Gerrit)
2015/12/07 22:10:12
Should this code block test for the presence of th
Corentin Wallez
2015/12/07 22:13:12
I don't think it has to since the code above doesn
|
+ display_attribs.push_back((EGLint)visual->visualid); |
+#endif |
+ |
display_attribs.push_back(EGL_NONE); |
return eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, |