Flutter Engine
The Flutter Engine
|
#include <entity.h>
Public Types | |
enum class | RenderingMode { kDirect , kSubpassAppendSnapshotTransform , kSubpassPrependSnapshotTransform } |
enum class | TileMode { kClamp , kRepeat , kMirror , kDecal } |
enum class | ClipOperation { kDifference , kIntersect } |
Public Member Functions | |
Entity () | |
~Entity () | |
Entity (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 |
bool | ShouldRender (const std::optional< Rect > &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 | CanInheritOpacity () const |
bool | SetInheritedOpacity (Scalar alpha) |
std::optional< Color > | AsBackgroundColor (ISize target_size) const |
Scalar | DeriveTextScale () 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 |
Enumerator | |
---|---|
kDifference | |
kIntersect |
|
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 |
|
default |
|
default |
bool impeller::Entity::CanInheritOpacity | ( | ) | const |
Definition at line 123 of file entity.cc.
Entity impeller::Entity::Clone | ( | ) | const |
Scalar impeller::Entity::DeriveTextScale | ( | ) | const |
Definition at line 187 of file entity.cc.
|
static |
Create an entity that can be used to render a given snapshot.
Definition at line 22 of file entity.cc.
BlendMode impeller::Entity::GetBlendMode | ( | ) | const |
Contents::ClipCoverage impeller::Entity::GetClipCoverage | ( | const std::optional< Rect > & | current_clip_coverage | ) | const |
uint32_t impeller::Entity::GetClipDepth | ( | ) | const |
const std::shared_ptr< Contents > & impeller::Entity::GetContents | ( | ) | const |
std::optional< Rect > impeller::Entity::GetCoverage | ( | ) | const |
Scalar impeller::Entity::GetShaderClipDepth | ( | ) | const |
|
static |
Matrix impeller::Entity::GetShaderTransform | ( | const RenderPass & | pass | ) | const |
Get the vertex shader transform used for drawing this Entity.
Definition at line 50 of file entity.cc.
|
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 54 of file entity.cc.
const Matrix & impeller::Entity::GetTransform | ( | ) | const |
|
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 156 of file entity.cc.
bool impeller::Entity::Render | ( | const ContentContext & | renderer, |
RenderPass & | parent_pass | ||
) | const |
Definition at line 173 of file entity.cc.
void impeller::Entity::SetBlendMode | ( | BlendMode | blend_mode | ) |
void impeller::Entity::SetClipDepth | ( | uint32_t | clip_depth | ) |
void impeller::Entity::SetContents | ( | std::shared_ptr< Contents > | contents | ) |
bool impeller::Entity::SetInheritedOpacity | ( | Scalar | alpha | ) |
Definition at line 134 of file entity.cc.
void impeller::Entity::SetTransform | ( | const Matrix & | transform | ) |
bool impeller::Entity::ShouldRender | ( | const std::optional< Rect > & | clip_coverage | ) | const |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |