diff options
author | Brian Osman <brianosman@google.com> | 2017-10-10 14:45:29 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-10 19:05:13 +0000 |
commit | e6984a0fb5557134165403400405bfda7ee03bef (patch) | |
tree | 6cc41ae1be877707bb58ca55938a62345e8a92f6 /tools/gpu | |
parent | 1700bafb8a0793a158f610b21efd4dcb822ddfba (diff) |
Fix bugs with fence sync API on iOS devices
- Actually request extension version of fence sync functions
- Fix incorrect usage of dlopen/dlsym
- Also fixed same bugs in Mac code, although we never hit that
code path.
Should fix iOS devices, giving more accurate (and less spammy)
results from nanobench.
Bug: skia:
Change-Id: I3456b301ef9b0b6559160d1d21c77bd93139d39a
Reviewed-on: https://skia-review.googlesource.com/57740
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tools/gpu')
-rw-r--r-- | tools/gpu/gl/GLTestContext.cpp | 6 | ||||
-rw-r--r-- | tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm | 5 | ||||
-rw-r--r-- | tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp | 5 |
3 files changed, 9 insertions, 7 deletions
diff --git a/tools/gpu/gl/GLTestContext.cpp b/tools/gpu/gl/GLTestContext.cpp index 91fa82ff9a..4375346892 100644 --- a/tools/gpu/gl/GLTestContext.cpp +++ b/tools/gpu/gl/GLTestContext.cpp @@ -67,9 +67,9 @@ std::unique_ptr<GLFenceSync> GLFenceSync::MakeIfSupported(const sk_gpu_test::GLT } GLFenceSync::GLFenceSync(const sk_gpu_test::GLTestContext* ctx, const char* ext) { - ctx->getGLProcAddress(&fGLFenceSync, "glFenceSync"); - ctx->getGLProcAddress(&fGLClientWaitSync, "glClientWaitSync"); - ctx->getGLProcAddress(&fGLDeleteSync, "glDeleteSync"); + ctx->getGLProcAddress(&fGLFenceSync, "glFenceSync", ext); + ctx->getGLProcAddress(&fGLClientWaitSync, "glClientWaitSync", ext); + ctx->getGLProcAddress(&fGLDeleteSync, "glDeleteSync", ext); } sk_gpu_test::PlatformFence GLFenceSync::insertFence() const { diff --git a/tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm b/tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm index 1fd50d1e1a..e897e8c7c4 100644 --- a/tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm +++ b/tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm @@ -74,7 +74,7 @@ void IOSGLTestContext::destroyGLContext() { } fEAGLContext = nil; } - if (RTLD_DEFAULT != fGLLibrary) { + if (nullptr != fGLLibrary) { dlclose(fGLLibrary); } } @@ -89,7 +89,8 @@ void IOSGLTestContext::onPlatformMakeCurrent() const { void IOSGLTestContext::onPlatformSwapBuffers() const { } GrGLFuncPtr IOSGLTestContext::onPlatformGetProcAddress(const char* procName) const { - return reinterpret_cast<GrGLFuncPtr>(dlsym(fGLLibrary, procName)); + void* handle = (nullptr == fGLLibrary) ? RTLD_DEFAULT : fGLLibrary; + return reinterpret_cast<GrGLFuncPtr>(dlsym(handle, procName)); } } // anonymous namespace diff --git a/tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp b/tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp index 8ce687d00d..a94f503d48 100644 --- a/tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp +++ b/tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp @@ -89,7 +89,7 @@ void MacGLTestContext::destroyGLContext() { CGLReleaseContext(fContext); fContext = nullptr; } - if (RTLD_DEFAULT != fGLLibrary) { + if (nullptr != fGLLibrary) { dlclose(fGLLibrary); } } @@ -103,7 +103,8 @@ void MacGLTestContext::onPlatformSwapBuffers() const { } GrGLFuncPtr MacGLTestContext::onPlatformGetProcAddress(const char* procName) const { - return reinterpret_cast<GrGLFuncPtr>(dlsym(fGLLibrary, procName)); + void* handle = (nullptr == fGLLibrary) ? RTLD_DEFAULT : fGLLibrary; + return reinterpret_cast<GrGLFuncPtr>(dlsym(handle, procName)); } } // anonymous namespace |