diff options
author | 2018-01-22 16:11:35 -0500 | |
---|---|---|
committer | 2018-01-22 21:41:45 +0000 | |
commit | 48661b868fbbf7a6193ef49bb6a05a0df61e7c45 (patch) | |
tree | 13582c20667d91e8989f76c224d99f2231714730 /src/gpu/GrBackendTextureImageGenerator.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/GrBackendTextureImageGenerator.cpp')
-rw-r--r-- | src/gpu/GrBackendTextureImageGenerator.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp index 9b55704dce..b07115ef2d 100644 --- a/src/gpu/GrBackendTextureImageGenerator.cpp +++ b/src/gpu/GrBackendTextureImageGenerator.cpp @@ -80,6 +80,7 @@ void GrBackendTextureImageGenerator::ReleaseRefHelper_TextureReleaseProc(void* c SkASSERT(refHelper); refHelper->fBorrowedTexture = nullptr; + refHelper->fBorrowingContextID = SK_InvalidGenID; refHelper->unref(); } @@ -125,11 +126,12 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture( if (!resourceProvider) { // If we get here then we never created a texture to pass the refHelper ref off // to. Thus we must unref it ourselves. + refHelper->fBorrowingContextID = SK_InvalidGenID; refHelper->unref(); return sk_sp<GrTexture>(); } - if (semaphore && !semaphore->hasSubmittedWait()) { + if (semaphore) { resourceProvider->priv().gpu()->waitSemaphore(semaphore); } @@ -155,6 +157,7 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture( tex = resourceProvider->wrapBackendTexture(backendTexture, kBorrow_GrWrapOwnership); if (!tex) { + refHelper->fBorrowingContextID = SK_InvalidGenID; refHelper->unref(); return sk_sp<GrTexture>(); } |