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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 GrVkRenderTarget* | 201 GrVkRenderTarget* |
202 GrVkRenderTarget::CreateWrappedRenderTarget(GrVkGpu* gpu, | 202 GrVkRenderTarget::CreateWrappedRenderTarget(GrVkGpu* gpu, |
203 const GrSurfaceDesc& desc, | 203 const GrSurfaceDesc& desc, |
204 GrWrapOwnership ownership, | 204 GrWrapOwnership ownership, |
205 const GrVkImageInfo* info) { | 205 const GrVkImageInfo* info) { |
206 SkASSERT(info); | 206 SkASSERT(info); |
207 // We can wrap a rendertarget without its allocation, as long as we don't ta
ke ownership | 207 // We can wrap a rendertarget without its allocation, as long as we don't ta
ke ownership |
208 SkASSERT(VK_NULL_HANDLE != info->fImage); | 208 SkASSERT(VK_NULL_HANDLE != info->fImage); |
209 SkASSERT(VK_NULL_HANDLE != info->fAlloc || kAdopt_GrWrapOwnership != ownersh
ip); | 209 SkASSERT(VK_NULL_HANDLE != info->fAlloc.fMemory || kAdopt_GrWrapOwnership !=
ownership); |
210 | 210 |
211 GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership ? GrVkImag
e::kBorrowed_Wrapped | 211 GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership ? GrVkImag
e::kBorrowed_Wrapped |
212 : GrVkImag
e::kAdopted_Wrapped; | 212 : GrVkImag
e::kAdopted_Wrapped; |
213 | 213 |
214 GrVkRenderTarget* rt = GrVkRenderTarget::Create(gpu, SkBudgeted::kNo, desc,
*info, wrapped); | 214 GrVkRenderTarget* rt = GrVkRenderTarget::Create(gpu, SkBudgeted::kNo, desc,
*info, wrapped); |
215 | 215 |
216 return rt; | 216 return rt; |
217 } | 217 } |
218 | 218 |
219 bool GrVkRenderTarget::completeStencilAttachment() { | 219 bool GrVkRenderTarget::completeStencilAttachment() { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 380 } |
381 | 381 |
382 return nullptr; | 382 return nullptr; |
383 } | 383 } |
384 | 384 |
385 | 385 |
386 GrVkGpu* GrVkRenderTarget::getVkGpu() const { | 386 GrVkGpu* GrVkRenderTarget::getVkGpu() const { |
387 SkASSERT(!this->wasDestroyed()); | 387 SkASSERT(!this->wasDestroyed()); |
388 return static_cast<GrVkGpu*>(this->getGpu()); | 388 return static_cast<GrVkGpu*>(this->getGpu()); |
389 } | 389 } |
OLD | NEW |