| 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 #pragma once
6
7 #include <variant>
8
9 #include "flutter/fml/macros.h"
10 #include "impeller/base/backend_cast.h"
11 #include "impeller/core/texture.h"
12 #include "impeller/renderer/backend/vulkan/context_vk.h"
13 #include "impeller/renderer/backend/vulkan/device_buffer_vk.h"
14 #include "impeller/renderer/backend/vulkan/formats_vk.h"
15 #include "impeller/renderer/backend/vulkan/texture_source_vk.h"
16 #include "impeller/renderer/backend/vulkan/vk.h"
17
18 namespace impeller {
19
20 class TextureVK final : public Texture, public BackendCast<TextureVK, Texture> {
21 public:
22 TextureVK(std::weak_ptr<Context> context,
23 std::shared_ptr<TextureSourceVK> source);
24
25 // |Texture|
26 ~TextureVK() override;
27
28 vk::Image GetImage() const;
29
30 vk::ImageView GetImageView() const;
31
32 bool SetLayout(const BarrierVK& barrier) const;
33
34 vk::ImageLayout SetLayoutWithoutEncoding(vk::ImageLayout layout) const;
35
36 vk::ImageLayout GetLayout() const;
37
38 std::shared_ptr<const TextureSourceVK> GetTextureSource() const;
39
40 private:
41 std::weak_ptr<Context> context_;
42 std::shared_ptr<TextureSourceVK> source_;
43
44 // |Texture|
45 void SetLabel(std::string_view label) override;
46
47 // |Texture|
48 bool OnSetContents(const uint8_t* contents,
49 size_t length,
50 size_t slice) override;
51
52 // |Texture|
53 bool OnSetContents(std::shared_ptr<const fml::Mapping> mapping,
54 size_t slice) override;
55
56 // |Texture|
57 bool IsValid() const override;
58
59 // |Texture|
60 ISize GetSize() const override;
61
62 FML_DISALLOW_COPY_AND_ASSIGN(TextureVK);
63 };
64
65 } // namespace impeller
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:20
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:20
impeller::BackendCast
Definition: backend_cast.h:12
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