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>
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 0d97779..d0666d5 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -201,32 +201,24 @@
return;
}
- GrBackendObject texHandles[2];
+ GrBackendTexture backendTextures[2];
static const int kW = 100;
static const int kH = 100;
- texHandles[0] = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH, kRGBA_8888_GrPixelConfig);
- texHandles[1] = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH, kRGBA_8888_GrPixelConfig);
+ backendTextures[0] = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH,
+ kRGBA_8888_GrPixelConfig,
+ false, GrMipMapped::kNo);
+ backendTextures[1] = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH,
+ kRGBA_8888_GrPixelConfig,
+ false, GrMipMapped::kNo);
context->resetContext();
- GrBackendTexture backendTex1 = GrTest::CreateBackendTexture(context->contextPriv().getBackend(),
- kW,
- kH,
- kRGBA_8888_GrPixelConfig,
- GrMipMapped::kNo,
- texHandles[0]);
sk_sp<GrTexture> borrowed(context->resourceProvider()->wrapBackendTexture(
- backendTex1, kBorrow_GrWrapOwnership));
+ backendTextures[0], kBorrow_GrWrapOwnership));
- GrBackendTexture backendTex2 = GrTest::CreateBackendTexture(context->contextPriv().getBackend(),
- kW,
- kH,
- kRGBA_8888_GrPixelConfig,
- GrMipMapped::kNo,
- texHandles[1]);
sk_sp<GrTexture> adopted(context->resourceProvider()->wrapBackendTexture(
- backendTex2, kAdopt_GrWrapOwnership));
+ backendTextures[1], kAdopt_GrWrapOwnership));
REPORTER_ASSERT(reporter, borrowed != nullptr && adopted != nullptr);
if (!borrowed || !adopted) {
@@ -238,14 +230,14 @@
context->flush();
- bool borrowedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[0]);
- bool adoptedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[1]);
+ bool borrowedIsAlive = gpu->isTestingOnlyBackendTexture(backendTextures[0]);
+ bool adoptedIsAlive = gpu->isTestingOnlyBackendTexture(backendTextures[1]);
REPORTER_ASSERT(reporter, borrowedIsAlive);
REPORTER_ASSERT(reporter, !adoptedIsAlive);
- gpu->deleteTestingOnlyBackendTexture(texHandles[0], !borrowedIsAlive);
- gpu->deleteTestingOnlyBackendTexture(texHandles[1], !adoptedIsAlive);
+ gpu->deleteTestingOnlyBackendTexture(&(backendTextures[0]), !borrowedIsAlive);
+ gpu->deleteTestingOnlyBackendTexture(&(backendTextures[1]), !adoptedIsAlive);
context->resetContext();
}