 |
Flutter Impeller
|
|
Go to the documentation of this file.
22 camera_transform_ = matrix;
26 node_ = std::move(node);
37 if (!coverage.has_value()) {
43 if (coverage.value().IsMaximum()) {
48 if (renderer.
GetContext()->GetCapabilities()->SupportsOffscreenMSAA()) {
52 ISize(coverage.value().GetSize()),
55 .storage_mode = StorageMode::kDeviceTransient,
56 .resolve_storage_mode = StorageMode::kDevicePrivate,
57 .load_action = LoadAction::kClear,
58 .store_action = StoreAction::kMultisampleResolve,
61 .storage_mode = StorageMode::kDeviceTransient,
62 .load_action = LoadAction::kDontCare,
63 .store_action = StoreAction::kDontCare,
70 ISize(coverage.value().GetSize()),
73 .storage_mode = StorageMode::kDevicePrivate,
74 .load_action = LoadAction::kClear,
75 .store_action = StoreAction::kStore,
78 .storage_mode = StorageMode::kDeviceTransient,
79 .load_action = LoadAction::kClear,
80 .store_action = StoreAction::kDontCare,
85 if (!subpass_target.
IsValid()) {
92 if (!scene.
Render(subpass_target, camera_transform_)) {
102 return contents.
Render(renderer, entity, pass);
void SetCameraTransform(Matrix matrix)
void SetGeometry(std::shared_ptr< Geometry > geometry)
Set the geometry that this contents will use to render.
void SetEffectTransform(Matrix matrix)
Set the effect transform for this color source.
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
const std::shared_ptr< Geometry > & GetGeometry() const
Get the geometry that this contents will use to render.
void SetNode(std::shared_ptr< scene::Node > node)
ISize GetRenderTargetSize() const
std::shared_ptr< Texture > GetRenderTargetTexture() const
~SceneContents() override
constexpr Vector3 GetScale() const
std::shared_ptr< Context > GetContext() const
std::shared_ptr< RenderTargetAllocator > GetRenderTargetCache() const
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
bool AddChild(std::shared_ptr< Node > child)
Render passes encode render commands directed as one specific render target into an underlying comman...
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)
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
constexpr static TRect MakeSize(const TSize< U > &size)
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
bool Render(const RenderTarget &render_target, const Matrix &camera_transform)
static constexpr Matrix MakeScale(const Vector3 &s)
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)
A 4x4 matrix using column-major storage.
void SetTexture(std::shared_ptr< Texture > texture)