diff options
author | Brian Salomon <bsalomon@google.com> | 2017-12-11 16:36:53 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-11 22:03:38 +0000 |
commit | 94f509b5042c29540d0b4ef255798b8daed5ace6 (patch) | |
tree | 4e02079f0227014e01ed538ac41c777d9db43e55 | |
parent | 2f466242c7289b246d7ef665aa50006cfd11aa36 (diff) |
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>
-rw-r--r-- | include/gpu/gl/GrGLAssembleInterface.h | 9 | ||||
-rw-r--r-- | src/gpu/gl/GrGLAssembleInterface.cpp | 14 | ||||
-rw-r--r-- | src/gpu/gl/android/GrGLMakeNativeInterface_android.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/glfw/GrGLMakeNativeInterface_glfw.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp | 4 | ||||
-rw-r--r-- | tools/gpu/gl/angle/GLTestContext_angle.cpp | 2 | ||||
-rw-r--r-- | tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp | 2 | ||||
-rw-r--r-- | tools/sk_app/win/ANGLEWindowContext_win.cpp | 2 |
12 files changed, 26 insertions, 19 deletions
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<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); 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<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(); +} 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<const GrGLInterface> 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<const GrGLInterface> 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<const GrGLInterface> 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<const GrGLInterface> 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<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(); } 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<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(); } 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<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; } 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<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, 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<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); } 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<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) { |