diff options
Diffstat (limited to 'tests/ResourceAllocatorTest.cpp')
-rw-r--r-- | tests/ResourceAllocatorTest.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp index 02785e6aa1..c74a8bd092 100644 --- a/tests/ResourceAllocatorTest.cpp +++ b/tests/ResourceAllocatorTest.cpp @@ -45,23 +45,18 @@ static sk_sp<GrSurfaceProxy> make_deferred(GrResourceProvider* resourceProvider, } static sk_sp<GrSurfaceProxy> make_backend(GrContext* context, const ProxyParams& p, - GrBackendObject* backendTexHandle) { - *backendTexHandle = context->getGpu()->createTestingOnlyBackendTexture( - nullptr, p.fSize, p.fSize, p.fConfig); - GrBackendTexture backendTex = GrTest::CreateBackendTexture(context->contextPriv().getBackend(), - p.fSize, - p.fSize, - p.fConfig, - GrMipMapped::kNo, - *backendTexHandle); - - sk_sp<GrSurface> tex = context->resourceProvider()->wrapBackendTexture(backendTex, + GrBackendTexture* backendTex) { + *backendTex = context->getGpu()->createTestingOnlyBackendTexture(nullptr, p.fSize, p.fSize, + p.fConfig, false, + GrMipMapped::kNo); + + sk_sp<GrSurface> tex = context->resourceProvider()->wrapBackendTexture(*backendTex, kBorrow_GrWrapOwnership); return GrSurfaceProxy::MakeWrapped(std::move(tex), p.fOrigin); } -static void cleanup_backend(GrContext* context, GrBackendObject* backendTexHandle) { - context->getGpu()->deleteTestingOnlyBackendTexture(*backendTexHandle); +static void cleanup_backend(GrContext* context, GrBackendTexture* backendTex) { + context->getGpu()->deleteTestingOnlyBackendTexture(backendTex); } // Basic test that two proxies with overlapping intervals and compatible descriptors are @@ -195,12 +190,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) { { { 64, kNotRT, kRGBA, kE, 0, kTL }, { 64, kNotRT, kRGBA, kE, 0, kTL }, kDontShare } }; - GrBackendObject backEndObj; - sk_sp<GrSurfaceProxy> p1 = make_backend(ctxInfo.grContext(), t[0].fP1, &backEndObj); + GrBackendTexture backEndTex; + sk_sp<GrSurfaceProxy> p1 = make_backend(ctxInfo.grContext(), t[0].fP1, &backEndTex); sk_sp<GrSurfaceProxy> p2 = make_deferred(resourceProvider, t[0].fP2); non_overlap_test(reporter, resourceProvider, std::move(p1), std::move(p2), t[0].fExpectation); - cleanup_backend(ctxInfo.grContext(), &backEndObj); + cleanup_backend(ctxInfo.grContext(), &backEndTex); } } |