OLD | NEW |
1 // Modified from chromium/src/webkit/glue/gl_bindings_skia_cmd_buffer.cc | 1 // Modified from chromium/src/webkit/glue/gl_bindings_skia_cmd_buffer.cc |
2 | 2 |
3 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
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 #include "gl/GrGLExtensions.h" | 7 #include "gl/GrGLExtensions.h" |
8 #include "gl/GrGLInterface.h" | 8 #include "gl/GrGLInterface.h" |
9 | 9 |
10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
11 #define GL_GLEXT_PROTOTYPES | 11 #define GL_GLEXT_PROTOTYPES |
12 #endif | 12 #endif |
13 | 13 |
14 #include <GLES2/gl2.h> | 14 #include <GLES2/gl2.h> |
15 #include <GLES2/gl2ext.h> | 15 #include <GLES2/gl2ext.h> |
16 | 16 |
17 #include <EGL/egl.h> | 17 #include <EGL/egl.h> |
18 | 18 |
19 const GrGLInterface* GrGLCreateNativeInterface() { | 19 const GrGLInterface* GrGLCreateNativeInterface() { |
20 static SkAutoTUnref<GrGLInterface> glInterface; | 20 static SkAutoTUnref<GrGLInterface> glInterface; |
21 if (!glInterface.get()) { | 21 if (!glInterface.get()) { |
22 GrGLExtensions extensions; | 22 GrGLExtensions extensions; |
23 if (!extensions.init(kES2_GrGLBinding, glGetString, NULL, glGetIntegerv)
) { | 23 if (!extensions.init(kES_GrGLBinding, glGetString, NULL, glGetIntegerv))
{ |
24 return NULL; | 24 return NULL; |
25 } | 25 } |
26 GrGLInterface* interface = new GrGLInterface; | 26 GrGLInterface* interface = new GrGLInterface; |
27 glInterface.reset(interface); | 27 glInterface.reset(interface); |
28 interface->fBindingsExported = kES2_GrGLBinding; | 28 interface->fBindingsExported = kES_GrGLBinding; |
29 interface->fActiveTexture = glActiveTexture; | 29 interface->fActiveTexture = glActiveTexture; |
30 interface->fAttachShader = glAttachShader; | 30 interface->fAttachShader = glAttachShader; |
31 interface->fBindAttribLocation = glBindAttribLocation; | 31 interface->fBindAttribLocation = glBindAttribLocation; |
32 interface->fBindBuffer = glBindBuffer; | 32 interface->fBindBuffer = glBindBuffer; |
33 interface->fBindTexture = glBindTexture; | 33 interface->fBindTexture = glBindTexture; |
34 interface->fBindVertexArray = glBindVertexArrayOES; | 34 interface->fBindVertexArray = glBindVertexArrayOES; |
35 interface->fBlendColor = glBlendColor; | 35 interface->fBlendColor = glBlendColor; |
36 interface->fBlendFunc = glBlendFunc; | 36 interface->fBlendFunc = glBlendFunc; |
37 interface->fBufferData = glBufferData; | 37 interface->fBufferData = glBufferData; |
38 interface->fBufferSubData = glBufferSubData; | 38 interface->fBufferSubData = glBufferSubData; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 interface->fMapBuffer = glMapBufferOES; | 160 interface->fMapBuffer = glMapBufferOES; |
161 interface->fUnmapBuffer = glUnmapBufferOES; | 161 interface->fUnmapBuffer = glUnmapBufferOES; |
162 #else | 162 #else |
163 interface->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBuff
erOES"); | 163 interface->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBuff
erOES"); |
164 interface->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnm
apBufferOES"); | 164 interface->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnm
apBufferOES"); |
165 #endif | 165 #endif |
166 } | 166 } |
167 glInterface.get()->ref(); | 167 glInterface.get()->ref(); |
168 return glInterface.get(); | 168 return glInterface.get(); |
169 } | 169 } |
OLD | NEW |