| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 } | 346 } |
| 347 | 347 |
| 348 void GrVkRenderTarget::onAbandon() { | 348 void GrVkRenderTarget::onAbandon() { |
| 349 this->abandonInternalObjects(); | 349 this->abandonInternalObjects(); |
| 350 this->abandonImage(); | 350 this->abandonImage(); |
| 351 GrRenderTarget::onAbandon(); | 351 GrRenderTarget::onAbandon(); |
| 352 } | 352 } |
| 353 | 353 |
| 354 | 354 |
| 355 GrBackendObject GrVkRenderTarget::getRenderTargetHandle() const { | 355 GrBackendObject GrVkRenderTarget::getRenderTargetHandle() const { |
| 356 // Currently just passing back the pointer to the main Image::Resource as th
e handle | 356 // If the render target is multisampled, we currently return the ImageInfo f
or the resolved |
| 357 return (GrBackendObject)&fResource; | 357 // image. If we only wrap the msaa target (currently not implemented) we sho
uld return a handle |
| 358 // to that instead. |
| 359 return (GrBackendObject)&fInfo; |
| 358 } | 360 } |
| 359 | 361 |
| 360 const GrVkResource* GrVkRenderTarget::stencilImageResource() const { | 362 const GrVkResource* GrVkRenderTarget::stencilImageResource() const { |
| 361 const GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAtta
chment(); | 363 const GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAtta
chment(); |
| 362 if (stencil) { | 364 if (stencil) { |
| 363 const GrVkStencilAttachment* vkStencil = static_cast<const GrVkStencilAt
tachment*>(stencil); | 365 const GrVkStencilAttachment* vkStencil = static_cast<const GrVkStencilAt
tachment*>(stencil); |
| 364 return vkStencil->imageResource(); | 366 return vkStencil->imageResource(); |
| 365 } | 367 } |
| 366 | 368 |
| 367 return nullptr; | 369 return nullptr; |
| 368 } | 370 } |
| 369 | 371 |
| 370 const GrVkImageView* GrVkRenderTarget::stencilAttachmentView() const { | 372 const GrVkImageView* GrVkRenderTarget::stencilAttachmentView() const { |
| 371 const GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAtta
chment(); | 373 const GrStencilAttachment* stencil = this->renderTargetPriv().getStencilAtta
chment(); |
| 372 if (stencil) { | 374 if (stencil) { |
| 373 const GrVkStencilAttachment* vkStencil = static_cast<const GrVkStencilAt
tachment*>(stencil); | 375 const GrVkStencilAttachment* vkStencil = static_cast<const GrVkStencilAt
tachment*>(stencil); |
| 374 return vkStencil->stencilView(); | 376 return vkStencil->stencilView(); |
| 375 } | 377 } |
| 376 | 378 |
| 377 return nullptr; | 379 return nullptr; |
| 378 } | 380 } |
| 379 | 381 |
| 380 | 382 |
| 381 GrVkGpu* GrVkRenderTarget::getVkGpu() const { | 383 GrVkGpu* GrVkRenderTarget::getVkGpu() const { |
| 382 SkASSERT(!this->wasDestroyed()); | 384 SkASSERT(!this->wasDestroyed()); |
| 383 return static_cast<GrVkGpu*>(this->getGpu()); | 385 return static_cast<GrVkGpu*>(this->getGpu()); |
| 384 } | 386 } |
| OLD | NEW |