OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 | 8 |
9 | 9 |
10 #include "gl/GrGLInterface.h" | 10 #include "gl/GrGLInterface.h" |
11 | 11 |
12 #import <OpenGLES/ES2/gl.h> | 12 #import <OpenGLES/ES2/gl.h> |
13 #import <OpenGLES/ES2/glext.h> | 13 #import <OpenGLES/ES2/glext.h> |
14 | 14 |
15 const GrGLInterface* GrGLCreateNativeInterface() { | 15 const GrGLInterface* GrGLCreateNativeInterface() { |
16 GrGLInterface* interface = SkNEW(GrGLInterface); | 16 GrGLInterface* interface = SkNEW(GrGLInterface); |
17 | 17 |
| 18 GrGLInterface::Functions* functions = interface->functions; |
| 19 |
18 functions->fActiveTexture = glActiveTexture; | 20 functions->fActiveTexture = glActiveTexture; |
19 functions->fAttachShader = glAttachShader; | 21 functions->fAttachShader = glAttachShader; |
20 functions->fBindAttribLocation = glBindAttribLocation; | 22 functions->fBindAttribLocation = glBindAttribLocation; |
21 functions->fBindBuffer = glBindBuffer; | 23 functions->fBindBuffer = glBindBuffer; |
22 functions->fBindTexture = glBindTexture; | 24 functions->fBindTexture = glBindTexture; |
23 functions->fBlendColor = glBlendColor; | 25 functions->fBlendColor = glBlendColor; |
24 functions->fBlendFunc = glBlendFunc; | 26 functions->fBlendFunc = glBlendFunc; |
25 functions->fBufferData = (GrGLBufferDataProc)glBufferData; | 27 functions->fBufferData = (GrGLBufferDataProc)glBufferData; |
26 functions->fBufferSubData = (GrGLBufferSubDataProc)glBufferSubData; | 28 functions->fBufferSubData = (GrGLBufferSubDataProc)glBufferSubData; |
27 functions->fClear = glClear; | 29 functions->fClear = glClear; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 #endif | 139 #endif |
138 | 140 |
139 #if GL_OES_vertex_array_object | 141 #if GL_OES_vertex_array_object |
140 functions->fBindVertexArray = glBindVertexArrayOES; | 142 functions->fBindVertexArray = glBindVertexArrayOES; |
141 functions->fDeleteVertexArrays = glDeleteVertexArraysOES; | 143 functions->fDeleteVertexArrays = glDeleteVertexArraysOES; |
142 functions->fGenVertexArrays = glGenVertexArraysOES; | 144 functions->fGenVertexArrays = glGenVertexArraysOES; |
143 #endif | 145 #endif |
144 | 146 |
145 interface->fStandard = kGLES_GrGLStandard; | 147 interface->fStandard = kGLES_GrGLStandard; |
146 interface->fExtensions.init(kGLES_GrGLStandard, glGetString, NULL, glGetInte
gerv); | 148 interface->fExtensions.init(kGLES_GrGLStandard, glGetString, NULL, glGetInte
gerv); |
| 149 |
147 return interface; | 150 return interface; |
148 } | 151 } |
OLD | NEW |