| Flutter Impeller |

khr_swapchain_image_vk.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMAGE_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMAGE_VK_H_
7
8 #include "impeller/geometry/size.h"
9 #include "impeller/renderer/backend/vulkan/formats_vk.h"
10 #include "impeller/renderer/backend/vulkan/texture_source_vk.h"
11 #include "impeller/renderer/backend/vulkan/vk.h"
12 #include "vulkan/vulkan_handles.hpp"
13
14 namespace impeller {
15
16 class KHRSwapchainImageVK final : public TextureSourceVK {
17 public:
18 KHRSwapchainImageVK(TextureDescriptor desc,
19 const vk::Device& device,
20 vk::Image image);
21
22 // |TextureSourceVK|
23 ~KHRSwapchainImageVK() override;
24
25 bool IsValid() const;
26
27 PixelFormat GetPixelFormat() const;
28
29 ISize GetSize() const;
30
31 // |TextureSourceVK|
32 vk::Image GetImage() const override;
33
34 std::shared_ptr<Texture> GetMSAATexture() const;
35
36 std::shared_ptr<Texture> GetDepthStencilTexture() const;
37
38 // |TextureSourceVK|
39 vk::ImageView GetImageView() const override;
40
41 vk::ImageView GetRenderTargetView() const override;
42
43 void SetMSAATexture(std::shared_ptr<Texture> texture);
44
45 void SetDepthStencilTexture(std::shared_ptr<Texture> texture);
46
47 bool IsSwapchainImage() const override { return true; }
48
49 private:
50 vk::Image image_ = VK_NULL_HANDLE;
51 vk::UniqueImageView image_view_ = {};
52 std::shared_ptr<Texture> msaa_texture_;
53 std::shared_ptr<Texture> depth_stencil_texture_;
54 bool is_valid_ = false;
55
56 KHRSwapchainImageVK(const KHRSwapchainImageVK&) = delete;
57
58 KHRSwapchainImageVK& operator=(const KHRSwapchainImageVK&) = delete;
59 };
60
61 } // namespace impeller
62
63 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMAGE_VK_H_
impeller::KHRSwapchainImageVK::GetDepthStencilTexture
std::shared_ptr< Texture > GetDepthStencilTexture() const
Definition: khr_swapchain_image_vk.cc:42
impeller::KHRSwapchainImageVK::~KHRSwapchainImageVK
~KHRSwapchainImageVK() override
impeller::TextureSourceVK
Abstract base class that represents a vkImage and an vkImageView.
Definition: texture_source_vk.h:28
texture_source_vk.h
impeller::KHRSwapchainImageVK::GetImage
vk::Image GetImage() const override
Get the image handle for this texture source.
Definition: khr_swapchain_image_vk.cc:64
impeller::KHRSwapchainImageVK::GetImageView
vk::ImageView GetImageView() const override
Retrieve the image view used for sampling/blitting/compute with this texture source.
Definition: khr_swapchain_image_vk.cc:69
formats_vk.h
impeller::KHRSwapchainImageVK::SetMSAATexture
void SetMSAATexture(std::shared_ptr< Texture > texture)
Definition: khr_swapchain_image_vk.cc:46
impeller::KHRSwapchainImageVK
Definition: khr_swapchain_image_vk.h:16
impeller::KHRSwapchainImageVK::IsSwapchainImage
bool IsSwapchainImage() const override
Determines if swapchain image. That is, an image used as the root render target.
Definition: khr_swapchain_image_vk.h:47
vk.h
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:100
impeller::TSize< int64_t >
impeller::KHRSwapchainImageVK::SetDepthStencilTexture
void SetDepthStencilTexture(std::shared_ptr< Texture > texture)
Definition: khr_swapchain_image_vk.cc:50
impeller::KHRSwapchainImageVK::GetPixelFormat
PixelFormat GetPixelFormat() const
Definition: khr_swapchain_image_vk.cc:55
impeller::KHRSwapchainImageVK::IsValid
bool IsValid() const
Definition: khr_swapchain_image_vk.cc:34
impeller::KHRSwapchainImageVK::GetRenderTargetView
vk::ImageView GetRenderTargetView() const override
Retrieve the image view used for render target attachments with this texture source.
Definition: khr_swapchain_image_vk.cc:74
impeller::KHRSwapchainImageVK::KHRSwapchainImageVK
KHRSwapchainImageVK(TextureDescriptor desc, const vk::Device &device, vk::Image image)
Definition: khr_swapchain_image_vk.cc:9
impeller::KHRSwapchainImageVK::GetSize
ISize GetSize() const
Definition: khr_swapchain_image_vk.cc:59
impeller::TextureDescriptor
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
Definition: texture_descriptor.h:37
impeller::KHRSwapchainImageVK::GetMSAATexture
std::shared_ptr< Texture > GetMSAATexture() const
Definition: khr_swapchain_image_vk.cc:38
impeller
Definition: aiks_blur_unittests.cc:20
size.h