diff --git a/include/gpu/gl/GrGLAssembleInterface.h b/include/gpu/gl/GrGLAssembleInterface.h index db44ce738f..42f842e2b8 100644 --- a/include/gpu/gl/GrGLAssembleInterface.h +++ b/include/gpu/gl/GrGLAssembleInterface.h @@ -13,17 +13,20 @@ typedef GrGLFuncPtr (*GrGLGetProc)(void* ctx, const char name[]); * Generic function for creating a GrGLInterface for an either OpenGL or GLES. It calls * get() to get each function address. ctx is a generic ptr passed to and interpreted by get(). */ -SK_API sk_sp GrGLAssembleInterface(void* ctx, GrGLGetProc get); +SK_API sk_sp GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get); /** * Generic function for creating a GrGLInterface for an OpenGL (but not GLES) context. It calls * get() to get each function address. ctx is a generic ptr passed to and interpreted by get(). */ -SK_API sk_sp GrGLAssembleGLInterface(void* ctx, GrGLGetProc get); +SK_API sk_sp GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get); /** * Generic function for creating a GrGLInterface for an OpenGL ES (but not Open GL) context. It * calls get() to get each function address. ctx is a generic ptr passed to and interpreted by * get(). */ -SK_API sk_sp GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get); +SK_API sk_sp GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get); + +/** Deprecated version of GrGLMakeAssembledInterface() that returns a bare pointer. */ +SK_API const GrGLInterface* GrGLAssembleInterface(void *ctx, GrGLGetProc get); diff --git a/src/gpu/gl/GrGLAssembleInterface.cpp b/src/gpu/gl/GrGLAssembleInterface.cpp index c5e99015e0..fcb9debc81 100644 --- a/src/gpu/gl/GrGLAssembleInterface.cpp +++ b/src/gpu/gl/GrGLAssembleInterface.cpp @@ -15,7 +15,7 @@ #define GET_EGL_PROC_SUFFIX(F, S) functions->fEGL ## F = (GrEGL ## F ## Proc) get(ctx, "egl" #F #S) -sk_sp GrGLAssembleInterface(void* ctx, GrGLGetProc get) { +sk_sp GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get) { GET_PROC_LOCAL(GetString); if (nullptr == GetString) { return nullptr; @@ -29,9 +29,9 @@ sk_sp GrGLAssembleInterface(void* ctx, GrGLGetProc get) { GrGLStandard standard = GrGLGetStandardInUseFromString(verStr); if (kGLES_GrGLStandard == standard) { - return GrGLAssembleGLESInterface(ctx, get); + return GrGLMakeAssembledGLESInterface(ctx, get); } else if (kGL_GrGLStandard == standard) { - return GrGLAssembleGLInterface(ctx, get); + return GrGLMakeAssembledGLInterface(ctx, get); } return nullptr; } @@ -51,7 +51,7 @@ static void get_egl_query_and_display(GrEGLQueryStringProc* queryString, GrEGLDi } } -sk_sp GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { +sk_sp GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get) { GET_PROC_LOCAL(GetString); GET_PROC_LOCAL(GetStringi); GET_PROC_LOCAL(GetIntegerv); @@ -546,7 +546,7 @@ sk_sp GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) { return interface; } -sk_sp GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) { +sk_sp GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get) { GET_PROC_LOCAL(GetString); if (nullptr == GetString) { return nullptr; @@ -993,3 +993,7 @@ sk_sp GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) return interface; } + +SK_API const GrGLInterface* GrGLAssembleInterface(void *ctx, GrGLGetProc get) { + return GrGLMakeAssembledInterface(ctx, get).release(); +} diff --git a/src/gpu/gl/android/GrGLMakeNativeInterface_android.cpp b/src/gpu/gl/android/GrGLMakeNativeInterface_android.cpp index 2630e87ba2..d40d7a707a 100644 --- a/src/gpu/gl/android/GrGLMakeNativeInterface_android.cpp +++ b/src/gpu/gl/android/GrGLMakeNativeInterface_android.cpp @@ -233,7 +233,7 @@ static GrGLFuncPtr android_get_gl_proc(void* ctx, const char name[]) { } sk_sp GrGLMakeNativeInterface() { - return GrGLAssembleInterface(nullptr, android_get_gl_proc); + return GrGLMakeAssembledInterface(nullptr, android_get_gl_proc); } const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); } diff --git a/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp b/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp index 3fbe037b1c..e50d9cd80c 100644 --- a/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp +++ b/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp @@ -25,7 +25,7 @@ static GrGLFuncPtr egl_get_gl_proc(void* ctx, const char name[]) { } sk_sp GrGLMakeNativeInterface() { - return GrGLAssembleInterface(nullptr, egl_get_gl_proc); + return GrGLMakeAssembledInterface(nullptr, egl_get_gl_proc); } const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); } diff --git a/src/gpu/gl/glfw/GrGLMakeNativeInterface_glfw.cpp b/src/gpu/gl/glfw/GrGLMakeNativeInterface_glfw.cpp index 3873510499..140a4a325e 100644 --- a/src/gpu/gl/glfw/GrGLMakeNativeInterface_glfw.cpp +++ b/src/gpu/gl/glfw/GrGLMakeNativeInterface_glfw.cpp @@ -23,7 +23,7 @@ sk_sp GrGLMakeNativeInterface() { return nullptr; } - return GrGLAssembleInterface(nullptr, glfw_get); + return GrGLMakeAssembledInterface(nullptr, glfw_get); } const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); } diff --git a/src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp b/src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp index 4bbbe087a2..c57ec2646d 100644 --- a/src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp +++ b/src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp @@ -31,7 +31,7 @@ sk_sp GrGLMakeNativeInterface() { return nullptr; } - return GrGLAssembleInterface(nullptr, glx_get); + return GrGLMakeAssembledInterface(nullptr, glx_get); } const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); } diff --git a/src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp b/src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp index a0a6ac6615..3b7bd7f66f 100644 --- a/src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp +++ b/src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp @@ -51,7 +51,7 @@ static GrGLFuncPtr ios_get_gl_proc(void* ctx, const char name[]) { sk_sp GrGLMakeNativeInterface() { GLProcGetter getter; - return GrGLAssembleGLESInterface(&getter, ios_get_gl_proc); + return GrGLMakeAssembledGLESInterface(&getter, ios_get_gl_proc); } const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); } diff --git a/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp index 7220b136c5..a508780f5f 100644 --- a/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp +++ b/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp @@ -55,7 +55,7 @@ static GrGLFuncPtr mac_get_gl_proc(void* ctx, const char name[]) { sk_sp GrGLMakeNativeInterface() { GLProcGetter getter; - return GrGLAssembleGLInterface(&getter, mac_get_gl_proc); + return GrGLMakeAssembledGLInterface(&getter, mac_get_gl_proc); } const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); } diff --git a/src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp b/src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp index 77db59a754..00c4b7c3a0 100644 --- a/src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp +++ b/src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp @@ -80,9 +80,9 @@ sk_sp GrGLMakeNativeInterface() { GrGLStandard standard = GrGLGetStandardInUseFromString(verStr); if (kGLES_GrGLStandard == standard) { - return GrGLAssembleGLESInterface(&getter, win_get_gl_proc); + return GrGLMakeAssembledGLESInterface(&getter, win_get_gl_proc); } else if (kGL_GrGLStandard == standard) { - return GrGLAssembleGLInterface(&getter, win_get_gl_proc); + return GrGLMakeAssembledGLInterface(&getter, win_get_gl_proc); } return nullptr; } diff --git a/tools/gpu/gl/angle/GLTestContext_angle.cpp b/tools/gpu/gl/angle/GLTestContext_angle.cpp index 7de709feae..50d7129bf3 100644 --- a/tools/gpu/gl/angle/GLTestContext_angle.cpp +++ b/tools/gpu/gl/angle/GLTestContext_angle.cpp @@ -411,7 +411,7 @@ sk_sp CreateANGLEGLInterface() { return nullptr; } - return GrGLAssembleGLESInterface(&gLibs, angle_get_gl_proc); + return GrGLMakeAssembledGLESInterface(&gLibs, angle_get_gl_proc); } std::unique_ptr MakeANGLETestContext(ANGLEBackend type, ANGLEContextVersion version, diff --git a/tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp b/tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp index 1924257be7..743aa4ef3a 100644 --- a/tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp +++ b/tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp @@ -135,7 +135,7 @@ static sk_sp create_command_buffer_interface() { if (!gfFunctionsLoadedSuccessfully) { return nullptr; } - return GrGLAssembleGLESInterface(gLibrary, command_buffer_get_gl_proc); + return GrGLMakeAssembledGLESInterface(gLibrary, command_buffer_get_gl_proc); } diff --git a/tools/sk_app/win/ANGLEWindowContext_win.cpp b/tools/sk_app/win/ANGLEWindowContext_win.cpp index ddea3e3747..649528d6cd 100644 --- a/tools/sk_app/win/ANGLEWindowContext_win.cpp +++ b/tools/sk_app/win/ANGLEWindowContext_win.cpp @@ -116,7 +116,7 @@ sk_sp ANGLEGLWindowContext_win::onInitializeContext() { return nullptr; } - sk_sp interface(GrGLAssembleInterface( + sk_sp interface(GrGLMakeAssembledInterface( nullptr, [](void* ctx, const char name[]) -> GrGLFuncPtr { return eglGetProcAddress(name); })); if (interface) {