Make GrGpu::deleteTestingOnlyBackendTexture() take const GrBackendTexture&
Change-Id: Ibd00d0dc6d8c73628f26851e102defdbafab149b Reviewed-on: https://skia-review.googlesource.com/113164 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
2fa912a7a7
commit
26102cb604
@ -1713,7 +1713,7 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log,
|
||||
if (!context->contextPriv().abandoned()) {
|
||||
surface.reset();
|
||||
if (backendTexture.isValid()) {
|
||||
context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(&backendTexture);
|
||||
context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(backendTexture);
|
||||
}
|
||||
if (backendRT.isValid()) {
|
||||
context->contextPriv().getGpu()->deleteTestingOnlyBackendRenderTarget(backendRT);
|
||||
|
@ -120,7 +120,7 @@ protected:
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
if (yuvTextures[i].isValid()) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&yuvTextures[i]);
|
||||
gpu->deleteTestingOnlyBackendTexture(yuvTextures[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -466,7 +466,7 @@ public:
|
||||
* Frees a texture created by createTestingOnlyBackendTexture(). If ownership of the backend
|
||||
* texture has been transferred to a GrContext using adopt semantics this should not be called.
|
||||
*/
|
||||
virtual void deleteTestingOnlyBackendTexture(GrBackendTexture*) = 0;
|
||||
virtual void deleteTestingOnlyBackendTexture(const GrBackendTexture&) = 0;
|
||||
|
||||
virtual GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) = 0;
|
||||
|
@ -4427,10 +4427,10 @@ bool GrGLGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
|
||||
return (GR_GL_TRUE == result);
|
||||
}
|
||||
|
||||
void GrGLGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) {
|
||||
SkASSERT(kOpenGL_GrBackend == tex->backend());
|
||||
void GrGLGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
|
||||
SkASSERT(kOpenGL_GrBackend == tex.backend());
|
||||
|
||||
if (const auto* info = tex->getGLTextureInfo()) {
|
||||
if (const auto* info = tex.getGLTextureInfo()) {
|
||||
GL_CALL(DeleteTextures(1, &info->fID));
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ public:
|
||||
bool isRenderTarget,
|
||||
GrMipMapped mipMapped) override;
|
||||
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
|
||||
void deleteTestingOnlyBackendTexture(GrBackendTexture*) override;
|
||||
void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
|
||||
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) override;
|
||||
|
@ -129,10 +129,10 @@ bool GrMockGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
|
||||
return fOutstandingTestingOnlyTextureIDs.contains(info->fID);
|
||||
}
|
||||
|
||||
void GrMockGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) {
|
||||
SkASSERT(kMock_GrBackend == tex->backend());
|
||||
void GrMockGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
|
||||
SkASSERT(kMock_GrBackend == tex.backend());
|
||||
|
||||
const GrMockTextureInfo* info = tex->getMockTextureInfo();
|
||||
const GrMockTextureInfo* info = tex.getMockTextureInfo();
|
||||
if (info) {
|
||||
fOutstandingTestingOnlyTextureIDs.remove(info->fID);
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ private:
|
||||
GrBackendTexture createTestingOnlyBackendTexture(void* pixels, int w, int h, GrPixelConfig,
|
||||
bool isRT, GrMipMapped) override;
|
||||
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
|
||||
void deleteTestingOnlyBackendTexture(GrBackendTexture*) override;
|
||||
void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
|
||||
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) override;
|
||||
|
@ -144,7 +144,7 @@ private:
|
||||
return GrBackendTexture();
|
||||
}
|
||||
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override { return false; }
|
||||
void deleteTestingOnlyBackendTexture(GrBackendTexture*) override {}
|
||||
void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override {}
|
||||
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) override {
|
||||
|
@ -1502,10 +1502,10 @@ bool GrVkGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void GrVkGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) {
|
||||
SkASSERT(kVulkan_GrBackend == tex->fBackend);
|
||||
void GrVkGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
|
||||
SkASSERT(kVulkan_GrBackend == tex.fBackend);
|
||||
|
||||
if (const auto* info = tex->getVkImageInfo()) {
|
||||
if (const auto* info = tex.getVkImageInfo()) {
|
||||
// something in the command buffer may still be using this, so force submit
|
||||
this->submitCommandBuffer(kForce_SyncQueue);
|
||||
GrVkImage::DestroyImageInfo(this, const_cast<GrVkImageInfo*>(info));
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
bool isRenderTarget,
|
||||
GrMipMapped) override;
|
||||
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
|
||||
void deleteTestingOnlyBackendTexture(GrBackendTexture*) override;
|
||||
void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
|
||||
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) override;
|
||||
|
@ -178,14 +178,14 @@ public:
|
||||
context, *backend, fOrigin, fSampleCount, fColorType, nullptr, nullptr);
|
||||
|
||||
if (!surface) {
|
||||
gpu->deleteTestingOnlyBackendTexture(backend);
|
||||
gpu->deleteTestingOnlyBackendTexture(*backend);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
void cleanUpBackEnd(GrContext* context, GrBackendTexture* backend) const {
|
||||
void cleanUpBackEnd(GrContext* context, const GrBackendTexture& backend) const {
|
||||
GrGpu* gpu = context->contextPriv().getGpu();
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(backend);
|
||||
@ -301,7 +301,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(DDLSurfaceCharacterizationTest, reporter, ctxInfo)
|
||||
REPORTER_ASSERT(reporter, !s->draw(ddl.get()));
|
||||
|
||||
s = nullptr;
|
||||
params.cleanUpBackEnd(context, &backend);
|
||||
params.cleanUpBackEnd(context, backend);
|
||||
}
|
||||
}
|
||||
|
||||
@ -368,7 +368,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLWrapBackendTest, reporter, ctxInfo) {
|
||||
|
||||
sk_sp<SkSurface> s = params.make(context);
|
||||
if (!s) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -379,13 +379,13 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLWrapBackendTest, reporter, ctxInfo) {
|
||||
|
||||
SkCanvas* canvas = recorder->getCanvas();
|
||||
if (!canvas) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
GrContext* deferredContext = canvas->getGrContext();
|
||||
if (!deferredContext) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -401,7 +401,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DDLWrapBackendTest, reporter, ctxInfo) {
|
||||
TextureReleaseChecker::Release, &releaseChecker);
|
||||
REPORTER_ASSERT(reporter, !image);
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ static void cleanup(GLTestContext* glctx0, GrGLuint texID0, GLTestContext* glctx
|
||||
if (grctx1) {
|
||||
if (backendTex1 && backendTex1->isValid()) {
|
||||
GrGLGpu* gpu1 = static_cast<GrGLGpu*>(grctx1->contextPriv().getGpu());
|
||||
gpu1->deleteTestingOnlyBackendTexture(backendTex1);
|
||||
gpu1->deleteTestingOnlyBackendTexture(*backendTex1);
|
||||
}
|
||||
}
|
||||
if (GR_EGL_NO_IMAGE != image1) {
|
||||
|
@ -71,7 +71,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
|
||||
}
|
||||
REPORTER_ASSERT(reporter, proxy);
|
||||
if (!proxy) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
|
||||
GrTexture* texture = proxy->priv().peekTexture();
|
||||
REPORTER_ASSERT(reporter, texture);
|
||||
if (!texture) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrWrappedMipMappedTest, reporter, ctxInfo) {
|
||||
} else {
|
||||
REPORTER_ASSERT(reporter, GrMipMapped::kNo == texture->texturePriv().mipMapped());
|
||||
}
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -122,7 +122,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
|
||||
GrTextureProxy* proxy = as_IB(image)->peekProxy();
|
||||
REPORTER_ASSERT(reporter, proxy);
|
||||
if (!proxy) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
|
||||
sk_sp<GrTexture> texture = sk_ref_sp(proxy->priv().peekTexture());
|
||||
REPORTER_ASSERT(reporter, texture);
|
||||
if (!texture) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
|
||||
texture, kTopLeft_GrSurfaceOrigin, nullptr, kPremul_SkAlphaType, nullptr);
|
||||
REPORTER_ASSERT(reporter, imageGen);
|
||||
if (!imageGen) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
|
||||
|
||||
REPORTER_ASSERT(reporter, genProxy);
|
||||
if (!genProxy) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -167,14 +167,14 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
|
||||
|
||||
REPORTER_ASSERT(reporter, genProxy->priv().isInstantiated());
|
||||
if (!genProxy->priv().isInstantiated()) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
GrTexture* genTexture = genProxy->priv().peekTexture();
|
||||
REPORTER_ASSERT(reporter, genTexture);
|
||||
if (!genTexture) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrBackendTextureImageMipMappedTest, reporter,
|
||||
context->flush();
|
||||
gpu->testingOnly_flushGpuAndSync();
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -246,7 +246,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
|
||||
}
|
||||
REPORTER_ASSERT(reporter, surface);
|
||||
if (!surface) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
SkGpuDevice* device = ((SkSurface_Gpu*)surface.get())->getDevice();
|
||||
GrTextureProxy* texProxy = device->accessRenderTargetContext()->asTextureProxy();
|
||||
@ -259,7 +259,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
|
||||
sk_sp<SkImage> image = surface->makeImageSnapshot();
|
||||
REPORTER_ASSERT(reporter, image);
|
||||
if (!image) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
texProxy = as_IB(image)->peekProxy();
|
||||
REPORTER_ASSERT(reporter, mipMapped == texProxy->mipMapped());
|
||||
@ -271,7 +271,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn
|
||||
// Must flush the context to make sure all the cmds (copies, etc.) from above are sent
|
||||
// to the gpu before we delete the backendHandle.
|
||||
context->flush();
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1102,7 +1102,7 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, options) {
|
||||
}
|
||||
}
|
||||
}
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -65,7 +65,7 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) {
|
||||
REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget()) ==
|
||||
static_cast<GrSurface*>(texRT2->asTexture()));
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
|
||||
// This test checks that the isConfigTexturable and isConfigRenderable are
|
||||
|
@ -505,7 +505,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsImage, reporter
|
||||
img.reset();
|
||||
ctxInfo.grContext()->flush();
|
||||
if (backendTex.isValid()) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -838,7 +838,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkImage_NewFromTextureRelease, reporter, c
|
||||
refImg.reset(nullptr); // force a release of the image
|
||||
REPORTER_ASSERT(reporter, 1 == releaseChecker.fReleaseCount);
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
|
||||
static void test_cross_context_image(skiatest::Reporter* reporter, const GrContextOptions& options,
|
||||
|
@ -458,7 +458,7 @@ DEF_GPUTEST(LazyProxyUninstantiateTest, reporter, /* options */) {
|
||||
REPORTER_ASSERT(reporter, 1 == releaseTestValue);
|
||||
}
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
|
||||
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapBackendTextureAsRenderTarget(
|
||||
backendTex, origin, supportedNumSamples);
|
||||
if (!sProxy) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
continue; // This can fail on Mesa
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
|
||||
supportedNumSamples, SkBackingFit::kExact,
|
||||
caps.maxWindowRectangles());
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
|
||||
// Tests wrapBackendTexture that is only renderable
|
||||
@ -268,7 +268,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
|
||||
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapRenderableBackendTexture(
|
||||
backendTex, origin, supportedNumSamples);
|
||||
if (!sProxy) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
continue; // This can fail on Mesa
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
|
||||
supportedNumSamples, SkBackingFit::kExact,
|
||||
caps.maxWindowRectangles());
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
|
||||
// Tests wrapBackendTexture that is only textureable
|
||||
@ -294,7 +294,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
|
||||
sk_sp<GrSurfaceProxy> sProxy = proxyProvider->wrapBackendTexture(
|
||||
backendTex, origin, kBorrow_GrWrapOwnership, nullptr, nullptr);
|
||||
if (!sProxy) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
|
||||
check_texture(reporter, resourceProvider, sProxy->asTextureProxy(),
|
||||
SkBackingFit::kExact);
|
||||
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ static sk_sp<GrSurfaceProxy> make_backend(GrContext* context, const ProxyParams&
|
||||
return proxyProvider->wrapBackendTexture(*backendTex, p.fOrigin);
|
||||
}
|
||||
|
||||
static void cleanup_backend(GrContext* context, GrBackendTexture* backendTex) {
|
||||
static void cleanup_backend(GrContext* context, const GrBackendTexture& backendTex) {
|
||||
context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) {
|
||||
sk_sp<GrSurfaceProxy> p2 = make_deferred(proxyProvider, t[0].fP2);
|
||||
non_overlap_test(reporter, resourceProvider,
|
||||
std::move(p1), std::move(p2), t[0].fExpectation);
|
||||
cleanup_backend(ctxInfo.grContext(), &backEndTex);
|
||||
cleanup_backend(ctxInfo.grContext(), backEndTex);
|
||||
}
|
||||
|
||||
resourceProvider->testingOnly_setExplicitlyAllocateGPUResources(orig);
|
||||
|
@ -246,10 +246,10 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceCacheWrappedResources, reporter, ctxI
|
||||
REPORTER_ASSERT(reporter, !adoptedIsAlive);
|
||||
|
||||
if (borrowedIsAlive) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&(backendTextures[0]));
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTextures[0]);
|
||||
}
|
||||
if (adoptedIsAlive) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&(backendTextures[1]));
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTextures[1]);
|
||||
}
|
||||
|
||||
context->resetContext();
|
||||
|
@ -125,7 +125,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsSurface, report
|
||||
surf.reset();
|
||||
ctxInfo.grContext()->flush();
|
||||
if (backendTex.isValid()) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
|
||||
static constexpr int kSampleCnt = 2;
|
||||
@ -174,7 +174,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsSurface, report
|
||||
surf.reset();
|
||||
ctxInfo.grContext()->flush();
|
||||
if (backendTex.isValid()) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -719,7 +719,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture(
|
||||
kRGBA_8888_SkColorType,
|
||||
nullptr, nullptr);
|
||||
if (!surface) {
|
||||
gpu->deleteTestingOnlyBackendTexture(outTexture);
|
||||
gpu->deleteTestingOnlyBackendTexture(*outTexture);
|
||||
return nullptr;
|
||||
}
|
||||
return surface;
|
||||
@ -746,7 +746,7 @@ static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target(
|
||||
nullptr, nullptr);
|
||||
|
||||
if (!surface) {
|
||||
gpu->deleteTestingOnlyBackendTexture(outTexture);
|
||||
gpu->deleteTestingOnlyBackendTexture(*outTexture);
|
||||
return nullptr;
|
||||
}
|
||||
return surface;
|
||||
@ -824,7 +824,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceClear_Gpu, reporter, ctxInfo) {
|
||||
auto surface = surfaceFunc(context, 1, kOrigColor, &backendTex);
|
||||
test_surface_clear(reporter, surface, grSurfaceGetter, kOrigColor);
|
||||
surface.reset();
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -888,7 +888,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacePartialDraw_Gpu, reporter, ctxInfo) {
|
||||
if (surface) {
|
||||
test_surface_draw_partially(reporter, surface, kOrigColor);
|
||||
surface.reset();
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -922,7 +922,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceAttachStencil_Gpu, reporter, ctxInf
|
||||
GrRenderTarget* rt = surface->getCanvas()
|
||||
->internal_private_accessTopLayerRenderTargetContext()->accessRenderTarget();
|
||||
REPORTER_ASSERT(reporter, resourceProvider->attachStencilAttachment(rt));
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1040,7 +1040,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter,
|
||||
|
||||
GrGpu* gpu = context->contextPriv().getGpu();
|
||||
for (auto backendTex : backendTextures) {
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -107,7 +107,7 @@ void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) {
|
||||
|
||||
// When we wrapBackendRenderTarget it is always borrowed, so we must make sure to free the
|
||||
// resource when we're done.
|
||||
gpu->deleteTestingOnlyBackendTexture(&origBackendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(origBackendTex);
|
||||
}
|
||||
|
||||
void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) {
|
||||
|
@ -431,7 +431,7 @@ static void test_write_pixels_non_texture(skiatest::Reporter* reporter, GrContex
|
||||
if (surface) {
|
||||
test_write_pixels(reporter, surface.get());
|
||||
}
|
||||
gpu->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
gpu->deleteTestingOnlyBackendTexture(backendTex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ sk_sp<GrTextureProxy> MakeTextureProxyFromData(GrContext* context, bool isRT, in
|
||||
}
|
||||
|
||||
if (!proxy) {
|
||||
context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(&backendTex);
|
||||
context->contextPriv().getGpu()->deleteTestingOnlyBackendTexture(backendTex);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user