diff options
author | Greg Daniel <egdaniel@google.com> | 2017-06-15 16:59:49 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-19 15:01:28 +0000 |
commit | c64ee46a982695dc32b9cad4dd4e635ac09cd25e (patch) | |
tree | 2784515cd988e4b985767d01b6762bef6389d292 /src/image | |
parent | d4a70ee36717493cc071f878b16b037463e6ce9a (diff) |
Add return to surface semaphore calls to indicate when we don't support them
Bug: skia:
Change-Id: I00118637bf6555278ca61707275ed60372de581d
Reviewed-on: https://skia-review.googlesource.com/20061
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/SkSurface.cpp | 6 | ||||
-rw-r--r-- | src/image/SkSurface_Base.h | 8 | ||||
-rw-r--r-- | src/image/SkSurface_Gpu.cpp | 8 | ||||
-rw-r--r-- | src/image/SkSurface_Gpu.h | 4 |
4 files changed, 15 insertions, 11 deletions
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp index fbd9f836d6..57d419c408 100644 --- a/src/image/SkSurface.cpp +++ b/src/image/SkSurface.cpp @@ -191,12 +191,12 @@ void SkSurface::flush() { asSB(this)->onFlush(0, nullptr); } -void SkSurface::flushAndSignalSemaphores(int numSemaphores, GrBackendSemaphore* signalSemaphores) { +bool SkSurface::flushAndSignalSemaphores(int numSemaphores, GrBackendSemaphore* signalSemaphores) { return asSB(this)->onFlush(numSemaphores, signalSemaphores); } -void SkSurface::wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) { - asSB(this)->onWait(numSemaphores, waitSemaphores); +bool SkSurface::wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) { + return asSB(this)->onWait(numSemaphores, waitSemaphores); } ////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h index 264a86fc9d..93528b8d5d 100644 --- a/src/image/SkSurface_Base.h +++ b/src/image/SkSurface_Base.h @@ -80,14 +80,18 @@ public: * Inserts the requested number of semaphores for the gpu to signal when work is complete on the * gpu and inits the array of GrBackendSemaphores with the signaled semaphores. */ - virtual void onFlush(int numSemaphores, GrBackendSemaphore* signalSemaphores) {} + virtual bool onFlush(int numSemaphores, GrBackendSemaphore* signalSemaphores) { + return false; + } /** * Caused the current backend 3D API to wait on the passed in semaphores before executing new * commands on the gpu. Any previously submitting commands will not be blocked by these * semaphores. */ - virtual void onWait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) {} + virtual bool onWait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) { + return false; + } inline SkCanvas* getCachedCanvas(); inline sk_sp<SkImage> refCachedImage(); diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp index 0f4b2cb84e..13c89d4ad6 100644 --- a/src/image/SkSurface_Gpu.cpp +++ b/src/image/SkSurface_Gpu.cpp @@ -166,12 +166,12 @@ void SkSurface_Gpu::onDiscard() { fDevice->accessRenderTargetContext()->discard(); } -void SkSurface_Gpu::onFlush(int numSemaphores, GrBackendSemaphore* signalSemaphores) { - fDevice->flushAndSignalSemaphores(numSemaphores, signalSemaphores); +bool SkSurface_Gpu::onFlush(int numSemaphores, GrBackendSemaphore* signalSemaphores) { + return fDevice->flushAndSignalSemaphores(numSemaphores, signalSemaphores); } -void SkSurface_Gpu::onWait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) { - fDevice->wait(numSemaphores, waitSemaphores); +bool SkSurface_Gpu::onWait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) { + return fDevice->wait(numSemaphores, waitSemaphores); } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/image/SkSurface_Gpu.h b/src/image/SkSurface_Gpu.h index e22ae10bd8..2bc9210b34 100644 --- a/src/image/SkSurface_Gpu.h +++ b/src/image/SkSurface_Gpu.h @@ -26,8 +26,8 @@ public: sk_sp<SkImage> onNewImageSnapshot() override; void onCopyOnWrite(ContentChangeMode) override; void onDiscard() override; - void onFlush(int numSemaphores, GrBackendSemaphore* signalSemaphores) override; - void onWait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) override; + bool onFlush(int numSemaphores, GrBackendSemaphore* signalSemaphores) override; + bool onWait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) override; SkGpuDevice* getDevice() { return fDevice.get(); } |