#include <entity.h>
Public Member Functions | |
| Entity () | |
| ~Entity () | |
| Entity (Entity &&) | |
| Entity & | operator= (Entity &&) |
| const Matrix & | GetTransform () const |
| Get the global transform matrix for this Entity. More... | |
| Matrix | GetShaderTransform (const RenderPass &pass) const |
| Get the vertex shader transform used for drawing this Entity. More... | |
| void | SetTransform (const Matrix &transform) |
| Set the global transform matrix for this Entity. More... | |
| std::optional< Rect > | GetCoverage () const |
| Contents::ClipCoverage | GetClipCoverage (const std::optional< Rect > ¤t_clip_coverage) const |
| void | SetContents (std::shared_ptr< Contents > contents) |
| const std::shared_ptr< Contents > & | GetContents () const |
| void | SetClipDepth (uint32_t clip_depth) |
| uint32_t | GetClipDepth () const |
| float | GetShaderClipDepth () const |
| void | SetBlendMode (BlendMode blend_mode) |
| BlendMode | GetBlendMode () const |
| bool | Render (const ContentContext &renderer, RenderPass &parent_pass) const |
| bool | SetInheritedOpacity (Scalar alpha) |
| std::optional< Color > | AsBackgroundColor (ISize target_size) const |
| Entity | Clone () const |
Static Public Member Functions | |
| static Entity | FromSnapshot (const Snapshot &snapshot, BlendMode blend_mode=BlendMode::kSourceOver) |
| Create an entity that can be used to render a given snapshot. More... | |
| static Matrix | GetShaderTransform (Scalar clip_depth, const RenderPass &pass, const Matrix &transform) |
| Static utility that computes the vertex shader transform used for drawing an Entity with a given the clip depth and RenderPass size. More... | |
| static float | GetShaderClipDepth (uint32_t clip_depth) |
| 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 |
| static constexpr Scalar | kDepthEpsilon = 1.0f / 262144.0 |
|
strong |
|
strong |
| Enumerator | |
|---|---|
| kDirect | In direct mode, the Entity's transform is used as the current local-to-screen transform matrix. |
| kSubpassAppendSnapshotTransform | 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 transform matrix. |
| kSubpassPrependSnapshotTransform | |
Definition at line 27 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 42 of file entity.h.
|
default |
Referenced by Clone().
|
default |
|
default |
| Entity impeller::Entity::Clone | ( | ) | const |
Definition at line 170 of file entity.cc.
References Entity().
Referenced by impeller::ColorSourceContents::DrawGeometry(), impeller::FilterContents::GetCoverage(), impeller::FilterContents::GetEntity(), impeller::FilterInput::GetLocalCoverage(), and impeller::EntityPassClipStack::RecordEntity().
|
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(), impeller::Snapshot::opacity, impeller::Snapshot::sampler_descriptor, SetBlendMode(), SetContents(), SetTransform(), impeller::Snapshot::texture, and impeller::Snapshot::transform.
Referenced by impeller::AdvancedBlend(), and impeller::PipelineBlend().
| BlendMode impeller::Entity::GetBlendMode | ( | ) | const |
Definition at line 112 of file entity.cc.
Referenced by impeller::AdvancedBlend(), impeller::ColorSourceContents::DrawGeometry(), impeller::OptionsFromPassAndEntity(), impeller::PipelineBlend(), impeller::SolidRRectBlurContents::Render(), impeller::Canvas::Restore(), and impeller::testing::TEST_P().
| Contents::ClipCoverage impeller::Entity::GetClipCoverage | ( | const std::optional< Rect > & | current_clip_coverage | ) | const |
| uint32_t impeller::Entity::GetClipDepth | ( | ) | const |
Definition at line 95 of file entity.cc.
Referenced by impeller::EntityPassClipStack::GetNextReplayResult(), impeller::GetShaderClipDepth(), and impeller::FilterContents::Render().
| const std::shared_ptr< Contents > & impeller::Entity::GetContents | ( | ) | const |
Definition at line 87 of file entity.cc.
Referenced by impeller::AdvancedBlend(), impeller::EntityPassClipStack::ApplyClipState(), impeller::ContentsFilterInput::GetSnapshot(), impeller::PipelineBlend(), and impeller::Canvas::Restore().
| std::optional< Rect > impeller::Entity::GetCoverage | ( | ) | const |
Definition at line 67 of file entity.cc.
Referenced by impeller::Canvas::Restore(), and impeller::testing::TEST_P().
| Scalar impeller::Entity::GetShaderClipDepth | ( | ) | const |
Definition at line 99 of file entity.cc.
Referenced by impeller::ColorSourceContents::DrawGeometry(), impeller::GetShaderClipDepth(), GetShaderTransform(), impeller::SolidRRectBlurContents::Render(), and impeller::TextContents::Render().
|
static |
| Matrix impeller::Entity::GetShaderTransform | ( | const RenderPass & | pass | ) | const |
Get the vertex shader transform used for drawing this Entity.
Definition at line 51 of file entity.cc.
References GetShaderClipDepth().
Referenced by impeller::Geometry::ComputePositionGeometry(), impeller::RectGeometry::GetPositionBuffer(), impeller::DlVerticesGeometry::GetPositionBuffer(), impeller::DlVerticesGeometry::GetPositionUVColorBuffer(), impeller::SolidRRectBlurContents::Render(), impeller::AtlasContents::Render(), impeller::TextContents::Render(), and impeller::TextureContents::Render().
|
static |
Static utility that computes the vertex shader transform used for drawing an Entity with a given the clip depth and RenderPass size.
Definition at line 55 of file entity.cc.
References impeller::RenderPass::GetOrthographicTransform(), kDepthEpsilon, impeller::Matrix::MakeScale(), impeller::Matrix::MakeTranslation(), and transform.
| const Matrix & impeller::Entity::GetTransform | ( | ) | const |
Get the global transform matrix for this Entity.
Definition at line 47 of file entity.cc.
Referenced by impeller::SolidColorContents::AsBackgroundColor(), impeller::ClipContents::GetClipCoverage(), impeller::SolidColorContents::GetCoverage(), impeller::SolidRRectBlurContents::GetCoverage(), impeller::VerticesSimpleBlendContents::GetCoverage(), impeller::AtlasContents::GetCoverage(), impeller::TextureContents::GetCoverage(), impeller::TextContents::GetCoverage(), impeller::ColorSourceContents::GetCoverage(), impeller::FilterContents::GetCoverage(), impeller::FilterContents::GetEntity(), impeller::FilterContentsFilterInput::GetLocalTransform(), impeller::FilterContentsFilterInput::GetTransform(), impeller::FilterInput::GetTransform(), impeller::TiledTextureContents::Render(), impeller::ClipContents::Render(), impeller::SolidColorContents::Render(), impeller::SolidRRectBlurContents::Render(), impeller::TextContents::Render(), impeller::TextureContents::RenderToSnapshot(), impeller::Contents::RenderToSnapshot(), impeller::Canvas::Restore(), SetInheritedOpacity(), and impeller::testing::TEST_P().
|
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 139 of file entity.cc.
References impeller::kClear, impeller::kDestinationATop, impeller::kDestinationIn, impeller::kDestinationOut, impeller::kModulate, impeller::kSource, impeller::kSourceIn, impeller::kSourceOut, and impeller::kXor.
Referenced by impeller::Canvas::SaveLayer().
| bool impeller::Entity::Render | ( | const ContentContext & | renderer, |
| RenderPass & | parent_pass | ||
| ) | const |
Definition at line 156 of file entity.cc.
References impeller::RenderPass::GetRenderTargetSize(), and impeller::TRect< Scalar >::MakeSize().
Referenced by impeller::ColorSourceContents::DrawGeometry(), impeller::EntityPlayground::OpenPlaygroundHere(), impeller::PipelineBlend(), impeller::Canvas::Restore(), impeller::Canvas::SaveLayer(), and impeller::testing::TEST_P().
| void impeller::Entity::SetBlendMode | ( | BlendMode | blend_mode | ) |
Definition at line 108 of file entity.cc.
Referenced by impeller::Canvas::DrawAtlas(), impeller::Canvas::DrawCircle(), impeller::Canvas::DrawImageRect(), impeller::Canvas::DrawLine(), impeller::Canvas::DrawOval(), 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(), impeller::Contents::RenderToSnapshot(), impeller::Canvas::Restore(), and impeller::testing::TEST_P().
| void impeller::Entity::SetClipDepth | ( | uint32_t | clip_depth | ) |
Definition at line 91 of file entity.cc.
Referenced by impeller::Canvas::DrawTextFrame(), impeller::Canvas::Restore(), and impeller::Canvas::SaveLayer().
| void impeller::Entity::SetContents | ( | std::shared_ptr< Contents > | contents | ) |
Definition at line 83 of file entity.cc.
Referenced by impeller::Canvas::ClipGeometry(), impeller::Canvas::DrawAtlas(), impeller::Canvas::DrawImageRect(), impeller::Canvas::DrawTextFrame(), impeller::Canvas::DrawVertices(), FromSnapshot(), impeller::PipelineBlend(), impeller::Canvas::Restore(), impeller::Canvas::SaveLayer(), impeller::testing::TEST(), and impeller::testing::TEST_P().
| bool impeller::Entity::SetInheritedOpacity | ( | Scalar | alpha | ) |
Definition at line 116 of file entity.cc.
References GetTransform(), impeller::kSource, and impeller::kSourceOver.
| void impeller::Entity::SetTransform | ( | const Matrix & | transform | ) |
Set the global transform matrix for this Entity.
Definition at line 63 of file entity.cc.
References transform.
Referenced by impeller::Canvas::ClipGeometry(), impeller::Canvas::DrawAtlas(), impeller::Canvas::DrawCircle(), impeller::Canvas::DrawImageRect(), impeller::Canvas::DrawLine(), impeller::Canvas::DrawOval(), 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::FilterContents::GetEntity(), impeller::FilterInput::GetLocalCoverage(), impeller::Contents::RenderToSnapshot(), impeller::Canvas::Restore(), impeller::Canvas::SaveLayer(), impeller::testing::TEST(), and impeller::testing::TEST_P().
|
staticconstexpr |
Definition at line 25 of file entity.h.
Referenced by GetShaderClipDepth(), and GetShaderTransform().
|
staticconstexpr |
Definition at line 23 of file entity.h.
Referenced by impeller::testing::GetBlendModeSelection(), impeller::ColorFilterContents::MakeBlend(), and impeller::BlendFilterContents::SetBlendMode().
|
staticconstexpr |
Definition at line 22 of file entity.h.
Referenced by impeller::ContentContextOptions::ApplyToPipelineDescriptor(), impeller::ColorFilterContents::MakeBlend(), impeller::VerticesSimpleBlendContents::Render(), impeller::RequiresReadbackForBlends(), impeller::Canvas::Restore(), impeller::BlendFilterContents::SetBlendMode(), and impeller::testing::TEST_P().