| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 clone->fStandard = interface->fStandard; | 109 clone->fStandard = interface->fStandard; |
| 110 clone->fExtensions = interface->fExtensions; | 110 clone->fExtensions = interface->fExtensions; |
| 111 clone->fFunctions = interface->fFunctions; | 111 clone->fFunctions = interface->fFunctions; |
| 112 #if GR_GL_PER_GL_FUNC_CALLBACK | 112 #if GR_GL_PER_GL_FUNC_CALLBACK |
| 113 clone->fCallback = interface->fCallback; | 113 clone->fCallback = interface->fCallback; |
| 114 clone->fCallbackData = interface->fCallbackData; | 114 clone->fCallbackData = interface->fCallbackData; |
| 115 #endif | 115 #endif |
| 116 return clone; | 116 return clone; |
| 117 } | 117 } |
| 118 | 118 |
| 119 #define RETURN_FALSE_INTERFACE \ |
| 120 GrDebugCrash("GrGLInterface::validate() failed."); \ |
| 121 return false; \ |
| 122 |
| 119 bool GrGLInterface::validate() const { | 123 bool GrGLInterface::validate() const { |
| 120 | 124 |
| 121 if (kNone_GrGLStandard == fStandard) { | 125 if (kNone_GrGLStandard == fStandard) { |
| 122 return false; | 126 RETURN_FALSE_INTERFACE |
| 123 } | 127 } |
| 124 | 128 |
| 125 if (!fExtensions.isInitialized()) { | 129 if (!fExtensions.isInitialized()) { |
| 126 return false; | 130 RETURN_FALSE_INTERFACE |
| 127 } | 131 } |
| 128 | 132 |
| 129 // functions that are always required | 133 // functions that are always required |
| 130 if (NULL == fFunctions.fActiveTexture || | 134 if (NULL == fFunctions.fActiveTexture || |
| 131 NULL == fFunctions.fAttachShader || | 135 NULL == fFunctions.fAttachShader || |
| 132 NULL == fFunctions.fBindAttribLocation || | 136 NULL == fFunctions.fBindAttribLocation || |
| 133 NULL == fFunctions.fBindBuffer || | 137 NULL == fFunctions.fBindBuffer || |
| 134 NULL == fFunctions.fBindTexture || | 138 NULL == fFunctions.fBindTexture || |
| 135 NULL == fFunctions.fBlendFunc || | 139 NULL == fFunctions.fBlendFunc || |
| 136 NULL == fFunctions.fBlendColor || // -> GL >= 1.4, ES >= 2.0 or ext
ension | 140 NULL == fFunctions.fBlendColor || // -> GL >= 1.4, ES >= 2.0 or ext
ension |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 NULL == fFunctions.fDeleteRenderbuffers || | 216 NULL == fFunctions.fDeleteRenderbuffers || |
| 213 NULL == fFunctions.fFinish || | 217 NULL == fFunctions.fFinish || |
| 214 NULL == fFunctions.fFlush || | 218 NULL == fFunctions.fFlush || |
| 215 NULL == fFunctions.fFramebufferRenderbuffer || | 219 NULL == fFunctions.fFramebufferRenderbuffer || |
| 216 NULL == fFunctions.fFramebufferTexture2D || | 220 NULL == fFunctions.fFramebufferTexture2D || |
| 217 NULL == fFunctions.fGetFramebufferAttachmentParameteriv || | 221 NULL == fFunctions.fGetFramebufferAttachmentParameteriv || |
| 218 NULL == fFunctions.fGetRenderbufferParameteriv || | 222 NULL == fFunctions.fGetRenderbufferParameteriv || |
| 219 NULL == fFunctions.fGenFramebuffers || | 223 NULL == fFunctions.fGenFramebuffers || |
| 220 NULL == fFunctions.fGenRenderbuffers || | 224 NULL == fFunctions.fGenRenderbuffers || |
| 221 NULL == fFunctions.fRenderbufferStorage) { | 225 NULL == fFunctions.fRenderbufferStorage) { |
| 222 return false; | 226 RETURN_FALSE_INTERFACE |
| 223 } | 227 } |
| 224 | 228 |
| 225 GrGLVersion glVer = GrGLGetVersion(this); | 229 GrGLVersion glVer = GrGLGetVersion(this); |
| 226 | 230 |
| 227 bool isCoreProfile = false; | 231 bool isCoreProfile = false; |
| 228 if (kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) { | 232 if (kGL_GrGLStandard == fStandard && glVer >= GR_GL_VER(3,2)) { |
| 229 GrGLint profileMask; | 233 GrGLint profileMask; |
| 230 GR_GL_GetIntegerv(this, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); | 234 GR_GL_GetIntegerv(this, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); |
| 231 isCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); | 235 isCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); |
| 232 } | 236 } |
| 233 | 237 |
| 234 // Now check that baseline ES/Desktop fns not covered above are present | 238 // Now check that baseline ES/Desktop fns not covered above are present |
| 235 // and that we have fn pointers for any advertised fExtensions that we will | 239 // and that we have fn pointers for any advertised fExtensions that we will |
| 236 // try to use. | 240 // try to use. |
| 237 | 241 |
| 238 // these functions are part of ES2, we assume they are available | 242 // these functions are part of ES2, we assume they are available |
| 239 // On the desktop we assume they are available if the extension | 243 // On the desktop we assume they are available if the extension |
| 240 // is present or GL version is high enough. | 244 // is present or GL version is high enough. |
| 241 if (kGLES_GrGLStandard == fStandard) { | 245 if (kGLES_GrGLStandard == fStandard) { |
| 242 if (NULL == fFunctions.fStencilFuncSeparate || | 246 if (NULL == fFunctions.fStencilFuncSeparate || |
| 243 NULL == fFunctions.fStencilMaskSeparate || | 247 NULL == fFunctions.fStencilMaskSeparate || |
| 244 NULL == fFunctions.fStencilOpSeparate) { | 248 NULL == fFunctions.fStencilOpSeparate) { |
| 245 return false; | 249 RETURN_FALSE_INTERFACE |
| 246 } | 250 } |
| 247 } else if (kGL_GrGLStandard == fStandard) { | 251 } else if (kGL_GrGLStandard == fStandard) { |
| 248 | 252 |
| 249 if (glVer >= GR_GL_VER(2,0)) { | 253 if (glVer >= GR_GL_VER(2,0)) { |
| 250 if (NULL == fFunctions.fStencilFuncSeparate || | 254 if (NULL == fFunctions.fStencilFuncSeparate || |
| 251 NULL == fFunctions.fStencilMaskSeparate || | 255 NULL == fFunctions.fStencilMaskSeparate || |
| 252 NULL == fFunctions.fStencilOpSeparate) { | 256 NULL == fFunctions.fStencilOpSeparate) { |
| 253 return false; | 257 RETURN_FALSE_INTERFACE |
| 254 } | 258 } |
| 255 } | 259 } |
| 256 if (glVer >= GR_GL_VER(3,0) && NULL == fFunctions.fBindFragDataLocation)
{ | 260 if (glVer >= GR_GL_VER(3,0) && NULL == fFunctions.fBindFragDataLocation)
{ |
| 257 return false; | 261 RETURN_FALSE_INTERFACE |
| 258 } | 262 } |
| 259 if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) { | 263 if (glVer >= GR_GL_VER(2,0) || fExtensions.has("GL_ARB_draw_buffers")) { |
| 260 if (NULL == fFunctions.fDrawBuffers) { | 264 if (NULL == fFunctions.fDrawBuffers) { |
| 261 return false; | 265 RETURN_FALSE_INTERFACE |
| 262 } | 266 } |
| 263 } | 267 } |
| 264 | 268 |
| 265 if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query")
) { | 269 if (glVer >= GR_GL_VER(1,5) || fExtensions.has("GL_ARB_occlusion_query")
) { |
| 266 if (NULL == fFunctions.fGenQueries || | 270 if (NULL == fFunctions.fGenQueries || |
| 267 NULL == fFunctions.fDeleteQueries || | 271 NULL == fFunctions.fDeleteQueries || |
| 268 NULL == fFunctions.fBeginQuery || | 272 NULL == fFunctions.fBeginQuery || |
| 269 NULL == fFunctions.fEndQuery || | 273 NULL == fFunctions.fEndQuery || |
| 270 NULL == fFunctions.fGetQueryiv || | 274 NULL == fFunctions.fGetQueryiv || |
| 271 NULL == fFunctions.fGetQueryObjectiv || | 275 NULL == fFunctions.fGetQueryObjectiv || |
| 272 NULL == fFunctions.fGetQueryObjectuiv) { | 276 NULL == fFunctions.fGetQueryObjectuiv) { |
| 273 return false; | 277 RETURN_FALSE_INTERFACE |
| 274 } | 278 } |
| 275 } | 279 } |
| 276 if (glVer >= GR_GL_VER(3,3) || | 280 if (glVer >= GR_GL_VER(3,3) || |
| 277 fExtensions.has("GL_ARB_timer_query") || | 281 fExtensions.has("GL_ARB_timer_query") || |
| 278 fExtensions.has("GL_EXT_timer_query")) { | 282 fExtensions.has("GL_EXT_timer_query")) { |
| 279 if (NULL == fFunctions.fGetQueryObjecti64v || | 283 if (NULL == fFunctions.fGetQueryObjecti64v || |
| 280 NULL == fFunctions.fGetQueryObjectui64v) { | 284 NULL == fFunctions.fGetQueryObjectui64v) { |
| 281 return false; | 285 RETURN_FALSE_INTERFACE |
| 282 } | 286 } |
| 283 } | 287 } |
| 284 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) { | 288 if (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_timer_query")) { |
| 285 if (NULL == fFunctions.fQueryCounter) { | 289 if (NULL == fFunctions.fQueryCounter) { |
| 286 return false; | 290 RETURN_FALSE_INTERFACE |
| 287 } | 291 } |
| 288 } | 292 } |
| 289 if (!isCoreProfile) { | 293 if (!isCoreProfile) { |
| 290 if (NULL == fFunctions.fLoadIdentity || | 294 if (NULL == fFunctions.fLoadIdentity || |
| 291 NULL == fFunctions.fLoadMatrixf || | 295 NULL == fFunctions.fLoadMatrixf || |
| 292 NULL == fFunctions.fMatrixMode || | 296 NULL == fFunctions.fMatrixMode || |
| 293 NULL == fFunctions.fTexGenfv || | 297 NULL == fFunctions.fTexGenfv || |
| 294 NULL == fFunctions.fTexGeni) { | 298 NULL == fFunctions.fTexGeni) { |
| 295 return false; | 299 RETURN_FALSE_INTERFACE |
| 296 } | 300 } |
| 297 } | 301 } |
| 298 if (fExtensions.has("GL_NV_path_rendering")) { | 302 if (fExtensions.has("GL_NV_path_rendering")) { |
| 299 if (NULL == fFunctions.fPathCommands || | 303 if (NULL == fFunctions.fPathCommands || |
| 300 NULL == fFunctions.fPathCoords || | 304 NULL == fFunctions.fPathCoords || |
| 301 NULL == fFunctions.fPathSubCommands || | 305 NULL == fFunctions.fPathSubCommands || |
| 302 NULL == fFunctions.fPathSubCoords || | 306 NULL == fFunctions.fPathSubCoords || |
| 303 NULL == fFunctions.fPathString || | 307 NULL == fFunctions.fPathString || |
| 304 NULL == fFunctions.fPathGlyphs || | 308 NULL == fFunctions.fPathGlyphs || |
| 305 NULL == fFunctions.fPathGlyphRange || | 309 NULL == fFunctions.fPathGlyphRange || |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 NULL == fFunctions.fGetPathMetricRange || | 342 NULL == fFunctions.fGetPathMetricRange || |
| 339 NULL == fFunctions.fGetPathSpacing || | 343 NULL == fFunctions.fGetPathSpacing || |
| 340 NULL == fFunctions.fGetPathColorGeniv || | 344 NULL == fFunctions.fGetPathColorGeniv || |
| 341 NULL == fFunctions.fGetPathColorGenfv || | 345 NULL == fFunctions.fGetPathColorGenfv || |
| 342 NULL == fFunctions.fGetPathTexGeniv || | 346 NULL == fFunctions.fGetPathTexGeniv || |
| 343 NULL == fFunctions.fGetPathTexGenfv || | 347 NULL == fFunctions.fGetPathTexGenfv || |
| 344 NULL == fFunctions.fIsPointInFillPath || | 348 NULL == fFunctions.fIsPointInFillPath || |
| 345 NULL == fFunctions.fIsPointInStrokePath || | 349 NULL == fFunctions.fIsPointInStrokePath || |
| 346 NULL == fFunctions.fGetPathLength || | 350 NULL == fFunctions.fGetPathLength || |
| 347 NULL == fFunctions.fPointAlongPath) { | 351 NULL == fFunctions.fPointAlongPath) { |
| 348 return false; | 352 RETURN_FALSE_INTERFACE |
| 349 } | 353 } |
| 350 } | 354 } |
| 351 } | 355 } |
| 352 | 356 |
| 353 // optional function on desktop before 1.3 | 357 // optional function on desktop before 1.3 |
| 354 if (kGL_GrGLStandard != fStandard || | 358 if (kGL_GrGLStandard != fStandard || |
| 355 (glVer >= GR_GL_VER(1,3)) || | 359 (glVer >= GR_GL_VER(1,3)) || |
| 356 fExtensions.has("GL_ARB_texture_compression")) { | 360 fExtensions.has("GL_ARB_texture_compression")) { |
| 357 if (NULL == fFunctions.fCompressedTexImage2D) { | 361 if (NULL == fFunctions.fCompressedTexImage2D) { |
| 358 return false; | 362 RETURN_FALSE_INTERFACE |
| 359 } | 363 } |
| 360 } | 364 } |
| 361 | 365 |
| 362 // part of desktop GL, but not ES | 366 // part of desktop GL, but not ES |
| 363 if (kGL_GrGLStandard == fStandard && | 367 if (kGL_GrGLStandard == fStandard && |
| 364 (NULL == fFunctions.fGetTexLevelParameteriv || | 368 (NULL == fFunctions.fGetTexLevelParameteriv || |
| 365 NULL == fFunctions.fDrawBuffer || | 369 NULL == fFunctions.fDrawBuffer || |
| 366 NULL == fFunctions.fReadBuffer)) { | 370 NULL == fFunctions.fReadBuffer)) { |
| 367 return false; | 371 RETURN_FALSE_INTERFACE |
| 368 } | 372 } |
| 369 | 373 |
| 370 // GL_EXT_texture_storage is part of desktop 4.2 | 374 // GL_EXT_texture_storage is part of desktop 4.2 |
| 371 // There is a desktop ARB extension and an ES+desktop EXT extension | 375 // There is a desktop ARB extension and an ES+desktop EXT extension |
| 372 if (kGL_GrGLStandard == fStandard) { | 376 if (kGL_GrGLStandard == fStandard) { |
| 373 if (glVer >= GR_GL_VER(4,2) || | 377 if (glVer >= GR_GL_VER(4,2) || |
| 374 fExtensions.has("GL_ARB_texture_storage") || | 378 fExtensions.has("GL_ARB_texture_storage") || |
| 375 fExtensions.has("GL_EXT_texture_storage")) { | 379 fExtensions.has("GL_EXT_texture_storage")) { |
| 376 if (NULL == fFunctions.fTexStorage2D) { | 380 if (NULL == fFunctions.fTexStorage2D) { |
| 377 return false; | 381 RETURN_FALSE_INTERFACE |
| 378 } | 382 } |
| 379 } | 383 } |
| 380 } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storag
e")) { | 384 } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storag
e")) { |
| 381 if (NULL == fFunctions.fTexStorage2D) { | 385 if (NULL == fFunctions.fTexStorage2D) { |
| 382 return false; | 386 RETURN_FALSE_INTERFACE |
| 383 } | 387 } |
| 384 } | 388 } |
| 385 | 389 |
| 386 if (fExtensions.has("GL_EXT_discard_framebuffer")) { | 390 if (fExtensions.has("GL_EXT_discard_framebuffer")) { |
| 387 // FIXME: Remove this once Chromium is updated to provide this function | 391 // FIXME: Remove this once Chromium is updated to provide this function |
| 388 #if 0 | 392 #if 0 |
| 389 if (NULL == fFunctions.fDiscardFramebuffer) { | 393 if (NULL == fFunctions.fDiscardFramebuffer) { |
| 390 return false; | 394 RETURN_FALSE_INTERFACE |
| 391 } | 395 } |
| 392 #endif | 396 #endif |
| 393 } | 397 } |
| 394 | 398 |
| 395 // FBO MSAA | 399 // FBO MSAA |
| 396 if (kGL_GrGLStandard == fStandard) { | 400 if (kGL_GrGLStandard == fStandard) { |
| 397 // GL 3.0 and the ARB extension have multisample + blit | 401 // GL 3.0 and the ARB extension have multisample + blit |
| 398 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_objec
t")) { | 402 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_ARB_framebuffer_objec
t")) { |
| 399 if (NULL == fFunctions.fRenderbufferStorageMultisample || | 403 if (NULL == fFunctions.fRenderbufferStorageMultisample || |
| 400 NULL == fFunctions.fBlitFramebuffer) { | 404 NULL == fFunctions.fBlitFramebuffer) { |
| 401 return false; | 405 RETURN_FALSE_INTERFACE |
| 402 } | 406 } |
| 403 } else { | 407 } else { |
| 404 if (fExtensions.has("GL_EXT_framebuffer_blit") && | 408 if (fExtensions.has("GL_EXT_framebuffer_blit") && |
| 405 NULL == fFunctions.fBlitFramebuffer) { | 409 NULL == fFunctions.fBlitFramebuffer) { |
| 406 return false; | 410 RETURN_FALSE_INTERFACE |
| 407 } | 411 } |
| 408 if (fExtensions.has("GL_EXT_framebuffer_multisample") && | 412 if (fExtensions.has("GL_EXT_framebuffer_multisample") && |
| 409 NULL == fFunctions.fRenderbufferStorageMultisample) { | 413 NULL == fFunctions.fRenderbufferStorageMultisample) { |
| 410 return false; | 414 RETURN_FALSE_INTERFACE |
| 411 } | 415 } |
| 412 } | 416 } |
| 413 } else { | 417 } else { |
| 414 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_
multisample")) { | 418 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_CHROMIUM_framebuffer_
multisample")) { |
| 415 if (NULL == fFunctions.fRenderbufferStorageMultisample || | 419 if (NULL == fFunctions.fRenderbufferStorageMultisample || |
| 416 NULL == fFunctions.fBlitFramebuffer) { | 420 NULL == fFunctions.fBlitFramebuffer) { |
| 417 return false; | 421 RETURN_FALSE_INTERFACE |
| 418 } | 422 } |
| 419 } | 423 } |
| 420 if (fExtensions.has("GL_APPLE_framebuffer_multisample")) { | 424 if (fExtensions.has("GL_APPLE_framebuffer_multisample")) { |
| 421 if (NULL == fFunctions.fRenderbufferStorageMultisampleES2APPLE || | 425 if (NULL == fFunctions.fRenderbufferStorageMultisampleES2APPLE || |
| 422 NULL == fFunctions.fResolveMultisampleFramebuffer) { | 426 NULL == fFunctions.fResolveMultisampleFramebuffer) { |
| 423 return false; | 427 RETURN_FALSE_INTERFACE |
| 424 } | 428 } |
| 425 } | 429 } |
| 426 if (fExtensions.has("GL_IMG_multisampled_render_to_texture") || | 430 if (fExtensions.has("GL_IMG_multisampled_render_to_texture") || |
| 427 fExtensions.has("GL_EXT_multisampled_render_to_texture")) { | 431 fExtensions.has("GL_EXT_multisampled_render_to_texture")) { |
| 428 if (NULL == fFunctions.fRenderbufferStorageMultisampleES2EXT || | 432 if (NULL == fFunctions.fRenderbufferStorageMultisampleES2EXT || |
| 429 NULL == fFunctions.fFramebufferTexture2DMultisample) { | 433 NULL == fFunctions.fFramebufferTexture2DMultisample) { |
| 430 return false; | 434 RETURN_FALSE_INTERFACE |
| 431 } | 435 } |
| 432 } | 436 } |
| 433 } | 437 } |
| 434 | 438 |
| 435 // On ES buffer mapping is an extension. On Desktop | 439 // On ES buffer mapping is an extension. On Desktop |
| 436 // buffer mapping was part of original VBO extension | 440 // buffer mapping was part of original VBO extension |
| 437 // which we require. | 441 // which we require. |
| 438 if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) { | 442 if (kGL_GrGLStandard == fStandard || fExtensions.has("GL_OES_mapbuffer")) { |
| 439 if (NULL == fFunctions.fMapBuffer || | 443 if (NULL == fFunctions.fMapBuffer || |
| 440 NULL == fFunctions.fUnmapBuffer) { | 444 NULL == fFunctions.fUnmapBuffer) { |
| 441 return false; | 445 RETURN_FALSE_INTERFACE |
| 442 } | 446 } |
| 443 } | 447 } |
| 444 | 448 |
| 445 // Dual source blending | 449 // Dual source blending |
| 446 if (kGL_GrGLStandard == fStandard && | 450 if (kGL_GrGLStandard == fStandard && |
| 447 (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extended"
))) { | 451 (glVer >= GR_GL_VER(3,3) || fExtensions.has("GL_ARB_blend_func_extended"
))) { |
| 448 if (NULL == fFunctions.fBindFragDataLocationIndexed) { | 452 if (NULL == fFunctions.fBindFragDataLocationIndexed) { |
| 449 return false; | 453 RETURN_FALSE_INTERFACE |
| 450 } | 454 } |
| 451 } | 455 } |
| 452 | 456 |
| 453 // glGetStringi was added in version 3.0 of both desktop and ES. | 457 // glGetStringi was added in version 3.0 of both desktop and ES. |
| 454 if (glVer >= GR_GL_VER(3, 0)) { | 458 if (glVer >= GR_GL_VER(3, 0)) { |
| 455 if (NULL == fFunctions.fGetStringi) { | 459 if (NULL == fFunctions.fGetStringi) { |
| 456 return false; | 460 RETURN_FALSE_INTERFACE |
| 457 } | 461 } |
| 458 } | 462 } |
| 459 | 463 |
| 460 if (kGL_GrGLStandard == fStandard) { | 464 if (kGL_GrGLStandard == fStandard) { |
| 461 if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_obj
ect")) { | 465 if (glVer >= GR_GL_VER(3, 0) || fExtensions.has("GL_ARB_vertex_array_obj
ect")) { |
| 462 if (NULL == fFunctions.fBindVertexArray || | 466 if (NULL == fFunctions.fBindVertexArray || |
| 463 NULL == fFunctions.fDeleteVertexArrays || | 467 NULL == fFunctions.fDeleteVertexArrays || |
| 464 NULL == fFunctions.fGenVertexArrays) { | 468 NULL == fFunctions.fGenVertexArrays) { |
| 465 return false; | 469 RETURN_FALSE_INTERFACE |
| 466 } | 470 } |
| 467 } | 471 } |
| 468 } else { | 472 } else { |
| 469 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_obje
ct")) { | 473 if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_OES_vertex_array_obje
ct")) { |
| 470 if (NULL == fFunctions.fBindVertexArray || | 474 if (NULL == fFunctions.fBindVertexArray || |
| 471 NULL == fFunctions.fDeleteVertexArrays || | 475 NULL == fFunctions.fDeleteVertexArrays || |
| 472 NULL == fFunctions.fGenVertexArrays) { | 476 NULL == fFunctions.fGenVertexArrays) { |
| 473 return false; | 477 RETURN_FALSE_INTERFACE |
| 474 } | 478 } |
| 475 } | 479 } |
| 476 } | 480 } |
| 477 | 481 |
| 478 #if 0 | 482 #if 0 |
| 479 if (fExtensions.has("GL_EXT_debug_marker")) { | 483 if (fExtensions.has("GL_EXT_debug_marker")) { |
| 480 if (NULL == fFunctions.fInsertEventMarker || | 484 if (NULL == fFunctions.fInsertEventMarker || |
| 481 NULL == fFunctions.fPushGroupMarker || | 485 NULL == fFunctions.fPushGroupMarker || |
| 482 NULL == fFunctions.fPopGroupMarker) { | 486 NULL == fFunctions.fPopGroupMarker) { |
| 483 return false; | 487 RETURN_FALSE_INTERFACE |
| 484 } | 488 } |
| 485 } | 489 } |
| 486 #endif | 490 #endif |
| 487 return true; | 491 return true; |
| 488 } | 492 } |
| OLD | NEW |