diff options
author | Brian Salomon <bsalomon@google.com> | 2018-03-09 09:33:19 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-09 18:20:40 +0000 |
commit | 26102cb6044700fd5c2a059437d75295be3dadaf (patch) | |
tree | 76cd45b1689e0170282f0c3a67332b864ea2f50f /tests | |
parent | 2fa912a7a7c687c4638f6bedaf56c70401150bb9 (diff) |
Make GrGpu::deleteTestingOnlyBackendTexture() take const GrBackendTexture&
Change-Id: Ibd00d0dc6d8c73628f26851e102defdbafab149b
Reviewed-on: https://skia-review.googlesource.com/113164
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DeferredDisplayListTest.cpp | 14 | ||||
-rw-r--r-- | tests/EGLImageTest.cpp | 2 | ||||
-rw-r--r-- | tests/GrMipMappedTest.cpp | 26 | ||||
-rw-r--r-- | tests/GrPorterDuffTest.cpp | 2 | ||||
-rw-r--r-- | tests/GrSurfaceTest.cpp | 2 | ||||
-rw-r--r-- | tests/ImageTest.cpp | 4 | ||||
-rw-r--r-- | tests/LazyProxyTest.cpp | 2 | ||||
-rw-r--r-- | tests/ProxyTest.cpp | 12 | ||||
-rw-r--r-- | tests/ResourceAllocatorTest.cpp | 4 | ||||
-rw-r--r-- | tests/ResourceCacheTest.cpp | 4 | ||||
-rw-r--r-- | tests/SurfaceTest.cpp | 16 | ||||
-rw-r--r-- | tests/VkWrapTests.cpp | 2 | ||||
-rw-r--r-- | tests/WritePixelsTest.cpp | 2 |
13 files changed, 46 insertions, 46 deletions
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); } } |