diff options
Diffstat (limited to 'tests/VkWrapTests.cpp')
-rw-r--r-- | tests/VkWrapTests.cpp | 66 |
1 files changed, 24 insertions, 42 deletions
diff --git a/tests/VkWrapTests.cpp b/tests/VkWrapTests.cpp index ca0feb5f14..4e363153f0 100644 --- a/tests/VkWrapTests.cpp +++ b/tests/VkWrapTests.cpp @@ -38,8 +38,6 @@ void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) { GrBackendTexture backendTex = GrBackendTexture(kW, kH, *imageInfo); sk_sp<GrTexture> tex = gpu->wrapBackendTexture(backendTex, kTopLeft_GrSurfaceOrigin, - kNone_GrBackendTextureFlag, - 0, kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, tex); @@ -49,14 +47,10 @@ void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) { backendTex = GrBackendTexture(kW, kH, backendCopy); tex = gpu->wrapBackendTexture(backendTex, kTopLeft_GrSurfaceOrigin, - kNone_GrBackendTextureFlag, - 0, kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, !tex); tex = gpu->wrapBackendTexture(backendTex, kTopLeft_GrSurfaceOrigin, - kNone_GrBackendTextureFlag, - 0, kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, !tex); @@ -66,14 +60,10 @@ void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) { backendTex = GrBackendTexture(kW, kH, backendCopy); tex = gpu->wrapBackendTexture(backendTex, kTopLeft_GrSurfaceOrigin, - kNone_GrBackendTextureFlag, - 0, kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, !tex); tex = gpu->wrapBackendTexture(backendTex, kTopLeft_GrSurfaceOrigin, - kNone_GrBackendTextureFlag, - 0, kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, !tex); // check adopt creation @@ -81,8 +71,6 @@ void wrap_tex_test(skiatest::Reporter* reporter, GrContext* context) { backendTex = GrBackendTexture(kW, kH, backendCopy); tex = gpu->wrapBackendTexture(backendTex, kTopLeft_GrSurfaceOrigin, - kNone_GrBackendTextureFlag, - 0, kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, tex); @@ -130,55 +118,49 @@ void wrap_trt_test(skiatest::Reporter* reporter, GrContext* context) { const GrVkImageInfo* imageInfo = reinterpret_cast<const GrVkImageInfo*>(backendObj); GrBackendTexture backendTex = GrBackendTexture(kW, kH, *imageInfo); - sk_sp<GrTexture> tex = gpu->wrapBackendTexture(backendTex, - kTopLeft_GrSurfaceOrigin, - kRenderTarget_GrBackendTextureFlag, - 0, - kBorrow_GrWrapOwnership); + sk_sp<GrTexture> tex = gpu->wrapRenderableBackendTexture(backendTex, + kTopLeft_GrSurfaceOrigin, + 0, + kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, tex); // image is null GrVkImageInfo backendCopy = *imageInfo; backendCopy.fImage = VK_NULL_HANDLE; backendTex = GrBackendTexture(kW, kH, backendCopy); - tex = gpu->wrapBackendTexture(backendTex, - kTopLeft_GrSurfaceOrigin, - kRenderTarget_GrBackendTextureFlag, - 0, - kBorrow_GrWrapOwnership); + tex = gpu->wrapRenderableBackendTexture(backendTex, + kTopLeft_GrSurfaceOrigin, + 0, + kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, !tex); - tex = gpu->wrapBackendTexture(backendTex, - kTopLeft_GrSurfaceOrigin, - kRenderTarget_GrBackendTextureFlag, - 0, - kAdopt_GrWrapOwnership); + tex = gpu->wrapRenderableBackendTexture(backendTex, + kTopLeft_GrSurfaceOrigin, + 0, + kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, !tex); // alloc is null backendCopy.fImage = imageInfo->fImage; backendCopy.fAlloc = { VK_NULL_HANDLE, 0, 0, 0 }; backendTex = GrBackendTexture(kW, kH, backendCopy); - tex = gpu->wrapBackendTexture(backendTex, - kTopLeft_GrSurfaceOrigin, - kRenderTarget_GrBackendTextureFlag, - 0, - kBorrow_GrWrapOwnership); + tex = gpu->wrapRenderableBackendTexture(backendTex, + kTopLeft_GrSurfaceOrigin, + 0, + kBorrow_GrWrapOwnership); REPORTER_ASSERT(reporter, !tex); - tex = gpu->wrapBackendTexture(backendTex, - kTopLeft_GrSurfaceOrigin, - kRenderTarget_GrBackendTextureFlag, - 0, - kAdopt_GrWrapOwnership); + tex = gpu->wrapRenderableBackendTexture(backendTex, + kTopLeft_GrSurfaceOrigin, + 0, + kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, !tex); // check adopt creation backendCopy.fAlloc = imageInfo->fAlloc; backendTex = GrBackendTexture(kW, kH, backendCopy); - tex = gpu->wrapBackendTexture(backendTex, - kTopLeft_GrSurfaceOrigin, - kRenderTarget_GrBackendTextureFlag, - 0, - kAdopt_GrWrapOwnership); + tex = gpu->wrapRenderableBackendTexture(backendTex, + kTopLeft_GrSurfaceOrigin, + 0, + kAdopt_GrWrapOwnership); REPORTER_ASSERT(reporter, tex); gpu->deleteTestingOnlyBackendTexture(backendObj, true); |