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 | |
10 #include "gl/GrGLInterface.h" | 9 #include "gl/GrGLInterface.h" |
11 | 10 |
12 #import <OpenGLES/ES2/gl.h> | 11 #import <OpenGLES/ES2/gl.h> |
13 #import <OpenGLES/ES2/glext.h> | 12 #import <OpenGLES/ES2/glext.h> |
14 | 13 |
15 const GrGLInterface* GrGLCreateNativeInterface() { | 14 const GrGLInterface* GrGLCreateNativeInterface() { |
16 GrGLInterface* interface = SkNEW(GrGLInterface); | 15 GrGLInterface* interface = SkNEW(GrGLInterface); |
17 | 16 |
18 GrGLInterface::Functions* functions = &interface->fFunctions; | 17 GrGLInterface::Functions* functions = &interface->fFunctions; |
19 | 18 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 functions->fGetShaderiv = glGetShaderiv; | 62 functions->fGetShaderiv = glGetShaderiv; |
64 functions->fGetString = glGetString; | 63 functions->fGetString = glGetString; |
65 functions->fGenTextures = glGenTextures; | 64 functions->fGenTextures = glGenTextures; |
66 functions->fGetUniformLocation = glGetUniformLocation; | 65 functions->fGetUniformLocation = glGetUniformLocation; |
67 functions->fLineWidth = glLineWidth; | 66 functions->fLineWidth = glLineWidth; |
68 functions->fLinkProgram = glLinkProgram; | 67 functions->fLinkProgram = glLinkProgram; |
69 functions->fPixelStorei = glPixelStorei; | 68 functions->fPixelStorei = glPixelStorei; |
70 functions->fReadBuffer = NULL; | 69 functions->fReadBuffer = NULL; |
71 functions->fReadPixels = glReadPixels; | 70 functions->fReadPixels = glReadPixels; |
72 functions->fScissor = glScissor; | 71 functions->fScissor = glScissor; |
73 functions->fShaderSource = glShaderSource; | 72 functions->fShaderSource = (GrGLShaderSourceProc) glShaderSource; |
74 functions->fStencilFunc = glStencilFunc; | 73 functions->fStencilFunc = glStencilFunc; |
75 functions->fStencilFuncSeparate = glStencilFuncSeparate; | 74 functions->fStencilFuncSeparate = glStencilFuncSeparate; |
76 functions->fStencilMask = glStencilMask; | 75 functions->fStencilMask = glStencilMask; |
77 functions->fStencilMaskSeparate = glStencilMaskSeparate; | 76 functions->fStencilMaskSeparate = glStencilMaskSeparate; |
78 functions->fStencilOp = glStencilOp; | 77 functions->fStencilOp = glStencilOp; |
79 functions->fStencilOpSeparate = glStencilOpSeparate; | 78 functions->fStencilOpSeparate = glStencilOpSeparate; |
80 // mac uses GLenum for internalFormat param (non-standard) | 79 // mac uses GLenum for internalFormat param (non-standard) |
81 // amounts to int vs. uint. | 80 // amounts to int vs. uint. |
82 functions->fTexImage2D = (GrGLTexImage2DProc)glTexImage2D; | 81 functions->fTexImage2D = (GrGLTexImage2DProc)glTexImage2D; |
83 #if GL_ARB_texture_storage | 82 #if GL_ARB_texture_storage |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 functions->fInvalidateBufferSubData = glInvalidateBufferSubData; | 159 functions->fInvalidateBufferSubData = glInvalidateBufferSubData; |
161 functions->fInvalidateTexImage = glInvalidateTexImage; | 160 functions->fInvalidateTexImage = glInvalidateTexImage; |
162 functions->fInvalidateTexSubImage = glInvalidateTexSubImage; | 161 functions->fInvalidateTexSubImage = glInvalidateTexSubImage; |
163 #endif | 162 #endif |
164 | 163 |
165 interface->fStandard = kGLES_GrGLStandard; | 164 interface->fStandard = kGLES_GrGLStandard; |
166 interface->fExtensions.init(kGLES_GrGLStandard, glGetString, NULL, glGetInte
gerv); | 165 interface->fExtensions.init(kGLES_GrGLStandard, glGetString, NULL, glGetInte
gerv); |
167 | 166 |
168 return interface; | 167 return interface; |
169 } | 168 } |
OLD | NEW |