#include <entity.h>
Public Types | |
| enum | RenderingMode { RenderingMode::kDirect, RenderingMode::kSubpass } |
| enum | TileMode { TileMode::kClamp, TileMode::kRepeat, TileMode::kMirror, TileMode::kDecal } |
| enum | ClipOperation { ClipOperation::kDifference, ClipOperation::kIntersect } |
Public Member Functions | |
| Entity () | |
| ~Entity () | |
| const Matrix & | GetTransformation () const |
| void | SetTransformation (const Matrix &transformation) |
| std::optional< Rect > | GetCoverage () const |
| Contents::StencilCoverage | GetStencilCoverage (const std::optional< Rect > ¤t_stencil_coverage) const |
| bool | ShouldRender (const std::optional< Rect > &stencil_coverage) const |
| void | SetContents (std::shared_ptr< Contents > contents) |
| const std::shared_ptr< Contents > & | GetContents () const |
| void | SetStencilDepth (uint32_t stencil_depth) |
| void | IncrementStencilDepth (uint32_t increment) |
| uint32_t | GetStencilDepth () const |
| void | SetBlendMode (BlendMode blend_mode) |
| BlendMode | GetBlendMode () const |
| bool | Render (const ContentContext &renderer, RenderPass &parent_pass) const |
| bool | CanInheritOpacity () const |
| bool | SetInheritedOpacity (Scalar alpha) |
| std::optional< Color > | AsBackgroundColor (ISize target_size) const |
| Scalar | DeriveTextScale () const |
| Capture & | GetCapture () const |
| void | SetCapture (Capture capture) const |
Static Public Member Functions | |
| static std::optional< Entity > | FromSnapshot (const std::optional< Snapshot > &snapshot, BlendMode blend_mode=BlendMode::kSourceOver, uint32_t stencil_depth=0) |
| Create an entity that can be used to render a given snapshot. More... | |
| static bool | IsBlendModeDestructive (BlendMode blend_mode) |
| Returns true if the blend mode is "destructive", meaning that even fully transparent source colors would result in the destination getting changed. More... | |
Static Public Attributes | |
| static constexpr BlendMode | kLastPipelineBlendMode = BlendMode::kModulate |
| static constexpr BlendMode | kLastAdvancedBlendMode = BlendMode::kLuminosity |
|
strong |
|
strong |
| Enumerator | |
|---|---|
| kDirect | In direct mode, the Entity's transform is used as the current local-to-screen transformation matrix. |
| kSubpass | In subpass mode, the Entity passed through the filter is in screen space rather than local space, and so some filters (namely, MatrixFilterContents) need to interpret the given EffectTransform as the current transformation matrix. |
Definition at line 26 of file entity.h.
|
strong |
An enum to define how to repeat, fold, or omit colors outside of the typically defined range of the source of the colors (such as the bounds of an image or the defining geometry of a gradient).
Definition at line 40 of file entity.h.
|
default |
|
default |
| bool impeller::Entity::CanInheritOpacity | ( | ) | const |
Definition at line 105 of file entity.cc.
References impeller::kSource, and impeller::kSourceOver.
Referenced by impeller::OpacityPeepholePassDelegate::CanCollapseIntoParentPass(), and SetInheritedOpacity().
| Scalar impeller::Entity::DeriveTextScale | ( | ) | const |
Definition at line 169 of file entity.cc.
References impeller::Matrix::GetMaxBasisLengthXY(), and GetTransformation().
|
static |
Create an entity that can be used to render a given snapshot.
Definition at line 21 of file entity.cc.
References impeller::TextureContents::MakeRect(), impeller::TRect< Scalar >::MakeSize(), SetBlendMode(), SetContents(), SetStencilDepth(), and SetTransformation().
Referenced by impeller::AdvancedBlend(), and impeller::PipelineBlend().
| BlendMode impeller::Entity::GetBlendMode | ( | ) | const |
Definition at line 101 of file entity.cc.
Referenced by impeller::EntityPass::AddEntity(), impeller::AdvancedBlend(), impeller::OptionsFromPassAndEntity(), impeller::PipelineBlend(), impeller::SolidRRectBlurContents::Render(), and impeller::testing::TEST_P().
| Capture & impeller::Entity::GetCapture | ( | ) | const |
Definition at line 173 of file entity.cc.
Referenced by impeller::SolidColorContents::Render(), and impeller::TextureContents::Render().
| const std::shared_ptr< Contents > & impeller::Entity::GetContents | ( | ) | const |
Definition at line 81 of file entity.cc.
Referenced by impeller::EntityPass::AddEntity(), impeller::AdvancedBlend(), impeller::OpacityPeepholePassDelegate::CanCollapseIntoParentPass(), impeller::ContentsFilterInput::GetSnapshot(), impeller::PipelineBlend(), and impeller::testing::TEST_P().
| std::optional< Rect > impeller::Entity::GetCoverage | ( | ) | const |
| Contents::StencilCoverage impeller::Entity::GetStencilCoverage | ( | const std::optional< Rect > & | current_stencil_coverage | ) | const |
| uint32_t impeller::Entity::GetStencilDepth | ( | ) | const |
Definition at line 89 of file entity.cc.
Referenced by impeller::AdvancedBlend(), impeller::PipelineBlend(), impeller::RuntimeEffectContents::Render(), impeller::ClipContents::Render(), impeller::SolidRRectBlurContents::Render(), impeller::SolidColorContents::Render(), impeller::TextContents::Render(), impeller::TextureContents::Render(), impeller::VerticesColorContents::Render(), impeller::AtlasContents::Render(), impeller::ClipRestoreContents::Render(), impeller::VerticesUVContents::Render(), impeller::AtlasTextureContents::Render(), and impeller::AtlasColorContents::Render().
| const Matrix & impeller::Entity::GetTransformation | ( | ) | const |
Definition at line 49 of file entity.cc.
Referenced by impeller::SolidColorContents::AsBackgroundColor(), impeller::ComputeUVGeometryForRect(), DeriveTextScale(), impeller::SolidRRectBlurContents::GetCoverage(), impeller::VerticesContents::GetCoverage(), impeller::SolidColorContents::GetCoverage(), impeller::TextContents::GetCoverage(), impeller::TextureContents::GetCoverage(), impeller::AtlasContents::GetCoverage(), impeller::ColorSourceContents::GetCoverage(), impeller::AtlasTextureContents::GetCoverage(), impeller::FilterContents::GetCoverage(), impeller::AtlasColorContents::GetCoverage(), impeller::FilterContents::GetEntity(), impeller::FilterContentsFilterInput::GetLocalTransform(), impeller::VerticesGeometry::GetPositionBuffer(), impeller::VerticesGeometry::GetPositionColorBuffer(), impeller::VerticesGeometry::GetPositionUVBuffer(), impeller::ClipContents::GetStencilCoverage(), impeller::FilterContentsFilterInput::GetTransform(), impeller::FilterInput::GetTransform(), impeller::SceneContents::Render(), impeller::SolidRRectBlurContents::Render(), impeller::TextContents::Render(), impeller::TextureContents::Render(), impeller::AtlasContents::Render(), impeller::AtlasTextureContents::Render(), impeller::AtlasColorContents::Render(), impeller::TiledTextureContents::RenderToSnapshot(), impeller::TextureContents::RenderToSnapshot(), and impeller::testing::TEST_P().
| void impeller::Entity::IncrementStencilDepth | ( | uint32_t | increment | ) |
|
static |
Returns true if the blend mode is "destructive", meaning that even fully transparent source colors would result in the destination getting changed.
This is useful for determining if EntityPass textures can be shrinkwrapped to their Entities' coverage; they can be shrinkwrapped if all of the contained Entities have non-destructive blends.
Definition at line 138 of file entity.cc.
References impeller::kClear, impeller::kDestinationATop, impeller::kDestinationIn, impeller::kDestinationOut, impeller::kModulate, impeller::kSource, impeller::kSourceIn, impeller::kSourceOut, and impeller::kXor.
| bool impeller::Entity::Render | ( | const ContentContext & | renderer, |
| RenderPass & | parent_pass | ||
| ) | const |
Definition at line 155 of file entity.cc.
References impeller::RenderPass::GetRenderTargetSize(), and impeller::TRect< Scalar >::MakeSize().
Referenced by impeller::EntityPlayground::OpenPlaygroundHere(), impeller::PipelineBlend(), and impeller::testing::TEST_P().
| void impeller::Entity::SetBlendMode | ( | BlendMode | blend_mode | ) |
Definition at line 97 of file entity.cc.
Referenced by impeller::EntityPass::AddEntity(), 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(), FromSnapshot(), impeller::DlImageImpeller::MakeFromYUVTextures(), impeller::PipelineBlend(), and impeller::testing::TEST_P().
| void impeller::Entity::SetCapture | ( | Capture | capture | ) | const |
| void impeller::Entity::SetContents | ( | std::shared_ptr< Contents > | contents | ) |
Definition at line 77 of file entity.cc.
Referenced by impeller::testing::CreatePassWithRectPath(), 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(), FromSnapshot(), impeller::PipelineBlend(), and impeller::testing::TEST_P().
| bool impeller::Entity::SetInheritedOpacity | ( | Scalar | alpha | ) |
Definition at line 116 of file entity.cc.
References CanInheritOpacity(), impeller::kSource, and impeller::kSourceOver.
| void impeller::Entity::SetStencilDepth | ( | uint32_t | stencil_depth | ) |
Definition at line 85 of file entity.cc.
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 FromSnapshot().
| void impeller::Entity::SetTransformation | ( | const Matrix & | transformation | ) |
Definition at line 53 of file entity.cc.
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(), FromSnapshot(), impeller::FilterContents::GetCoverage(), impeller::EntityPass::GetElementsCoverage(), impeller::FilterContents::GetEntity(), impeller::FilterInput::GetLocalCoverage(), impeller::testing::TEST(), and impeller::testing::TEST_P().
| bool impeller::Entity::ShouldRender | ( | const std::optional< Rect > & | stencil_coverage | ) | const |
|
staticconstexpr |
Definition at line 24 of file entity.h.
Referenced by impeller::ColorFilterContents::MakeBlend(), and impeller::BlendFilterContents::SetBlendMode().
|
staticconstexpr |
Definition at line 23 of file entity.h.
Referenced by impeller::EntityPass::AddEntity(), impeller::EntityPass::AddSubpass(), impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ColorFilterContents::MakeBlend(), impeller::BlendFilterContents::SetBlendMode(), and impeller::testing::TEST_P().