Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: src/gpu/vk/GrVkTextureRenderTarget.cpp

Issue 1824123002: Fix borrowed GrVkImage::Resource. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkTexture.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkTextureRenderTarget.cpp
diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp
index fa9327c78844300a702a9b5ca56b0f76cf0f5df0..43e213fc5002255ba9e0a68fd3c96471c6aaf82f 100644
--- a/src/gpu/vk/GrVkTextureRenderTarget.cpp
+++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp
@@ -150,9 +150,12 @@ GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(GrVkGpu* gpu,
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;
}
@@ -166,6 +169,5 @@ GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(GrVkGpu* gpu,
imageResource->unref(gpu);
return trt;
-
}
« no previous file with comments | « src/gpu/vk/GrVkTexture.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698