| Flutter Impeller |

Public Member Functions | List of all members
impeller::SwapchainImageVK Class Referencefinal

`#include <swapchain_image_vk.h>`

Inheritance diagram for impeller::SwapchainImageVK:

## Public Member Functions
| SwapchainImageVK (TextureDescriptor desc, const vk::Device &device, vk::Image image)
| ~SwapchainImageVK () override
bool | IsValid () const
PixelFormat | GetPixelFormat () const
ISize | GetSize () const
vk::Image | GetImage () const override
std::shared_ptr< Texture > | GetMSAATexture () const
bool | HasMSAATexture () const
vk::ImageView | GetImageView () const override
void | SetMSAATexture (std::shared_ptr< Texture > msaa_tex)
Public Member Functions inherited from impeller::TextureSourceVK
virtual | ~TextureSourceVK ()
const TextureDescriptor & | GetTextureDescriptor () const
fml::Status | SetLayout (const BarrierVK &barrier) const
vk::ImageLayout | SetLayoutWithoutEncoding (vk::ImageLayout layout) const
vk::ImageLayout | GetLayout () const

## Additional Inherited Members
Protected Member Functions inherited from impeller::TextureSourceVK
| TextureSourceVK (TextureDescriptor desc)
Protected Attributes inherited from impeller::TextureSourceVK
const TextureDescriptor | desc_

## Detailed Description

Definition at line 15 of file swapchain_image_vk.h.

## Constructor & Destructor Documentation

## ◆ SwapchainImageVK()

impeller::SwapchainImageVK::SwapchainImageVK | ( | TextureDescriptor | desc,
|  | const vk::Device & | device,
|  | vk::Image | image
| ) |  |

Definition at line 9 of file swapchain_image_vk.cc.

12 : TextureSourceVK(desc), image_(image) {
13 vk::ImageViewCreateInfo view_info;
14 view_info.image = image_;
15 view_info.viewType = vk::ImageViewType::e2D;
16 view_info.format = ToVKImageFormat(desc.format);
17 view_info.subresourceRange.aspectMask = vk::ImageAspectFlagBits::eColor;
18 view_info.subresourceRange.baseMipLevel = 0u;
19 view_info.subresourceRange.baseArrayLayer = 0u;
20 view_info.subresourceRange.levelCount = desc.mip_count;
21 view_info.subresourceRange.layerCount = ToArrayLayerCount(desc.type);
22
23 auto [view_result, view] = device.createImageViewUnique(view_info);
24 if (view_result != vk::Result::eSuccess) {
25 return;
26 }
27
28 image_view_ = std::move(view);
29 is_valid_ = true;
30 }

References impeller::TextureDescriptor::format, impeller::TextureDescriptor::mip_count, impeller::ToArrayLayerCount(), impeller::ToVKImageFormat(), and impeller::TextureDescriptor::type.

## ◆ ~SwapchainImageVK()

impeller::SwapchainImageVK::~SwapchainImageVK | ( |  | ) |
| override default

## Member Function Documentation

## ◆ GetImage()

vk::Image impeller::SwapchainImageVK::GetImage | ( |  | ) | const
| override virtual

Implements impeller::TextureSourceVK.

Definition at line 59 of file swapchain_image_vk.cc.

59 {
60 return image_;
61 }

## ◆ GetImageView()

vk::ImageView impeller::SwapchainImageVK::GetImageView | ( |  | ) | const
| override virtual

Implements impeller::TextureSourceVK.

Definition at line 64 of file swapchain_image_vk.cc.

64 {
65 return image_view_.get();
66 }

## ◆ GetMSAATexture()

std::shared_ptr< Texture > impeller::SwapchainImageVK::GetMSAATexture | ( |  | ) | const

Definition at line 38 of file swapchain_image_vk.cc.

38 {
39 return msaa_tex_;
40 }

## ◆ GetPixelFormat()

PixelFormat impeller::SwapchainImageVK::GetPixelFormat | ( |  | ) | const

Definition at line 50 of file swapchain_image_vk.cc.

50 {
51 return desc_.format;
52 }

References impeller::TextureSourceVK::desc_, and impeller::TextureDescriptor::format.

## ◆ GetSize()

ISize impeller::SwapchainImageVK::GetSize | ( |  | ) | const

Definition at line 54 of file swapchain_image_vk.cc.

54 {
55 return desc_.size;
56 }

References impeller::TextureSourceVK::desc_, and impeller::TextureDescriptor::size.

## ◆ HasMSAATexture()

bool impeller::SwapchainImageVK::HasMSAATexture | ( |  | ) | const

Definition at line 42 of file swapchain_image_vk.cc.

42 {
43 return msaa_tex_ != nullptr;
44 }

## ◆ IsValid()

bool impeller::SwapchainImageVK::IsValid | ( |  | ) | const

Definition at line 34 of file swapchain_image_vk.cc.

34 {
35 return is_valid_;
36 }

## ◆ SetMSAATexture()

void impeller::SwapchainImageVK::SetMSAATexture | ( | std::shared_ptr< Texture > | msaa_tex | ) |

Definition at line 46 of file swapchain_image_vk.cc.

46 {
47 msaa_tex_ = std::move(msaa_tex);
48 }

The documentation for this class was generated from the following files:

- impeller/renderer/backend/vulkan/swapchain_image_vk.h
- impeller/renderer/backend/vulkan/swapchain_image_vk.cc

impeller::TextureSourceVK::TextureSourceVK
TextureSourceVK(TextureDescriptor desc)
Definition: texture_source_vk.cc:9
impeller::TextureDescriptor::format
PixelFormat format
Definition: texture_descriptor.h:42
impeller::ToArrayLayerCount
constexpr uint32_t ToArrayLayerCount(TextureType type)
Definition: formats_vk.h:591
impeller::TextureSourceVK::desc_
const TextureDescriptor desc_
Definition: texture_source_vk.h:54
impeller::ToVKImageFormat
constexpr vk::Format ToVKImageFormat(PixelFormat format)
Definition: formats_vk.h:136
impeller::TextureDescriptor::size
ISize size
Definition: texture_descriptor.h:43