OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 | 9 |
10 #include "GrGLAssembleInterface.h" | 10 #include "GrGLAssembleInterface.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 GET_PROC(ActiveTexture); | 64 GET_PROC(ActiveTexture); |
65 GET_PROC(AttachShader); | 65 GET_PROC(AttachShader); |
66 GET_PROC(BindAttribLocation); | 66 GET_PROC(BindAttribLocation); |
67 GET_PROC(BindBuffer); | 67 GET_PROC(BindBuffer); |
68 if (glVer >= GR_GL_VER(3,0)) { | 68 if (glVer >= GR_GL_VER(3,0)) { |
69 GET_PROC(BindFragDataLocation); | 69 GET_PROC(BindFragDataLocation); |
70 } | 70 } |
71 GET_PROC(BeginQuery); | 71 GET_PROC(BeginQuery); |
72 GET_PROC(BindTexture); | 72 GET_PROC(BindTexture); |
73 GET_PROC(BlendFunc); | 73 |
| 74 if (extensions.has("GL_KHR_blend_equation_advanced")) { |
| 75 GET_PROC_SUFFIX(BlendBarrier, KHR); |
| 76 } else if (extensions.has("GL_NV_blend_equation_advanced")) { |
| 77 GET_PROC_SUFFIX(BlendBarrier, NV); |
| 78 } |
74 | 79 |
75 if (glVer >= GR_GL_VER(1,4) || | 80 if (glVer >= GR_GL_VER(1,4) || |
76 extensions.has("GL_ARB_imaging") || | 81 extensions.has("GL_ARB_imaging")) { |
77 extensions.has("GL_EXT_blend_color")) { | |
78 GET_PROC(BlendColor); | 82 GET_PROC(BlendColor); |
| 83 } else if (extensions.has("GL_EXT_blend_color")) { |
| 84 GET_PROC_SUFFIX(BlendColor, EXT); |
79 } | 85 } |
80 | 86 |
| 87 if (glVer >= GR_GL_VER(1,4) || |
| 88 extensions.has("GL_ARB_imaging")) { |
| 89 GET_PROC(BlendEquation); |
| 90 } else if (extensions.has("GL_EXT_blend_subtract")) { |
| 91 GET_PROC_SUFFIX(BlendEquation, EXT); |
| 92 } |
| 93 |
| 94 GET_PROC(BlendFunc); |
81 GET_PROC(BufferData); | 95 GET_PROC(BufferData); |
82 GET_PROC(BufferSubData); | 96 GET_PROC(BufferSubData); |
83 GET_PROC(Clear); | 97 GET_PROC(Clear); |
84 GET_PROC(ClearColor); | 98 GET_PROC(ClearColor); |
85 GET_PROC(ClearStencil); | 99 GET_PROC(ClearStencil); |
86 GET_PROC(ColorMask); | 100 GET_PROC(ColorMask); |
87 GET_PROC(CompileShader); | 101 GET_PROC(CompileShader); |
88 GET_PROC(CompressedTexImage2D); | 102 GET_PROC(CompressedTexImage2D); |
89 GET_PROC(CompressedTexSubImage2D); | 103 GET_PROC(CompressedTexSubImage2D); |
90 GET_PROC(CopyTexSubImage2D); | 104 GET_PROC(CopyTexSubImage2D); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 GET_PROC(StencilOpSeparate); | 170 GET_PROC(StencilOpSeparate); |
157 GET_PROC(TexImage2D); | 171 GET_PROC(TexImage2D); |
158 GET_PROC(TexParameteri); | 172 GET_PROC(TexParameteri); |
159 GET_PROC(TexParameteriv); | 173 GET_PROC(TexParameteriv); |
160 if (glVer >= GR_GL_VER(4,2) || extensions.has("GL_ARB_texture_storage")) { | 174 if (glVer >= GR_GL_VER(4,2) || extensions.has("GL_ARB_texture_storage")) { |
161 GET_PROC(TexStorage2D); | 175 GET_PROC(TexStorage2D); |
162 } else if (extensions.has("GL_EXT_texture_storage")) { | 176 } else if (extensions.has("GL_EXT_texture_storage")) { |
163 GET_PROC_SUFFIX(TexStorage2D, EXT); | 177 GET_PROC_SUFFIX(TexStorage2D, EXT); |
164 } | 178 } |
165 GET_PROC(TexSubImage2D); | 179 GET_PROC(TexSubImage2D); |
| 180 if (glVer >= GR_GL_VER(4,5) || extensions.has("GL_ARB_texture_barrier")) { |
| 181 GET_PROC(TextureBarrier); |
| 182 } else if (extensions.has("GL_NV_texture_barrier")) { |
| 183 GET_PROC_SUFFIX(TextureBarrier, NV); |
| 184 } |
166 GET_PROC(Uniform1f); | 185 GET_PROC(Uniform1f); |
167 GET_PROC(Uniform1i); | 186 GET_PROC(Uniform1i); |
168 GET_PROC(Uniform1fv); | 187 GET_PROC(Uniform1fv); |
169 GET_PROC(Uniform1iv); | 188 GET_PROC(Uniform1iv); |
170 GET_PROC(Uniform2f); | 189 GET_PROC(Uniform2f); |
171 GET_PROC(Uniform2i); | 190 GET_PROC(Uniform2i); |
172 GET_PROC(Uniform2fv); | 191 GET_PROC(Uniform2fv); |
173 GET_PROC(Uniform2iv); | 192 GET_PROC(Uniform2iv); |
174 GET_PROC(Uniform3f); | 193 GET_PROC(Uniform3f); |
175 GET_PROC(Uniform3i); | 194 GET_PROC(Uniform3i); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 348 |
330 GrGLInterface* interface = SkNEW(GrGLInterface); | 349 GrGLInterface* interface = SkNEW(GrGLInterface); |
331 GrGLInterface::Functions* functions = &interface->fFunctions; | 350 GrGLInterface::Functions* functions = &interface->fFunctions; |
332 | 351 |
333 GET_PROC(ActiveTexture); | 352 GET_PROC(ActiveTexture); |
334 GET_PROC(AttachShader); | 353 GET_PROC(AttachShader); |
335 GET_PROC(BindAttribLocation); | 354 GET_PROC(BindAttribLocation); |
336 GET_PROC(BindBuffer); | 355 GET_PROC(BindBuffer); |
337 GET_PROC(BindTexture); | 356 GET_PROC(BindTexture); |
338 GET_PROC_SUFFIX(BindVertexArray, OES); | 357 GET_PROC_SUFFIX(BindVertexArray, OES); |
| 358 |
| 359 if (extensions.has("GL_KHR_blend_equation_advanced")) { |
| 360 GET_PROC_SUFFIX(BlendBarrier, KHR); |
| 361 } else if (extensions.has("GL_NV_blend_equation_advanced")) { |
| 362 GET_PROC_SUFFIX(BlendBarrier, NV); |
| 363 } |
| 364 |
339 GET_PROC(BlendColor); | 365 GET_PROC(BlendColor); |
| 366 GET_PROC(BlendEquation); |
340 GET_PROC(BlendFunc); | 367 GET_PROC(BlendFunc); |
341 GET_PROC(BufferData); | 368 GET_PROC(BufferData); |
342 GET_PROC(BufferSubData); | 369 GET_PROC(BufferSubData); |
343 GET_PROC(Clear); | 370 GET_PROC(Clear); |
344 GET_PROC(ClearColor); | 371 GET_PROC(ClearColor); |
345 GET_PROC(ClearStencil); | 372 GET_PROC(ClearStencil); |
346 GET_PROC(ColorMask); | 373 GET_PROC(ColorMask); |
347 GET_PROC(CompileShader); | 374 GET_PROC(CompileShader); |
348 GET_PROC(CompressedTexImage2D); | 375 GET_PROC(CompressedTexImage2D); |
349 GET_PROC(CompressedTexSubImage2D); | 376 GET_PROC(CompressedTexSubImage2D); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 GET_PROC(TexParameteri); | 424 GET_PROC(TexParameteri); |
398 GET_PROC(TexParameteriv); | 425 GET_PROC(TexParameteriv); |
399 GET_PROC(TexSubImage2D); | 426 GET_PROC(TexSubImage2D); |
400 | 427 |
401 if (version >= GR_GL_VER(3,0)) { | 428 if (version >= GR_GL_VER(3,0)) { |
402 GET_PROC(TexStorage2D); | 429 GET_PROC(TexStorage2D); |
403 } else { | 430 } else { |
404 GET_PROC_SUFFIX(TexStorage2D, EXT); | 431 GET_PROC_SUFFIX(TexStorage2D, EXT); |
405 } | 432 } |
406 | 433 |
| 434 if (extensions.has("GL_NV_texture_barrier")) { |
| 435 GET_PROC_SUFFIX(TextureBarrier, NV); |
| 436 } |
| 437 |
407 GET_PROC_SUFFIX(DiscardFramebuffer, EXT); | 438 GET_PROC_SUFFIX(DiscardFramebuffer, EXT); |
408 GET_PROC(Uniform1f); | 439 GET_PROC(Uniform1f); |
409 GET_PROC(Uniform1i); | 440 GET_PROC(Uniform1i); |
410 GET_PROC(Uniform1fv); | 441 GET_PROC(Uniform1fv); |
411 GET_PROC(Uniform1iv); | 442 GET_PROC(Uniform1iv); |
412 GET_PROC(Uniform2f); | 443 GET_PROC(Uniform2f); |
413 GET_PROC(Uniform2i); | 444 GET_PROC(Uniform2i); |
414 GET_PROC(Uniform2fv); | 445 GET_PROC(Uniform2fv); |
415 GET_PROC(Uniform2iv); | 446 GET_PROC(Uniform2iv); |
416 GET_PROC(Uniform3f); | 447 GET_PROC(Uniform3f); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 556 |
526 if (extensions.has("GL_NV_framebuffer_mixed_samples")) { | 557 if (extensions.has("GL_NV_framebuffer_mixed_samples")) { |
527 GET_PROC_SUFFIX(CoverageModulation, NV); | 558 GET_PROC_SUFFIX(CoverageModulation, NV); |
528 } | 559 } |
529 | 560 |
530 interface->fStandard = kGLES_GrGLStandard; | 561 interface->fStandard = kGLES_GrGLStandard; |
531 interface->fExtensions.swap(&extensions); | 562 interface->fExtensions.swap(&extensions); |
532 | 563 |
533 return interface; | 564 return interface; |
534 } | 565 } |
OLD | NEW |