aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/image')
-rw-r--r--src/image/SkSurface.cpp6
-rw-r--r--src/image/SkSurface_Base.h8
-rw-r--r--src/image/SkSurface_Gpu.cpp8
-rw-r--r--src/image/SkSurface_Gpu.h4
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(); }