From a5cb781c17c09e01655defd0a84b431996b6a015 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Fri, 16 Jun 2017 09:45:32 -0400 Subject: Revert "Revert "Add API for flushing surfaces with gpu semaphores"" This reverts commit 7292231905c34ed290ba479338f26b56ae2a7792. This change relands the original plus the follow on change: https://skia-review.googlesource.com/20059. Additionally it adds a blacklist for the mac intel bots which don't see to respect the added fences on the GPU. Original change's description: > Revert "Add API for flushing surfaces with gpu semaphores" > > This reverts commit 66366c697853e906d961ae691e2bc5209cdcfa62. > > Reason for revert: Failing test on mac bots > > Original change's description: > > Add API for flushing surfaces with gpu semaphores > > > > BUG=skia: > > > > Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1 > > Reviewed-on: https://skia-review.googlesource.com/11488 > > Commit-Queue: Greg Daniel > > Reviewed-by: Brian Salomon > > Reviewed-by: Forrest Reiling > > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com > > Change-Id: I75633a2732d2d48b1926f9ad818a9f1a9196d211 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/20063 > Commit-Queue: Greg Daniel > Reviewed-by: Greg Daniel TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com Change-Id: I4dc6c0e1deb0398eeb165a34f0a26af7a58259f1 Reviewed-on: https://skia-review.googlesource.com/20141 Commit-Queue: Greg Daniel Reviewed-by: Greg Daniel --- include/core/SkSurface.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/core') diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h index efa2428ccb..6fad21721e 100644 --- a/include/core/SkSurface.h +++ b/include/core/SkSurface.h @@ -15,6 +15,7 @@ class SkCanvas; class SkPaint; class GrBackendRenderTarget; +class GrBackendSemaphore; class GrContext; class GrRenderTarget; @@ -323,9 +324,33 @@ public: /** * Issue any pending surface IO to the current backend 3D API and resolve any surface MSAA. + * + * The flush calls below are the new preferred way to flush calls to a surface, and this call + * will eventually be removed. */ void prepareForExternalIO(); + /** + * Issue any pending surface IO to the current backend 3D API + */ + void flush(); + + /** + * Issue any pending surface IO to the current backend 3D API. After issuing all commands, we + * will issue numSemaphore semaphores for the gpu to signal. We will then fill in the array + * signalSemaphores with the info on the semaphores we submitted. The client is reposonsible for + * allocating enough space in signalSemaphores to handle numSemaphores of GrBackendSemaphores. + * The client will also take ownership of the returned underlying backend semaphores. + */ + void flushAndSignalSemaphores(int numSemaphores, GrBackendSemaphore* signalSemaphores); + + /** + * Inserts a list of GPU semaphores that the current backend 3D API must wait on before + * executing any more commands on the GPU for this surface. Skia will take ownership of the + * underlying semaphores and delete them once they have been signaled and waited on. + */ + void wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores); + protected: SkSurface(int width, int height, const SkSurfaceProps*); SkSurface(const SkImageInfo&, const SkSurfaceProps*); -- cgit v1.2.3