From d21b2a5d5c5dca87b7df02713782e722a2c0ae92 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 12 Dec 2017 13:01:25 -0500 Subject: Remove GrBackendObject from tests (except image_from_yuv_textures) This sets the stage for landing https://skia-review.googlesource.com/c/skia/+/82823 (Update SkImage::MakeFromYUVTexturesCopy to GrBackendTexture) Change-Id: I2c62f23dc447b9ad55c0b5f06bcd6d7ca0ec4d2b Reviewed-on: https://skia-review.googlesource.com/83920 Reviewed-by: Greg Daniel Commit-Queue: Robert Phillips --- tests/ResourceAllocatorTest.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'tests/ResourceAllocatorTest.cpp') 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 make_deferred(GrResourceProvider* resourceProvider, } static sk_sp 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 tex = context->resourceProvider()->wrapBackendTexture(backendTex, + GrBackendTexture* backendTex) { + *backendTex = context->getGpu()->createTestingOnlyBackendTexture(nullptr, p.fSize, p.fSize, + p.fConfig, false, + GrMipMapped::kNo); + + sk_sp 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 p1 = make_backend(ctxInfo.grContext(), t[0].fP1, &backEndObj); + GrBackendTexture backEndTex; + sk_sp p1 = make_backend(ctxInfo.grContext(), t[0].fP1, &backEndTex); sk_sp 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); } } -- cgit v1.2.3