| 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 |
| 47 // functions that are always required | 57 // functions that are always required |
| 48 if (NULL == fActiveTexture || | 58 if (NULL == fActiveTexture || |
| 49 NULL == fAttachShader || | 59 NULL == fAttachShader || |
| 50 NULL == fBindAttribLocation || | 60 NULL == fBindAttribLocation || |
| 51 NULL == fBindBuffer || | 61 NULL == fBindBuffer || |
| 52 NULL == fBindTexture || | 62 NULL == fBindTexture || |
| 53 NULL == fBlendFunc || | 63 NULL == fBlendFunc || |
| 54 NULL == fBlendColor || // -> GL >= 1.4, ES >= 2.0 or extension | 64 NULL == fBlendColor || // -> GL >= 1.4, ES >= 2.0 or extension |
| 55 NULL == fBufferData || | 65 NULL == fBufferData || |
| 56 NULL == fBufferSubData || | 66 NULL == fBufferSubData || |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (NULL == fGetQueryObjecti64v || | 201 if (NULL == fGetQueryObjecti64v || |
| 192 NULL == fGetQueryObjectui64v) { | 202 NULL == fGetQueryObjectui64v) { |
| 193 return false; | 203 return false; |
| 194 } | 204 } |
| 195 } | 205 } |
| 196 if (glVer >= GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) { | 206 if (glVer >= GR_GL_VER(3,3) || extensions.has("GL_ARB_timer_query")) { |
| 197 if (NULL == fQueryCounter) { | 207 if (NULL == fQueryCounter) { |
| 198 return false; | 208 return false; |
| 199 } | 209 } |
| 200 } | 210 } |
| 201 // The below two blocks are checks for functions used with | 211 if (!isCoreProfile) { |
| 202 // GL_NV_path_rendering. We're not enforcing that they be non-NULL | 212 if (NULL == fClientActiveTexture || |
| 203 // because they aren't actually called at this time. | 213 NULL == fDisableClientState || |
| 204 if (false && | 214 NULL == fEnableClientState || |
| 205 (NULL == fMatrixMode || | 215 NULL == fLoadIdentity || |
| 206 NULL == fLoadIdentity || | 216 NULL == fLoadMatrixf || |
| 207 NULL == fLoadMatrixf)) { | 217 NULL == fMatrixMode || |
| 208 return false; | 218 NULL == fTexGenf || |
| 219 NULL == fTexGenfv || |
| 220 NULL == fTexGeni || |
| 221 NULL == fVertexPointer) { |
| 222 return false; |
| 223 } |
| 209 } | 224 } |
| 210 if (false && extensions.has("GL_NV_path_rendering")) { | 225 if (false && extensions.has("GL_NV_path_rendering")) { |
| 211 if (NULL == fPathCommands || | 226 if (NULL == fPathCommands || |
| 212 NULL == fPathCoords || | 227 NULL == fPathCoords || |
| 213 NULL == fPathSubCommands || | 228 NULL == fPathSubCommands || |
| 214 NULL == fPathSubCoords || | 229 NULL == fPathSubCoords || |
| 215 NULL == fPathString || | 230 NULL == fPathString || |
| 216 NULL == fPathGlyphs || | 231 NULL == fPathGlyphs || |
| 217 NULL == fPathGlyphRange || | 232 NULL == fPathGlyphRange || |
| 218 NULL == fWeightPaths || | 233 NULL == fWeightPaths || |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 if (NULL == fBindVertexArray || | 397 if (NULL == fBindVertexArray || |
| 383 NULL == fDeleteVertexArrays || | 398 NULL == fDeleteVertexArrays || |
| 384 NULL == fGenVertexArrays) { | 399 NULL == fGenVertexArrays) { |
| 385 return false; | 400 return false; |
| 386 } | 401 } |
| 387 } | 402 } |
| 388 } | 403 } |
| 389 | 404 |
| 390 return true; | 405 return true; |
| 391 } | 406 } |
| OLD | NEW |