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" |
11 #include "GrGLUtil.h" | 11 #include "GrGLUtil.h" |
12 | 12 |
13 #define GET_PROC(F) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "gl" #F) | 13 #define GET_PROC(F) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "gl" #F) |
14 #define GET_PROC_SUFFIX(F, S) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "
gl" #F #S) | 14 #define GET_PROC_SUFFIX(F, S) functions->f ## F = (GrGL ## F ## Proc) get(ctx, "
gl" #F #S) |
15 #define GET_PROC_LOCAL(F) GrGL ## F ## Proc F = (GrGL ## F ## Proc) get(ctx, "gl
" #F) | 15 #define GET_PROC_LOCAL(F) GrGL ## F ## Proc F = (GrGL ## F ## Proc) get(ctx, "gl
" #F) |
16 | 16 |
17 #define GET_EGL_PROC_SUFFIX(F, S) functions->fEGL ## F = (GrEGL ## F ## Proc) ge
t(ctx, "egl" #F #S) | 17 #define GET_EGL_PROC_SUFFIX(F, S) functions->f ## F = (GrEGL ## F ## Proc) get(c
tx, "egl" #F #S) |
18 | 18 |
19 const GrGLInterface* GrGLAssembleInterface(void* ctx, GrGLGetProc get) { | 19 const GrGLInterface* GrGLAssembleInterface(void* ctx, GrGLGetProc get) { |
20 GET_PROC_LOCAL(GetString); | 20 GET_PROC_LOCAL(GetString); |
21 if (nullptr == GetString) { | 21 if (nullptr == GetString) { |
22 return nullptr; | 22 return nullptr; |
23 } | 23 } |
24 | 24 |
25 const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION))
; | 25 const char* verStr = reinterpret_cast<const char*>(GetString(GR_GL_VERSION))
; |
26 if (nullptr == verStr) { | 26 if (nullptr == verStr) { |
27 return nullptr; | 27 return nullptr; |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 if (extensions.has("EGL_KHR_image") || extensions.has("EGL_KHR_image_base"))
{ | 799 if (extensions.has("EGL_KHR_image") || extensions.has("EGL_KHR_image_base"))
{ |
800 GET_EGL_PROC_SUFFIX(CreateImage, KHR); | 800 GET_EGL_PROC_SUFFIX(CreateImage, KHR); |
801 GET_EGL_PROC_SUFFIX(DestroyImage, KHR); | 801 GET_EGL_PROC_SUFFIX(DestroyImage, KHR); |
802 } | 802 } |
803 | 803 |
804 interface->fStandard = kGLES_GrGLStandard; | 804 interface->fStandard = kGLES_GrGLStandard; |
805 interface->fExtensions.swap(&extensions); | 805 interface->fExtensions.swap(&extensions); |
806 | 806 |
807 return interface; | 807 return interface; |
808 } | 808 } |
OLD | NEW |