Make GrSemaphore no longer derive from GrGPUResource.
Instead most things are now passed around as unique_ptrs
Bug: skia:9603
Change-Id: I2b2f5c68ba1964953dd1457b65433e6098597605
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255086
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 2ecc33c..3068b9b 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -529,13 +529,15 @@
return fGpu->wrapBackendTextureAsRenderTarget(tex, sampleCnt, colorType);
}
-sk_sp<GrSemaphore> SK_WARN_UNUSED_RESULT GrResourceProvider::makeSemaphore(bool isOwned) {
- return fGpu->makeSemaphore(isOwned);
+std::unique_ptr<GrSemaphore> SK_WARN_UNUSED_RESULT GrResourceProvider::makeSemaphore(
+ bool isOwned) {
+ return this->isAbandoned() ? nullptr : fGpu->makeSemaphore(isOwned);
}
-sk_sp<GrSemaphore> GrResourceProvider::wrapBackendSemaphore(const GrBackendSemaphore& semaphore,
- SemaphoreWrapType wrapType,
- GrWrapOwnership ownership) {
+std::unique_ptr<GrSemaphore> GrResourceProvider::wrapBackendSemaphore(
+ const GrBackendSemaphore& semaphore,
+ SemaphoreWrapType wrapType,
+ GrWrapOwnership ownership) {
ASSERT_SINGLE_OWNER
return this->isAbandoned() ? nullptr : fGpu->wrapBackendSemaphore(semaphore,
wrapType,