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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GL_GL_BINDINGS_H_ 5 #ifndef UI_GL_GL_BINDINGS_H_
6 #define UI_GL_GL_BINDINGS_H_ 6 #define UI_GL_GL_BINDINGS_H_
7 7
8 // Includes the platform independent and platform dependent GL headers. 8 // Includes the platform independent and platform dependent GL headers.
9 // Only include this in cc files. It pulls in system headers, including 9 // Only include this in cc files. It pulls in system headers, including
10 // the X11 headers on linux, which define all kinds of macros that are 10 // the X11 headers on linux, which define all kinds of macros that are
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 struct GL_EXPORT DriverGLX { 368 struct GL_EXPORT DriverGLX {
369 void InitializeStaticBindings(); 369 void InitializeStaticBindings();
370 void InitializeDynamicBindings(GLContext* context); 370 void InitializeDynamicBindings(GLContext* context);
371 void InitializeDebugBindings(); 371 void InitializeDebugBindings();
372 void ClearBindings(); 372 void ClearBindings();
373 373
374 ProcsGLX fn; 374 ProcsGLX fn;
375 ProcsGLX debug_fn; 375 ProcsGLX debug_fn;
376 ExtensionsGLX ext; 376 ExtensionsGLX ext;
377 }; 377 };
378
379 #if defined(USE_OZONE)
380 // OZONE build defines EGLNativeDisplayType like intptr_t and this requires
381 // reinterpret casts for use with X functions.
382 inline EGLNativeDisplayType XDisplayToEGLNativeDisplay(::Display* display) {
383 COMPILE_ASSERT(sizeof(EGLNativeDisplayType) == sizeof(::Display*),
384 "EGLNativeDisplayType size should be equal to pointer size for"
385 "OZONE with x11 builds");
386 return reinterpret_cast<EGLNativeDisplayType>(display);
387 }
388
389 inline ::Display* EGLNativeDisplayToXDisplay(EGLNativeDisplayType display) {
390 return reinterpret_cast<::Display*>(display);
391 }
392 #else
393 inline EGLNativeDisplayType XDisplayToEGLNativeDisplay(::Display* display) {
394 return display;
395 }
396
397 inline ::Display* EGLNativeDisplayToXDisplay(EGLNativeDisplayType display) {
398 return display;
399 }
400 #endif
378 #endif 401 #endif
379 402
380 // This #define is here to support autogenerated code. 403 // This #define is here to support autogenerated code.
381 #define g_current_gl_context g_current_gl_context_tls->Get() 404 #define g_current_gl_context g_current_gl_context_tls->Get()
382 GL_EXPORT extern base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls; 405 GL_EXPORT extern base::ThreadLocalPointer<GLApi>* g_current_gl_context_tls;
383 406
384 GL_EXPORT extern OSMESAApi* g_current_osmesa_context; 407 GL_EXPORT extern OSMESAApi* g_current_osmesa_context;
385 GL_EXPORT extern DriverGL g_driver_gl; 408 GL_EXPORT extern DriverGL g_driver_gl;
386 GL_EXPORT extern DriverOSMESA g_driver_osmesa; 409 GL_EXPORT extern DriverOSMESA g_driver_osmesa;
387 410
(...skipping 19 matching lines...) Expand all
407 #elif defined(OS_ANDROID) 430 #elif defined(OS_ANDROID)
408 431
409 GL_EXPORT extern EGLApi* g_current_egl_context; 432 GL_EXPORT extern EGLApi* g_current_egl_context;
410 GL_EXPORT extern DriverEGL g_driver_egl; 433 GL_EXPORT extern DriverEGL g_driver_egl;
411 434
412 #endif 435 #endif
413 436
414 } // namespace gfx 437 } // namespace gfx
415 438
416 #endif // UI_GL_GL_BINDINGS_H_ 439 #endif // UI_GL_GL_BINDINGS_H_
OLDNEW
« 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