OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrVkStencilAttachment.h" | 8 #include "GrVkStencilAttachment.h" |
9 #include "GrVkGpu.h" | 9 #include "GrVkGpu.h" |
10 #include "GrVkImage.h" | 10 #include "GrVkImage.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 GrVkImageView::kStenc
il_Type); | 55 GrVkImageView::kStenc
il_Type); |
56 if (!imageView) { | 56 if (!imageView) { |
57 imageResource->unref(gpu); | 57 imageResource->unref(gpu); |
58 return nullptr; | 58 return nullptr; |
59 } | 59 } |
60 | 60 |
61 GrVkStencilAttachment* stencil = new GrVkStencilAttachment(gpu, lifeCycle, f
ormat, imageDesc, | 61 GrVkStencilAttachment* stencil = new GrVkStencilAttachment(gpu, lifeCycle, f
ormat, imageDesc, |
62 imageResource, im
ageView); | 62 imageResource, im
ageView); |
63 imageResource->unref(gpu); | 63 imageResource->unref(gpu); |
64 imageView->unref(gpu); | 64 imageView->unref(gpu); |
65 | 65 |
66 return stencil; | 66 return stencil; |
67 } | 67 } |
68 | 68 |
69 GrVkStencilAttachment::~GrVkStencilAttachment() { | 69 GrVkStencilAttachment::~GrVkStencilAttachment() { |
70 // should have been released or abandoned first | 70 // should have been released or abandoned first |
71 SkASSERT(!fStencilView); | 71 SkASSERT(!fStencilView); |
72 } | 72 } |
73 | 73 |
74 size_t GrVkStencilAttachment::onGpuMemorySize() const { | 74 size_t GrVkStencilAttachment::onGpuMemorySize() const { |
75 uint64_t size = this->width(); | 75 uint64_t size = this->width(); |
(...skipping 17 matching lines...) Expand all Loading... |
93 this->abandonImage(); | 93 this->abandonImage(); |
94 fStencilView->unrefAndAbandon(); | 94 fStencilView->unrefAndAbandon(); |
95 fStencilView = nullptr; | 95 fStencilView = nullptr; |
96 GrStencilAttachment::onAbandon(); | 96 GrStencilAttachment::onAbandon(); |
97 } | 97 } |
98 | 98 |
99 GrVkGpu* GrVkStencilAttachment::getVkGpu() const { | 99 GrVkGpu* GrVkStencilAttachment::getVkGpu() const { |
100 SkASSERT(!this->wasDestroyed()); | 100 SkASSERT(!this->wasDestroyed()); |
101 return static_cast<GrVkGpu*>(this->getGpu()); | 101 return static_cast<GrVkGpu*>(this->getGpu()); |
102 } | 102 } |
OLD | NEW |