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

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

Issue 1735283004: Make GrVkStencilAttachment derive form GrVkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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') | no next file » | 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 0b234f2a9b458fd705ffa84a7d8bed89ca55d827..a632700d028b17e865185f6b34e009598a579716 100644
--- a/src/gpu/vk/GrVkStencilAttachment.cpp
+++ b/src/gpu/vk/GrVkStencilAttachment.cpp
@@ -19,12 +19,12 @@ GrVkStencilAttachment::GrVkStencilAttachment(GrVkGpu* gpu,
const GrVkImage::ImageDesc& desc,
const GrVkImage::Resource* imageResource,
const GrVkImageView* stencilView)
- : INHERITED(gpu, lifeCycle, desc.fWidth, desc.fHeight, format.fStencilBits, desc.fSamples)
+ : GrStencilAttachment(gpu, lifeCycle, desc.fWidth, desc.fHeight,
+ format.fStencilBits, desc.fSamples)
+ , GrVkImage(imageResource)
, fFormat(format)
- , fImageResource(imageResource)
, fStencilView(stencilView) {
this->registerWithCache();
- imageResource->ref();
stencilView->ref();
}
@@ -68,7 +68,6 @@ GrVkStencilAttachment* GrVkStencilAttachment::Create(GrVkGpu* gpu,
GrVkStencilAttachment::~GrVkStencilAttachment() {
// should have been released or abandoned first
- SkASSERT(!fImageResource);
SkASSERT(!fStencilView);
}
@@ -83,20 +82,18 @@ size_t GrVkStencilAttachment::onGpuMemorySize() const {
void GrVkStencilAttachment::onRelease() {
GrVkGpu* gpu = this->getVkGpu();
- fImageResource->unref(gpu);
- fImageResource = nullptr;
+ this->releaseImage(gpu);
fStencilView->unref(gpu);
fStencilView = nullptr;
- INHERITED::onRelease();
+ GrStencilAttachment::onRelease();
}
void GrVkStencilAttachment::onAbandon() {
- fImageResource->unrefAndAbandon();
- fImageResource = nullptr;
+ this->abandonImage();
fStencilView->unrefAndAbandon();
fStencilView = nullptr;
- INHERITED::onAbandon();
+ GrStencilAttachment::onAbandon();
}
GrVkGpu* GrVkStencilAttachment::getVkGpu() const {
« no previous file with comments | « src/gpu/vk/GrVkStencilAttachment.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698