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

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

Issue 1974983002: Refactor Vulkan image, texture, RTs so that create and getter handles match. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixLayerVersion
Patch Set: nits Created 4 years, 7 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/GrVkStencilAttachment.h ('k') | src/gpu/vk/GrVkTexture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkStencilAttachment.cpp
diff --git a/src/gpu/vk/GrVkStencilAttachment.cpp b/src/gpu/vk/GrVkStencilAttachment.cpp
index a876aea15f9626feadb7f08761dfe2552ffc1dd5..5976811be4618799a2171413c57bc14f7a998279 100644
--- a/src/gpu/vk/GrVkStencilAttachment.cpp
+++ b/src/gpu/vk/GrVkStencilAttachment.cpp
@@ -16,11 +16,11 @@
GrVkStencilAttachment::GrVkStencilAttachment(GrVkGpu* gpu,
const Format& format,
const GrVkImage::ImageDesc& desc,
- const GrVkImage::Resource* imageResource,
+ const GrVkImageInfo& info,
const GrVkImageView* stencilView)
: GrStencilAttachment(gpu, desc.fWidth, desc.fHeight,
format.fStencilBits, desc.fSamples)
- , GrVkImage(imageResource)
+ , GrVkImage(info, GrVkImage::kNot_Wrapped)
, fFormat(format)
, fStencilView(stencilView) {
this->registerWithCache(SkBudgeted::kYes);
@@ -44,22 +44,22 @@ GrVkStencilAttachment* GrVkStencilAttachment::Create(GrVkGpu* gpu,
VK_IMAGE_USAGE_TRANSFER_DST_BIT;
imageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
- const GrVkImage::Resource* imageResource = GrVkImage::CreateResource(gpu, imageDesc);
- if (!imageResource) {
+ GrVkImageInfo info;
+ if (!GrVkImage::InitImageInfo(gpu, imageDesc, &info)) {
return nullptr;
}
- const GrVkImageView* imageView = GrVkImageView::Create(gpu, imageResource->fImage,
+ const GrVkImageView* imageView = GrVkImageView::Create(gpu, info.fImage,
format.fInternalFormat,
GrVkImageView::kStencil_Type, 1);
if (!imageView) {
- imageResource->unref(gpu);
+ VK_CALL(gpu, DestroyImage(gpu->device(), info.fImage, nullptr));
+ VK_CALL(gpu, FreeMemory(gpu->device(), info.fAlloc, nullptr));
return nullptr;
}
GrVkStencilAttachment* stencil = new GrVkStencilAttachment(gpu, format, imageDesc,
- imageResource, imageView);
- imageResource->unref(gpu);
+ info, imageView);
imageView->unref(gpu);
return stencil;
« no previous file with comments | « src/gpu/vk/GrVkStencilAttachment.h ('k') | src/gpu/vk/GrVkTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698