diff options
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index e842ddc4f5..a2eabe4e46 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -4476,3 +4476,11 @@ void GrGLGpu::waitSemaphore(sk_sp<GrSemaphore> semaphore) { void GrGLGpu::deleteSync(GrGLsync sync) const { GL_CALL(DeleteSync(sync)); } + +sk_sp<GrSemaphore> GrGLGpu::prepareTextureForCrossContextUsage(GrTexture* texture) { + // Set up a semaphore to be signaled once the data is ready, and flush GL + sk_sp<GrSemaphore> semaphore = this->makeSemaphore(); + this->insertSemaphore(semaphore, true); + + return semaphore; +} diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index 04929f89fa..041ecfb5ce 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -149,6 +149,8 @@ public: void insertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush) override; void waitSemaphore(sk_sp<GrSemaphore> semaphore) override; + sk_sp<GrSemaphore> prepareTextureForCrossContextUsage(GrTexture*) override; + void deleteSync(GrGLsync) const; private: |