Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1095)

Side by Side Diff: src/gpu/gl/GrGLInterface.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLIndexBuffer.cpp ('k') | src/gpu/gl/GrGLNameAllocator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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/GrGLExtensions.h" 10 #include "gl/GrGLExtensions.h"
(...skipping 21 matching lines...) Expand all
32 newInterface->fFunctions.fPushGroupMarker = pushGroupMarkerFn; 32 newInterface->fFunctions.fPushGroupMarker = pushGroupMarkerFn;
33 newInterface->fFunctions.fPopGroupMarker = popGroupMarkerFn; 33 newInterface->fFunctions.fPopGroupMarker = popGroupMarkerFn;
34 34
35 return newInterface; 35 return newInterface;
36 } 36 }
37 37
38 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) { 38 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface) {
39 GrGLInterface* newInterface = GrGLInterface::NewClone(interface); 39 GrGLInterface* newInterface = GrGLInterface::NewClone(interface);
40 40
41 newInterface->fExtensions.remove("GL_NV_path_rendering"); 41 newInterface->fExtensions.remove("GL_NV_path_rendering");
42 newInterface->fFunctions.fPathCommands = NULL; 42 newInterface->fFunctions.fPathCommands = nullptr;
43 newInterface->fFunctions.fPathParameteri = NULL; 43 newInterface->fFunctions.fPathParameteri = nullptr;
44 newInterface->fFunctions.fPathParameterf = NULL; 44 newInterface->fFunctions.fPathParameterf = nullptr;
45 newInterface->fFunctions.fGenPaths = NULL; 45 newInterface->fFunctions.fGenPaths = nullptr;
46 newInterface->fFunctions.fDeletePaths = NULL; 46 newInterface->fFunctions.fDeletePaths = nullptr;
47 newInterface->fFunctions.fIsPath = NULL; 47 newInterface->fFunctions.fIsPath = nullptr;
48 newInterface->fFunctions.fPathStencilFunc = NULL; 48 newInterface->fFunctions.fPathStencilFunc = nullptr;
49 newInterface->fFunctions.fStencilFillPath = NULL; 49 newInterface->fFunctions.fStencilFillPath = nullptr;
50 newInterface->fFunctions.fStencilStrokePath = NULL; 50 newInterface->fFunctions.fStencilStrokePath = nullptr;
51 newInterface->fFunctions.fStencilFillPathInstanced = NULL; 51 newInterface->fFunctions.fStencilFillPathInstanced = nullptr;
52 newInterface->fFunctions.fStencilStrokePathInstanced = NULL; 52 newInterface->fFunctions.fStencilStrokePathInstanced = nullptr;
53 newInterface->fFunctions.fCoverFillPath = NULL; 53 newInterface->fFunctions.fCoverFillPath = nullptr;
54 newInterface->fFunctions.fCoverStrokePath = NULL; 54 newInterface->fFunctions.fCoverStrokePath = nullptr;
55 newInterface->fFunctions.fCoverFillPathInstanced = NULL; 55 newInterface->fFunctions.fCoverFillPathInstanced = nullptr;
56 newInterface->fFunctions.fCoverStrokePathInstanced = NULL; 56 newInterface->fFunctions.fCoverStrokePathInstanced = nullptr;
57 newInterface->fFunctions.fStencilThenCoverFillPath = NULL; 57 newInterface->fFunctions.fStencilThenCoverFillPath = nullptr;
58 newInterface->fFunctions.fStencilThenCoverStrokePath = NULL; 58 newInterface->fFunctions.fStencilThenCoverStrokePath = nullptr;
59 newInterface->fFunctions.fStencilThenCoverFillPathInstanced = NULL; 59 newInterface->fFunctions.fStencilThenCoverFillPathInstanced = nullptr;
60 newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = NULL; 60 newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = nullptr;
61 newInterface->fFunctions.fProgramPathFragmentInputGen = NULL; 61 newInterface->fFunctions.fProgramPathFragmentInputGen = nullptr;
62 newInterface->fFunctions.fBindFragmentInputLocation = NULL; 62 newInterface->fFunctions.fBindFragmentInputLocation = nullptr;
63 return newInterface; 63 return newInterface;
64 } 64 }
65 65
66 GrGLInterface::GrGLInterface() { 66 GrGLInterface::GrGLInterface() {
67 fStandard = kNone_GrGLStandard; 67 fStandard = kNone_GrGLStandard;
68 68
69 #if GR_GL_PER_GL_FUNC_CALLBACK 69 #if GR_GL_PER_GL_FUNC_CALLBACK
70 fCallback = GrGLDefaultInterfaceCallback; 70 fCallback = GrGLDefaultInterfaceCallback;
71 fCallbackData = 0; 71 fCallbackData = 0;
72 #endif 72 #endif
(...skipping 27 matching lines...) Expand all
100 100
101 if (kNone_GrGLStandard == fStandard) { 101 if (kNone_GrGLStandard == fStandard) {
102 RETURN_FALSE_INTERFACE 102 RETURN_FALSE_INTERFACE
103 } 103 }
104 104
105 if (!fExtensions.isInitialized()) { 105 if (!fExtensions.isInitialized()) {
106 RETURN_FALSE_INTERFACE 106 RETURN_FALSE_INTERFACE
107 } 107 }
108 108
109 // functions that are always required 109 // functions that are always required
110 if (NULL == fFunctions.fActiveTexture || 110 if (nullptr == fFunctions.fActiveTexture ||
111 NULL == fFunctions.fAttachShader || 111 nullptr == fFunctions.fAttachShader ||
112 NULL == fFunctions.fBindAttribLocation || 112 nullptr == fFunctions.fBindAttribLocation ||
113 NULL == fFunctions.fBindBuffer || 113 nullptr == fFunctions.fBindBuffer ||
114 NULL == fFunctions.fBindTexture || 114 nullptr == fFunctions.fBindTexture ||
115 NULL == fFunctions.fBlendColor || // -> GL >= 1.4 or extension, ES >= 2.0 115 nullptr == fFunctions.fBlendColor || // -> GL >= 1.4 or extension, ES >= 2.0
116 NULL == fFunctions.fBlendEquation || // -> GL >= 1.4 or extension, ES >= 2.0 116 nullptr == fFunctions.fBlendEquation || // -> GL >= 1.4 or extension, ES >= 2.0
117 NULL == fFunctions.fBlendFunc || 117 nullptr == fFunctions.fBlendFunc ||
118 NULL == fFunctions.fBufferData || 118 nullptr == fFunctions.fBufferData ||
119 NULL == fFunctions.fBufferSubData || 119 nullptr == fFunctions.fBufferSubData ||
120 NULL == fFunctions.fClear || 120 nullptr == fFunctions.fClear ||
121 NULL == fFunctions.fClearColor || 121 nullptr == fFunctions.fClearColor ||
122 NULL == fFunctions.fClearStencil || 122 nullptr == fFunctions.fClearStencil ||
123 NULL == fFunctions.fColorMask || 123 nullptr == fFunctions.fColorMask ||
124 NULL == fFunctions.fCompileShader || 124 nullptr == fFunctions.fCompileShader ||
125 NULL == fFunctions.fCopyTexSubImage2D || 125 nullptr == fFunctions.fCopyTexSubImage2D ||
126 NULL == fFunctions.fCreateProgram || 126 nullptr == fFunctions.fCreateProgram ||
127 NULL == fFunctions.fCreateShader || 127 nullptr == fFunctions.fCreateShader ||
128 NULL == fFunctions.fCullFace || 128 nullptr == fFunctions.fCullFace ||
129 NULL == fFunctions.fDeleteBuffers || 129 nullptr == fFunctions.fDeleteBuffers ||
130 NULL == fFunctions.fDeleteProgram || 130 nullptr == fFunctions.fDeleteProgram ||
131 NULL == fFunctions.fDeleteShader || 131 nullptr == fFunctions.fDeleteShader ||
132 NULL == fFunctions.fDeleteTextures || 132 nullptr == fFunctions.fDeleteTextures ||
133 NULL == fFunctions.fDepthMask || 133 nullptr == fFunctions.fDepthMask ||
134 NULL == fFunctions.fDisable || 134 nullptr == fFunctions.fDisable ||
135 NULL == fFunctions.fDisableVertexAttribArray || 135 nullptr == fFunctions.fDisableVertexAttribArray ||
136 NULL == fFunctions.fDrawArrays || 136 nullptr == fFunctions.fDrawArrays ||
137 NULL == fFunctions.fDrawElements || 137 nullptr == fFunctions.fDrawElements ||
138 NULL == fFunctions.fEnable || 138 nullptr == fFunctions.fEnable ||
139 NULL == fFunctions.fEnableVertexAttribArray || 139 nullptr == fFunctions.fEnableVertexAttribArray ||
140 NULL == fFunctions.fFrontFace || 140 nullptr == fFunctions.fFrontFace ||
141 NULL == fFunctions.fGenBuffers || 141 nullptr == fFunctions.fGenBuffers ||
142 NULL == fFunctions.fGenTextures || 142 nullptr == fFunctions.fGenTextures ||
143 NULL == fFunctions.fGetBufferParameteriv || 143 nullptr == fFunctions.fGetBufferParameteriv ||
144 NULL == fFunctions.fGenerateMipmap || 144 nullptr == fFunctions.fGenerateMipmap ||
145 NULL == fFunctions.fGetError || 145 nullptr == fFunctions.fGetError ||
146 NULL == fFunctions.fGetIntegerv || 146 nullptr == fFunctions.fGetIntegerv ||
147 NULL == fFunctions.fGetProgramInfoLog || 147 nullptr == fFunctions.fGetProgramInfoLog ||
148 NULL == fFunctions.fGetProgramiv || 148 nullptr == fFunctions.fGetProgramiv ||
149 NULL == fFunctions.fGetShaderInfoLog || 149 nullptr == fFunctions.fGetShaderInfoLog ||
150 NULL == fFunctions.fGetShaderiv || 150 nullptr == fFunctions.fGetShaderiv ||
151 NULL == fFunctions.fGetString || 151 nullptr == fFunctions.fGetString ||
152 NULL == fFunctions.fGetUniformLocation || 152 nullptr == fFunctions.fGetUniformLocation ||
153 #if 0 // Not included in Chrome yet 153 #if 0 // Not included in Chrome yet
154 NULL == fFunctions.fIsTexture || 154 nullptr == fFunctions.fIsTexture ||
155 #endif 155 #endif
156 NULL == fFunctions.fLinkProgram || 156 nullptr == fFunctions.fLinkProgram ||
157 NULL == fFunctions.fLineWidth || 157 nullptr == fFunctions.fLineWidth ||
158 NULL == fFunctions.fPixelStorei || 158 nullptr == fFunctions.fPixelStorei ||
159 NULL == fFunctions.fReadPixels || 159 nullptr == fFunctions.fReadPixels ||
160 NULL == fFunctions.fScissor || 160 nullptr == fFunctions.fScissor ||
161 NULL == fFunctions.fShaderSource || 161 nullptr == fFunctions.fShaderSource ||
162 NULL == fFunctions.fStencilFunc || 162 nullptr == fFunctions.fStencilFunc ||
163 NULL == fFunctions.fStencilMask || 163 nullptr == fFunctions.fStencilMask ||
164 NULL == fFunctions.fStencilOp || 164 nullptr == fFunctions.fStencilOp ||
165 NULL == fFunctions.fTexImage2D || 165 nullptr == fFunctions.fTexImage2D ||
166 NULL == fFunctions.fTexParameteri || 166 nullptr == fFunctions.fTexParameteri ||
167 NULL == fFunctions.fTexParameteriv || 167 nullptr == fFunctions.fTexParameteriv ||
168 NULL == fFunctions.fTexSubImage2D || 168 nullptr == fFunctions.fTexSubImage2D ||
169 NULL == fFunctions.fUniform1f || 169 nullptr == fFunctions.fUniform1f ||
170 NULL == fFunctions.fUniform1i || 170 nullptr == fFunctions.fUniform1i ||
171 NULL == fFunctions.fUniform1fv || 171 nullptr == fFunctions.fUniform1fv ||
172 NULL == fFunctions.fUniform1iv || 172 nullptr == fFunctions.fUniform1iv ||
173 NULL == fFunctions.fUniform2f || 173 nullptr == fFunctions.fUniform2f ||
174 NULL == fFunctions.fUniform2i || 174 nullptr == fFunctions.fUniform2i ||
175 NULL == fFunctions.fUniform2fv || 175 nullptr == fFunctions.fUniform2fv ||
176 NULL == fFunctions.fUniform2iv || 176 nullptr == fFunctions.fUniform2iv ||
177 NULL == fFunctions.fUniform3f || 177 nullptr == fFunctions.fUniform3f ||
178 NULL == fFunctions.fUniform3i || 178 nullptr == fFunctions.fUniform3i ||
179 NULL == fFunctions.fUniform3fv || 179 nullptr == fFunctions.fUniform3fv ||
180 NULL == fFunctions.fUniform3iv || 180 nullptr == fFunctions.fUniform3iv ||
181 NULL == fFunctions.fUniform4f || 181 nullptr == fFunctions.fUniform4f ||
182 NULL == fFunctions.fUniform4i || 182 nullptr == fFunctions.fUniform4i ||
183 NULL == fFunctions.fUniform4fv || 183 nullptr == fFunctions.fUniform4fv ||
184 NULL == fFunctions.fUniform4iv || 184 nullptr == fFunctions.fUniform4iv ||
185 NULL == fFunctions.fUniformMatrix2fv || 185 nullptr == fFunctions.fUniformMatrix2fv ||
186 NULL == fFunctions.fUniformMatrix3fv || 186 nullptr == fFunctions.fUniformMatrix3fv ||
187 NULL == fFunctions.fUniformMatrix4fv || 187 nullptr == fFunctions.fUniformMatrix4fv ||
188 NULL == fFunctions.fUseProgram || 188 nullptr == fFunctions.fUseProgram ||
189 NULL == fFunctions.fVertexAttrib1f || 189 nullptr == fFunctions.fVertexAttrib1f ||
190 NULL == fFunctions.fVertexAttrib2fv || 190 nullptr == fFunctions.fVertexAttrib2fv ||
191 NULL == fFunctions.fVertexAttrib3fv || 191 nullptr == fFunctions.fVertexAttrib3fv ||
192 NULL == fFunctions.fVertexAttrib4fv || 192 nullptr == fFunctions.fVertexAttrib4fv ||
193 NULL == fFunctions.fVertexAttribPointer || 193 nullptr == fFunctions.fVertexAttribPointer ||
194 NULL == fFunctions.fViewport || 194 nullptr == fFunctions.fViewport ||
195 NULL == fFunctions.fBindFramebuffer || 195 nullptr == fFunctions.fBindFramebuffer ||
196 NULL == fFunctions.fBindRenderbuffer || 196 nullptr == fFunctions.fBindRenderbuffer ||
197 NULL == fFunctions.fCheckFramebufferStatus || 197 nullptr == fFunctions.fCheckFramebufferStatus ||
198 NULL == fFunctions.fDeleteFramebuffers || 198 nullptr == fFunctions.fDeleteFramebuffers ||
199 NULL == fFunctions.fDeleteRenderbuffers || 199 nullptr == fFunctions.fDeleteRenderbuffers ||
200 NULL == fFunctions.fFinish || 200 nullptr == fFunctions.fFinish ||
201 NULL == fFunctions.fFlush || 201 nullptr == fFunctions.fFlush ||
202 NULL == fFunctions.fFramebufferRenderbuffer || 202 nullptr == fFunctions.fFramebufferRenderbuffer ||
203 NULL == fFunctions.fFramebufferTexture2D || 203 nullptr == fFunctions.fFramebufferTexture2D ||
204 NULL == fFunctions.fGetFramebufferAttachmentParameteriv || 204 nullptr == fFunctions.fGetFramebufferAttachmentParameteriv ||
205 NULL == fFunctions.fGetRenderbufferParameteriv || 205 nullptr == fFunctions.fGetRenderbufferParameteriv ||
206 NULL == fFunctions.fGenFramebuffers || 206 nullptr == fFunctions.fGenFramebuffers ||
207 NULL == fFunctions.fGenRenderbuffers || 207 nullptr == fFunctions.fGenRenderbuffers ||
208 NULL == fFunctions.fRenderbufferStorage) { 208 nullptr == fFunctions.fRenderbufferStorage) {
209 RETURN_FALSE_INTERFACE 209 RETURN_FALSE_INTERFACE
210 } 210 }
211 211
212 GrGLVersion glVer = GrGLGetVersion(this); 212 GrGLVersion glVer = GrGLGetVersion(this);
213 if (GR_GL_INVALID_VER == glVer) { 213 if (GR_GL_INVALID_VER == glVer) {
214 RETURN_FALSE_INTERFACE 214 RETURN_FALSE_INTERFACE
215 } 215 }
216 216
217 // Now check that baseline ES/Desktop fns not covered above are present 217 // Now check that baseline ES/Desktop fns not covered above are present
218 // and that we have fn pointers for any advertised fExtensions that we will 218 // and that we have fn pointers for any advertised fExtensions that we will
219 // try to use. 219 // try to use.
220 220
221 // these functions are part of ES2, we assume they are available 221 // these functions are part of ES2, we assume they are available
222 // On the desktop we assume they are available if the extension 222 // On the desktop we assume they are available if the extension
223 // is present or GL version is high enough. 223 // is present or GL version is high enough.
224 if (kGLES_GrGLStandard == fStandard) { 224 if (kGLES_GrGLStandard == fStandard) {
225 if (NULL == fFunctions.fStencilFuncSeparate || 225 if (nullptr == fFunctions.fStencilFuncSeparate ||
226 NULL == fFunctions.fStencilMaskSeparate || 226 nullptr == fFunctions.fStencilMaskSeparate ||
227 NULL == fFunctions.fStencilOpSeparate) { 227 nullptr == fFunctions.fStencilOpSeparate) {
228 RETURN_FALSE_INTERFACE 228 RETURN_FALSE_INTERFACE
229 } 229 }
230 } else if (kGL_GrGLStandard == fStandard) { 230 } else if (kGL_GrGLStandard == fStandard) {
231 231
232 if (glVer >= GR_GL_VER(2,0)) { 232 if (glVer >= GR_GL_VER(2,0)) {
233 if (NULL == fFunctions.fStencilFuncSeparate || 233 if (nullptr == fFunctions.fStencilFuncSeparate ||
234 NULL == fFunctions.fStencilMaskSeparate || 234 nullptr == fFunctions.fStencilMaskSeparate ||
235 NULL == fFunctions.fStencilOpSeparate) { 235 nullptr == fFunctions.fStencilOpSeparate) {
236 RETURN_FALSE_INTERFACE 236 RETURN_FALSE_INTERFACE
237 } 237 }
238 } 238 }
239 if (glVer >= GR_GL_VER(3,0) && NULL == fFunctions.fBindFragDataLocation) { 239 if (glVer >= GR_GL_VER(3,0) && nullptr == fFunctions.fBindFragDataLocati on) {
240 RETURN_FALSE_INTERFACE 240 RETURN_FALSE_INTERFACE
241 } 241 }
242 if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) { 242 if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) {
243 if (NULL == fFunctions.fDrawBuffers) { 243 if (nullptr == fFunctions.fDrawBuffers) {
244 RETURN_FALSE_INTERFACE 244 RETURN_FALSE_INTERFACE
245 } 245 }
246 } 246 }
247 247
248 if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query") ) { 248 if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query") ) {
249 if (NULL == fFunctions.fGenQueries || 249 if (nullptr == fFunctions.fGenQueries ||
250 NULL == fFunctions.fDeleteQueries || 250 nullptr == fFunctions.fDeleteQueries ||
251 NULL == fFunctions.fBeginQuery || 251 nullptr == fFunctions.fBeginQuery ||
252 NULL == fFunctions.fEndQuery || 252 nullptr == fFunctions.fEndQuery ||
253 NULL == fFunctions.fGetQueryiv || 253 nullptr == fFunctions.fGetQueryiv ||
254 NULL == fFunctions.fGetQueryObjectiv || 254 nullptr == fFunctions.fGetQueryObjectiv ||
255 NULL == fFunctions.fGetQueryObjectuiv) { 255 nullptr == fFunctions.fGetQueryObjectuiv) {
256 RETURN_FALSE_INTERFACE 256 RETURN_FALSE_INTERFACE
257 } 257 }
258 } 258 }
259 if (glVer >= GR_GL_VER(3,3) || 259 if (glVer >= GR_GL_VER(3,3) ||
260 fExtensions.has("GL_ARB_timer_query") || 260 fExtensions.has("GL_ARB_timer_query") ||
261 fExtensions.has("GL_EXT_timer_query")) { 261 fExtensions.has("GL_EXT_timer_query")) {
262 if (NULL == fFunctions.fGetQueryObjecti64v || 262 if (nullptr == fFunctions.fGetQueryObjecti64v ||
263 NULL == fFunctions.fGetQueryObjectui64v) { 263 nullptr == fFunctions.fGetQueryObjectui64v) {
264 RETURN_FALSE_INTERFACE 264 RETURN_FALSE_INTERFACE
265 } 265 }
266 } 266 }
267 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) { 267 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) {
268 if (NULL == fFunctions.fQueryCounter) { 268 if (nullptr == fFunctions.fQueryCounter) {
269 RETURN_FALSE_INTERFACE 269 RETURN_FALSE_INTERFACE
270 } 270 }
271 } 271 }
272 } 272 }
273 273
274 // optional function on desktop before 1.3 274 // optional function on desktop before 1.3
275 if (kGL_GrGLStandard != fStandard || 275 if (kGL_GrGLStandard != fStandard ||
276 (glVer >= GR_GL_VER(1,3)) || 276 (glVer >= GR_GL_VER(1,3)) ||
277 fExtensions.has("GL_ARB_texture_compression")) { 277 fExtensions.has("GL_ARB_texture_compression")) {
278 if (NULL == fFunctions.fCompressedTexImage2D 278 if (nullptr == fFunctions.fCompressedTexImage2D
279 #if 0 279 #if 0
280 || NULL == fFunctions.fCompressedTexSubImage2D 280 || nullptr == fFunctions.fCompressedTexSubImage2D
281 #endif 281 #endif
282 ) { 282 ) {
283 RETURN_FALSE_INTERFACE 283 RETURN_FALSE_INTERFACE
284 } 284 }
285 } 285 }
286 286
287 // part of desktop GL, but not ES 287 // part of desktop GL, but not ES
288 if (kGL_GrGLStandard == fStandard && 288 if (kGL_GrGLStandard == fStandard &&
289 (NULL == fFunctions.fGetTexLevelParameteriv || 289 (nullptr == fFunctions.fGetTexLevelParameteriv ||
290 NULL == fFunctions.fDrawBuffer || 290 nullptr == fFunctions.fDrawBuffer ||
291 NULL == fFunctions.fReadBuffer)) { 291 nullptr == fFunctions.fReadBuffer)) {
292 RETURN_FALSE_INTERFACE 292 RETURN_FALSE_INTERFACE
293 } 293 }
294 294
295 // GL_EXT_texture_storage is part of desktop 4.2 295 // GL_EXT_texture_storage is part of desktop 4.2
296 // There is a desktop ARB extension and an ES+desktop EXT extension 296 // There is a desktop ARB extension and an ES+desktop EXT extension
297 if (kGL_GrGLStandard == fStandard) { 297 if (kGL_GrGLStandard == fStandard) {
298 if (glVer >= GR_GL_VER(4,2) || 298 if (glVer >= GR_GL_VER(4,2) ||
299 fExtensions.has("GL_ARB_texture_storage") || 299 fExtensions.has("GL_ARB_texture_storage") ||
300 fExtensions.has("GL_EXT_texture_storage")) { 300 fExtensions.has("GL_EXT_texture_storage")) {
301 if (NULL == fFunctions.fTexStorage2D) { 301 if (nullptr == fFunctions.fTexStorage2D) {
302 RETURN_FALSE_INTERFACE 302 RETURN_FALSE_INTERFACE
303 } 303 }
304 } 304 }
305 } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storag e")) { 305 } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storag e")) {
306 if (NULL == fFunctions.fTexStorage2D) { 306 if (nullptr == fFunctions.fTexStorage2D) {
307 RETURN_FALSE_INTERFACE 307 RETURN_FALSE_INTERFACE
308 } 308 }
309 } 309 }
310 310
311 // glTextureBarrier is part of desktop 4.5. There are also ARB and NV extens ions. 311 // glTextureBarrier is part of desktop 4.5. There are also ARB and NV extens ions.
312 if (kGL_GrGLStandard == fStandard) { 312 if (kGL_GrGLStandard == fStandard) {
313 if (glVer >= GR_GL_VER(4,5) || 313 if (glVer >= GR_GL_VER(4,5) ||
314 fExtensions.has("GL_ARB_texture_barrier") || 314 fExtensions.has("GL_ARB_texture_barrier") ||
315 fExtensions.has("GL_NV_texture_barrier")) { 315 fExtensions.has("GL_NV_texture_barrier")) {
316 if (NULL == fFunctions.fTextureBarrier) { 316 if (nullptr == fFunctions.fTextureBarrier) {
317 RETURN_FALSE_INTERFACE 317 RETURN_FALSE_INTERFACE
318 } 318 }
319 } 319 }
320 } else if (fExtensions.has("GL_NV_texture_barrier")) { 320 } else if (fExtensions.has("GL_NV_texture_barrier")) {
321 if (NULL == fFunctions.fTextureBarrier) { 321 if (nullptr == fFunctions.fTextureBarrier) {
322 RETURN_FALSE_INTERFACE 322 RETURN_FALSE_INTERFACE
323 } 323 }
324 } 324 }
325 325
326 if (fExtensions.has("GL_KHR_blend_equation_advanced") || 326 if (fExtensions.has("GL_KHR_blend_equation_advanced") ||
327 fExtensions.has("GL_NV_blend_equation_advanced")) { 327 fExtensions.has("GL_NV_blend_equation_advanced")) {
328 if (NULL == fFunctions.fBlendBarrier) { 328 if (nullptr == fFunctions.fBlendBarrier) {
329 RETURN_FALSE_INTERFACE 329 RETURN_FALSE_INTERFACE
330 } 330 }
331 } 331 }
332 332
333 if (fExtensions.has("GL_EXT_discard_framebuffer")) { 333 if (fExtensions.has("GL_EXT_discard_framebuffer")) {
334 // FIXME: Remove this once Chromium is updated to provide this function 334 // FIXME: Remove this once Chromium is updated to provide this function
335 #if 0 335 #if 0
336 if (NULL == fFunctions.fDiscardFramebuffer) { 336 if (nullptr == fFunctions.fDiscardFramebuffer) {
337 RETURN_FALSE_INTERFACE 337 RETURN_FALSE_INTERFACE
338 } 338 }
339 #endif 339 #endif
340 } 340 }
341 341
342 // FBO MSAA 342 // FBO MSAA
343 if (kGL_GrGLStandard == fStandard) { 343 if (kGL_GrGLStandard == fStandard) {
344 // GL 3.0 and the ARB extension have multisample + blit 344 // GL 3.0 and the ARB extension have multisample + blit
345 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_objec t")) { 345 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_objec t")) {
346 if (NULL == fFunctions.fRenderbufferStorageMultisample || 346 if (nullptr == fFunctions.fRenderbufferStorageMultisample ||
347 NULL == fFunctions.fBlitFramebuffer) { 347 nullptr == fFunctions.fBlitFramebuffer) {
348 RETURN_FALSE_INTERFACE 348 RETURN_FALSE_INTERFACE
349 } 349 }
350 } else { 350 } else {
351 if (fExtensions.has("GL_EXT_framebuffer_blit") && 351 if (fExtensions.has("GL_EXT_framebuffer_blit") &&
352 NULL == fFunctions.fBlitFramebuffer) { 352 nullptr == fFunctions.fBlitFramebuffer) {
353 RETURN_FALSE_INTERFACE 353 RETURN_FALSE_INTERFACE
354 } 354 }
355 if (fExtensions.has("GL_EXT_framebuffer_multisample") && 355 if (fExtensions.has("GL_EXT_framebuffer_multisample") &&
356 NULL == fFunctions.fRenderbufferStorageMultisample) { 356 nullptr == fFunctions.fRenderbufferStorageMultisample) {
357 RETURN_FALSE_INTERFACE 357 RETURN_FALSE_INTERFACE
358 } 358 }
359 } 359 }
360 } else { 360 } else {
361 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_ multisample")) { 361 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_ multisample")) {
362 if (NULL == fFunctions.fRenderbufferStorageMultisample || 362 if (nullptr == fFunctions.fRenderbufferStorageMultisample ||
363 NULL == fFunctions.fBlitFramebuffer) { 363 nullptr == fFunctions.fBlitFramebuffer) {
364 RETURN_FALSE_INTERFACE 364 RETURN_FALSE_INTERFACE
365 } 365 }
366 } 366 }
367 if (fExtensions.has("GL_APPLE_framebuffer_multisample")) { 367 if (fExtensions.has("GL_APPLE_framebuffer_multisample")) {
368 if (NULL == fFunctions.fRenderbufferStorageMultisampleES2APPLE || 368 if (nullptr == fFunctions.fRenderbufferStorageMultisampleES2APPLE ||
369 NULL == fFunctions.fResolveMultisampleFramebuffer) { 369 nullptr == fFunctions.fResolveMultisampleFramebuffer) {
370 RETURN_FALSE_INTERFACE 370 RETURN_FALSE_INTERFACE
371 } 371 }
372 } 372 }
373 if (fExtensions.has("GL_IMG_multisampled_render_to_texture") || 373 if (fExtensions.has("GL_IMG_multisampled_render_to_texture") ||
374 fExtensions.has("GL_EXT_multisampled_render_to_texture")) { 374 fExtensions.has("GL_EXT_multisampled_render_to_texture")) {
375 if (NULL == fFunctions.fRenderbufferStorageMultisampleES2EXT || 375 if (nullptr == fFunctions.fRenderbufferStorageMultisampleES2EXT ||
376 NULL == fFunctions.fFramebufferTexture2DMultisample) { 376 nullptr == fFunctions.fFramebufferTexture2DMultisample) {
377 RETURN_FALSE_INTERFACE 377 RETURN_FALSE_INTERFACE
378 } 378 }
379 } 379 }
380 } 380 }
381 381
382 // On ES buffer mapping is an extension. On Desktop 382 // On ES buffer mapping is an extension. On Desktop
383 // buffer mapping was part of original VBO extension 383 // buffer mapping was part of original VBO extension
384 // which we require. 384 // which we require.
385 if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) { 385 if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) {
386 if (NULL == fFunctions.fMapBuffer || 386 if (nullptr == fFunctions.fMapBuffer ||
387 NULL == fFunctions.fUnmapBuffer) { 387 nullptr == fFunctions.fUnmapBuffer) {
388 RETURN_FALSE_INTERFACE 388 RETURN_FALSE_INTERFACE
389 } 389 }
390 } 390 }
391 391
392 // Dual source blending 392 // Dual source blending
393 if (kGL_GrGLStandard == fStandard) { 393 if (kGL_GrGLStandard == fStandard) {
394 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extend ed")) { 394 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extend ed")) {
395 if (NULL == fFunctions.fBindFragDataLocationIndexed) { 395 if (nullptr == fFunctions.fBindFragDataLocationIndexed) {
396 RETURN_FALSE_INTERFACE 396 RETURN_FALSE_INTERFACE
397 } 397 }
398 } 398 }
399 } else { 399 } else {
400 if (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extend ed")) { 400 if (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extend ed")) {
401 if (NULL == fFunctions.fBindFragDataLocation || 401 if (nullptr == fFunctions.fBindFragDataLocation ||
402 NULL == fFunctions.fBindFragDataLocationIndexed) { 402 nullptr == fFunctions.fBindFragDataLocationIndexed) {
403 RETURN_FALSE_INTERFACE 403 RETURN_FALSE_INTERFACE
404 } 404 }
405 } 405 }
406 } 406 }
407 407
408 408
409 // glGetStringi was added in version 3.0 of both desktop and ES. 409 // glGetStringi was added in version 3.0 of both desktop and ES.
410 if (glVer >= GR_GL_VER(3, 0)) { 410 if (glVer >= GR_GL_VER(3, 0)) {
411 if (NULL == fFunctions.fGetStringi) { 411 if (nullptr == fFunctions.fGetStringi) {
412 RETURN_FALSE_INTERFACE 412 RETURN_FALSE_INTERFACE
413 } 413 }
414 } 414 }
415 415
416 if (kGL_GrGLStandard == fStandard) { 416 if (kGL_GrGLStandard == fStandard) {
417 if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_obj ect")) { 417 if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_obj ect")) {
418 if (NULL == fFunctions.fBindVertexArray || 418 if (nullptr == fFunctions.fBindVertexArray ||
419 NULL == fFunctions.fDeleteVertexArrays || 419 nullptr == fFunctions.fDeleteVertexArrays ||
420 NULL == fFunctions.fGenVertexArrays) { 420 nullptr == fFunctions.fGenVertexArrays) {
421 RETURN_FALSE_INTERFACE 421 RETURN_FALSE_INTERFACE
422 } 422 }
423 } 423 }
424 } else { 424 } else {
425 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_obje ct")) { 425 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_obje ct")) {
426 if (NULL == fFunctions.fBindVertexArray || 426 if (nullptr == fFunctions.fBindVertexArray ||
427 NULL == fFunctions.fDeleteVertexArrays || 427 nullptr == fFunctions.fDeleteVertexArrays ||
428 NULL == fFunctions.fGenVertexArrays) { 428 nullptr == fFunctions.fGenVertexArrays) {
429 RETURN_FALSE_INTERFACE 429 RETURN_FALSE_INTERFACE
430 } 430 }
431 } 431 }
432 } 432 }
433 433
434 if (fExtensions.has("GL_EXT_debug_marker")) { 434 if (fExtensions.has("GL_EXT_debug_marker")) {
435 if (NULL == fFunctions.fInsertEventMarker || 435 if (nullptr == fFunctions.fInsertEventMarker ||
436 NULL == fFunctions.fPushGroupMarker || 436 nullptr == fFunctions.fPushGroupMarker ||
437 NULL == fFunctions.fPopGroupMarker) { 437 nullptr == fFunctions.fPopGroupMarker) {
438 RETURN_FALSE_INTERFACE 438 RETURN_FALSE_INTERFACE
439 } 439 }
440 } 440 }
441 441
442 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) || 442 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
443 fExtensions.has("GL_ARB_invalidate_subdata")) { 443 fExtensions.has("GL_ARB_invalidate_subdata")) {
444 if (NULL == fFunctions.fInvalidateBufferData || 444 if (nullptr == fFunctions.fInvalidateBufferData ||
445 NULL == fFunctions.fInvalidateBufferSubData || 445 nullptr == fFunctions.fInvalidateBufferSubData ||
446 NULL == fFunctions.fInvalidateFramebuffer || 446 nullptr == fFunctions.fInvalidateFramebuffer ||
447 NULL == fFunctions.fInvalidateSubFramebuffer || 447 nullptr == fFunctions.fInvalidateSubFramebuffer ||
448 NULL == fFunctions.fInvalidateTexImage || 448 nullptr == fFunctions.fInvalidateTexImage ||
449 NULL == fFunctions.fInvalidateTexSubImage) { 449 nullptr == fFunctions.fInvalidateTexSubImage) {
450 RETURN_FALSE_INTERFACE; 450 RETURN_FALSE_INTERFACE;
451 } 451 }
452 } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) { 452 } else if (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) {
453 // ES 3.0 adds the framebuffer functions but not the others. 453 // ES 3.0 adds the framebuffer functions but not the others.
454 if (NULL == fFunctions.fInvalidateFramebuffer || 454 if (nullptr == fFunctions.fInvalidateFramebuffer ||
455 NULL == fFunctions.fInvalidateSubFramebuffer) { 455 nullptr == fFunctions.fInvalidateSubFramebuffer) {
456 RETURN_FALSE_INTERFACE; 456 RETURN_FALSE_INTERFACE;
457 } 457 }
458 } 458 }
459 459
460 if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub" )) { 460 if (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_CHROMIUM_map_sub" )) {
461 if (NULL == fFunctions.fMapBufferSubData || 461 if (nullptr == fFunctions.fMapBufferSubData ||
462 NULL == fFunctions.fMapTexSubImage2D || 462 nullptr == fFunctions.fMapTexSubImage2D ||
463 NULL == fFunctions.fUnmapBufferSubData || 463 nullptr == fFunctions.fUnmapBufferSubData ||
464 NULL == fFunctions.fUnmapTexSubImage2D) { 464 nullptr == fFunctions.fUnmapTexSubImage2D) {
465 RETURN_FALSE_INTERFACE; 465 RETURN_FALSE_INTERFACE;
466 } 466 }
467 } 467 }
468 468
469 // These functions are added to the 3.0 version of both GLES and GL. 469 // These functions are added to the 3.0 version of both GLES and GL.
470 if (glVer >= GR_GL_VER(3,0) || 470 if (glVer >= GR_GL_VER(3,0) ||
471 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_r ange")) || 471 (kGLES_GrGLStandard == fStandard && fExtensions.has("GL_EXT_map_buffer_r ange")) ||
472 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_ran ge"))) { 472 (kGL_GrGLStandard == fStandard && fExtensions.has("GL_ARB_map_buffer_ran ge"))) {
473 if (NULL == fFunctions.fMapBufferRange || 473 if (nullptr == fFunctions.fMapBufferRange ||
474 NULL == fFunctions.fFlushMappedBufferRange) { 474 nullptr == fFunctions.fFlushMappedBufferRange) {
475 RETURN_FALSE_INTERFACE; 475 RETURN_FALSE_INTERFACE;
476 } 476 }
477 } 477 }
478 478
479 if ((kGL_GrGLStandard == fStandard && 479 if ((kGL_GrGLStandard == fStandard &&
480 (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_q uery"))) || 480 (glVer >= GR_GL_VER(4,3) || fExtensions.has("GL_ARB_program_interface_q uery"))) ||
481 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) { 481 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1))) {
482 if (NULL == fFunctions.fGetProgramResourceLocation) { 482 if (nullptr == fFunctions.fGetProgramResourceLocation) {
483 RETURN_FALSE_INTERFACE 483 RETURN_FALSE_INTERFACE
484 } 484 }
485 } 485 }
486 486
487 if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) || 487 if (kGLES_GrGLStandard == fStandard || glVer >= GR_GL_VER(4,1) ||
488 fExtensions.has("GL_ARB_ES2_compatibility")) { 488 fExtensions.has("GL_ARB_ES2_compatibility")) {
489 #if 0 // Enable this once Chrome gives us the function ptr 489 #if 0 // Enable this once Chrome gives us the function ptr
490 if (NULL == fFunctions.fGetShaderPrecisionFormat) { 490 if (nullptr == fFunctions.fGetShaderPrecisionFormat) {
491 RETURN_FALSE_INTERFACE 491 RETURN_FALSE_INTERFACE
492 } 492 }
493 #endif 493 #endif
494 } 494 }
495 495
496 if (fExtensions.has("GL_NV_path_rendering") || fExtensions.has("GL_CHROMIUM_ path_rendering")) { 496 if (fExtensions.has("GL_NV_path_rendering") || fExtensions.has("GL_CHROMIUM_ path_rendering")) {
497 if (NULL == fFunctions.fMatrixLoadf || 497 if (nullptr == fFunctions.fMatrixLoadf ||
498 NULL == fFunctions.fMatrixLoadIdentity || 498 nullptr == fFunctions.fMatrixLoadIdentity ||
499 NULL == fFunctions.fPathCommands || 499 nullptr == fFunctions.fPathCommands ||
500 NULL == fFunctions.fPathParameteri || 500 nullptr == fFunctions.fPathParameteri ||
501 NULL == fFunctions.fPathParameterf || 501 nullptr == fFunctions.fPathParameterf ||
502 NULL == fFunctions.fGenPaths || 502 nullptr == fFunctions.fGenPaths ||
503 NULL == fFunctions.fDeletePaths || 503 nullptr == fFunctions.fDeletePaths ||
504 NULL == fFunctions.fIsPath || 504 nullptr == fFunctions.fIsPath ||
505 NULL == fFunctions.fPathStencilFunc || 505 nullptr == fFunctions.fPathStencilFunc ||
506 NULL == fFunctions.fStencilFillPath || 506 nullptr == fFunctions.fStencilFillPath ||
507 NULL == fFunctions.fStencilStrokePath || 507 nullptr == fFunctions.fStencilStrokePath ||
508 NULL == fFunctions.fStencilFillPathInstanced || 508 nullptr == fFunctions.fStencilFillPathInstanced ||
509 NULL == fFunctions.fStencilStrokePathInstanced || 509 nullptr == fFunctions.fStencilStrokePathInstanced ||
510 NULL == fFunctions.fCoverFillPath || 510 nullptr == fFunctions.fCoverFillPath ||
511 NULL == fFunctions.fCoverStrokePath || 511 nullptr == fFunctions.fCoverStrokePath ||
512 NULL == fFunctions.fCoverFillPathInstanced || 512 nullptr == fFunctions.fCoverFillPathInstanced ||
513 NULL == fFunctions.fCoverStrokePathInstanced 513 nullptr == fFunctions.fCoverStrokePathInstanced
514 #if 0 514 #if 0
515 // List of functions that Skia uses, but which have been added since the initial release 515 // List of functions that Skia uses, but which have been added since the initial release
516 // of NV_path_rendering driver. We do not want to fail interface val idation due to 516 // of NV_path_rendering driver. We do not want to fail interface val idation due to
517 // missing features, we will just not use the extension. 517 // missing features, we will just not use the extension.
518 // Update this list -> update GrGLCaps::hasPathRenderingSupport too. 518 // Update this list -> update GrGLCaps::hasPathRenderingSupport too.
519 || NULL == fFunctions.fStencilThenCoverFillPath || 519 || nullptr == fFunctions.fStencilThenCoverFillPath ||
520 NULL == fFunctions.fStencilThenCoverStrokePath || 520 nullptr == fFunctions.fStencilThenCoverStrokePath ||
521 NULL == fFunctions.fStencilThenCoverFillPathInstanced || 521 nullptr == fFunctions.fStencilThenCoverFillPathInstanced ||
522 NULL == fFunctions.fStencilThenCoverStrokePathInstanced || 522 nullptr == fFunctions.fStencilThenCoverStrokePathInstanced ||
523 NULL == fFunctions.fProgramPathFragmentInputGen 523 nullptr == fFunctions.fProgramPathFragmentInputGen
524 #endif 524 #endif
525 ) { 525 ) {
526 RETURN_FALSE_INTERFACE 526 RETURN_FALSE_INTERFACE
527 } 527 }
528 if (fExtensions.has("GL_CHROMIUM_path_rendering")) { 528 if (fExtensions.has("GL_CHROMIUM_path_rendering")) {
529 if (NULL == fFunctions.fBindFragmentInputLocation) { 529 if (nullptr == fFunctions.fBindFragmentInputLocation) {
530 RETURN_FALSE_INTERFACE 530 RETURN_FALSE_INTERFACE
531 } 531 }
532 } 532 }
533 } 533 }
534 534
535 if (fExtensions.has("GL_EXT_raster_multisample")) { 535 if (fExtensions.has("GL_EXT_raster_multisample")) {
536 if (NULL == fFunctions.fRasterSamples) { 536 if (nullptr == fFunctions.fRasterSamples) {
537 RETURN_FALSE_INTERFACE 537 RETURN_FALSE_INTERFACE
538 } 538 }
539 } 539 }
540 540
541 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { 541 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) {
542 if (NULL == fFunctions.fCoverageModulation) { 542 if (nullptr == fFunctions.fCoverageModulation) {
543 RETURN_FALSE_INTERFACE 543 RETURN_FALSE_INTERFACE
544 } 544 }
545 } 545 }
546 546
547 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1)) || 547 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,1)) ||
548 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) || 548 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
549 fExtensions.has("GL_ARB_draw_instanced") || 549 fExtensions.has("GL_ARB_draw_instanced") ||
550 fExtensions.has("GL_EXT_draw_instanced")) { 550 fExtensions.has("GL_EXT_draw_instanced")) {
551 if (NULL == fFunctions.fDrawArraysInstanced || 551 if (nullptr == fFunctions.fDrawArraysInstanced ||
552 NULL == fFunctions.fDrawElementsInstanced) { 552 nullptr == fFunctions.fDrawElementsInstanced) {
553 RETURN_FALSE_INTERFACE 553 RETURN_FALSE_INTERFACE
554 } 554 }
555 } 555 }
556 556
557 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) || 557 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) ||
558 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) || 558 (kGLES_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,0)) ||
559 fExtensions.has("GL_ARB_instanced_arrays") || 559 fExtensions.has("GL_ARB_instanced_arrays") ||
560 fExtensions.has("GL_EXT_instanced_arrays")) { 560 fExtensions.has("GL_EXT_instanced_arrays")) {
561 if (NULL == fFunctions.fVertexAttribDivisor) { 561 if (nullptr == fFunctions.fVertexAttribDivisor) {
562 RETURN_FALSE_INTERFACE 562 RETURN_FALSE_INTERFACE
563 } 563 }
564 } 564 }
565 565
566 if (fExtensions.has("GL_NV_bindless_texture")) { 566 if (fExtensions.has("GL_NV_bindless_texture")) {
567 if (NULL == fFunctions.fGetTextureHandle || 567 if (nullptr == fFunctions.fGetTextureHandle ||
568 NULL == fFunctions.fGetTextureSamplerHandle || 568 nullptr == fFunctions.fGetTextureSamplerHandle ||
569 NULL == fFunctions.fMakeTextureHandleResident || 569 nullptr == fFunctions.fMakeTextureHandleResident ||
570 NULL == fFunctions.fMakeTextureHandleNonResident || 570 nullptr == fFunctions.fMakeTextureHandleNonResident ||
571 NULL == fFunctions.fGetImageHandle || 571 nullptr == fFunctions.fGetImageHandle ||
572 NULL == fFunctions.fMakeImageHandleResident || 572 nullptr == fFunctions.fMakeImageHandleResident ||
573 NULL == fFunctions.fMakeImageHandleNonResident || 573 nullptr == fFunctions.fMakeImageHandleNonResident ||
574 NULL == fFunctions.fIsTextureHandleResident || 574 nullptr == fFunctions.fIsTextureHandleResident ||
575 NULL == fFunctions.fIsImageHandleResident || 575 nullptr == fFunctions.fIsImageHandleResident ||
576 NULL == fFunctions.fUniformHandleui64 || 576 nullptr == fFunctions.fUniformHandleui64 ||
577 NULL == fFunctions.fUniformHandleui64v || 577 nullptr == fFunctions.fUniformHandleui64v ||
578 NULL == fFunctions.fProgramUniformHandleui64 || 578 nullptr == fFunctions.fProgramUniformHandleui64 ||
579 NULL == fFunctions.fProgramUniformHandleui64v) { 579 nullptr == fFunctions.fProgramUniformHandleui64v) {
580 RETURN_FALSE_INTERFACE 580 RETURN_FALSE_INTERFACE
581 } 581 }
582 } 582 }
583 583
584 if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_ac cess")) { 584 if (kGL_GrGLStandard == fStandard && fExtensions.has("GL_EXT_direct_state_ac cess")) {
585 if (NULL == fFunctions.fTextureParameteri || 585 if (nullptr == fFunctions.fTextureParameteri ||
586 NULL == fFunctions.fTextureParameteriv || 586 nullptr == fFunctions.fTextureParameteriv ||
587 NULL == fFunctions.fTextureParameterf || 587 nullptr == fFunctions.fTextureParameterf ||
588 NULL == fFunctions.fTextureParameterfv || 588 nullptr == fFunctions.fTextureParameterfv ||
589 NULL == fFunctions.fTextureImage1D || 589 nullptr == fFunctions.fTextureImage1D ||
590 NULL == fFunctions.fTextureImage2D || 590 nullptr == fFunctions.fTextureImage2D ||
591 NULL == fFunctions.fTextureSubImage1D || 591 nullptr == fFunctions.fTextureSubImage1D ||
592 NULL == fFunctions.fTextureSubImage2D || 592 nullptr == fFunctions.fTextureSubImage2D ||
593 NULL == fFunctions.fCopyTextureImage1D || 593 nullptr == fFunctions.fCopyTextureImage1D ||
594 NULL == fFunctions.fCopyTextureImage2D || 594 nullptr == fFunctions.fCopyTextureImage2D ||
595 NULL == fFunctions.fCopyTextureSubImage1D || 595 nullptr == fFunctions.fCopyTextureSubImage1D ||
596 NULL == fFunctions.fCopyTextureSubImage2D || 596 nullptr == fFunctions.fCopyTextureSubImage2D ||
597 NULL == fFunctions.fGetTextureImage || 597 nullptr == fFunctions.fGetTextureImage ||
598 NULL == fFunctions.fGetTextureParameterfv || 598 nullptr == fFunctions.fGetTextureParameterfv ||
599 NULL == fFunctions.fGetTextureParameteriv || 599 nullptr == fFunctions.fGetTextureParameteriv ||
600 NULL == fFunctions.fGetTextureLevelParameterfv || 600 nullptr == fFunctions.fGetTextureLevelParameterfv ||
601 NULL == fFunctions.fGetTextureLevelParameteriv) { 601 nullptr == fFunctions.fGetTextureLevelParameteriv) {
602 RETURN_FALSE_INTERFACE 602 RETURN_FALSE_INTERFACE
603 } 603 }
604 if (glVer >= GR_GL_VER(1,2)) { 604 if (glVer >= GR_GL_VER(1,2)) {
605 if (NULL == fFunctions.fTextureImage3D || 605 if (nullptr == fFunctions.fTextureImage3D ||
606 NULL == fFunctions.fTextureSubImage3D || 606 nullptr == fFunctions.fTextureSubImage3D ||
607 NULL == fFunctions.fCopyTextureSubImage3D || 607 nullptr == fFunctions.fCopyTextureSubImage3D ||
608 NULL == fFunctions.fCompressedTextureImage3D || 608 nullptr == fFunctions.fCompressedTextureImage3D ||
609 NULL == fFunctions.fCompressedTextureImage2D || 609 nullptr == fFunctions.fCompressedTextureImage2D ||
610 NULL == fFunctions.fCompressedTextureImage1D || 610 nullptr == fFunctions.fCompressedTextureImage1D ||
611 NULL == fFunctions.fCompressedTextureSubImage3D || 611 nullptr == fFunctions.fCompressedTextureSubImage3D ||
612 NULL == fFunctions.fCompressedTextureSubImage2D || 612 nullptr == fFunctions.fCompressedTextureSubImage2D ||
613 NULL == fFunctions.fCompressedTextureSubImage1D || 613 nullptr == fFunctions.fCompressedTextureSubImage1D ||
614 NULL == fFunctions.fGetCompressedTextureImage) { 614 nullptr == fFunctions.fGetCompressedTextureImage) {
615 RETURN_FALSE_INTERFACE 615 RETURN_FALSE_INTERFACE
616 } 616 }
617 } 617 }
618 if (glVer >= GR_GL_VER(1,5)) { 618 if (glVer >= GR_GL_VER(1,5)) {
619 if (NULL == fFunctions.fNamedBufferData || 619 if (nullptr == fFunctions.fNamedBufferData ||
620 NULL == fFunctions.fNamedBufferSubData || 620 nullptr == fFunctions.fNamedBufferSubData ||
621 NULL == fFunctions.fMapNamedBuffer || 621 nullptr == fFunctions.fMapNamedBuffer ||
622 NULL == fFunctions.fUnmapNamedBuffer || 622 nullptr == fFunctions.fUnmapNamedBuffer ||
623 NULL == fFunctions.fGetNamedBufferParameteriv || 623 nullptr == fFunctions.fGetNamedBufferParameteriv ||
624 NULL == fFunctions.fGetNamedBufferPointerv || 624 nullptr == fFunctions.fGetNamedBufferPointerv ||
625 NULL == fFunctions.fGetNamedBufferSubData) { 625 nullptr == fFunctions.fGetNamedBufferSubData) {
626 RETURN_FALSE_INTERFACE 626 RETURN_FALSE_INTERFACE
627 } 627 }
628 } 628 }
629 if (glVer >= GR_GL_VER(2,0)) { 629 if (glVer >= GR_GL_VER(2,0)) {
630 if (NULL == fFunctions.fProgramUniform1f || 630 if (nullptr == fFunctions.fProgramUniform1f ||
631 NULL == fFunctions.fProgramUniform2f || 631 nullptr == fFunctions.fProgramUniform2f ||
632 NULL == fFunctions.fProgramUniform3f || 632 nullptr == fFunctions.fProgramUniform3f ||
633 NULL == fFunctions.fProgramUniform4f || 633 nullptr == fFunctions.fProgramUniform4f ||
634 NULL == fFunctions.fProgramUniform1i || 634 nullptr == fFunctions.fProgramUniform1i ||
635 NULL == fFunctions.fProgramUniform2i || 635 nullptr == fFunctions.fProgramUniform2i ||
636 NULL == fFunctions.fProgramUniform3i || 636 nullptr == fFunctions.fProgramUniform3i ||
637 NULL == fFunctions.fProgramUniform4i || 637 nullptr == fFunctions.fProgramUniform4i ||
638 NULL == fFunctions.fProgramUniform1fv || 638 nullptr == fFunctions.fProgramUniform1fv ||
639 NULL == fFunctions.fProgramUniform2fv || 639 nullptr == fFunctions.fProgramUniform2fv ||
640 NULL == fFunctions.fProgramUniform3fv || 640 nullptr == fFunctions.fProgramUniform3fv ||
641 NULL == fFunctions.fProgramUniform4fv || 641 nullptr == fFunctions.fProgramUniform4fv ||
642 NULL == fFunctions.fProgramUniform1iv || 642 nullptr == fFunctions.fProgramUniform1iv ||
643 NULL == fFunctions.fProgramUniform2iv || 643 nullptr == fFunctions.fProgramUniform2iv ||
644 NULL == fFunctions.fProgramUniform3iv || 644 nullptr == fFunctions.fProgramUniform3iv ||
645 NULL == fFunctions.fProgramUniform4iv || 645 nullptr == fFunctions.fProgramUniform4iv ||
646 NULL == fFunctions.fProgramUniformMatrix2fv || 646 nullptr == fFunctions.fProgramUniformMatrix2fv ||
647 NULL == fFunctions.fProgramUniformMatrix3fv || 647 nullptr == fFunctions.fProgramUniformMatrix3fv ||
648 NULL == fFunctions.fProgramUniformMatrix4fv) { 648 nullptr == fFunctions.fProgramUniformMatrix4fv) {
649 RETURN_FALSE_INTERFACE 649 RETURN_FALSE_INTERFACE
650 } 650 }
651 } 651 }
652 if (glVer >= GR_GL_VER(2,1)) { 652 if (glVer >= GR_GL_VER(2,1)) {
653 if (NULL == fFunctions.fProgramUniformMatrix2x3fv || 653 if (nullptr == fFunctions.fProgramUniformMatrix2x3fv ||
654 NULL == fFunctions.fProgramUniformMatrix3x2fv || 654 nullptr == fFunctions.fProgramUniformMatrix3x2fv ||
655 NULL == fFunctions.fProgramUniformMatrix2x4fv || 655 nullptr == fFunctions.fProgramUniformMatrix2x4fv ||
656 NULL == fFunctions.fProgramUniformMatrix4x2fv || 656 nullptr == fFunctions.fProgramUniformMatrix4x2fv ||
657 NULL == fFunctions.fProgramUniformMatrix3x4fv || 657 nullptr == fFunctions.fProgramUniformMatrix3x4fv ||
658 NULL == fFunctions.fProgramUniformMatrix4x3fv) { 658 nullptr == fFunctions.fProgramUniformMatrix4x3fv) {
659 RETURN_FALSE_INTERFACE 659 RETURN_FALSE_INTERFACE
660 } 660 }
661 } 661 }
662 if (glVer >= GR_GL_VER(3,0)) { 662 if (glVer >= GR_GL_VER(3,0)) {
663 if (NULL == fFunctions.fNamedRenderbufferStorage || 663 if (nullptr == fFunctions.fNamedRenderbufferStorage ||
664 NULL == fFunctions.fGetNamedRenderbufferParameteriv || 664 nullptr == fFunctions.fGetNamedRenderbufferParameteriv ||
665 NULL == fFunctions.fNamedRenderbufferStorageMultisample || 665 nullptr == fFunctions.fNamedRenderbufferStorageMultisample ||
666 NULL == fFunctions.fCheckNamedFramebufferStatus || 666 nullptr == fFunctions.fCheckNamedFramebufferStatus ||
667 NULL == fFunctions.fNamedFramebufferTexture1D || 667 nullptr == fFunctions.fNamedFramebufferTexture1D ||
668 NULL == fFunctions.fNamedFramebufferTexture2D || 668 nullptr == fFunctions.fNamedFramebufferTexture2D ||
669 NULL == fFunctions.fNamedFramebufferTexture3D || 669 nullptr == fFunctions.fNamedFramebufferTexture3D ||
670 NULL == fFunctions.fNamedFramebufferRenderbuffer || 670 nullptr == fFunctions.fNamedFramebufferRenderbuffer ||
671 NULL == fFunctions.fGetNamedFramebufferAttachmentParameteriv || 671 nullptr == fFunctions.fGetNamedFramebufferAttachmentParameteriv ||
672 NULL == fFunctions.fGenerateTextureMipmap || 672 nullptr == fFunctions.fGenerateTextureMipmap ||
673 NULL == fFunctions.fFramebufferDrawBuffer || 673 nullptr == fFunctions.fFramebufferDrawBuffer ||
674 NULL == fFunctions.fFramebufferDrawBuffers || 674 nullptr == fFunctions.fFramebufferDrawBuffers ||
675 NULL == fFunctions.fFramebufferReadBuffer || 675 nullptr == fFunctions.fFramebufferReadBuffer ||
676 NULL == fFunctions.fGetFramebufferParameteriv || 676 nullptr == fFunctions.fGetFramebufferParameteriv ||
677 NULL == fFunctions.fNamedCopyBufferSubData || 677 nullptr == fFunctions.fNamedCopyBufferSubData ||
678 NULL == fFunctions.fVertexArrayVertexOffset || 678 nullptr == fFunctions.fVertexArrayVertexOffset ||
679 NULL == fFunctions.fVertexArrayColorOffset || 679 nullptr == fFunctions.fVertexArrayColorOffset ||
680 NULL == fFunctions.fVertexArrayEdgeFlagOffset || 680 nullptr == fFunctions.fVertexArrayEdgeFlagOffset ||
681 NULL == fFunctions.fVertexArrayIndexOffset || 681 nullptr == fFunctions.fVertexArrayIndexOffset ||
682 NULL == fFunctions.fVertexArrayNormalOffset || 682 nullptr == fFunctions.fVertexArrayNormalOffset ||
683 NULL == fFunctions.fVertexArrayTexCoordOffset || 683 nullptr == fFunctions.fVertexArrayTexCoordOffset ||
684 NULL == fFunctions.fVertexArrayMultiTexCoordOffset || 684 nullptr == fFunctions.fVertexArrayMultiTexCoordOffset ||
685 NULL == fFunctions.fVertexArrayFogCoordOffset || 685 nullptr == fFunctions.fVertexArrayFogCoordOffset ||
686 NULL == fFunctions.fVertexArraySecondaryColorOffset || 686 nullptr == fFunctions.fVertexArraySecondaryColorOffset ||
687 NULL == fFunctions.fVertexArrayVertexAttribOffset || 687 nullptr == fFunctions.fVertexArrayVertexAttribOffset ||
688 NULL == fFunctions.fVertexArrayVertexAttribIOffset || 688 nullptr == fFunctions.fVertexArrayVertexAttribIOffset ||
689 NULL == fFunctions.fEnableVertexArray || 689 nullptr == fFunctions.fEnableVertexArray ||
690 NULL == fFunctions.fDisableVertexArray || 690 nullptr == fFunctions.fDisableVertexArray ||
691 NULL == fFunctions.fEnableVertexArrayAttrib || 691 nullptr == fFunctions.fEnableVertexArrayAttrib ||
692 NULL == fFunctions.fDisableVertexArrayAttrib || 692 nullptr == fFunctions.fDisableVertexArrayAttrib ||
693 NULL == fFunctions.fGetVertexArrayIntegerv || 693 nullptr == fFunctions.fGetVertexArrayIntegerv ||
694 NULL == fFunctions.fGetVertexArrayPointerv || 694 nullptr == fFunctions.fGetVertexArrayPointerv ||
695 NULL == fFunctions.fGetVertexArrayIntegeri_v || 695 nullptr == fFunctions.fGetVertexArrayIntegeri_v ||
696 NULL == fFunctions.fGetVertexArrayPointeri_v || 696 nullptr == fFunctions.fGetVertexArrayPointeri_v ||
697 NULL == fFunctions.fMapNamedBufferRange || 697 nullptr == fFunctions.fMapNamedBufferRange ||
698 NULL == fFunctions.fFlushMappedNamedBufferRange) { 698 nullptr == fFunctions.fFlushMappedNamedBufferRange) {
699 RETURN_FALSE_INTERFACE 699 RETURN_FALSE_INTERFACE
700 } 700 }
701 } 701 }
702 } 702 }
703 703
704 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) || 704 if ((kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(4,3)) ||
705 fExtensions.has("GL_KHR_debug")) { 705 fExtensions.has("GL_KHR_debug")) {
706 if (NULL == fFunctions.fDebugMessageControl || 706 if (nullptr == fFunctions.fDebugMessageControl ||
707 NULL == fFunctions.fDebugMessageInsert || 707 nullptr == fFunctions.fDebugMessageInsert ||
708 NULL == fFunctions.fDebugMessageCallback || 708 nullptr == fFunctions.fDebugMessageCallback ||
709 NULL == fFunctions.fGetDebugMessageLog || 709 nullptr == fFunctions.fGetDebugMessageLog ||
710 NULL == fFunctions.fPushDebugGroup || 710 nullptr == fFunctions.fPushDebugGroup ||
711 NULL == fFunctions.fPopDebugGroup || 711 nullptr == fFunctions.fPopDebugGroup ||
712 NULL == fFunctions.fObjectLabel) { 712 nullptr == fFunctions.fObjectLabel) {
713 RETURN_FALSE_INTERFACE 713 RETURN_FALSE_INTERFACE
714 } 714 }
715 } 715 }
716 716
717 return true; 717 return true;
718 } 718 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLIndexBuffer.cpp ('k') | src/gpu/gl/GrGLNameAllocator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698