Rename GrGLAssembleFooInterface to GrGLMakeAssembledFooInterface.

Add GrGLAssembleInterface with legacy bare pointer return.

This allows existing clients of GrGLAssembleInterface to roll Skia without
code changes.

Change-Id: I0764a9f4583e554fff5574889adcc6fe004db159
Reviewed-on: https://skia-review.googlesource.com/83564
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2017-12-11 16:36:53 -05:00 committed by Skia Commit-Bot
parent 2f466242c7
commit 94f509b504
12 changed files with 26 additions and 19 deletions

View File

@ -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<const GrGLInterface> GrGLAssembleInterface(void* ctx, GrGLGetProc get);
SK_API sk_sp<const GrGLInterface> 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<const GrGLInterface> GrGLAssembleGLInterface(void* ctx, GrGLGetProc get);
SK_API sk_sp<const GrGLInterface> 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<const GrGLInterface> GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get);
SK_API sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get);
/** Deprecated version of GrGLMakeAssembledInterface() that returns a bare pointer. */
SK_API const GrGLInterface* GrGLAssembleInterface(void *ctx, GrGLGetProc get);

View File

@ -15,7 +15,7 @@
#define GET_EGL_PROC_SUFFIX(F, S) functions->fEGL ## F = (GrEGL ## F ## Proc) get(ctx, "egl" #F #S)
sk_sp<const GrGLInterface> GrGLAssembleInterface(void* ctx, GrGLGetProc get) {
sk_sp<const GrGLInterface> GrGLMakeAssembledInterface(void *ctx, GrGLGetProc get) {
GET_PROC_LOCAL(GetString);
if (nullptr == GetString) {
return nullptr;
@ -29,9 +29,9 @@ sk_sp<const GrGLInterface> 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<const GrGLInterface> GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
sk_sp<const GrGLInterface> GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get) {
GET_PROC_LOCAL(GetString);
GET_PROC_LOCAL(GetStringi);
GET_PROC_LOCAL(GetIntegerv);
@ -546,7 +546,7 @@ sk_sp<const GrGLInterface> GrGLAssembleGLInterface(void* ctx, GrGLGetProc get) {
return interface;
}
sk_sp<const GrGLInterface> GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get) {
sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get) {
GET_PROC_LOCAL(GetString);
if (nullptr == GetString) {
return nullptr;
@ -993,3 +993,7 @@ sk_sp<const GrGLInterface> GrGLAssembleGLESInterface(void* ctx, GrGLGetProc get)
return interface;
}
SK_API const GrGLInterface* GrGLAssembleInterface(void *ctx, GrGLGetProc get) {
return GrGLMakeAssembledInterface(ctx, get).release();
}

View File

@ -233,7 +233,7 @@ static GrGLFuncPtr android_get_gl_proc(void* ctx, const char name[]) {
}
sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {
return GrGLAssembleInterface(nullptr, android_get_gl_proc);
return GrGLMakeAssembledInterface(nullptr, android_get_gl_proc);
}
const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); }

View File

@ -25,7 +25,7 @@ static GrGLFuncPtr egl_get_gl_proc(void* ctx, const char name[]) {
}
sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {
return GrGLAssembleInterface(nullptr, egl_get_gl_proc);
return GrGLMakeAssembledInterface(nullptr, egl_get_gl_proc);
}
const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); }

View File

@ -23,7 +23,7 @@ sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {
return nullptr;
}
return GrGLAssembleInterface(nullptr, glfw_get);
return GrGLMakeAssembledInterface(nullptr, glfw_get);
}
const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); }

View File

@ -31,7 +31,7 @@ sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {
return nullptr;
}
return GrGLAssembleInterface(nullptr, glx_get);
return GrGLMakeAssembledInterface(nullptr, glx_get);
}
const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); }

View File

@ -51,7 +51,7 @@ static GrGLFuncPtr ios_get_gl_proc(void* ctx, const char name[]) {
sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {
GLProcGetter getter;
return GrGLAssembleGLESInterface(&getter, ios_get_gl_proc);
return GrGLMakeAssembledGLESInterface(&getter, ios_get_gl_proc);
}
const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); }

View File

@ -55,7 +55,7 @@ static GrGLFuncPtr mac_get_gl_proc(void* ctx, const char name[]) {
sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {
GLProcGetter getter;
return GrGLAssembleGLInterface(&getter, mac_get_gl_proc);
return GrGLMakeAssembledGLInterface(&getter, mac_get_gl_proc);
}
const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); }

View File

@ -80,9 +80,9 @@ sk_sp<const GrGLInterface> 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;
}

View File

@ -411,7 +411,7 @@ sk_sp<const GrGLInterface> CreateANGLEGLInterface() {
return nullptr;
}
return GrGLAssembleGLESInterface(&gLibs, angle_get_gl_proc);
return GrGLMakeAssembledGLESInterface(&gLibs, angle_get_gl_proc);
}
std::unique_ptr<GLTestContext> MakeANGLETestContext(ANGLEBackend type, ANGLEContextVersion version,

View File

@ -135,7 +135,7 @@ static sk_sp<const GrGLInterface> create_command_buffer_interface() {
if (!gfFunctionsLoadedSuccessfully) {
return nullptr;
}
return GrGLAssembleGLESInterface(gLibrary, command_buffer_get_gl_proc);
return GrGLMakeAssembledGLESInterface(gLibrary, command_buffer_get_gl_proc);
}

View File

@ -116,7 +116,7 @@ sk_sp<const GrGLInterface> ANGLEGLWindowContext_win::onInitializeContext() {
return nullptr;
}
sk_sp<const GrGLInterface> interface(GrGLAssembleInterface(
sk_sp<const GrGLInterface> interface(GrGLMakeAssembledInterface(
nullptr,
[](void* ctx, const char name[]) -> GrGLFuncPtr { return eglGetProcAddress(name); }));
if (interface) {