summaryrefslogtreecommitdiffstats
path: root/package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch
diff options
context:
space:
mode:
authorGustavo Zacarias <gustavo@zacarias.com.ar>2016-03-09 06:58:39 -0300
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-03-20 18:34:10 +0100
commit0911f32d1c34b239cbb59e1b2d89d1b5cadee7e0 (patch)
tree0220ecd8b2323ea9d23a33078b0311a30d5ed44a /package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch
parent7429785873c6572db7440d1be26fab011c5d670a (diff)
downloadbuildroot-0911f32d1c34b239cbb59e1b2d89d1b5cadee7e0.tar.gz
buildroot-0911f32d1c34b239cbb59e1b2d89d1b5cadee7e0.zip
libepoxy: move outside x11r7 scope
Move it outside x11r7 scope since it can be built without it with a few patches (sent upstream via github pull request). Motivation is simple, it's a dependency for newer gtk3 versions which can work with a wayland or broadway backend, and having a full x11 stack is pointless for that scenario. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> [Thomas: split the first patch into four separate patches, since that's how they were submitted upstream.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch')
-rw-r--r--package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch b/package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch
new file mode 100644
index 0000000000..be9b009f5c
--- /dev/null
+++ b/package/libepoxy/0004-darwin-use-glx-instead-of-opengl-framework.patch
@@ -0,0 +1,95 @@
+From d010922282580a32dfebcda12ee1c307b3ef6005 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Mon, 18 Jan 2016 09:49:55 -0800
+Subject: [PATCH 4/4] darwin: Use GLX instead of OpenGL.framework if it is the
+ current context
+
+Also makes a stab at similar support for Win32
+
+anholt/libepoxy#63
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Fetched from pull #81 on github for libepoxy:
+https://github.com/anholt/libepoxy/pull/81/commits
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+---
+ src/dispatch_common.c | 29 ++++++++++++++++-------------
+ 1 file changed, 16 insertions(+), 13 deletions(-)
+
+diff --git a/src/dispatch_common.c b/src/dispatch_common.c
+index 163d348..cb9f76a 100644
+--- a/src/dispatch_common.c
++++ b/src/dispatch_common.c
+@@ -482,16 +482,20 @@ epoxy_glx_dlsym(const char *name)
+ void *
+ epoxy_gl_dlsym(const char *name)
+ {
+-#ifdef _WIN32
++#if defined(_WIN32) || defined(__APPLE__)
++if (!epoxy_current_context_is_glx()) {
++# if defined(_WIN32)
+ return do_dlsym(&api.gl_handle, "OPENGL32", name, true);
+-#elif defined(__APPLE__)
++# elif defined(__APPLE__)
+ return do_dlsym(&api.gl_handle,
+ "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL",
+ name, true);
+-#else
++# endif
++}
++#endif
++
+ /* There's no library for desktop GL support independent of GLX. */
+ return epoxy_glx_dlsym(name);
+-#endif
+ }
+
+ void *
+@@ -615,7 +619,7 @@ epoxy_get_bootstrap_proc_address(const char *name)
+ */
+ #if PLATFORM_HAS_GLX
+ if (api.glx_handle && glXGetCurrentContext())
+- return epoxy_gl_dlsym(name);
++ return epoxy_glx_dlsym(name);
+ #endif
+
+ /* If epoxy hasn't loaded any API-specific library yet, try to
+@@ -644,22 +648,17 @@ epoxy_get_bootstrap_proc_address(const char *name)
+ }
+ #endif /* PLATFORM_HAS_EGL */
+
+- /* Fall back to GLX */
++ /* Fall back to the platform default */
+ return epoxy_gl_dlsym(name);
+ }
+
+ void *
+ epoxy_get_proc_address(const char *name)
+ {
+-#ifdef _WIN32
+- return wglGetProcAddress(name);
+-#elif defined(__APPLE__)
+- return epoxy_gl_dlsym(name);
+-#else
+ #if PLATFORM_HAS_GLX
+ if (epoxy_current_context_is_glx()) {
+ return glXGetProcAddressARB((const GLubyte *)name);
+- } else
++ }
+ #endif /* PLATFORM_HAS_GLX */
+ #if PLATFORM_HAS_EGL
+ {
+@@ -674,8 +673,12 @@ epoxy_get_proc_address(const char *name)
+ }
+ }
+ #endif /* PLATFORM_HAS_EGL */
++#if defined(_WIN32)
++ return wglGetProcAddress(name);
++#elif defined(__APPLE__)
++ return epoxy_gl_dlsym(name);
++#endif
+ errx(1, "Couldn't find current GLX or EGL context.\n");
+-#endif /* _WIN32 | __APPLE__*/
+ }
+
+ WRAPPER_VISIBILITY (void)
OpenPOWER on IntegriCloud