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

Unified Diff: ui/gl/gl_surface_egl.cc

Issue 1504903003: Add support for EGL_ANGLE_x11_visual_id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gn check Created 5 years 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
« no previous file with comments | « ui/gl/gl.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_egl.cc
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index e29910c2b6178016aa194c8748a9c2a9dc031270..b4898ac4b0345073d2d5524778e7b721000f5e0a 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -32,6 +32,11 @@
#endif
#if defined(USE_X11) && !defined(OS_CHROMEOS)
+extern "C" {
+#include <X11/Xlib.h>
+#define Status int
+}
+#include "ui/base/x/x11_util_internal.h"
#include "ui/gfx/x/x11_switches.h"
#endif
@@ -70,6 +75,11 @@
#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 {
@@ -143,6 +153,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);
+ display_attribs.push_back((EGLint)visual->visualid);
+#endif
+
display_attribs.push_back(EGL_NONE);
return eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE,
« no previous file with comments | « ui/gl/gl.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698