diff options
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 18 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.h | 10 |
2 files changed, 13 insertions, 15 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 267b405b67..212826d0dd 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -4579,29 +4579,27 @@ sk_sp<GrSemaphore> SK_WARN_UNUSED_RESULT GrGLGpu::makeSemaphore(bool isOwned) { return GrGLSemaphore::Make(this, isOwned); } -sk_sp<GrSemaphore> GrGLGpu::onWrapBackendSemaphore(const GrBackendSemaphore& semaphore, - GrWrapOwnership ownership) { +sk_sp<GrSemaphore> GrGLGpu::wrapBackendSemaphore(const GrBackendSemaphore& semaphore, + GrResourceProvider::SemaphoreWrapType wrapType, + GrWrapOwnership ownership) { SkASSERT(this->caps()->fenceSyncSupport()); return GrGLSemaphore::MakeWrapped(this, semaphore.glSync(), ownership); } -void GrGLGpu::onInsertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush) { +void GrGLGpu::insertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush) { GrGLSemaphore* glSem = static_cast<GrGLSemaphore*>(semaphore.get()); - if (glSem) { - GrGLsync sync; - GL_CALL_RET(sync, FenceSync(GR_GL_SYNC_GPU_COMMANDS_COMPLETE, 0)); - glSem->setSync(sync); - } + GrGLsync sync; + GL_CALL_RET(sync, FenceSync(GR_GL_SYNC_GPU_COMMANDS_COMPLETE, 0)); + glSem->setSync(sync); if (flush) { GL_CALL(Flush()); } } -void GrGLGpu::onWaitSemaphore(sk_sp<GrSemaphore> semaphore) { +void GrGLGpu::waitSemaphore(sk_sp<GrSemaphore> semaphore) { GrGLSemaphore* glSem = static_cast<GrGLSemaphore*>(semaphore.get()); - SkASSERT(glSem); GL_CALL(WaitSync(glSem->sync(), 0, GR_GL_TIMEOUT_IGNORED)); } diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index 2087356f04..9ac86ba123 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -173,6 +173,11 @@ public: void deleteFence(GrFence) const override; sk_sp<GrSemaphore> SK_WARN_UNUSED_RESULT makeSemaphore(bool isOwned) override; + sk_sp<GrSemaphore> wrapBackendSemaphore(const GrBackendSemaphore& semaphore, + GrResourceProvider::SemaphoreWrapType wrapType, + GrWrapOwnership ownership) override; + void insertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush) override; + void waitSemaphore(sk_sp<GrSemaphore> semaphore) override; sk_sp<GrSemaphore> prepareTextureForCrossContextUsage(GrTexture*) override; @@ -286,11 +291,6 @@ private: void onFinishFlush(bool insertedSemaphores) override; - void onInsertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush) override; - void onWaitSemaphore(sk_sp<GrSemaphore> semaphore) override; - sk_sp<GrSemaphore> onWrapBackendSemaphore(const GrBackendSemaphore& semaphore, - GrWrapOwnership ownership) override; - bool hasExtension(const char* ext) const { return fGLContext->hasExtension(ext); } bool copySurfaceAsDraw(GrSurface* dst, GrSurfaceOrigin dstOrigin, |