OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "gl/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
10 #include "gl/GrGLAssembleInterface.h" | 10 #include "gl/GrGLAssembleInterface.h" |
11 #include "gl/GrGLUtil.h" | 11 #include "gl/GrGLUtil.h" |
12 | 12 #include <string> |
13 #include <GL/glx.h> | 13 #include <GL/glx.h> |
14 | 14 |
15 static GrGLFuncPtr glx_get(void* ctx, const char name[]) { | 15 static GrGLFuncPtr glx_get(void* ctx, const char name[]) { |
16 SkASSERT(nullptr == ctx); | 16 SkASSERT(nullptr == ctx); |
17 SkASSERT(glXGetCurrentContext()); | 17 SkASSERT(glXGetCurrentContext()); |
| 18 const char *strP = strstr(name, "egl"); |
| 19 if(strP && strP == name) { //return 0 for egl functions in glx context |
| 20 return nullptr; |
| 21 } |
18 return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name)); | 22 return glXGetProcAddress(reinterpret_cast<const GLubyte*>(name)); |
19 } | 23 } |
20 | 24 |
21 const GrGLInterface* GrGLCreateNativeInterface() { | 25 const GrGLInterface* GrGLCreateNativeInterface() { |
22 if (nullptr == glXGetCurrentContext()) { | 26 if (nullptr == glXGetCurrentContext()) { |
23 return nullptr; | 27 return nullptr; |
24 } | 28 } |
25 | 29 |
26 return GrGLAssembleInterface(nullptr, glx_get); | 30 return GrGLAssembleInterface(nullptr, glx_get); |
27 } | 31 } |
OLD | NEW |