Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
VulkanImageView.h
Go to the documentation of this file.
1/*
2* Copyright 2023 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
8#ifndef skgpu_graphite_VulkanImageView_DEFINED
9#define skgpu_graphite_VulkanImageView_DEFINED
10
14
15namespace skgpu::graphite {
16
17class VulkanSharedContext;
18class VulkanResourceProvider;
19
20/*
21 * VulkanImageView is not derived from Resource as its lifetime is dependent on the lifetime of
22 * its associated VulkanTexture. Hence VulkanTexture will act as a container for its ImageViews
23 * w.r.t. the ResourceCache and CommandBuffer, and is responsible for deleting its ImageView
24 * children when freeGpuData() is called.
25 */
27public:
28 enum class Usage {
31 };
32
33 static std::unique_ptr<const VulkanImageView> Make(
34 const VulkanSharedContext* sharedContext,
35 VkImage image,
38 uint32_t miplevels,
41
42 VkImageView imageView() const { return fImageView; }
43 Usage usage() const { return fUsage; }
44
45private:
46 VulkanImageView(const VulkanSharedContext*, VkImageView, Usage,
48
49 // Since we're not derived from Resource we need to store the context for deletion later
50 const VulkanSharedContext* fSharedContext;
51 VkImageView fImageView;
52 Usage fUsage;
54};
55
56} // namespace skgpu::graphite
57
58#endif // skgpu_graphite_VulkanImageView_DEFINED
static std::unique_ptr< const VulkanImageView > Make(const VulkanSharedContext *sharedContext, VkImage image, VkFormat format, Usage usage, uint32_t miplevels, sk_sp< VulkanSamplerYcbcrConversion >)
sk_sp< SkImage > image
Definition examples.cpp:29
uint32_t uint32_t * format
VkFormat