aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-07-21 14:27:57 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-22 01:03:06 +0000
commitcd1416efbc7af6f115dbaa09dce48e075d1d96ca (patch)
tree3f4ddbc475a167107929da6f670b7832b97f2c93 /include/core
parent97d4cf0e7eb15340b1f513ff8cfba4e55ee3acf2 (diff)
Add support for semaphores to be inserted on GrContext flush
This also moves the logic of inserting semaphores down into GrDrawingManager and finishFlush on GrGpu. With it being on finishFlush, there should be no issues when the DrawingManager starts respecting the proxy passed in assuming it always calls finishFlush at the end (which it should). Bug: skia: Change-Id: I925c2a289dcbbb9159b9120878af1d34f21a2dc7 Reviewed-on: https://skia-review.googlesource.com/25641 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkSurface.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h
index 4a8d81205f..d977391442 100644
--- a/include/core/SkSurface.h
+++ b/include/core/SkSurface.h
@@ -18,6 +18,7 @@ class GrBackendRenderTarget;
class GrBackendSemaphore;
class GrContext;
class GrRenderTarget;
+enum class GrSemaphoresSubmitted;
/**
* SkSurface is responsible for managing the pixels that a canvas draws into. The pixels can be
@@ -329,16 +330,21 @@ public:
* If it is not initialized, a new semaphore is created and the GrBackendSemaphore object
* is initialized with that semaphore.
*
+ * The client will own and be responsible for deleting the underlying semaphores that are stored
+ * and returned in initialized GrBackendSemaphore objects. The GrBackendSemaphore objects
+ * themselves can be deleted as soon as this function returns.
+ *
* If the backend API is OpenGL only uninitialized GrBackendSemaphores are supported.
* If the backend API is Vulkan either initialized or unitialized semaphores are supported.
* If unitialized, the semaphores which are created will be valid for use only with the VkDevice
* with which they were created.
*
- * If this call returns false, the GPU backend will not have created or added any semaphores to
- * signal. Thus the array of semaphores will remain uninitialized. However, any pending surface
- * IO will still be flush.
+ * If this call returns GrSemaphoresSubmited::kNo, the GPU backend will not have created or
+ * added any semaphores to signal on the GPU. Thus the client should not have the GPU wait on
+ * any of the semaphores. However, any pending surface IO will still be flushed.
*/
- bool flushAndSignalSemaphores(int numSemaphores, GrBackendSemaphore* signalSemaphores);
+ GrSemaphoresSubmitted flushAndSignalSemaphores(int numSemaphores,
+ GrBackendSemaphore signalSemaphores[]);
/**
* Inserts a list of GPU semaphores that the current backend 3D API must wait on before