diff options
author | Brian Salomon <bsalomon@google.com> | 2017-12-11 10:06:31 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-11 17:54:38 +0000 |
commit | 3d6801eeee6b036de9f8d09e2ae8fa99df5a397c (patch) | |
tree | cbdcd23fe4924fbe25afae209d01bb6527244abf /tools/sk_app | |
parent | d67e5189802e89e74217244b36cc7263883d5dba (diff) |
Add GrGLMakeNativeInterface factory that returns sk_sp<const GrGLInterface>.
Removes the concept of a configurable "default" interface and makes the default
always be the "native" interface.
Also removes unused functions: GrGLInterfaceAddTestDebugMarker and
GrGLInterface::NewClone.
Keeps around legacy GrGLCreateNativeInterface() until clients can be weened.
Change-Id: I4a3bdafa8cf8c68ed13318393abd55686b045ccb
Reviewed-on: https://skia-review.googlesource.com/83000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tools/sk_app')
-rw-r--r-- | tools/sk_app/android/GLWindowContext_android.cpp | 4 | ||||
-rw-r--r-- | tools/sk_app/ios/GLWindowContext_ios.cpp | 2 | ||||
-rw-r--r-- | tools/sk_app/ios/RasterWindowContext_ios.cpp | 2 | ||||
-rw-r--r-- | tools/sk_app/mac/GLWindowContext_mac.cpp | 2 | ||||
-rw-r--r-- | tools/sk_app/mac/RasterWindowContext_mac.cpp | 2 | ||||
-rw-r--r-- | tools/sk_app/unix/GLWindowContext_unix.cpp | 2 | ||||
-rw-r--r-- | tools/sk_app/win/GLWindowContext_win.cpp | 8 |
7 files changed, 11 insertions, 11 deletions
diff --git a/tools/sk_app/android/GLWindowContext_android.cpp b/tools/sk_app/android/GLWindowContext_android.cpp index 944865909b..acdb587230 100644 --- a/tools/sk_app/android/GLWindowContext_android.cpp +++ b/tools/sk_app/android/GLWindowContext_android.cpp @@ -121,7 +121,7 @@ sk_sp<const GrGLInterface> GLWindowContext_android::onInitializeContext() { SkASSERT(EGL_NO_SURFACE != fSurfaceAndroid); SkAssertResult(eglMakeCurrent(fDisplay, fSurfaceAndroid, fSurfaceAndroid, fEGLContext)); - // GLWindowContext::initializeContext will call GrGLCreateNativeInterface so we + // GLWindowContext::initializeContext will call GrGLMakeNativeInterface so we // won't call it here. glClearStencil(0); @@ -132,7 +132,7 @@ sk_sp<const GrGLInterface> GLWindowContext_android::onInitializeContext() { eglGetConfigAttrib(fDisplay, surfaceConfig, EGL_STENCIL_SIZE, &fStencilBits); eglGetConfigAttrib(fDisplay, surfaceConfig, EGL_SAMPLES, &fSampleCount); - return sk_sp<const GrGLInterface>(GrGLCreateNativeInterface()); + return GrGLMakeNativeInterface(); } void GLWindowContext_android::onDestroyContext() { diff --git a/tools/sk_app/ios/GLWindowContext_ios.cpp b/tools/sk_app/ios/GLWindowContext_ios.cpp index 30bacf5cea..f4c0d6b3c0 100644 --- a/tools/sk_app/ios/GLWindowContext_ios.cpp +++ b/tools/sk_app/ios/GLWindowContext_ios.cpp @@ -73,7 +73,7 @@ sk_sp<const GrGLInterface> GLWindowContext_ios::onInitializeContext() { } else { SkDebugf("MakeCurrent failed: %s\n", SDL_GetError()); } - return sk_sp<const GrGLInterface>(GrGLCreateNativeInterface()); + return GrGLMakeNativeInterface(); } void GLWindowContext_ios::onDestroyContext() { diff --git a/tools/sk_app/ios/RasterWindowContext_ios.cpp b/tools/sk_app/ios/RasterWindowContext_ios.cpp index 08b6560510..cae5774c28 100644 --- a/tools/sk_app/ios/RasterWindowContext_ios.cpp +++ b/tools/sk_app/ios/RasterWindowContext_ios.cpp @@ -90,7 +90,7 @@ sk_sp<const GrGLInterface> RasterWindowContext_ios::onInitializeContext() { SkImageInfo info = SkImageInfo::Make(fWidth, fHeight, fDisplayParams.fColorType, kPremul_SkAlphaType, fDisplayParams.fColorSpace); fBackbufferSurface = SkSurface::MakeRaster(info); - return sk_sp<const GrGLInterface>(GrGLCreateNativeInterface()); + return GrGLMakeNativeInterface(); } void RasterWindowContext_ios::onDestroyContext() { diff --git a/tools/sk_app/mac/GLWindowContext_mac.cpp b/tools/sk_app/mac/GLWindowContext_mac.cpp index 7f09d54522..005fc07df4 100644 --- a/tools/sk_app/mac/GLWindowContext_mac.cpp +++ b/tools/sk_app/mac/GLWindowContext_mac.cpp @@ -73,7 +73,7 @@ sk_sp<const GrGLInterface> GLWindowContext_mac::onInitializeContext() { } else { SkDebugf("MakeCurrent failed: %s\n", SDL_GetError()); } - return sk_sp<const GrGLInterface>(GrGLCreateNativeInterface()); + return GrGLMakeNativeInterface(); } void GLWindowContext_mac::onDestroyContext() { diff --git a/tools/sk_app/mac/RasterWindowContext_mac.cpp b/tools/sk_app/mac/RasterWindowContext_mac.cpp index 409c49f218..67022af7fe 100644 --- a/tools/sk_app/mac/RasterWindowContext_mac.cpp +++ b/tools/sk_app/mac/RasterWindowContext_mac.cpp @@ -90,7 +90,7 @@ sk_sp<const GrGLInterface> RasterWindowContext_mac::onInitializeContext() { SkImageInfo info = SkImageInfo::Make(fWidth, fHeight, fDisplayParams.fColorType, kPremul_SkAlphaType, fDisplayParams.fColorSpace); fBackbufferSurface = SkSurface::MakeRaster(info); - return sk_sp<const GrGLInterface>(GrGLCreateNativeInterface()); + return GrGLMakeNativeInterface(); } void RasterWindowContext_mac::onDestroyContext() { diff --git a/tools/sk_app/unix/GLWindowContext_unix.cpp b/tools/sk_app/unix/GLWindowContext_unix.cpp index d7a4387880..25ec95cdd6 100644 --- a/tools/sk_app/unix/GLWindowContext_unix.cpp +++ b/tools/sk_app/unix/GLWindowContext_unix.cpp @@ -107,7 +107,7 @@ sk_sp<const GrGLInterface> GLWindowContext_xlib::onInitializeContext() { &border_width, &depth); glViewport(0, 0, fWidth, fHeight); - return sk_sp<const GrGLInterface>(GrGLCreateNativeInterface()); + return GrGLMakeNativeInterface(); } GLWindowContext_xlib::~GLWindowContext_xlib() { diff --git a/tools/sk_app/win/GLWindowContext_win.cpp b/tools/sk_app/win/GLWindowContext_win.cpp index 17a6b32962..7e43d2b544 100644 --- a/tools/sk_app/win/GLWindowContext_win.cpp +++ b/tools/sk_app/win/GLWindowContext_win.cpp @@ -61,9 +61,9 @@ sk_sp<const GrGLInterface> GLWindowContext_win::onInitializeContext() { // Look to see if RenderDoc is attached. If so, re-create the context with a core profile if (wglMakeCurrent(dc, fHGLRC)) { - const GrGLInterface* glInterface = GrGLCreateNativeInterface(); - bool renderDocAttached = glInterface->hasExtension("GL_EXT_debug_tool"); - SkSafeUnref(glInterface); + auto interface = GrGLMakeNativeInterface(); + bool renderDocAttached = interface->hasExtension("GL_EXT_debug_tool"); + interface.reset(nullptr); if (renderDocAttached) { wglDeleteContext(fHGLRC); fHGLRC = SkCreateWGLContext(dc, fDisplayParams.fMSAASampleCount, false /* deepColor */, @@ -106,7 +106,7 @@ sk_sp<const GrGLInterface> GLWindowContext_win::onInitializeContext() { fHeight = rect.bottom - rect.top; glViewport(0, 0, fWidth, fHeight); } - return sk_sp<const GrGLInterface>(GrGLCreateNativeInterface()); + return GrGLMakeNativeInterface(); } |