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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 if (!fExtensions.isInitialized()) { | 107 if (!fExtensions.isInitialized()) { |
108 RETURN_FALSE_INTERFACE | 108 RETURN_FALSE_INTERFACE |
109 } | 109 } |
110 | 110 |
111 // functions that are always required | 111 // functions that are always required |
112 if (NULL == fFunctions.fActiveTexture || | 112 if (NULL == fFunctions.fActiveTexture || |
113 NULL == fFunctions.fAttachShader || | 113 NULL == fFunctions.fAttachShader || |
114 NULL == fFunctions.fBindAttribLocation || | 114 NULL == fFunctions.fBindAttribLocation || |
115 NULL == fFunctions.fBindBuffer || | 115 NULL == fFunctions.fBindBuffer || |
116 NULL == fFunctions.fBindTexture || | 116 NULL == fFunctions.fBindTexture || |
| 117 NULL == fFunctions.fBlendColor || // -> GL >= 1.4 or extension, ES
>= 2.0 |
| 118 NULL == fFunctions.fBlendEquation || // -> GL >= 1.4 or extension, ES
>= 2.0 |
117 NULL == fFunctions.fBlendFunc || | 119 NULL == fFunctions.fBlendFunc || |
118 NULL == fFunctions.fBlendColor || // -> GL >= 1.4, ES >= 2.0 or ext
ension | |
119 NULL == fFunctions.fBufferData || | 120 NULL == fFunctions.fBufferData || |
120 NULL == fFunctions.fBufferSubData || | 121 NULL == fFunctions.fBufferSubData || |
121 NULL == fFunctions.fClear || | 122 NULL == fFunctions.fClear || |
122 NULL == fFunctions.fClearColor || | 123 NULL == fFunctions.fClearColor || |
123 NULL == fFunctions.fClearStencil || | 124 NULL == fFunctions.fClearStencil || |
124 NULL == fFunctions.fColorMask || | 125 NULL == fFunctions.fColorMask || |
125 NULL == fFunctions.fCompileShader || | 126 NULL == fFunctions.fCompileShader || |
126 NULL == fFunctions.fCopyTexSubImage2D || | 127 NULL == fFunctions.fCopyTexSubImage2D || |
127 NULL == fFunctions.fCreateProgram || | 128 NULL == fFunctions.fCreateProgram || |
128 NULL == fFunctions.fCreateShader || | 129 NULL == fFunctions.fCreateShader || |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 if (NULL == fFunctions.fTexStorage2D) { | 300 if (NULL == fFunctions.fTexStorage2D) { |
300 RETURN_FALSE_INTERFACE | 301 RETURN_FALSE_INTERFACE |
301 } | 302 } |
302 } | 303 } |
303 } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storag
e")) { | 304 } else if (glVer >= GR_GL_VER(3,0) || fExtensions.has("GL_EXT_texture_storag
e")) { |
304 if (NULL == fFunctions.fTexStorage2D) { | 305 if (NULL == fFunctions.fTexStorage2D) { |
305 RETURN_FALSE_INTERFACE | 306 RETURN_FALSE_INTERFACE |
306 } | 307 } |
307 } | 308 } |
308 | 309 |
| 310 // glTextureBarrier is part of desktop 4.5. There are also ARB and NV extens
ions. |
| 311 if (kGL_GrGLStandard == fStandard) { |
| 312 if (glVer >= GR_GL_VER(4,5) || |
| 313 fExtensions.has("GL_ARB_texture_barrier") || |
| 314 fExtensions.has("GL_NV_texture_barrier")) { |
| 315 if (NULL == fFunctions.fTextureBarrier) { |
| 316 RETURN_FALSE_INTERFACE |
| 317 } |
| 318 } |
| 319 } else if (fExtensions.has("GL_NV_texture_barrier")) { |
| 320 if (NULL == fFunctions.fTextureBarrier) { |
| 321 RETURN_FALSE_INTERFACE |
| 322 } |
| 323 } |
| 324 |
| 325 if (fExtensions.has("GL_KHR_blend_equation_advanced") || |
| 326 fExtensions.has("GL_NV_blend_equation_advanced")) { |
| 327 if (NULL == fFunctions.fBlendBarrier) { |
| 328 RETURN_FALSE_INTERFACE |
| 329 } |
| 330 } |
| 331 |
309 if (fExtensions.has("GL_EXT_discard_framebuffer")) { | 332 if (fExtensions.has("GL_EXT_discard_framebuffer")) { |
310 // FIXME: Remove this once Chromium is updated to provide this function | 333 // FIXME: Remove this once Chromium is updated to provide this function |
311 #if 0 | 334 #if 0 |
312 if (NULL == fFunctions.fDiscardFramebuffer) { | 335 if (NULL == fFunctions.fDiscardFramebuffer) { |
313 RETURN_FALSE_INTERFACE | 336 RETURN_FALSE_INTERFACE |
314 } | 337 } |
315 #endif | 338 #endif |
316 } | 339 } |
317 | 340 |
318 // FBO MSAA | 341 // FBO MSAA |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 529 } |
507 | 530 |
508 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { | 531 if (fExtensions.has("GL_NV_framebuffer_mixed_samples")) { |
509 if (NULL == fFunctions.fCoverageModulation) { | 532 if (NULL == fFunctions.fCoverageModulation) { |
510 RETURN_FALSE_INTERFACE | 533 RETURN_FALSE_INTERFACE |
511 } | 534 } |
512 } | 535 } |
513 | 536 |
514 return true; | 537 return true; |
515 } | 538 } |
OLD | NEW |