| 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
13 namespace impeller {
14
15 class KHRSwapchainImageVK final : public TextureSourceVK {
16 public:
17 KHRSwapchainImageVK(TextureDescriptor desc,
18 const vk::Device& device,
19 vk::Image image);
20
21 // |TextureSourceVK|
22 ~KHRSwapchainImageVK() override;
23
24 bool IsValid() const;
25
26 // |TextureSourceVK|
27 vk::Image GetImage() const override;
28
29 // |TextureSourceVK|
30 vk::ImageView GetImageView() const override;
31
32 // |TextureSourceVK|
33 vk::ImageView GetRenderTargetView() const override;
34
35 // |TextureSourceVK|
36 bool IsSwapchainImage() const override;
37
38 private:
39 vk::Image image_ = VK_NULL_HANDLE;
40 vk::UniqueImageView image_view_ = {};
41 bool is_valid_ = false;
42
43 KHRSwapchainImageVK(const KHRSwapchainImageVK&) = delete;
44
45 KHRSwapchainImageVK& operator=(const KHRSwapchainImageVK&) = delete;
46 };
47
48 } // namespace impeller
49
50 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMAGE_VK_H_
impeller::KHRSwapchainImageVK
Definition: khr_swapchain_image_vk.h:15
impeller::KHRSwapchainImageVK::KHRSwapchainImageVK
KHRSwapchainImageVK(TextureDescriptor desc, const vk::Device &device, vk::Image image)
Definition: khr_swapchain_image_vk.cc:9
impeller::KHRSwapchainImageVK::IsValid
bool IsValid() const
Definition: khr_swapchain_image_vk.cc:34
impeller::KHRSwapchainImageVK::GetImage
vk::Image GetImage() const override
Get the image handle for this texture source.
Definition: khr_swapchain_image_vk.cc:39
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:44
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.cc:54
impeller::KHRSwapchainImageVK::~KHRSwapchainImageVK
~KHRSwapchainImageVK() override
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:49
impeller::TextureSourceVK
Abstract base class that represents a vkImage and an vkImageView.
Definition: texture_source_vk.h:33
formats_vk.h
impeller
Definition: allocation.cc:12
size.h
impeller::TextureDescriptor
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
Definition: texture_descriptor.h:38
texture_source_vk.h
vk.h