#include <entity_pass.h>
Classes | |
| struct | StencilCoverageLayer |
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)> |
| using | StencilCoverageStack = std::vector< StencilCoverageLayer > |
Public Member Functions | |
| EntityPass () | |
| ~EntityPass () | |
| void | SetDelegate (std::shared_ptr< EntityPassDelegate > delgate) |
| 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 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... | |
| size_t | GetSubpassesDepth () const |
| std::unique_ptr< EntityPass > | Clone () const |
| void | AddEntity (Entity entity) |
| void | SetElements (std::vector< Element > elements) |
| EntityPass * | AddSubpass (std::unique_ptr< EntityPass > pass) |
| Appends a given pass as a subpass. More... | |
| void | AddSubpassInline (std::unique_ptr< EntityPass > pass) |
| Merges a given pass into this pass. Useful for drawing pre-recorded pictures that don't require rendering into a separate 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 | 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 | SetTransformation (Matrix xformation) |
| void | SetStencilDepth (size_t stencil_depth) |
| size_t | GetStencilDepth () |
| void | SetBlendMode (BlendMode blend_mode) |
| Color | GetClearColor (ISize size=ISize::Infinite()) const |
| void | SetBackdropFilter (BackdropFilterProc proc) |
| void | SetEnableOffscreenCheckerboard (bool enabled) |
| std::optional< Rect > | GetSubpassCoverage (const EntityPass &subpass, std::optional< Rect > coverage_limit) const |
| Get the coverage of an unfiltered subpass. More... | |
| std::optional< Rect > | GetElementsCoverage (std::optional< Rect > coverage_limit) const |
Static Public Attributes | |
| static const std::string | kCaptureDocumentName = "EntityPass" |
Definition at line 26 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 44 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 37 of file entity_pass.h.
| using impeller::EntityPass::StencilCoverageStack = std::vector<StencilCoverageLayer> |
Definition at line 51 of file entity_pass.h.
|
default |
|
default |
| void impeller::EntityPass::AddEntity | ( | Entity | entity | ) |
Definition at line 77 of file entity_pass.cc.
References impeller::Entity::GetBlendMode(), impeller::Entity::GetContents(), impeller::Entity::kLastPipelineBlendMode, impeller::kSource, impeller::kSourceOver, and impeller::Entity::SetBlendMode().
Referenced by impeller::Canvas::DrawAtlas(), impeller::Canvas::DrawImageRect(), impeller::Canvas::DrawPaint(), impeller::Canvas::DrawPath(), impeller::Canvas::DrawPoints(), impeller::Canvas::DrawRect(), impeller::Canvas::DrawRRect(), impeller::Canvas::DrawTextFrame(), impeller::Canvas::DrawVertices(), and impeller::testing::TEST_P().
| EntityPass * impeller::EntityPass::AddSubpass | ( | std::unique_ptr< EntityPass > | pass | ) |
Appends a given pass as a subpass.
Definition at line 226 of file entity_pass.cc.
References impeller::Entity::kLastPipelineBlendMode.
Referenced by impeller::testing::TEST_P().
| void impeller::EntityPass::AddSubpassInline | ( | std::unique_ptr< EntityPass > | pass | ) |
Merges a given pass into this pass. Useful for drawing pre-recorded pictures that don't require rendering into a separate subpass.
Definition at line 245 of file entity_pass.cc.
Referenced by impeller::Canvas::DrawPicture().
| std::unique_ptr< EntityPass > impeller::EntityPass::Clone | ( | ) | const |
Definition at line 1095 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 73 of file entity_pass.cc.
Referenced by impeller::OpacityPeepholePassDelegate::CanCollapseIntoParentPass().
| Color impeller::EntityPass::GetClearColor | ( | ISize | size = ISize::Infinite() | ) | const |
Definition at line 1143 of file entity_pass.cc.
References impeller::Color::Blend(), and impeller::Color::Premultiply().
| size_t impeller::EntityPass::GetElementCount | ( | ) | const |
Return the number of elements on this pass.
Definition at line 1091 of file entity_pass.cc.
Referenced by impeller::OpacityPeepholePassDelegate::CanCollapseIntoParentPass().
| std::optional< Rect > impeller::EntityPass::GetElementsCoverage | ( | std::optional< Rect > | coverage_limit | ) | const |
Definition at line 104 of file entity_pass.cc.
References GetSubpassCoverage(), impeller::Entity::kSubpass, impeller::FilterInput::Make(), impeller::Entity::SetTransformation(), and VALIDATION_LOG.
Referenced by GetSubpassCoverage(), and impeller::testing::TEST_P().
| size_t impeller::EntityPass::GetStencilDepth | ( | ) |
Definition at line 1134 of file entity_pass.cc.
| std::optional< Rect > impeller::EntityPass::GetSubpassCoverage | ( | const EntityPass & | subpass, |
| std::optional< Rect > | coverage_limit | ||
| ) | const |
Get the coverage of an unfiltered subpass.
Definition at line 195 of file entity_pass.cc.
References GetElementsCoverage().
Referenced by GetElementsCoverage(), and impeller::testing::TEST_P().
| size_t impeller::EntityPass::GetSubpassesDepth | ( | ) | const |
Definition at line 93 of file entity_pass.cc.
| EntityPass * impeller::EntityPass::GetSuperpass | ( | ) | const |
Definition at line 222 of file entity_pass.cc.
Referenced by impeller::Canvas::Restore().
| 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 1014 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.
References IterateAllEntities().
| 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.
Referenced by IterateAllEntities(), and Render().
| 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.
Referenced by impeller::OpacityPeepholePassDelegate::CanCollapseIntoParentPass().
| bool impeller::EntityPass::Render | ( | ContentContext & | renderer, |
| const RenderTarget & | render_target | ||
| ) | const |
Definition at line 323 of file entity_pass.cc.
References impeller::ContentContext::GetContext(), impeller::ContentContext::GetLazyGlyphAtlas(), impeller::ContentContext::GetRenderTargetCache(), IterateAllEntities(), kCaptureDocumentName, impeller::TRect< Scalar >::MakeSize(), and VALIDATION_LOG.
Referenced by impeller::EntityPlayground::OpenPlaygroundHere().
| void impeller::EntityPass::SetBackdropFilter | ( | BackdropFilterProc | proc | ) |
| void impeller::EntityPass::SetBlendMode | ( | BlendMode | blend_mode | ) |
Definition at line 1138 of file entity_pass.cc.
| void impeller::EntityPass::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 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.
Definition at line 69 of file entity_pass.cc.
| void impeller::EntityPass::SetDelegate | ( | std::shared_ptr< EntityPassDelegate > | delgate | ) |
Definition at line 62 of file entity_pass.cc.
| void impeller::EntityPass::SetElements | ( | std::vector< Element > | elements | ) |
Definition at line 89 of file entity_pass.cc.
| void impeller::EntityPass::SetEnableOffscreenCheckerboard | ( | bool | enabled | ) |
Definition at line 1169 of file entity_pass.cc.
| void impeller::EntityPass::SetStencilDepth | ( | size_t | stencil_depth | ) |
Definition at line 1130 of file entity_pass.cc.
| void impeller::EntityPass::SetTransformation | ( | Matrix | xformation | ) |
Definition at line 1126 of file entity_pass.cc.
|
static |
Definition at line 39 of file entity_pass.h.
Referenced by Render().