Index: src/gpu/vk/GrVkTexture.cpp |
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp |
index a6a89df37a3340d86248bb149ee8fbb4f2971653..058dfbdc0a277ea18a53ad24d813e7f9536719a9 100644 |
--- a/src/gpu/vk/GrVkTexture.cpp |
+++ b/src/gpu/vk/GrVkTexture.cpp |
@@ -85,9 +85,12 @@ GrVkTexture* GrVkTexture::CreateWrappedTexture(GrVkGpu* gpu, const GrSurfaceDesc |
GrVkImage::Resource::Flags flags = (VK_IMAGE_TILING_LINEAR == info->fImageTiling) |
? Resource::kLinearTiling_Flag : Resource::kNo_Flags; |
- const GrVkImage::Resource* imageResource = new GrVkImage::Resource(info->fImage, |
- info->fAlloc, |
- flags); |
+ const GrVkImage::Resource* imageResource; |
+ if (kBorrowed_LifeCycle == lifeCycle) { |
+ imageResource = new GrVkImage::BorrowedResource(info->fImage, info->fAlloc, flags); |
+ } else { |
+ imageResource = new GrVkImage::Resource(info->fImage, info->fAlloc, flags); |
+ } |
if (!imageResource) { |
return nullptr; |
} |