 |
Flutter Impeller
|
|
Go to the documentation of this file.
24 uint32_t clip_depth) {
28 contents->SetTexture(snapshot.
texture);
30 contents->SetSourceRect(texture_rect);
31 contents->SetOpacity(snapshot.
opacity);
66 transform_ = transform;
74 return contents_->GetCoverage(*
this);
78 const std::optional<Rect>& current_clip_coverage)
const {
82 return contents_->GetClipCoverage(*
this, current_clip_coverage);
86 #ifdef IMPELLER_CONTENT_CULLING
87 return contents_->ShouldRender(*
this, clip_coverage);
90 #endif // IMPELLER_CONTENT_CULLING
94 contents_ = std::move(contents);
102 clip_depth_ = clip_depth;
110 new_clip_depth_ = clip_depth;
114 return new_clip_depth_;
127 clip_depth_ += increment;
131 blend_mode_ = blend_mode;
146 return contents_->CanInheritOpacity(*
this);
156 contents_->SetInheritedOpacity(alpha);
161 return contents_->AsBackgroundColor(*
this, target_size);
172 switch (blend_mode) {
194 if (!contents_->GetCoverageHint().has_value()) {
195 contents_->SetCoverageHint(
199 return contents_->Render(renderer, *
this, parent_pass);
215 capture_ = std::move(capture);
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
uint32_t GetNewClipDepth() const
void SetBlendMode(BlendMode blend_mode)
static constexpr Scalar kDepthEpsilon
Capture & GetCapture() const
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...
void IncrementStencilDepth(uint32_t increment)
static Entity FromSnapshot(const Snapshot &snapshot, BlendMode blend_mode=BlendMode::kSourceOver, uint32_t clip_depth=0)
Create an entity that can be used to render a given snapshot.
static constexpr Matrix MakeTranslation(const Vector3 &t)
const Matrix & GetOrthographicTransform() const
void SetCapture(Capture capture) 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.
Represents a texture and its intended draw transform/sampler configuration.
const std::shared_ptr< Contents > & GetContents() const
BlendMode GetBlendMode() const
void SetNewClipDepth(uint32_t clip_depth)
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.