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

Side by Side Diff: src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp

Issue 543363004: Add support for EGL on linux (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months 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
OLDNEW
1
1 /* 2 /*
2 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
3 * 4 *
4 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 6 * found in the LICENSE file.
6 */ 7 */
7
8
9 #include "gl/GrGLInterface.h" 8 #include "gl/GrGLInterface.h"
10 #include "gl/GrGLAssembleInterface.h" 9 #include "gl/GrGLAssembleInterface.h"
11 #include "gl/GrGLUtil.h" 10 #include "gl/GrGLUtil.h"
12 11
13 #include <GL/glx.h> 12 #include <EGL/egl.h>
13 #include <GLES2/gl2.h>
14 14
15 static GrGLFuncPtr glx_get(void* ctx, const char name[]) { 15 static GrGLFuncPtr egl_get_gl_proc(void* ctx, const char name[]) {
16 SkASSERT(NULL == ctx); 16 SkASSERT(NULL == ctx);
17 SkASSERT(glXGetCurrentContext()); 17 return eglGetProcAddress(name);
18 return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name));
19 } 18 }
20 19
21 const GrGLInterface* GrGLCreateNativeInterface() { 20 const GrGLInterface* GrGLCreateNativeInterface() {
22 if (NULL == glXGetCurrentContext()) { 21 return GrGLAssembleInterface(NULL, egl_get_gl_proc);
23 return NULL;
24 }
25
26 return GrGLAssembleInterface(NULL, glx_get);
27 } 22 }
OLDNEW
« no previous file with comments | « src/gpu/gl/android/SkNativeGLContext_android.cpp ('k') | src/gpu/gl/egl/SkNativeGLContext_egl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698