diff options
author | Robert Phillips <robertphillips@google.com> | 2017-12-12 13:01:25 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-12 18:45:09 +0000 |
commit | d21b2a5d5c5dca87b7df02713782e722a2c0ae92 (patch) | |
tree | d2f24173bbc6840e56f455d518b69ffc02e3c948 /tests/ResourceAllocatorTest.cpp | |
parent | f3506fa87d0090bd01688e5d26f062fe2bdb801c (diff) |
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 <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
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); } } |