aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar derekf <derekf@osg.samsung.com>2014-10-01 10:52:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-01 10:52:52 -0700
commit29dda80c0178371feea3aa81d72e1f8ff3b17bb6 (patch)
tree62b5d8f0d03def6479dcfca9c138323c0b849874 /include
parent6589dec11efbe240c5ce71d1ba9f5dd0c77ffd86 (diff)
Add support for EGL on linux
Allow setting skia_egl=1 to build skia against EGL instead of GLX on unix Review URL: https://codereview.chromium.org/604853003
Diffstat (limited to 'include')
-rw-r--r--include/core/SkPostConfig.h9
-rw-r--r--include/gpu/gl/SkNativeGLContext.h6
2 files changed, 12 insertions, 3 deletions
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index d513d20633..ec17b65353 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -411,6 +411,15 @@
# endif
#endif
+//////////////////////////////////////////////////////////////////////
+
+#ifndef SK_EGL
+# if defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_NACL)
+# define SK_EGL 1
+# else
+# define SK_EGL 0
+# endif
+#endif
//////////////////////////////////////////////////////////////////////
diff --git a/include/gpu/gl/SkNativeGLContext.h b/include/gpu/gl/SkNativeGLContext.h
index 3bb6530c27..93b5b4183a 100644
--- a/include/gpu/gl/SkNativeGLContext.h
+++ b/include/gpu/gl/SkNativeGLContext.h
@@ -35,7 +35,7 @@ static const struct { int major, minor; } gl_versions[] = {
#if defined(SK_BUILD_FOR_MAC)
#include <OpenGL/OpenGL.h>
-#elif defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_NACL)
+#elif SK_EGL
#include <GLES2/gl2.h>
#include <EGL/egl.h>
#elif defined(SK_BUILD_FOR_UNIX)
@@ -64,7 +64,7 @@ public:
private:
#if defined(SK_BUILD_FOR_MAC)
CGLContextObj fOldCGLContext;
- #elif defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_NACL)
+ #elif SK_EGL
EGLContext fOldEGLContext;
EGLDisplay fOldDisplay;
EGLSurface fOldSurface;
@@ -88,7 +88,7 @@ protected:
private:
#if defined(SK_BUILD_FOR_MAC)
CGLContextObj fContext;
-#elif defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_NACL)
+#elif SK_EGL
EGLContext fContext;
EGLDisplay fDisplay;
EGLSurface fSurface;