diff options
author | Brian Salomon <bsalomon@google.com> | 2018-03-07 11:47:54 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-07 17:56:30 +0000 |
commit | e64b064f87018cc84ad843b3cad3185f87917fe8 (patch) | |
tree | cef7f85bd7b639fdc0c26831c24a6f1d96637559 /src | |
parent | 1b9b7d539335030e3d269a57d418a4fa6d62c038 (diff) |
Remove abandon param from GrGpu::deleteTestingOnlyBackendTexture.
Prior to the existence of GrBackendTexture this was required to delete a backend-specific blob. Now it's a no-op.
Change-Id: Iba0e4233e4d07235626f0ae14b0f7e77c073d8c0
Reviewed-on: https://skia-review.googlesource.com/112569
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrGpu.h | 10 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 9 | ||||
-rw-r--r-- | src/gpu/gl/GrGLGpu.h | 2 | ||||
-rw-r--r-- | src/gpu/mock/GrMockGpu.cpp | 2 | ||||
-rw-r--r-- | src/gpu/mock/GrMockGpu.h | 2 | ||||
-rw-r--r-- | src/gpu/mtl/GrMtlGpu.h | 2 | ||||
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 6 | ||||
-rw-r--r-- | src/gpu/vk/GrVkGpu.h | 2 |
8 files changed, 15 insertions, 20 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index dc518cd72d..e7e4ac087f 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -464,11 +464,11 @@ public: GrMipMapped mipMapped) = 0; /** Check a handle represents an actual texture in the backend API that has not been freed. */ virtual bool isTestingOnlyBackendTexture(const GrBackendTexture&) const = 0; - /** If ownership of the backend texture has been transferred pass true for abandonTexture. This - will do any necessary cleanup of the handle without freeing the texture in the backend - API. */ - virtual void deleteTestingOnlyBackendTexture(GrBackendTexture*, - bool abandonTexture = false) = 0; + /** + * Frees a texture created by createTestingOnlyBackendTexture(). If ownership of the backend + * texture has been transferred to a GrContext using adopt semantics this should not be called. + */ + virtual void deleteTestingOnlyBackendTexture(GrBackendTexture*) = 0; // width and height may be larger than rt (if underlying API allows it). // Returns nullptr if compatible sb could not be created, otherwise the caller owns the ref on diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 97aa4ac03a..ea7be0ef93 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -4428,14 +4428,11 @@ bool GrGLGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const { return (GR_GL_TRUE == result); } -void GrGLGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex, bool abandonTexture) { +void GrGLGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) { SkASSERT(kOpenGL_GrBackend == tex->backend()); - const GrGLTextureInfo* info = tex->getGLTextureInfo(); - if (info && !abandonTexture) { - GrGLuint texID = info->fID; - - GL_CALL(DeleteTextures(1, &texID)); + if (const auto* info = tex->getGLTextureInfo()) { + GL_CALL(DeleteTextures(1, &info->fID)); } } diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h index a62c7153fe..6b193993bc 100644 --- a/src/gpu/gl/GrGLGpu.h +++ b/src/gpu/gl/GrGLGpu.h @@ -154,7 +154,7 @@ public: bool isRenderTarget, GrMipMapped mipMapped) override; bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; - void deleteTestingOnlyBackendTexture(GrBackendTexture*, bool abandonTexture = false) override; + void deleteTestingOnlyBackendTexture(GrBackendTexture*) override; void resetShaderCacheForTesting() const override; diff --git a/src/gpu/mock/GrMockGpu.cpp b/src/gpu/mock/GrMockGpu.cpp index 3a6b661ece..05371b42e6 100644 --- a/src/gpu/mock/GrMockGpu.cpp +++ b/src/gpu/mock/GrMockGpu.cpp @@ -113,7 +113,7 @@ bool GrMockGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const { return fOutstandingTestingOnlyTextureIDs.contains(info->fID); } -void GrMockGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex, bool abandonTexture) { +void GrMockGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) { SkASSERT(kMock_GrBackend == tex->backend()); const GrMockTextureInfo* info = tex->getMockTextureInfo(); diff --git a/src/gpu/mock/GrMockGpu.h b/src/gpu/mock/GrMockGpu.h index b5398e54b3..14cbd7979f 100644 --- a/src/gpu/mock/GrMockGpu.h +++ b/src/gpu/mock/GrMockGpu.h @@ -124,7 +124,7 @@ private: GrBackendTexture createTestingOnlyBackendTexture(void* pixels, int w, int h, GrPixelConfig, bool isRT, GrMipMapped) override; bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; - void deleteTestingOnlyBackendTexture(GrBackendTexture*, bool abandonTexture = false) override; + void deleteTestingOnlyBackendTexture(GrBackendTexture*) override; static int NextInternalTextureID(); static int NextExternalTextureID(); diff --git a/src/gpu/mtl/GrMtlGpu.h b/src/gpu/mtl/GrMtlGpu.h index a48618b868..fd190e28fa 100644 --- a/src/gpu/mtl/GrMtlGpu.h +++ b/src/gpu/mtl/GrMtlGpu.h @@ -144,7 +144,7 @@ private: return GrBackendTexture(); } bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override { return false; } - void deleteTestingOnlyBackendTexture(GrBackendTexture*, bool abandon = false) override {} + void deleteTestingOnlyBackendTexture(GrBackendTexture*) override {} sk_sp<GrMtlCaps> fMtlCaps; diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index a53432c25f..3a81eed350 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -1536,12 +1536,10 @@ bool GrVkGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const { return false; } -void GrVkGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex, bool abandon) { +void GrVkGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) { SkASSERT(kVulkan_GrBackend == tex->fBackend); - const GrVkImageInfo* info = tex->getVkImageInfo(); - - if (info && !abandon) { + if (const auto* info = tex->getVkImageInfo()) { // something in the command buffer may still be using this, so force submit this->submitCommandBuffer(kForce_SyncQueue); GrVkImage::DestroyImageInfo(this, const_cast<GrVkImageInfo*>(info)); diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index 36555272a0..7616fccefe 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -74,7 +74,7 @@ public: bool isRenderTarget, GrMipMapped) override; bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; - void deleteTestingOnlyBackendTexture(GrBackendTexture*, bool abandonTexture = false) override; + void deleteTestingOnlyBackendTexture(GrBackendTexture*) override; GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTarget*, int width, |