 |
Flutter Impeller
|
|
Go to the documentation of this file.
11 #include "flutter/fml/macros.h"
45 std::shared_ptr<Allocator> allocator_;
88 const std::string& label =
"Offscreen",
90 std::optional<AttachmentConfig> stencil_attachment_config =
97 const std::string& label =
"Offscreen MSAA",
98 AttachmentConfigMSAA color_attachment_config =
100 std::optional<AttachmentConfig> stencil_attachment_config =
113 const std::string& label =
"Offscreen",
114 AttachmentConfig stencil_attachment_config =
135 std::optional<StencilAttachment> attachment);
148 const std::function<
bool(
const Attachment& attachment)>& iterator)
const;
153 std::map<size_t, ColorAttachment> colors_;
154 std::optional<DepthAttachment> depth_;
155 std::optional<StencilAttachment> stencil_;
void SetupStencilAttachment(const Context &context, RenderTargetAllocator &allocator, ISize size, bool msaa, const std::string &label="Offscreen", AttachmentConfig stencil_attachment_config=kDefaultStencilAttachmentConfig)
size_t GetTotalAttachmentCount() const
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
virtual void Start()
Mark the beginning of a frame workload.
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
static constexpr AttachmentConfigMSAA kDefaultColorAttachmentConfigMSAA
PixelFormat GetRenderTargetPixelFormat() const
std::optional< ISize > GetColorAttachmentSize(size_t index) const
RenderTargetAllocator(std::shared_ptr< Allocator > allocator)
const std::map< size_t, ColorAttachment > & GetColorAttachments() const
StorageMode resolve_storage_mode
const std::optional< DepthAttachment > & GetDepthAttachment() const
StorageMode
Specified where the allocation resides and how it is used.
std::shared_ptr< Texture > GetRenderTargetTexture() const
void IterateAllAttachments(const std::function< bool(const Attachment &attachment)> &iterator) const
static constexpr AttachmentConfig kDefaultStencilAttachmentConfig
virtual std::shared_ptr< Texture > CreateTexture(const TextureDescriptor &desc)
Create a new render target texture, or recycle a previously allocated render target texture.
a wrapper around the impeller [Allocator] instance that can be used to provide caching of allocated r...
ISize GetRenderTargetSize() const
static RenderTarget CreateOffscreen(const Context &context, RenderTargetAllocator &allocator, ISize size, const std::string &label="Offscreen", AttachmentConfig color_attachment_config=kDefaultColorAttachmentConfig, std::optional< AttachmentConfig > stencil_attachment_config=kDefaultStencilAttachmentConfig)
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
To do anything rendering related with Impeller, you need a context.
virtual void End()
Mark the end of a frame workload.
static constexpr Color BlackTransparent()
size_t GetMaxColorAttacmentBindIndex() const
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
const std::optional< StencilAttachment > & GetStencilAttachment() const
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
SampleCount GetSampleCount() const
bool HasColorAttachment(size_t index) const
std::string ToString() const
static RenderTarget CreateOffscreenMSAA(const Context &context, RenderTargetAllocator &allocator, ISize size, const std::string &label="Offscreen MSAA", AttachmentConfigMSAA color_attachment_config=kDefaultColorAttachmentConfigMSAA, std::optional< AttachmentConfig > stencil_attachment_config=kDefaultStencilAttachmentConfig)
virtual ~RenderTargetAllocator()=default