OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * 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 |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "gl/GrGLInterface.h" | 8 #include "gl/GrGLInterface.h" |
9 #include "gl/GrGLAssembleInterface.h" | 9 #include "gl/GrGLAssembleInterface.h" |
10 #include "gl/GrGLUtil.h" | 10 #include "gl/GrGLUtil.h" |
11 | 11 |
12 #include <EGL/egl.h> | 12 #include <EGL/egl.h> |
13 #include <GLES2/gl2.h> | 13 #include <GLES2/gl2.h> |
14 | 14 |
15 static GrGLFuncPtr android_get_gl_proc(void* ctx, const char name[]) { | 15 static GrGLFuncPtr android_get_gl_proc(void* ctx, const char name[]) { |
16 SkASSERT(NULL == ctx); | 16 SkASSERT(nullptr == ctx); |
17 // Some older drivers on Android have busted eglGetProcAdddress Functions th
at | 17 // Some older drivers on Android have busted eglGetProcAdddress Functions th
at |
18 // will return the wrong pointer for built in GLES2 functions. This set of f
unctions | 18 // will return the wrong pointer for built in GLES2 functions. This set of f
unctions |
19 // was generated on a Xoom by finding mismatches between the function pulled
in via gl2.h and | 19 // was generated on a Xoom by finding mismatches between the function pulled
in via gl2.h and |
20 // the address returned by eglGetProcAddress. | 20 // the address returned by eglGetProcAddress. |
21 if (0 == strcmp("glActiveTexture", name)) { | 21 if (0 == strcmp("glActiveTexture", name)) { |
22 return (GrGLFuncPtr) glActiveTexture; | 22 return (GrGLFuncPtr) glActiveTexture; |
23 } else if (0 == strcmp("glAttachShader", name)) { | 23 } else if (0 == strcmp("glAttachShader", name)) { |
24 return (GrGLFuncPtr) glAttachShader; | 24 return (GrGLFuncPtr) glAttachShader; |
25 } else if (0 == strcmp("glBindAttribLocation", name)) { | 25 } else if (0 == strcmp("glBindAttribLocation", name)) { |
26 return (GrGLFuncPtr) glBindAttribLocation; | 26 return (GrGLFuncPtr) glBindAttribLocation; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 return (GrGLFuncPtr) glGetFramebufferAttachmentParameteriv; | 218 return (GrGLFuncPtr) glGetFramebufferAttachmentParameteriv; |
219 } else if (0 == strcmp("glGetRenderbufferParameteriv", name)) { | 219 } else if (0 == strcmp("glGetRenderbufferParameteriv", name)) { |
220 return (GrGLFuncPtr) glGetRenderbufferParameteriv; | 220 return (GrGLFuncPtr) glGetRenderbufferParameteriv; |
221 } else if (0 == strcmp("glRenderbufferStorage", name)) { | 221 } else if (0 == strcmp("glRenderbufferStorage", name)) { |
222 return (GrGLFuncPtr) glRenderbufferStorage; | 222 return (GrGLFuncPtr) glRenderbufferStorage; |
223 } | 223 } |
224 return eglGetProcAddress(name); | 224 return eglGetProcAddress(name); |
225 } | 225 } |
226 | 226 |
227 const GrGLInterface* GrGLCreateNativeInterface() { | 227 const GrGLInterface* GrGLCreateNativeInterface() { |
228 return GrGLAssembleInterface(NULL, android_get_gl_proc); | 228 return GrGLAssembleInterface(nullptr, android_get_gl_proc); |
229 } | 229 } |
OLD | NEW |