aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
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 /src
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 'src')
-rw-r--r--src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp22
-rw-r--r--src/gpu/gl/egl/SkNativeGLContext_egl.cpp (renamed from src/gpu/gl/android/SkNativeGLContext_android.cpp)0
-rw-r--r--src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp (renamed from src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp)0
-rw-r--r--src/gpu/gl/glx/SkNativeGLContext_glx.cpp (renamed from src/gpu/gl/unix/SkNativeGLContext_unix.cpp)0
4 files changed, 22 insertions, 0 deletions
diff --git a/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp b/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp
new file mode 100644
index 0000000000..ddc9e693a4
--- /dev/null
+++ b/src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp
@@ -0,0 +1,22 @@
+
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#include "gl/GrGLInterface.h"
+#include "gl/GrGLAssembleInterface.h"
+#include "gl/GrGLUtil.h"
+
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+
+static GrGLFuncPtr egl_get_gl_proc(void* ctx, const char name[]) {
+ SkASSERT(NULL == ctx);
+ return eglGetProcAddress(name);
+}
+
+const GrGLInterface* GrGLCreateNativeInterface() {
+ return GrGLAssembleInterface(NULL, egl_get_gl_proc);
+}
diff --git a/src/gpu/gl/android/SkNativeGLContext_android.cpp b/src/gpu/gl/egl/SkNativeGLContext_egl.cpp
index d4d7219b5b..d4d7219b5b 100644
--- a/src/gpu/gl/android/SkNativeGLContext_android.cpp
+++ b/src/gpu/gl/egl/SkNativeGLContext_egl.cpp
diff --git a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp b/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp
index 19eec7e8ac..19eec7e8ac 100644
--- a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
+++ b/src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp
diff --git a/src/gpu/gl/unix/SkNativeGLContext_unix.cpp b/src/gpu/gl/glx/SkNativeGLContext_glx.cpp
index bd130b545c..bd130b545c 100644
--- a/src/gpu/gl/unix/SkNativeGLContext_unix.cpp
+++ b/src/gpu/gl/glx/SkNativeGLContext_glx.cpp