Flutter Engine
The Flutter Engine
|
#include <entity_pass.h>
Public Types | |
using | Element = std::variant< Entity, std::unique_ptr< EntityPass > > |
using | BackdropFilterProc = std::function< std::shared_ptr< FilterContents >(FilterInput::Ref, const Matrix &effect_transform, Entity::RenderingMode rendering_mode)> |
Public Member Functions | |
EntityPass () | |
~EntityPass () | |
void | SetDelegate (std::shared_ptr< EntityPassDelegate > delgate) |
void | SetBoundsLimit (std::optional< Rect > bounds_limit, ContentBoundsPromise bounds_promise=ContentBoundsPromise::kUnknown) |
Set the bounds limit, which is provided by the user when creating a SaveLayer. This is a hint that allows the user to communicate that it's OK to not render content outside of the bounds. More... | |
std::optional< Rect > | GetBoundsLimit () const |
Get the bounds limit, which is provided by the user when creating a SaveLayer. More... | |
bool | GetBoundsLimitMightClipContent () const |
Indicates if the bounds limit set using |SetBoundsLimit()| might clip the contents of the pass. More... | |
bool | GetBoundsLimitIsSnug () const |
Indicates if the bounds limit set using |SetBoundsLimit()| is a reasonably tight estimate of the bounds of the contents. More... | |
size_t | GetSubpassesDepth () const |
void | AddEntity (Entity entity) |
Add an entity to the current entity pass. More... | |
void | PushClip (Entity entity) |
void | PopClips (size_t num_clips, uint64_t depth) |
void | PopAllClips (uint64_t depth) |
void | SetElements (std::vector< Element > elements) |
EntityPass * | AddSubpass (std::unique_ptr< EntityPass > pass) |
Appends a given pass as a subpass. More... | |
EntityPass * | GetSuperpass () const |
bool | Render (ContentContext &renderer, const RenderTarget &render_target) const |
void | IterateAllElements (const std::function< bool(Element &)> &iterator) |
Iterate all elements (entities and subpasses) in this pass, recursively including elements of child passes. The iteration order is depth-first. Whenever a subpass elements is encountered, it's included in the stream before its children. More... | |
void | IterateAllElements (const std::function< bool(const Element &)> &iterator) const |
void | IterateAllEntities (const std::function< bool(Entity &)> &iterator) |
Iterate all entities in this pass, recursively including entities of child passes. The iteration order is depth-first. More... | |
void | IterateAllEntities (const std::function< bool(const Entity &)> &iterator) const |
Iterate all entities in this pass, recursively including entities of child passes. The iteration order is depth-first and does not allow modification of the entities. More... | |
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-ahead optimizations. More... | |
size_t | GetElementCount () const |
Return the number of elements on this pass. More... | |
void | SetTransform (Matrix transform) |
void | SetClipHeight (size_t clip_height) |
size_t | GetClipHeight () const |
void | SetClipDepth (size_t clip_depth) |
uint32_t | GetClipDepth () const |
void | SetBlendMode (BlendMode blend_mode) |
std::optional< Color > | GetClearColor (ISize size=ISize::Infinite()) const |
Return the premultiplied clear color of the pass entities, if any. More... | |
Color | GetClearColorOrDefault (ISize size=ISize::Infinite()) const |
Return the premultiplied clear color of the pass entities. More... | |
void | SetBackdropFilter (BackdropFilterProc proc) |
int32_t | GetRequiredMipCount () const |
void | SetRequiredMipCount (int32_t mip_count) |
std::optional< Rect > | GetSubpassCoverage (const EntityPass &subpass, std::optional< Rect > coverage_limit) const |
Computes the coverage of a given subpass. This is used to determine the texture size of a given subpass before it's rendered to and passed through the subpass ImageFilter, if any. More... | |
std::optional< Rect > | GetElementsCoverage (std::optional< Rect > coverage_limit) const |
Definition at line 43 of file entity_pass.h.
using impeller::EntityPass::BackdropFilterProc = std::function<std::shared_ptr<FilterContents>( FilterInput::Ref, const Matrix& effect_transform, Entity::RenderingMode rendering_mode)> |
Definition at line 56 of file entity_pass.h.
using impeller::EntityPass::Element = std::variant<Entity, std::unique_ptr<EntityPass> > |
Elements are renderable items in the EntityPass
. Each can either be an Entity
or a child EntityPass
.
When the element is a child EntityPass
, it may be rendered to an offscreen texture and converted into an Entity
that draws the texture into the current pass, or its children may be collapsed into the current
EntityPass
. Elements are converted to Entities in GetEntityForElement()
.
Definition at line 54 of file entity_pass.h.
|
default |
|
default |
void impeller::EntityPass::AddEntity | ( | Entity | entity | ) |
Add an entity to the current entity pass.
Definition at line 100 of file entity_pass.cc.
EntityPass * impeller::EntityPass::AddSubpass | ( | std::unique_ptr< EntityPass > | pass | ) |
Appends a given pass as a subpass.
Definition at line 267 of file entity_pass.cc.
std::optional< Rect > impeller::EntityPass::GetBoundsLimit | ( | ) | const |
Get the bounds limit, which is provided by the user when creating a SaveLayer.
Definition at line 65 of file entity_pass.cc.
bool impeller::EntityPass::GetBoundsLimitIsSnug | ( | ) | const |
Indicates if the bounds limit set using |SetBoundsLimit()| is a reasonably tight estimate of the bounds of the contents.
Definition at line 88 of file entity_pass.cc.
bool impeller::EntityPass::GetBoundsLimitMightClipContent | ( | ) | const |
Indicates if the bounds limit set using |SetBoundsLimit()| might clip the contents of the pass.
Definition at line 69 of file entity_pass.cc.
std::optional< Color > impeller::EntityPass::GetClearColor | ( | ISize | size = ISize::Infinite() | ) | const |
Return the premultiplied clear color of the pass entities, if any.
Definition at line 1124 of file entity_pass.cc.
Color impeller::EntityPass::GetClearColorOrDefault | ( | ISize | size = ISize::Infinite() | ) | const |
Return the premultiplied clear color of the pass entities.
If the entity pass has no clear color, this will return transparent black.
Definition at line 1120 of file entity_pass.cc.
uint32_t impeller::EntityPass::GetClipDepth | ( | ) | const |
Definition at line 1111 of file entity_pass.cc.
size_t impeller::EntityPass::GetClipHeight | ( | ) | const |
Definition at line 1103 of file entity_pass.cc.
size_t impeller::EntityPass::GetElementCount | ( | ) | const |
Return the number of elements on this pass.
Definition at line 1091 of file entity_pass.cc.
std::optional< Rect > impeller::EntityPass::GetElementsCoverage | ( | std::optional< Rect > | coverage_limit | ) | const |
Definition at line 154 of file entity_pass.cc.
|
inline |
Definition at line 175 of file entity_pass.h.
std::optional< Rect > impeller::EntityPass::GetSubpassCoverage | ( | const EntityPass & | subpass, |
std::optional< Rect > | coverage_limit | ||
) | const |
Computes the coverage of a given subpass. This is used to determine the texture size of a given subpass before it's rendered to and passed through the subpass ImageFilter, if any.
[in] | subpass | The EntityPass for which to compute pre-filteredcoverage. |
[in] | coverage_limit | Confines coverage to a specified area. This hint is used to trim coverage to the root framebuffer area. std::nullopt means there is no limit. |
std::nullopt
means rendering the subpass will have no effect on the color attachment. Definition at line 231 of file entity_pass.cc.
size_t impeller::EntityPass::GetSubpassesDepth | ( | ) | const |
Definition at line 143 of file entity_pass.cc.
EntityPass * impeller::EntityPass::GetSuperpass | ( | ) | const |
Definition at line 263 of file entity_pass.cc.
void impeller::EntityPass::IterateAllElements | ( | const std::function< bool(const Element &)> & | iterator | ) | const |
TODO(gaaclarke): Remove duplication here between const and non-const versions.
Definition at line 1011 of file entity_pass.cc.
void impeller::EntityPass::IterateAllElements | ( | const std::function< bool(Element &)> & | iterator | ) |
Iterate all elements (entities and subpasses) in this pass, recursively including elements of child passes. The iteration order is depth-first. Whenever a subpass elements is encountered, it's included in the stream before its children.
Definition at line 995 of file entity_pass.cc.
void impeller::EntityPass::IterateAllEntities | ( | const std::function< bool(const Entity &)> & | iterator | ) | const |
Iterate all entities in this pass, recursively including entities of child passes. The iteration order is depth-first and does not allow modification of the entities.
Definition at line 1051 of file entity_pass.cc.
void impeller::EntityPass::IterateAllEntities | ( | const std::function< bool(Entity &)> & | iterator | ) |
Iterate all entities in this pass, recursively including entities of child passes. The iteration order is depth-first.
Definition at line 1030 of file entity_pass.cc.
bool impeller::EntityPass::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-ahead optimizations.
Definition at line 1073 of file entity_pass.cc.
void impeller::EntityPass::PopAllClips | ( | uint64_t | depth | ) |
Definition at line 135 of file entity_pass.cc.
void impeller::EntityPass::PopClips | ( | size_t | num_clips, |
uint64_t | depth | ||
) |
Definition at line 117 of file entity_pass.cc.
void impeller::EntityPass::PushClip | ( | Entity | entity | ) |
Definition at line 112 of file entity_pass.cc.
bool impeller::EntityPass::Render | ( | ContentContext & | renderer, |
const RenderTarget & | render_target | ||
) | const |
Definition at line 354 of file entity_pass.cc.
void impeller::EntityPass::SetBackdropFilter | ( | BackdropFilterProc | proc | ) |
Definition at line 1145 of file entity_pass.cc.
void impeller::EntityPass::SetBlendMode | ( | BlendMode | blend_mode | ) |
Definition at line 1115 of file entity_pass.cc.
void impeller::EntityPass::SetBoundsLimit | ( | std::optional< Rect > | bounds_limit, |
ContentBoundsPromise | bounds_promise = ContentBoundsPromise::kUnknown |
||
) |
Set the bounds limit, which is provided by the user when creating a SaveLayer. This is a hint that allows the user to communicate that it's OK to not render content outside of the bounds.
For consistency with Skia, we effectively treat this like a rectangle clip by forcing the subpass texture size to never exceed it.
The entity pass will assume that these bounds cause a clipping effect on the layer unless this call is followed up with a call to |SetBoundsClipsContent()| specifying otherwise.
Definition at line 58 of file entity_pass.cc.
void impeller::EntityPass::SetClipDepth | ( | size_t | clip_depth | ) |
Definition at line 1107 of file entity_pass.cc.
void impeller::EntityPass::SetClipHeight | ( | size_t | clip_height | ) |
Definition at line 1099 of file entity_pass.cc.
void impeller::EntityPass::SetDelegate | ( | std::shared_ptr< EntityPassDelegate > | delgate | ) |
Definition at line 51 of file entity_pass.cc.
void impeller::EntityPass::SetElements | ( | std::vector< Element > | elements | ) |
Definition at line 139 of file entity_pass.cc.
|
inline |
Definition at line 177 of file entity_pass.h.
void impeller::EntityPass::SetTransform | ( | Matrix | transform | ) |
Definition at line 1095 of file entity_pass.cc.