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

Unified Diff: ui/gl/gl_bindings.h

Issue 702713003: Add casts for EGLNativeDisplayType to XDisplay to use X functions with OZONE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ::Display Created 6 years, 1 month 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 | « no previous file | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_bindings.h
diff --git a/ui/gl/gl_bindings.h b/ui/gl/gl_bindings.h
index dd737f4185dc7c222d63945bf4413fe4a6fd11d4..029a2d43930b70cde8335bd4747ba105ee37b453 100644
--- a/ui/gl/gl_bindings.h
+++ b/ui/gl/gl_bindings.h
@@ -375,6 +375,29 @@ struct GL_EXPORT DriverGLX {
ProcsGLX debug_fn;
ExtensionsGLX ext;
};
+
+#if defined(USE_OZONE)
+// OZONE build defines EGLNativeDisplayType like intptr_t and this requires
+// reinterpret casts for use with X functions.
+inline EGLNativeDisplayType XDisplayToEGLNativeDisplay(::Display* display) {
+ COMPILE_ASSERT(sizeof(EGLNativeDisplayType) == sizeof(::Display*),
+ "EGLNativeDisplayType size should be equal to pointer size for"
+ "OZONE with x11 builds");
+ return reinterpret_cast<EGLNativeDisplayType>(display);
+}
+
+inline ::Display* EGLNativeDisplayToXDisplay(EGLNativeDisplayType display) {
+ return reinterpret_cast<::Display*>(display);
+}
+#else
+inline EGLNativeDisplayType XDisplayToEGLNativeDisplay(::Display* display) {
+ return display;
+}
+
+inline ::Display* EGLNativeDisplayToXDisplay(EGLNativeDisplayType display) {
+ return display;
+}
+#endif
#endif
// This #define is here to support autogenerated code.
« no previous file with comments | « no previous file | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698