本文整理汇总了C++中GrVkRenderTarget::getBoundsRect方法的典型用法代码示例。如果您正苦于以下问题:C++ GrVkRenderTarget::getBoundsRect方法的具体用法?C++ GrVkRenderTarget::getBoundsRect怎么用?C++ GrVkRenderTarget::getBoundsRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrVkRenderTarget
的用法示例。
在下文中一共展示了GrVkRenderTarget::getBoundsRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: executeDrawable
void GrVkGpuRTCommandBuffer::executeDrawable(std::unique_ptr<SkDrawable::GpuDrawHandler> drawable) {
GrVkRenderTarget* target = static_cast<GrVkRenderTarget*>(fRenderTarget);
GrVkImage* targetImage = target->msaaImage() ? target->msaaImage() : target;
CommandBufferInfo& cbInfo = fCommandBufferInfos[fCurrentCmdInfo];
VkRect2D bounds;
bounds.offset = { 0, 0 };
bounds.extent = { 0, 0 };
GrVkDrawableInfo vkInfo;
vkInfo.fSecondaryCommandBuffer = cbInfo.currentCmdBuf()->vkCommandBuffer();
vkInfo.fCompatibleRenderPass = cbInfo.fRenderPass->vkRenderPass();
SkAssertResult(cbInfo.fRenderPass->colorAttachmentIndex(&vkInfo.fColorAttachmentIndex));
vkInfo.fFormat = targetImage->imageFormat();
vkInfo.fDrawBounds = &bounds;
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
vkInfo.fImage = targetImage->image();
#else
vkInfo.fImage = VK_NULL_HANDLE;
#endif //SK_BUILD_FOR_ANDROID_FRAMEWORK
GrBackendDrawableInfo info(vkInfo);
// After we draw into the command buffer via the drawable, cached state we have may be invalid.
cbInfo.currentCmdBuf()->invalidateState();
// Also assume that the drawable produced output.
cbInfo.fIsEmpty = false;
drawable->draw(info);
fGpu->addDrawable(std::move(drawable));
if (bounds.extent.width == 0 || bounds.extent.height == 0) {
cbInfo.fBounds.join(target->getBoundsRect());
} else {
cbInfo.fBounds.join(SkRect::MakeXYWH(bounds.offset.x, bounds.offset.y,
bounds.extent.width, bounds.extent.height));
}
}