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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 if (glVer < GR_GL_VER(1,5) || GR_GL_INVALID_VER == glVer) { | 51 if (glVer < GR_GL_VER(1,5) || GR_GL_INVALID_VER == glVer) { |
52 // We must have array and element_array buffer objects. | 52 // We must have array and element_array buffer objects. |
53 return NULL; | 53 return NULL; |
54 } | 54 } |
55 | 55 |
56 GrGLExtensions extensions; | 56 GrGLExtensions extensions; |
57 if (!extensions.init(kGL_GrGLStandard, GetString, GetStringi, GetIntegerv))
{ | 57 if (!extensions.init(kGL_GrGLStandard, GetString, GetStringi, GetIntegerv))
{ |
58 return NULL; | 58 return NULL; |
59 } | 59 } |
60 | 60 |
61 GrGLInterface* interface = SkNEW(GrGLInterface()); | 61 GrGLInterface* interface = new GrGLInterface(); |
62 GrGLInterface::Functions* functions = &interface->fFunctions; | 62 GrGLInterface::Functions* functions = &interface->fFunctions; |
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); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 return NULL; | 480 return NULL; |
481 } | 481 } |
482 | 482 |
483 GET_PROC_LOCAL(GetIntegerv); | 483 GET_PROC_LOCAL(GetIntegerv); |
484 GET_PROC_LOCAL(GetStringi); | 484 GET_PROC_LOCAL(GetStringi); |
485 GrGLExtensions extensions; | 485 GrGLExtensions extensions; |
486 if (!extensions.init(kGLES_GrGLStandard, GetString, GetStringi, GetIntegerv)
) { | 486 if (!extensions.init(kGLES_GrGLStandard, GetString, GetStringi, GetIntegerv)
) { |
487 return NULL; | 487 return NULL; |
488 } | 488 } |
489 | 489 |
490 GrGLInterface* interface = SkNEW(GrGLInterface); | 490 GrGLInterface* interface = new GrGLInterface; |
491 GrGLInterface::Functions* functions = &interface->fFunctions; | 491 GrGLInterface::Functions* functions = &interface->fFunctions; |
492 | 492 |
493 GET_PROC(ActiveTexture); | 493 GET_PROC(ActiveTexture); |
494 GET_PROC(AttachShader); | 494 GET_PROC(AttachShader); |
495 GET_PROC(BindAttribLocation); | 495 GET_PROC(BindAttribLocation); |
496 GET_PROC(BindBuffer); | 496 GET_PROC(BindBuffer); |
497 GET_PROC(BindTexture); | 497 GET_PROC(BindTexture); |
498 GET_PROC_SUFFIX(BindVertexArray, OES); | 498 GET_PROC_SUFFIX(BindVertexArray, OES); |
499 | 499 |
500 if (version >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended"
)) { | 500 if (version >= GR_GL_VER(3,0) && extensions.has("GL_EXT_blend_func_extended"
)) { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 GET_PROC_SUFFIX(PushDebugGroup, KHR); | 751 GET_PROC_SUFFIX(PushDebugGroup, KHR); |
752 GET_PROC_SUFFIX(PopDebugGroup, KHR); | 752 GET_PROC_SUFFIX(PopDebugGroup, KHR); |
753 GET_PROC_SUFFIX(ObjectLabel, KHR); | 753 GET_PROC_SUFFIX(ObjectLabel, KHR); |
754 } | 754 } |
755 | 755 |
756 interface->fStandard = kGLES_GrGLStandard; | 756 interface->fStandard = kGLES_GrGLStandard; |
757 interface->fExtensions.swap(&extensions); | 757 interface->fExtensions.swap(&extensions); |
758 | 758 |
759 return interface; | 759 return interface; |
760 } | 760 } |
OLD | NEW |