Flutter Impeller
texture_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_TEXTURE_VK_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEXTURE_VK_H_
7 
8 #include <variant>
9 
10 #include "flutter/fml/macros.h"
12 #include "impeller/core/texture.h"
18 
19 namespace impeller {
20 
21 class TextureVK final : public Texture, public BackendCast<TextureVK, Texture> {
22  public:
23  TextureVK(std::weak_ptr<Context> context,
24  std::shared_ptr<TextureSourceVK> source);
25 
26  // |Texture|
27  ~TextureVK() override;
28 
29  vk::Image GetImage() const;
30 
31  vk::ImageView GetImageView() const;
32 
33  bool SetLayout(const BarrierVK& barrier) const;
34 
35  vk::ImageLayout SetLayoutWithoutEncoding(vk::ImageLayout layout) const;
36 
37  vk::ImageLayout GetLayout() const;
38 
39  std::shared_ptr<const TextureSourceVK> GetTextureSource() const;
40 
41  private:
42  std::weak_ptr<Context> context_;
43  std::shared_ptr<TextureSourceVK> source_;
44 
45  // |Texture|
46  void SetLabel(std::string_view label) override;
47 
48  // |Texture|
49  bool OnSetContents(const uint8_t* contents,
50  size_t length,
51  size_t slice) override;
52 
53  // |Texture|
54  bool OnSetContents(std::shared_ptr<const fml::Mapping> mapping,
55  size_t slice) override;
56 
57  // |Texture|
58  bool IsValid() const override;
59 
60  // |Texture|
61  ISize GetSize() const override;
62 
63  TextureVK(const TextureVK&) = delete;
64 
65  TextureVK& operator=(const TextureVK&) = delete;
66 };
67 
68 } // namespace impeller
69 
70 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_VULKAN_TEXTURE_VK_H_
texture_source_vk.h
formats_vk.h
impeller::TextureVK::GetTextureSource
std::shared_ptr< const TextureSourceVK > GetTextureSource() const
Definition: texture_vk.cc:136
vk.h
impeller::TextureVK::SetLayout
bool SetLayout(const BarrierVK &barrier) const
Definition: texture_vk.cc:140
impeller::Texture
Definition: texture.h:17
impeller::TSize< int64_t >
impeller::TextureVK::GetImage
vk::Image GetImage() const
Definition: texture_vk.cc:128
impeller::BarrierVK
Defines an operations and memory access barrier on a resource.
Definition: barrier_vk.h:21
impeller::TextureVK::GetImageView
vk::ImageView GetImageView() const
Definition: texture_vk.cc:132
impeller::TextureVK::~TextureVK
~TextureVK() override
backend_cast.h
impeller::TextureVK::GetLayout
vk::ImageLayout GetLayout() const
Definition: texture_vk.cc:150
impeller::TextureVK
Definition: texture_vk.h:21
impeller::BackendCast
Definition: backend_cast.h:13
device_buffer_vk.h
texture.h
impeller::TextureVK::SetLayoutWithoutEncoding
vk::ImageLayout SetLayoutWithoutEncoding(vk::ImageLayout layout) const
Definition: texture_vk.cc:144
context_vk.h
impeller::TextureVK::TextureVK
TextureVK(std::weak_ptr< Context > context, std::shared_ptr< TextureSourceVK > source)
Definition: texture_vk.cc:13
impeller
Definition: aiks_context.cc:10