Remove SkCrossContextImageData and all support code
Bug: skia:
Change-Id: I8eb8cef5456c05a8e314d8404698893c7af82d13
Reviewed-on: https://skia-review.googlesource.com/16368
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 3a11bb9..45946cf 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -212,13 +212,12 @@
return;
}
- GrBackendObject texHandles[3];
+ GrBackendObject texHandles[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);
- texHandles[2] = gpu->createTestingOnlyBackendTexture(nullptr, kW, kH, kRGBA_8888_GrPixelConfig);
context->resetContext();
@@ -240,46 +239,26 @@
backendTex2, kTopLeft_GrSurfaceOrigin, kNone_GrBackendTextureFlag, 0,
kAdopt_GrWrapOwnership));
- GrBackendTexture backendTex3 = GrTest::CreateBackendTexture(context->contextPriv().getBackend(),
- kW,
- kH,
- kRGBA_8888_GrPixelConfig,
- texHandles[2]);
- sk_sp<GrTexture> adoptedAndCached(context->resourceProvider()->wrapBackendTexture(
- backendTex3, kTopLeft_GrSurfaceOrigin, kNone_GrBackendTextureFlag, 0,
- kAdoptAndCache_GrWrapOwnership));
-
- REPORTER_ASSERT(reporter, borrowed != nullptr && adopted != nullptr &&
- adoptedAndCached != nullptr);
- if (!borrowed || !adopted || !adoptedAndCached) {
+ REPORTER_ASSERT(reporter, borrowed != nullptr && adopted != nullptr);
+ if (!borrowed || !adopted) {
return;
}
borrowed.reset(nullptr);
adopted.reset(nullptr);
- adoptedAndCached.reset(nullptr);
context->flush();
bool borrowedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[0]);
bool adoptedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[1]);
- bool adoptedAndCachedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[2]);
REPORTER_ASSERT(reporter, borrowedIsAlive);
REPORTER_ASSERT(reporter, !adoptedIsAlive);
- REPORTER_ASSERT(reporter, adoptedAndCachedIsAlive); // Still alive because it's in the cache
gpu->deleteTestingOnlyBackendTexture(texHandles[0], !borrowedIsAlive);
gpu->deleteTestingOnlyBackendTexture(texHandles[1], !adoptedIsAlive);
- // We can't delete texHandles[2] - we've given control of the lifetime to the context/cache
context->resetContext();
-
- // Purge the cache. This should force texHandles[2] to be deleted
- context->getResourceCache()->purgeAllUnlocked();
- adoptedAndCachedIsAlive = gpu->isTestingOnlyBackendTexture(texHandles[2]);
- REPORTER_ASSERT(reporter, !adoptedAndCachedIsAlive);
- gpu->deleteTestingOnlyBackendTexture(texHandles[2], !adoptedAndCachedIsAlive);
}
class TestResource : public GrGpuResource {