26 bool drawable =
false);
28 static std::shared_ptr<TextureMTL>
Wrapper(
31 std::function<
void()> deletion_proc =
nullptr);
52 void SetDebugAllocator(
53 const std::shared_ptr<DebugAllocatorStats>& debug_allocator);
58 std::shared_ptr<DebugAllocatorStats> debug_allocator_ =
nullptr;
62 bool is_valid_ =
false;
63 bool is_wrapped_ =
false;
64 bool is_drawable_ =
false;
67 void SetLabel(std::string_view label)
override;
70 void SetLabel(std::string_view label, std::string_view trailing)
override;
73 bool OnSetContents(
const uint8_t* contents,
75 size_t slice)
override;
78 bool OnSetContents(std::shared_ptr<const fml::Mapping> mapping,
79 size_t slice)
override;
81 ISize GetSize()
const override;
id< MTLTexture > GetMTLTexture() const
bool IsDrawable() const
Whether or not this texture is wrapping a Metal drawable.
bool IsValid() const override
std::function< id< MTLTexture >()> AcquireTextureProc
This callback needs to always return the same texture when called multiple times.
bool GenerateMipmap(id< MTLBlitCommandEncoder > encoder)
static std::shared_ptr< TextureMTL > Wrapper(TextureDescriptor desc, id< MTLTexture > texture, std::function< void()> deletion_proc=nullptr)
static std::shared_ptr< TextureMTL > Create(TextureDescriptor desc, id< MTLTexture > texture)
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...