 |
Flutter Impeller
|
|
Go to the documentation of this file.
12 #include "flutter/fml/macros.h"
37 using Element = std::variant<Entity, std::unique_ptr<EntityPass>>;
43 const Matrix& effect_transform,
57 void SetDelegate(std::shared_ptr<EntityPassDelegate> delgate);
74 std::unique_ptr<EntityPass>
Clone()
const;
115 const std::function<
bool(
const Entity&)>& iterator)
const;
149 std::optional<Rect> coverage_limit)
const;
152 std::optional<Rect> coverage_limit)
const;
155 struct EntityResult {
171 Status status = kFailure;
173 static EntityResult Success(
const Entity& e) {
return {e, kSuccess}; }
174 static EntityResult Failure() {
return {{}, kFailure}; }
175 static EntityResult Skip() {
return {{}, kSkip}; }
179 ContentContext& renderer,
181 InlinePassContext& pass_context,
182 ISize root_pass_size,
183 Point global_pass_position,
186 size_t stencil_depth_floor)
const;
245 bool OnRender(ContentContext& renderer,
247 ISize root_pass_size,
248 EntityPassTarget& pass_target,
249 Point global_pass_position,
250 Point local_pass_position,
253 size_t stencil_depth_floor = 0,
254 std::shared_ptr<Contents> backdrop_filter_contents =
nullptr,
255 const std::optional<InlinePassContext::RenderPassResult>&
256 collapsed_parent_pass = std::nullopt)
const;
260 std::vector<Element> elements_;
264 size_t stencil_depth_ = 0u;
266 bool flood_clip_ =
false;
267 bool enable_offscreen_debug_checkerboard_ =
false;
268 std::optional<Rect> bounds_limit_;
278 uint32_t advanced_blend_reads_from_pass_texture_ = 0;
279 uint32_t backdrop_filter_reads_from_pass_texture_ = 0;
281 uint32_t GetTotalPassReads(ContentContext& renderer)
const;
285 std::shared_ptr<EntityPassDelegate> delegate_ =
void AddSubpassInline(std::unique_ptr< EntityPass > pass)
Merges a given pass into this pass. Useful for drawing pre-recorded pictures that don't require rende...
void IterateAllEntities(const std::function< bool(Entity &)> &iterator)
Iterate all entities in this pass, recursively including entities of child passes....
void SetTransformation(Matrix xformation)
void SetBackdropFilter(BackdropFilterProc proc)
std::function< std::shared_ptr< FilterContents >(FilterInput::Ref, const Matrix &effect_transform, Entity::RenderingMode rendering_mode)> BackdropFilterProc
std::optional< Rect > GetSubpassCoverage(const EntityPass &subpass, std::optional< Rect > coverage_limit) const
Get the coverage of an unfiltered subpass.
size_t GetSubpassesDepth() const
void SetBoundsLimit(std::optional< Rect > bounds_limit)
Set the bounds limit, which is provided by the user when creating a SaveLayer. This is a hint that al...
static std::unique_ptr< EntityPassDelegate > MakeDefault()
EntityPass * AddSubpass(std::unique_ptr< EntityPass > pass)
Appends a given pass as a subpass.
bool IterateUntilSubpass(const std::function< bool(Entity &)> &iterator)
Iterate entities in this pass up until the first subpass is found. This is useful for limiting look-a...
void IterateAllElements(const std::function< bool(Element &)> &iterator)
Iterate all elements (entities and subpasses) in this pass, recursively including elements of child p...
std::optional< Rect > GetElementsCoverage(std::optional< Rect > coverage_limit) const
void SetStencilDepth(size_t stencil_depth)
void SetBlendMode(BlendMode blend_mode)
std::vector< StencilCoverageLayer > StencilCoverageStack
void SetElements(std::vector< Element > elements)
std::optional< Rect > GetBoundsLimit() const
Get the bounds limit, which is provided by the user when creating a SaveLayer.
EntityPass * GetSuperpass() const
std::variant< Entity, std::unique_ptr< EntityPass > > Element
size_t GetElementCount() const
Return the number of elements on this pass.
Color GetClearColor(ISize size=ISize::Infinite()) const
bool Render(ContentContext &renderer, const RenderTarget &render_target) const
static constexpr TSize Infinite()
static const std::string kCaptureDocumentName
void SetDelegate(std::shared_ptr< EntityPassDelegate > delgate)
void SetEnableOffscreenCheckerboard(bool enabled)
std::optional< Rect > coverage
A 4x4 matrix using column-major storage.
void AddEntity(Entity entity)
std::unique_ptr< EntityPass > Clone() const