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 "GrVkRenderTarget.h" | 8 #include "GrVkRenderTarget.h" |
9 | 9 |
10 #include "GrRenderTargetPriv.h" | 10 #include "GrRenderTargetPriv.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 SkASSERT(imageDesc.fUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); | 189 SkASSERT(imageDesc.fUsageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); |
190 | 190 |
191 const GrVkImage::Resource* imageResource = GrVkImage::CreateResource(gpu, im
ageDesc); | 191 const GrVkImage::Resource* imageResource = GrVkImage::CreateResource(gpu, im
ageDesc); |
192 if (!imageResource) { | 192 if (!imageResource) { |
193 return nullptr; | 193 return nullptr; |
194 } | 194 } |
195 | 195 |
196 GrVkRenderTarget* rt = GrVkRenderTarget::Create(gpu, desc, lifeCycle, imageR
esource); | 196 GrVkRenderTarget* rt = GrVkRenderTarget::Create(gpu, desc, lifeCycle, imageR
esource); |
197 // Create() will increment the refCount of the image resource if it succeeds | 197 // Create() will increment the refCount of the image resource if it succeeds |
198 imageResource->unref(gpu); | 198 imageResource->unref(gpu); |
199 | |
200 return rt; | 199 return rt; |
201 } | 200 } |
202 | 201 |
203 GrVkRenderTarget* | 202 GrVkRenderTarget* |
204 GrVkRenderTarget::CreateWrappedRenderTarget(GrVkGpu* gpu, | 203 GrVkRenderTarget::CreateWrappedRenderTarget(GrVkGpu* gpu, |
205 const GrSurfaceDesc& desc, | 204 const GrSurfaceDesc& desc, |
206 GrGpuResource::LifeCycle lifeCycle, | 205 GrGpuResource::LifeCycle lifeCycle, |
207 const GrVkImage::Resource* imageReso
urce) { | 206 const GrVkImage::Resource* imageReso
urce) { |
208 SkASSERT(imageResource); | 207 SkASSERT(imageResource); |
209 | 208 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 381 |
383 return nullptr; | 382 return nullptr; |
384 } | 383 } |
385 | 384 |
386 | 385 |
387 GrVkGpu* GrVkRenderTarget::getVkGpu() const { | 386 GrVkGpu* GrVkRenderTarget::getVkGpu() const { |
388 SkASSERT(!this->wasDestroyed()); | 387 SkASSERT(!this->wasDestroyed()); |
389 return static_cast<GrVkGpu*>(this->getGpu()); | 388 return static_cast<GrVkGpu*>(this->getGpu()); |
390 } | 389 } |
391 | 390 |
OLD | NEW |