diff options
author | Greg Daniel <egdaniel@google.com> | 2018-01-22 16:11:35 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-22 21:41:45 +0000 |
commit | 48661b868fbbf7a6193ef49bb6a05a0df61e7c45 (patch) | |
tree | 13582c20667d91e8989f76c224d99f2231714730 /src/gpu/GrGpu.cpp | |
parent | 2e6feed858c2b14b9083cf7d2b040a177dcb62ea (diff) |
Make use of VkSemaphores thread safe assuming use of the same VkQueue.
This allows us to re-enable support for multiple GrContexts in
GrBackendTextureImageGenerator.
Bug: skia:
Change-Id: Ifd6ac1ad81cdfbd1fd986467d8beb359399d6588
Reviewed-on: https://skia-review.googlesource.com/98340
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r-- | src/gpu/GrGpu.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 93f719ab48..eb005d110a 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -517,49 +517,3 @@ void GrGpu::dumpJSON(SkJSONWriter* writer) const { writer->endObject(); } - -void GrGpu::insertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush) { - if (!semaphore) { - return; - } - - SkASSERT(!semaphore->fSignaled); - if (semaphore->fSignaled) { - this->onInsertSemaphore(nullptr, flush); - return; - } - this->onInsertSemaphore(semaphore, flush); - semaphore->fSignaled = true; -} - -void GrGpu::waitSemaphore(sk_sp<GrSemaphore> semaphore) { - if (!semaphore) { - return; - } - - SkASSERT(!semaphore->fWaitedOn); - if (!semaphore->fWaitedOn) { - this->onWaitSemaphore(semaphore); - semaphore->fWaitedOn = true; - } -} - -sk_sp<GrSemaphore> GrGpu::wrapBackendSemaphore(const GrBackendSemaphore& semaphore, - GrResourceProvider::SemaphoreWrapType wrapType, - GrWrapOwnership ownership) { - sk_sp<GrSemaphore> grSema = this->onWrapBackendSemaphore(semaphore, ownership); - if (GrResourceProvider::SemaphoreWrapType::kWillSignal == wrapType) { - // This is a safety check to make sure we never try to wait on this semaphore since we - // assume the client will wait on it themselves if they've asked us to signal it. - grSema->fWaitedOn = true; - } else { - SkASSERT(GrResourceProvider::SemaphoreWrapType::kWillWait == wrapType); - // This is a safety check to make sure we never try to signal this semaphore since we assume - // the client will signal it themselves if they've asked us wait on it. - grSema->fSignaled = true; - } - - SkASSERT(this->caps()->fenceSyncSupport()); - return grSema; -} - |