diff options
author | derekf <derekf@osg.samsung.com> | 2014-10-01 10:52:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-01 10:52:52 -0700 |
commit | 29dda80c0178371feea3aa81d72e1f8ff3b17bb6 (patch) | |
tree | 62b5d8f0d03def6479dcfca9c138323c0b849874 /src/gpu/gl | |
parent | 6589dec11efbe240c5ce71d1ba9f5dd0c77ffd86 (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/gpu/gl')
-rw-r--r-- | src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp | 22 | ||||
-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 |