aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dm/DMSrcSink.cpp2
-rw-r--r--gm/imagefromyuvtextures.cpp2
-rw-r--r--src/gpu/GrGpu.h2
-rw-r--r--src/gpu/gl/GrGLGpu.cpp6
-rw-r--r--src/gpu/gl/GrGLGpu.h2
-rw-r--r--src/gpu/mock/GrMockGpu.cpp6
-rw-r--r--src/gpu/mock/GrMockGpu.h2
-rw-r--r--src/gpu/mtl/GrMtlGpu.h2
-rw-r--r--src/gpu/vk/GrVkGpu.cpp6
-rw-r--r--src/gpu/vk/GrVkGpu.h2
-rw-r--r--tests/DeferredDisplayListTest.cpp14
-rw-r--r--tests/EGLImageTest.cpp2
-rw-r--r--tests/GrMipMappedTest.cpp26
-rw-r--r--tests/GrPorterDuffTest.cpp2
-rw-r--r--tests/GrSurfaceTest.cpp2
-rw-r--r--tests/ImageTest.cpp4
-rw-r--r--tests/LazyProxyTest.cpp2
-rw-r--r--tests/ProxyTest.cpp12
-rw-r--r--tests/ResourceAllocatorTest.cpp4
-rw-r--r--tests/ResourceCacheTest.cpp4
-rw-r--r--tests/SurfaceTest.cpp16
-rw-r--r--tests/VkWrapTests.cpp2
-rw-r--r--tests/WritePixelsTest.cpp2
-rw-r--r--tools/gpu/ProxyUtils.cpp2
24 files changed, 63 insertions, 63 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 0fedd8e7ec..9f7814f21f 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1713,7 +1713,7 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log,
if (!context->contextPriv().abandoned()) {
surface.reset();
if (backendTexture.isValid()) {
- context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(&backendTexture);
+ context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(backendTexture);
}
if (backendRT.isValid()) {
context->contextPriv().getGpu()->deleteTestingOnlyBackendRenderTarget(backendRT);
diff --git a/gm/imagefromyuvtextures.cpp b/gm/imagefromyuvtextures.cpp
index a14674db5a..526350c734 100644
--- a/gm/imagefromyuvtextures.cpp
+++ b/gm/imagefromyuvtextures.cpp
@@ -120,7 +120,7 @@ protected:
for (int i = 0; i < 3; ++i) {
if (yuvTextures[i].isValid()) {
- gpu->deleteTestingOnlyBackendTexture(&yuvTextures[i]);
+ gpu->deleteTestingOnlyBackendTexture(yuvTextures[i]);
}
}
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index d63a38b758..40d766431a 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -466,7 +466,7 @@ public:
* 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;
+ virtual void deleteTestingOnlyBackendTexture(const GrBackendTexture&) = 0;
virtual GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
GrSRGBEncoded) = 0;
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 7499e761c9..7e69fbe341 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -4427,10 +4427,10 @@ bool GrGLGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
return (GR_GL_TRUE == result);
}
-void GrGLGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) {
- SkASSERT(kOpenGL_GrBackend == tex->backend());
+void GrGLGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
+ SkASSERT(kOpenGL_GrBackend == tex.backend());
- if (const auto* info = tex->getGLTextureInfo()) {
+ 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 fa3d9e09c7..79d74d2c09 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -150,7 +150,7 @@ public:
bool isRenderTarget,
GrMipMapped mipMapped) override;
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
- void deleteTestingOnlyBackendTexture(GrBackendTexture*) override;
+ void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
GrSRGBEncoded) override;
diff --git a/src/gpu/mock/GrMockGpu.cpp b/src/gpu/mock/GrMockGpu.cpp
index 50b19f15e9..ad9dc882ce 100644
--- a/src/gpu/mock/GrMockGpu.cpp
+++ b/src/gpu/mock/GrMockGpu.cpp
@@ -129,10 +129,10 @@ bool GrMockGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
return fOutstandingTestingOnlyTextureIDs.contains(info->fID);
}
-void GrMockGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) {
- SkASSERT(kMock_GrBackend == tex->backend());
+void GrMockGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
+ SkASSERT(kMock_GrBackend == tex.backend());
- const GrMockTextureInfo* info = tex->getMockTextureInfo();
+ const GrMockTextureInfo* info = tex.getMockTextureInfo();
if (info) {
fOutstandingTestingOnlyTextureIDs.remove(info->fID);
}
diff --git a/src/gpu/mock/GrMockGpu.h b/src/gpu/mock/GrMockGpu.h
index b58b9ff6d7..8bc72510ee 100644
--- a/src/gpu/mock/GrMockGpu.h
+++ b/src/gpu/mock/GrMockGpu.h
@@ -123,7 +123,7 @@ private:
GrBackendTexture createTestingOnlyBackendTexture(void* pixels, int w, int h, GrPixelConfig,
bool isRT, GrMipMapped) override;
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
- void deleteTestingOnlyBackendTexture(GrBackendTexture*) override;
+ void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
GrSRGBEncoded) override;
diff --git a/src/gpu/mtl/GrMtlGpu.h b/src/gpu/mtl/GrMtlGpu.h
index 38b4e6303c..1babc8218e 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*) override {}
+ void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override {}
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
GrSRGBEncoded) override {
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index 1acbf02627..73787bf29b 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1502,10 +1502,10 @@ bool GrVkGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
return false;
}
-void GrVkGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) {
- SkASSERT(kVulkan_GrBackend == tex->fBackend);
+void GrVkGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
+ SkASSERT(kVulkan_GrBackend == tex.fBackend);
- if (const auto* info = tex->getVkImageInfo()) {
+ 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 81517af86e..b5ddcb894a 100644
--- a/src/gpu/vk/GrVkGpu.h
+++ b/src/gpu/vk/GrVkGpu.h
@@ -75,7 +75,7 @@ public:
bool isRenderTarget,
GrMipMapped) override;
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
- void deleteTestingOnlyBackendTexture(GrBackendTexture*) override;
+ void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
GrSRGBEncoded) override;
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index 6700ba5570..896a64a5a9 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -178,14 +178,14 @@ public:
context, *backend, fOrigin, fSampleCount, fColorType, nullptr, nullptr);
if (!surface) {
- gpu->deleteTestingOnlyBackendTexture(backend);
+ gpu->deleteTestingOnlyBackendTexture(*backend);
return nullptr;
}
return surface;
}
- void cleanUpBackEnd(GrContext* context, GrBackendTexture* backend) const {
+ void cleanUpBackEnd(GrContext* context, const GrBackendTexture& backend) const {
GrGpu* gpu = context->contextPriv().getGpu();
gpu->deleteTestingOnlyBackendTexture(backend);
@@ -301,7 +301,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(DDLSurfaceCharacterizationTest, reporter, ctxInfo)
REPORTER_ASSERT(reporter, !s->draw(ddl.get()));
s = nullptr;
- params.cleanUpBackEnd(context, &backend);
+ params.cleanUpBackEnd(context, backend);
}
}
@@ -368,7 +368,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLWrapBackendTest, reporter, ctxInfo) {
sk_sp<SkSurface> s = params.make(context);
if (!s) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -379,13 +379,13 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLWrapBackendTest, reporter, ctxInfo) {
SkCanvas* canvas = recorder->getCanvas();
if (!canvas) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
GrContext* deferredContext = canvas->getGrContext();
if (!deferredContext) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -401,7 +401,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLWrapBackendTest, reporter, ctxInfo) {
TextureReleaseChecker::Release, &releaseChecker);
REPORTER_ASSERT(reporter, !image);
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp
index b0631d0b3c..e65954a0c8 100644
--- a/tests/EGLImageTest.cpp
+++ b/tests/EGLImageTest.cpp
@@ -29,7 +29,7 @@ static void cleanup(GLTestContext* glctx0, GrGLuint texID0, GLTestContext* glctx
if (grctx1) {
if (backendTex1 && backendTex1->isValid()) {
GrGLGpu* gpu1 = static_cast<GrGLGpu*>(grctx1->contextPriv().getGpu());
- gpu1->deleteTestingOnlyBackendTexture(backendTex1);
+ gpu1->deleteTestingOnlyBackendTexture(*backendTex1);
}
}
if (GR_EGL_NO_IMAGE != image1) {
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index 484b7bfd4f..d71dda8dc0 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -71,7 +71,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
}
REPORTER_ASSERT(reporter, proxy);
if (!proxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -80,7 +80,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
GrTexture* texture = proxy->priv().peekTexture();
REPORTER_ASSERT(reporter, texture);
if (!texture) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -94,7 +94,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
} else {
REPORTER_ASSERT(reporter, GrMipMapped::kNo == texture->texturePriv().mipMapped());
}
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
@@ -122,7 +122,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
GrTextureProxy* proxy = as_IB(image)->peekProxy();
REPORTER_ASSERT(reporter, proxy);
if (!proxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -131,7 +131,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
sk_sp<GrTexture> texture = sk_ref_sp(proxy->priv().peekTexture());
REPORTER_ASSERT(reporter, texture);
if (!texture) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -139,7 +139,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
texture, kTopLeft_GrSurfaceOrigin, nullptr, kPremul_SkAlphaType, nullptr);
REPORTER_ASSERT(reporter, imageGen);
if (!imageGen) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -155,7 +155,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
REPORTER_ASSERT(reporter, genProxy);
if (!genProxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -167,14 +167,14 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
REPORTER_ASSERT(reporter, genProxy->priv().isInstantiated());
if (!genProxy->priv().isInstantiated()) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
GrTexture* genTexture = genProxy->priv().peekTexture();
REPORTER_ASSERT(reporter, genTexture);
if (!genTexture) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
return;
}
@@ -207,7 +207,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
context->flush();
gpu->testingOnly_flushGpuAndSync();
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
@@ -246,7 +246,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
}
REPORTER_ASSERT(reporter, surface);
if (!surface) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
SkGpuDevice* device = ((SkSurface_Gpu*)surface.get())->getDevice();
GrTextureProxy* texProxy = device->accessRenderTargetContext()->asTextureProxy();
@@ -259,7 +259,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
sk_sp<SkImage> image = surface->makeImageSnapshot();
REPORTER_ASSERT(reporter, image);
if (!image) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
texProxy = as_IB(image)->peekProxy();
REPORTER_ASSERT(reporter, mipMapped == texProxy->mipMapped());
@@ -271,7 +271,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
// Must flush the context to make sure all the cmds (copies, etc.) from above are sent
// to the gpu before we delete the backendHandle.
context->flush();
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp
index f0c157f149..8a94084c0e 100644
--- a/tests/GrPorterDuffTest.cpp
+++ b/tests/GrPorterDuffTest.cpp
@@ -1102,7 +1102,7 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, options) {
}
}
}
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
#endif
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index 18c0275cba..a7c688d361 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -65,7 +65,7 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget()) ==
static_cast<GrSurface*>(texRT2->asTexture()));
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
// This test checks that the isConfigTexturable and isConfigRenderable are
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 49ab65b6a7..b2a65b653b 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -505,7 +505,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsImage, reporter
img.reset();
ctxInfo.grContext()->flush();
if (backendTex.isValid()) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
@@ -838,7 +838,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkImage_NewFromTextureRelease, reporter, c
refImg.reset(nullptr); // force a release of the image
REPORTER_ASSERT(reporter, 1 == releaseChecker.fReleaseCount);
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
static void test_cross_context_image(skiatest::Reporter* reporter, const GrContextOptions& options,
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index b7c4a9c43c..e21031a50f 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -458,7 +458,7 @@ DEF_GPUTEST(LazyProxyUninstantiateTest, reporter, /* options */) {
REPORTER_ASSERT(reporter, 1 == releaseTestValue);
}
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 8f5eb13639..911c430dc1 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -243,7 +243,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapBackendTextureAsRenderTarget(
backendTex, origin, supportedNumSamples);
if (!sProxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
continue; // This can fail on Mesa
}
@@ -255,7 +255,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
supportedNumSamples, SkBackingFit::kExact,
caps.maxWindowRectangles());
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
// Tests wrapBackendTexture that is only renderable
@@ -268,7 +268,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapRenderableBackendTexture(
backendTex, origin, supportedNumSamples);
if (!sProxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
continue; // This can fail on Mesa
}
@@ -280,7 +280,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
supportedNumSamples, SkBackingFit::kExact,
caps.maxWindowRectangles());
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
// Tests wrapBackendTexture that is only textureable
@@ -294,7 +294,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapBackendTexture(
backendTex, origin, kBorrow_GrWrapOwnership, nullptr, nullptr);
if (!sProxy) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
continue;
}
@@ -304,7 +304,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
check_texture(reporter, resourceProvider, sProxy->asTextureProxy(),
SkBackingFit::kExact);
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp
index 7718146ce4..a0d67bb2e3 100644
--- a/tests/ResourceAllocatorTest.cpp
+++ b/tests/ResourceAllocatorTest.cpp
@@ -55,7 +55,7 @@ static sk_sp<GrSurfaceProxy> make_backend(GrContext* context, const ProxyParams&
return proxyProvider->wrapBackendTexture(*backendTex, p.fOrigin);
}
-static void cleanup_backend(GrContext* context, GrBackendTexture* backendTex) {
+static void cleanup_backend(GrContext* context, const GrBackendTexture& backendTex) {
context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(backendTex);
}
@@ -210,7 +210,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) {
sk_sp<GrSurfaceProxy> p2 = make_deferred(proxyProvider, t[0].fP2);
non_overlap_test(reporter, resourceProvider,
std::move(p1), std::move(p2), t[0].fExpectation);
- cleanup_backend(ctxInfo.grContext(), &backEndTex);
+ cleanup_backend(ctxInfo.grContext(), backEndTex);
}
resourceProvider->testingOnly_setExplicitlyAllocateGPUResources(orig);
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index a88c06270d..1844f18364 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -246,10 +246,10 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceCacheWrappedResources, reporter, ctxI
REPORTER_ASSERT(reporter, !adoptedIsAlive);
if (borrowedIsAlive) {
- gpu->deleteTestingOnlyBackendTexture(&(backendTextures[0]));
+ gpu->deleteTestingOnlyBackendTexture(backendTextures[0]);
}
if (adoptedIsAlive) {
- gpu->deleteTestingOnlyBackendTexture(&(backendTextures[1]));
+ gpu->deleteTestingOnlyBackendTexture(backendTextures[1]);
}
context->resetContext();
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 35b72a972e..bd3090cc8e 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -125,7 +125,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsSurface, report
surf.reset();
ctxInfo.grContext()->flush();
if (backendTex.isValid()) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
static constexpr int kSampleCnt = 2;
@@ -174,7 +174,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsSurface, report
surf.reset();
ctxInfo.grContext()->flush();
if (backendTex.isValid()) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
@@ -719,7 +719,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture(
kRGBA_8888_SkColorType,
nullptr, nullptr);
if (!surface) {
- gpu->deleteTestingOnlyBackendTexture(outTexture);
+ gpu->deleteTestingOnlyBackendTexture(*outTexture);
return nullptr;
}
return surface;
@@ -746,7 +746,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target(
nullptr, nullptr);
if (!surface) {
- gpu->deleteTestingOnlyBackendTexture(outTexture);
+ gpu->deleteTestingOnlyBackendTexture(*outTexture);
return nullptr;
}
return surface;
@@ -824,7 +824,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceClear_Gpu, reporter, ctxInfo) {
auto surface = surfaceFunc(context, 1, kOrigColor, &backendTex);
test_surface_clear(reporter, surface, grSurfaceGetter, kOrigColor);
surface.reset();
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
@@ -888,7 +888,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacePartialDraw_Gpu, reporter, ctxInfo) {
if (surface) {
test_surface_draw_partially(reporter, surface, kOrigColor);
surface.reset();
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
@@ -922,7 +922,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceAttachStencil_Gpu, reporter, ctxInf
GrRenderTarget* rt = surface->getCanvas()
->internal_private_accessTopLayerRenderTargetContext()->accessRenderTarget();
REPORTER_ASSERT(reporter, resourceProvider->attachStencilAttachment(rt));
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
}
@@ -1040,7 +1040,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter,
GrGpu* gpu = context->contextPriv().getGpu();
for (auto backendTex : backendTextures) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
#endif
diff --git a/tests/VkWrapTests.cpp b/tests/VkWrapTests.cpp
index 2f52972903..367fdb5c53 100644
--- a/tests/VkWrapTests.cpp
+++ b/tests/VkWrapTests.cpp
@@ -107,7 +107,7 @@ void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) {
// When we wrapBackendRenderTarget it is always borrowed, so we must make sure to free the
// resource when we're done.
- gpu->deleteTestingOnlyBackendTexture(&origBackendTex);
+ gpu->deleteTestingOnlyBackendTexture(origBackendTex);
}
void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) {
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index adab3a0c2f..f00d092d03 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -431,7 +431,7 @@ static void test_write_pixels_non_texture(skiatest::Reporter* reporter, GrContex
if (surface) {
test_write_pixels(reporter, surface.get());
}
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
+ gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
diff --git a/tools/gpu/ProxyUtils.cpp b/tools/gpu/ProxyUtils.cpp
index 0102eda9e7..bba17de939 100644
--- a/tools/gpu/ProxyUtils.cpp
+++ b/tools/gpu/ProxyUtils.cpp
@@ -37,7 +37,7 @@ sk_sp<GrTextureProxy> MakeTextureProxyFromData(GrContext* context, bool isRT, in
}
if (!proxy) {
- context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
+ context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(backendTex);
return nullptr;
}