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 
12 
13 namespace impeller {
14 
15 class KHRSwapchainImageVK final : public TextureSourceVK {
16  public:
18  const vk::Device& device,
19  vk::Image image);
20 
21  // |TextureSourceVK|
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(uint32_t mip_level,
34  uint32_t array_layer) const override;
35 
36  // |TextureSourceVK|
37  bool IsSwapchainImage() const override;
38 
39  private:
40  vk::Image image_ = VK_NULL_HANDLE;
41  vk::UniqueImageView image_view_ = {};
42  bool is_valid_ = false;
43 
45 
46  KHRSwapchainImageVK& operator=(const KHRSwapchainImageVK&) = delete;
47 };
48 
49 } // namespace impeller
50 
51 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_SWAPCHAIN_KHR_KHR_SWAPCHAIN_IMAGE_VK_H_
KHRSwapchainImageVK(TextureDescriptor desc, const vk::Device &device, vk::Image image)
vk::Image GetImage() const override
Get the image handle for this texture source.
vk::ImageView GetImageView() const override
Retrieve the image view used for sampling/blitting/compute with this texture source.
bool IsSwapchainImage() const override
Determines if swapchain image. That is, an image used as the root render target.
vk::ImageView GetRenderTargetView(uint32_t mip_level, uint32_t array_layer) const override
Retrieve the image view used to attach a specific subresource of this texture as a render target.
Abstract base class that represents a vkImage and an vkImageView.
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...