 |
Flutter Impeller
|
|
Go to the documentation of this file.
26 contents->SetTexture(snapshot.
texture);
28 contents->SetSourceRect(texture_rect);
29 contents->SetOpacity(snapshot.
opacity);
71 return contents_->GetCoverage(*
this);
75 const std::optional<Rect>& current_clip_coverage)
const {
79 return contents_->GetClipCoverage(*
this, current_clip_coverage);
83 #ifdef IMPELLER_CONTENT_CULLING
84 return contents_->ShouldRender(*
this, clip_coverage);
87 #endif // IMPELLER_CONTENT_CULLING
91 contents_ = std::move(contents);
99 clip_depth_ = clip_depth;
116 blend_mode_ = blend_mode;
131 return contents_->CanInheritOpacity(*
this);
141 contents_->SetInheritedOpacity(alpha);
146 return contents_->AsBackgroundColor(*
this, target_size);
157 switch (blend_mode) {
179 if (!contents_->GetCoverageHint().has_value()) {
180 contents_->SetCoverageHint(
184 return contents_->Render(renderer, *
this, parent_pass);
Matrix GetShaderTransform(const RenderPass &pass) const
Get the vertex shader transform used for drawing this Entity.
void SetClipDepth(uint32_t clip_depth)
float GetShaderClipDepth() const
void SetBlendMode(BlendMode blend_mode)
static constexpr Scalar kDepthEpsilon
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
static bool IsBlendModeDestructive(BlendMode blend_mode)
Returns true if the blend mode is "destructive", meaning that even fully transparent source colors wo...
static constexpr Matrix MakeTranslation(const Vector3 &t)
const Matrix & GetOrthographicTransform() const
SamplerDescriptor sampler_descriptor
void SetContents(std::shared_ptr< Contents > contents)
bool CanInheritOpacity() const
ISize GetRenderTargetSize() const
bool ShouldRender(const std::optional< Rect > &clip_coverage) const
bool Render(const ContentContext &renderer, RenderPass &parent_pass) const
bool SetInheritedOpacity(Scalar alpha)
Matrix transform
The transform that should be applied to this texture for rendering.
static Entity FromSnapshot(const Snapshot &snapshot, BlendMode blend_mode=BlendMode::kSourceOver)
Create an entity that can be used to render a given snapshot.
Represents a texture and its intended draw transform/sampler configuration.
const std::shared_ptr< Contents > & GetContents() const
BlendMode GetBlendMode() const
Render passes encode render commands directed as one specific render target into an underlying comman...
uint32_t GetClipDepth() const
std::optional< Color > AsBackgroundColor(ISize target_size) const
std::optional< Rect > GetCoverage() const
void SetTransform(const Matrix &transform)
Set the global transform matrix for this Entity.
constexpr Scalar GetMaxBasisLengthXY() const
constexpr static TRect MakeSize(const TSize< U > &size)
Contents::ClipCoverage GetClipCoverage(const std::optional< Rect > ¤t_clip_coverage) const
std::shared_ptr< Texture > texture
Scalar DeriveTextScale() const
static std::shared_ptr< TextureContents > MakeRect(Rect destination)
A common case factory that marks the texture contents as having a destination rectangle....
static constexpr Matrix MakeScale(const Vector3 &s)
A 4x4 matrix using column-major storage.