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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 if (0 == (binding & fBindingsExported)) { | 38 if (0 == (binding & fBindingsExported)) { |
39 return false; | 39 return false; |
40 } | 40 } |
41 | 41 |
42 GrGLExtensions extensions; | 42 GrGLExtensions extensions; |
43 if (!extensions.init(binding, this)) { | 43 if (!extensions.init(binding, this)) { |
44 return false; | 44 return false; |
45 } | 45 } |
46 | 46 |
47 bool isCoreProfile = false; | |
48 if (kDesktop_GrGLBinding == binding) { | |
49 if (NULL == this->fGetIntegerv) { | |
50 return false; | |
51 } | |
52 GrGLint profileMask = 0; | |
53 fGetIntegerv(GR_GL_CONTEXT_PROFILE_MASK, &profileMask); | |
54 isCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); | |
55 } | |
56 | |
57 // functions that are always required | 47 // functions that are always required |
58 if (NULL == fActiveTexture || | 48 if (NULL == fActiveTexture || |
59 NULL == fAttachShader || | 49 NULL == fAttachShader || |
60 NULL == fBindAttribLocation || | 50 NULL == fBindAttribLocation || |
61 NULL == fBindBuffer || | 51 NULL == fBindBuffer || |
62 NULL == fBindTexture || | 52 NULL == fBindTexture || |
63 NULL == fBlendFunc || | 53 NULL == fBlendFunc || |
64 NULL == fBlendColor || // -> GL >= 1.4, ES >= 2.0 or extension | 54 NULL == fBlendColor || // -> GL >= 1.4, ES >= 2.0 or extension |
65 NULL == fBufferData || | 55 NULL == fBufferData || |
66 NULL == fBufferSubData || | 56 NULL == fBufferSubData || |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 NULL == fGetFramebufferAttachmentParameteriv || | 137 NULL == fGetFramebufferAttachmentParameteriv || |
148 NULL == fGetRenderbufferParameteriv || | 138 NULL == fGetRenderbufferParameteriv || |
149 NULL == fGenFramebuffers || | 139 NULL == fGenFramebuffers || |
150 NULL == fGenRenderbuffers || | 140 NULL == fGenRenderbuffers || |
151 NULL == fRenderbufferStorage) { | 141 NULL == fRenderbufferStorage) { |
152 return false; | 142 return false; |
153 } | 143 } |
154 | 144 |
155 GrGLVersion glVer = GrGLGetVersion(this); | 145 GrGLVersion glVer = GrGLGetVersion(this); |
156 | 146 |
| 147 bool isCoreProfile = false; |
| 148 if (kDesktop_GrGLBinding == binding && glVer >= GR_GL_VER(3,2)) { |
| 149 GrGLint profileMask; |
| 150 GR_GL_GetIntegerv(this, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); |
| 151 isCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_BIT); |
| 152 } |
| 153 |
157 // Now check that baseline ES/Desktop fns not covered above are present | 154 // Now check that baseline ES/Desktop fns not covered above are present |
158 // and that we have fn pointers for any advertised extensions that we will | 155 // and that we have fn pointers for any advertised extensions that we will |
159 // try to use. | 156 // try to use. |
160 | 157 |
161 // these functions are part of ES2, we assume they are available | 158 // these functions are part of ES2, we assume they are available |
162 // On the desktop we assume they are available if the extension | 159 // On the desktop we assume they are available if the extension |
163 // is present or GL version is high enough. | 160 // is present or GL version is high enough. |
164 if (kES_GrGLBinding == binding) { | 161 if (kES_GrGLBinding == binding) { |
165 if (NULL == fStencilFuncSeparate || | 162 if (NULL == fStencilFuncSeparate || |
166 NULL == fStencilMaskSeparate || | 163 NULL == fStencilMaskSeparate || |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 if (NULL == fBindVertexArray || | 395 if (NULL == fBindVertexArray || |
399 NULL == fDeleteVertexArrays || | 396 NULL == fDeleteVertexArrays || |
400 NULL == fGenVertexArrays) { | 397 NULL == fGenVertexArrays) { |
401 return false; | 398 return false; |
402 } | 399 } |
403 } | 400 } |
404 } | 401 } |
405 | 402 |
406 return true; | 403 return true; |
407 } | 404 } |
OLD | NEW |