OLD | NEW |
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 NULL == fFunctions.fGetFramebufferAttachmentParameteriv || | 221 NULL == fFunctions.fGetFramebufferAttachmentParameteriv || |
222 NULL == fFunctions.fGetRenderbufferParameteriv || | 222 NULL == fFunctions.fGetRenderbufferParameteriv || |
223 NULL == fFunctions.fGenFramebuffers || | 223 NULL == fFunctions.fGenFramebuffers || |
224 NULL == fFunctions.fGenRenderbuffers || | 224 NULL == fFunctions.fGenRenderbuffers || |
225 NULL == fFunctions.fRenderbufferStorage) { | 225 NULL == fFunctions.fRenderbufferStorage) { |
226 RETURN_FALSE_INTERFACE | 226 RETURN_FALSE_INTERFACE |
227 } | 227 } |
228 | 228 |
229 GrGLVersion glVer = GrGLGetVersion(this); | 229 GrGLVersion glVer = GrGLGetVersion(this); |
230 | 230 |
231 bool isCoreProfile = false; | |
232 if (kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) { | |
233 GrGLint profileMask; | |
234 GR_GL_GetIntegerv(this, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); | |
235 isCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); | |
236 } | |
237 | |
238 // Now check that baseline ES/Desktop fns not covered above are present | 231 // Now check that baseline ES/Desktop fns not covered above are present |
239 // and that we have fn pointers for any advertised fExtensions that we will | 232 // and that we have fn pointers for any advertised fExtensions that we will |
240 // try to use. | 233 // try to use. |
241 | 234 |
242 // these functions are part of ES2, we assume they are available | 235 // these functions are part of ES2, we assume they are available |
243 // On the desktop we assume they are available if the extension | 236 // On the desktop we assume they are available if the extension |
244 // is present or GL version is high enough. | 237 // is present or GL version is high enough. |
245 if (kGLES_GrGLStandard == fStandard) { | 238 if (kGLES_GrGLStandard == fStandard) { |
246 if (NULL == fFunctions.fStencilFuncSeparate || | 239 if (NULL == fFunctions.fStencilFuncSeparate || |
247 NULL == fFunctions.fStencilMaskSeparate || | 240 NULL == fFunctions.fStencilMaskSeparate || |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 if (NULL == fFunctions.fGetQueryObjecti64v || | 276 if (NULL == fFunctions.fGetQueryObjecti64v || |
284 NULL == fFunctions.fGetQueryObjectui64v) { | 277 NULL == fFunctions.fGetQueryObjectui64v) { |
285 RETURN_FALSE_INTERFACE | 278 RETURN_FALSE_INTERFACE |
286 } | 279 } |
287 } | 280 } |
288 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) { | 281 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) { |
289 if (NULL == fFunctions.fQueryCounter) { | 282 if (NULL == fFunctions.fQueryCounter) { |
290 RETURN_FALSE_INTERFACE | 283 RETURN_FALSE_INTERFACE |
291 } | 284 } |
292 } | 285 } |
293 if (!isCoreProfile) { | 286 if (fExtensions.has("GL_EXT_direct_state_access")) { |
294 if (NULL == fFunctions.fLoadIdentity || | 287 if (NULL == fFunctions.fMatrixLoadf || |
295 NULL == fFunctions.fLoadMatrixf || | 288 NULL == fFunctions.fMatrixLoadIdentity) { |
296 NULL == fFunctions.fMatrixMode) { | |
297 RETURN_FALSE_INTERFACE | 289 RETURN_FALSE_INTERFACE |
298 } | 290 } |
299 } | 291 } |
300 if (fExtensions.has("GL_NV_path_rendering")) { | 292 if (fExtensions.has("GL_NV_path_rendering")) { |
301 if (NULL == fFunctions.fPathCommands || | 293 if (NULL == fFunctions.fPathCommands || |
302 NULL == fFunctions.fPathCoords || | 294 NULL == fFunctions.fPathCoords || |
303 NULL == fFunctions.fPathSubCommands || | 295 NULL == fFunctions.fPathSubCommands || |
304 NULL == fFunctions.fPathSubCoords || | 296 NULL == fFunctions.fPathSubCoords || |
305 NULL == fFunctions.fPathString || | 297 NULL == fFunctions.fPathString || |
306 NULL == fFunctions.fPathGlyphs || | 298 NULL == fFunctions.fPathGlyphs || |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 NULL == fFunctions.fMapTexSubImage2D || | 500 NULL == fFunctions.fMapTexSubImage2D || |
509 NULL == fFunctions.fUnmapBufferSubData || | 501 NULL == fFunctions.fUnmapBufferSubData || |
510 NULL == fFunctions.fUnmapTexSubImage2D) { | 502 NULL == fFunctions.fUnmapTexSubImage2D) { |
511 RETURN_FALSE_INTERFACE; | 503 RETURN_FALSE_INTERFACE; |
512 } | 504 } |
513 } | 505 } |
514 #endif | 506 #endif |
515 | 507 |
516 return true; | 508 return true; |
517 } | 509 } |
OLD | NEW |