diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/EGLImageTest.cpp | 12 | ||||
-rw-r--r-- | tests/GrPorterDuffTest.cpp | 8 | ||||
-rw-r--r-- | tests/GrSurfaceTest.cpp | 7 | ||||
-rw-r--r-- | tests/ImageTest.cpp | 2 | ||||
-rw-r--r-- | tests/PathTest.cpp | 2 | ||||
-rw-r--r-- | tests/RectangleTextureTest.cpp | 12 | ||||
-rw-r--r-- | tests/ResourceCacheTest.cpp | 9 | ||||
-rw-r--r-- | tests/VkWrapTests.cpp | 12 |
8 files changed, 28 insertions, 36 deletions
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp index 4a23a9c3f5..de305c7443 100644 --- a/tests/EGLImageTest.cpp +++ b/tests/EGLImageTest.cpp @@ -173,7 +173,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) { externalDesc.fWidth = kSize; externalDesc.fHeight = kSize; externalDesc.fTextureHandle = reinterpret_cast<GrBackendObject>(&externalTexture); - SkAutoTUnref<GrTexture> externalTextureObj( + sk_sp<GrTexture> externalTextureObj( context0->textureProvider()->wrapBackendTexture(externalDesc)); if (!externalTextureObj) { ERRORF(reporter, "Error wrapping external texture in GrTexture."); @@ -183,7 +183,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) { // Should not be able to wrap as a RT externalDesc.fFlags = kRenderTarget_GrBackendTextureFlag; - SkAutoTUnref<GrTexture> externalTextureRTObj( + sk_sp<GrTexture> externalTextureRTObj( context0->textureProvider()->wrapBackendTexture(externalDesc)); if (externalTextureRTObj) { ERRORF(reporter, "Should not be able to wrap an EXTERNAL texture as a RT."); @@ -192,18 +192,18 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) { // Should not be able to wrap with a sample count externalDesc.fSampleCnt = 4; - SkAutoTUnref<GrTexture> externalTextureMSAAObj( + sk_sp<GrTexture> externalTextureMSAAObj( context0->textureProvider()->wrapBackendTexture(externalDesc)); if (externalTextureMSAAObj) { ERRORF(reporter, "Should not be able to wrap an EXTERNAL texture with MSAA."); } externalDesc.fSampleCnt = 0; - test_read_pixels(reporter, context0, externalTextureObj, pixels.get()); + test_read_pixels(reporter, context0, externalTextureObj.get(), pixels.get()); - test_write_pixels(reporter, context0, externalTextureObj); + test_write_pixels(reporter, context0, externalTextureObj.get()); - test_copy_surface(reporter, context0, externalTextureObj, pixels.get()); + test_copy_surface(reporter, context0, externalTextureObj.get(), pixels.get()); cleanup(glCtx0, externalTexture.fID, glCtx1, context1, backendTexture1, image); } diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp index 845dae16e4..719f787d1d 100644 --- a/tests/GrPorterDuffTest.cpp +++ b/tests/GrPorterDuffTest.cpp @@ -1161,16 +1161,14 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, /*factory*/) { } GrBackendObject backendTex = - ctx->getGpu()->createTestingOnlyBackendTexture(nullptr, 100, 100, - kRGBA_8888_GrPixelConfig); + ctx->getGpu()->createTestingOnlyBackendTexture(nullptr, 100, 100, kRGBA_8888_GrPixelConfig); GrBackendTextureDesc fakeDesc; fakeDesc.fConfig = kRGBA_8888_GrPixelConfig; fakeDesc.fWidth = fakeDesc.fHeight = 100; fakeDesc.fTextureHandle = backendTex; - SkAutoTUnref<GrTexture> fakeTexture(ctx->textureProvider()->wrapBackendTexture(fakeDesc, - kBorrow_GrWrapOwnership)); GrXferProcessor::DstTexture fakeDstTexture; - fakeDstTexture.setTexture(fakeTexture); + fakeDstTexture.setTexture( + ctx->textureProvider()->wrapBackendTexture(fakeDesc, kBorrow_GrWrapOwnership)); static const GrColor testColors[] = { 0, diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index b6ca406118..5a69e53474 100644 --- a/tests/GrSurfaceTest.cpp +++ b/tests/GrSurfaceTest.cpp @@ -54,10 +54,10 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) { backendDesc.fHeight = 256; backendDesc.fSampleCnt = 0; backendDesc.fTextureHandle = backendTex; - GrSurface* texRT2 = context->textureProvider()->wrapBackendTexture( + sk_sp<GrSurface> texRT2 = context->textureProvider()->wrapBackendTexture( backendDesc, kBorrow_GrWrapOwnership); - REPORTER_ASSERT(reporter, texRT2 == texRT2->asRenderTarget()); - REPORTER_ASSERT(reporter, texRT2 == texRT2->asTexture()); + REPORTER_ASSERT(reporter, texRT2.get() == texRT2->asRenderTarget()); + REPORTER_ASSERT(reporter, texRT2.get() == texRT2->asTexture()); REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget()) == texRT2->asTexture()); REPORTER_ASSERT(reporter, texRT2->asRenderTarget() == @@ -66,7 +66,6 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrSurface, reporter, ctxInfo) { static_cast<GrSurface*>(texRT2->asTexture())); texRT1->unref(); - texRT2->unref(); tex1->unref(); context->getGpu()->deleteTestingOnlyBackendTexture(backendTex); } diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index e7de3694df..a0ce16fcab 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -889,7 +889,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(NewTextureFromPixmap, reporter, ctxInfo) { DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredTextureImage, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); sk_gpu_test::TestContext* testContext = ctxInfo.testContext(); - SkAutoTUnref<GrContextThreadSafeProxy> proxy(context->threadSafeProxy()); + sk_sp<GrContextThreadSafeProxy> proxy = context->threadSafeProxy(); GrContextFactory otherFactory; ContextInfo otherContextInfo = diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 99a4e5b5af..1b8071e013 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -4007,7 +4007,7 @@ public: static void TestPathRef(skiatest::Reporter* reporter) { static const int kRepeatCnt = 10; - SkAutoTUnref<SkPathRef> pathRef(new SkPathRef); + sk_sp<SkPathRef> pathRef(new SkPathRef); SkPathRef::Editor ed(&pathRef); diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp index a21b5a2f63..1491326236 100644 --- a/tests/RectangleTextureTest.cpp +++ b/tests/RectangleTextureTest.cpp @@ -187,7 +187,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(RectangleTexture, reporter, ctxInfo) { } } - SkAutoTUnref<GrTexture> rectangleTexture( + sk_sp<GrTexture> rectangleTexture( context->textureProvider()->wrapBackendTexture(rectangleDesc)); if (!rectangleTexture) { ERRORF(reporter, "Error wrapping rectangle texture in GrTexture."); @@ -195,15 +195,15 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(RectangleTexture, reporter, ctxInfo) { continue; } - test_read_pixels(reporter, context, rectangleTexture, refPixels); + test_read_pixels(reporter, context, rectangleTexture.get(), refPixels); - test_copy_surface_src(reporter, context, rectangleTexture, refPixels); + test_copy_surface_src(reporter, context, rectangleTexture.get(), refPixels); - test_copy_surface_dst(reporter, context, rectangleTexture); + test_copy_surface_dst(reporter, context, rectangleTexture.get()); - test_write_pixels(reporter, context, rectangleTexture); + test_write_pixels(reporter, context, rectangleTexture.get()); - test_clear(reporter, context, rectangleTexture); + test_clear(reporter, context, rectangleTexture.get()); GR_GL_CALL(glContext->gl(), DeleteTextures(1, &rectTexID)); } diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index b6f13e69bb..3e4efb108f 100644 --- a/tests/ResourceCacheTest.cpp +++ b/tests/ResourceCacheTest.cpp @@ -221,13 +221,14 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceCacheWrappedResources, reporter, ctxI desc.fHeight = kH; desc.fTextureHandle = texHandles[0]; - SkAutoTUnref<GrTexture> borrowed(context->textureProvider()->wrapBackendTexture( - desc, kBorrow_GrWrapOwnership)); + sk_sp<GrTexture> borrowed(context->textureProvider()->wrapBackendTexture( + desc, kBorrow_GrWrapOwnership)); desc.fTextureHandle = texHandles[1]; - SkAutoTUnref<GrTexture> adopted(context->textureProvider()->wrapBackendTexture( - desc, kAdopt_GrWrapOwnership)); + sk_sp<GrTexture> adopted(context->textureProvider()->wrapBackendTexture( + desc, kAdopt_GrWrapOwnership)); + printf("\nborrowed: %p, adopted: %p\n", borrowed.get(), adopted.get()); REPORTER_ASSERT(reporter, borrowed != nullptr && adopted != nullptr); if (!borrowed || !adopted) { return; diff --git a/tests/VkWrapTests.cpp b/tests/VkWrapTests.cpp index b3456c28ba..58c4b356c6 100644 --- a/tests/VkWrapTests.cpp +++ b/tests/VkWrapTests.cpp @@ -39,9 +39,8 @@ void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) { desc.fWidth = kW; desc.fHeight = kH; desc.fTextureHandle = backendObj; - GrTexture* tex = gpu->wrapBackendTexture(desc, kBorrow_GrWrapOwnership); + sk_sp<GrTexture> tex = gpu->wrapBackendTexture(desc, kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, tex); - tex->unref(); // image is null GrVkImageInfo backendCopy = *backendTex; @@ -64,7 +63,6 @@ void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) { backendCopy.fAlloc = backendTex->fAlloc; tex = gpu->wrapBackendTexture(desc, kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, tex); - tex->unref(); gpu->deleteTestingOnlyBackendTexture(backendObj, true); } @@ -85,9 +83,8 @@ void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) { desc.fSampleCnt = 0; desc.fStencilBits = 0; desc.fRenderTargetHandle = backendObj; - GrRenderTarget* rt = gpu->wrapBackendRenderTarget(desc, kBorrow_GrWrapOwnership); + sk_sp<GrRenderTarget> rt = gpu->wrapBackendRenderTarget(desc, kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, rt); - rt->unref(); // image is null GrVkImageInfo backendCopy = *backendTex; @@ -112,7 +109,6 @@ void wrap_rt_test(skiatest::Reporter* reporter, GrContext* context) { backendCopy.fAlloc = backendTex->fAlloc; rt = gpu->wrapBackendRenderTarget(desc, kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, rt); - rt->unref(); gpu->deleteTestingOnlyBackendTexture(backendObj, true); } @@ -131,9 +127,8 @@ void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) { desc.fWidth = kW; desc.fHeight = kH; desc.fTextureHandle = backendObj; - GrTexture* tex = gpu->wrapBackendTexture(desc, kBorrow_GrWrapOwnership); + sk_sp<GrTexture> tex = gpu->wrapBackendTexture(desc, kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, tex); - tex->unref(); // image is null GrVkImageInfo backendCopy = *backendTex; @@ -156,7 +151,6 @@ void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) { backendCopy.fAlloc = backendTex->fAlloc; tex = gpu->wrapBackendTexture(desc, kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, tex); - tex->unref(); gpu->deleteTestingOnlyBackendTexture(backendObj, true); } |