Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
impeller::FilterContentsFilterInput Class Referencefinal

#include <filter_contents_filter_input.h>

Inheritance diagram for impeller::FilterContentsFilterInput:
impeller::FilterInput

Public Member Functions

 ~FilterContentsFilterInput () override
 
Variant GetInput () const override
 
std::optional< SnapshotGetSnapshot (const std::string &label, const ContentContext &renderer, const Entity &entity, std::optional< Rect > coverage_limit, int32_t mip_count) const override
 
std::optional< RectGetCoverage (const Entity &entity) const override
 
std::optional< RectGetSourceCoverage (const Matrix &effect_transform, const Rect &output_limit) const override
 
Matrix GetLocalTransform (const Entity &entity) const override
 Get the local transform of this filter input. This transform is relative to the Entity transform space. More...
 
Matrix GetTransform (const Entity &entity) const override
 Get the transform of this FilterInput. This is equivalent to calling entity.GetTransform() * GetLocalTransform(). More...
 
void PopulateGlyphAtlas (const std::shared_ptr< LazyGlyphAtlas > &lazy_glyph_atlas, Scalar scale) override
 
bool IsTranslationOnly () const override
 
bool IsLeaf () const override
 Returns true unless this input is a FilterInput, which may take other inputs. More...
 
void SetLeafInputs (const FilterInput::Vector &inputs) override
 Replaces the inputs of all leaf FilterContents with a new set of inputs. More...
 
virtual void SetEffectTransform (const Matrix &matrix) override
 Sets the effect transform of filter inputs. More...
 
virtual void SetRenderingMode (Entity::RenderingMode rendering_mode) override
 Turns on subpass mode for filter inputs. More...
 
- Public Member Functions inherited from impeller::FilterInput
virtual ~FilterInput ()
 
virtual Variant GetInput () const =0
 
virtual std::optional< SnapshotGetSnapshot (const std::string &label, const ContentContext &renderer, const Entity &entity, std::optional< Rect > coverage_limit=std::nullopt, int32_t mip_count=1) const =0
 
std::optional< RectGetLocalCoverage (const Entity &entity) const
 
virtual std::optional< RectGetCoverage (const Entity &entity) const =0
 
virtual std::optional< RectGetSourceCoverage (const Matrix &effect_transform, const Rect &output_limit) const
 
virtual Matrix GetLocalTransform (const Entity &entity) const
 Get the local transform of this filter input. This transform is relative to the Entity transform space. More...
 
virtual Matrix GetTransform (const Entity &entity) const
 Get the transform of this FilterInput. This is equivalent to calling entity.GetTransform() * GetLocalTransform(). More...
 
virtual void PopulateGlyphAtlas (const std::shared_ptr< LazyGlyphAtlas > &lazy_glyph_atlas, Scalar scale)
 
virtual bool IsTranslationOnly () const
 
virtual bool IsLeaf () const
 Returns true unless this input is a FilterInput, which may take other inputs. More...
 
virtual void SetLeafInputs (const FilterInput::Vector &inputs)
 Replaces the inputs of all leaf FilterContents with a new set of inputs. More...
 
virtual void SetEffectTransform (const Matrix &matrix)
 Sets the effect transform of filter inputs. More...
 
virtual void SetRenderingMode (Entity::RenderingMode rendering_mode)
 Turns on subpass mode for filter inputs. More...
 

Additional Inherited Members

- Public Types inherited from impeller::FilterInput
using Ref = std::shared_ptr< FilterInput >
 
using Vector = std::vector< FilterInput::Ref >
 
using Variant = std::variant< std::shared_ptr< FilterContents >, std::shared_ptr< Contents >, std::shared_ptr< Texture >, Rect >
 
- Static Public Member Functions inherited from impeller::FilterInput
static FilterInput::Ref Make (Variant input, bool msaa_enabled=true)
 
static FilterInput::Ref Make (std::shared_ptr< Texture > input, Matrix local_transform)
 
static FilterInput::Vector Make (std::initializer_list< Variant > inputs)
 

Detailed Description

Definition at line 12 of file filter_contents_filter_input.h.

Constructor & Destructor Documentation

◆ ~FilterContentsFilterInput()

impeller::FilterContentsFilterInput::~FilterContentsFilterInput ( )
overridedefault

Member Function Documentation

◆ GetCoverage()

std::optional< Rect > impeller::FilterContentsFilterInput::GetCoverage ( const Entity entity) const
overridevirtual

Implements impeller::FilterInput.

Definition at line 43 of file filter_contents_filter_input.cc.

44 {
45 return filter_->GetCoverage(entity);
46}

◆ GetInput()

FilterInput::Variant impeller::FilterContentsFilterInput::GetInput ( ) const
overridevirtual

Implements impeller::FilterInput.

Definition at line 20 of file filter_contents_filter_input.cc.

20 {
21 return filter_;
22}

◆ GetLocalTransform()

Matrix impeller::FilterContentsFilterInput::GetLocalTransform ( const Entity entity) const
overridevirtual

Get the local transform of this filter input. This transform is relative to the Entity transform space.

Reimplemented from impeller::FilterInput.

Definition at line 54 of file filter_contents_filter_input.cc.

55 {
56 return filter_->GetLocalTransform(entity.GetTransform());
57}

◆ GetSnapshot()

std::optional< Snapshot > impeller::FilterContentsFilterInput::GetSnapshot ( const std::string &  label,
const ContentContext renderer,
const Entity entity,
std::optional< Rect coverage_limit,
int32_t  mip_count 
) const
overridevirtual

Implements impeller::FilterInput.

Definition at line 24 of file filter_contents_filter_input.cc.

29 {
30 if (!snapshot_.has_value()) {
31 snapshot_ = filter_->RenderToSnapshot(
32 renderer, // renderer
33 entity, // entity
34 coverage_limit, // coverage_limit
35 std::nullopt, // sampler_descriptor
36 true, // msaa_enabled
37 /*mip_count=*/mip_count,
38 SPrintF("Filter to %s Filter Snapshot", label.c_str())); // label
39 }
40 return snapshot_;
41}
std::string SPrintF(const char *format,...)
Definition: strings.cc:12

◆ GetSourceCoverage()

std::optional< Rect > impeller::FilterContentsFilterInput::GetSourceCoverage ( const Matrix effect_transform,
const Rect output_limit 
) const
overridevirtual

Reimplemented from impeller::FilterInput.

Definition at line 48 of file filter_contents_filter_input.cc.

50 {
51 return filter_->GetSourceCoverage(effect_transform, output_limit);
52}

◆ GetTransform()

Matrix impeller::FilterContentsFilterInput::GetTransform ( const Entity entity) const
overridevirtual

Get the transform of this FilterInput. This is equivalent to calling entity.GetTransform() * GetLocalTransform().

Reimplemented from impeller::FilterInput.

Definition at line 59 of file filter_contents_filter_input.cc.

59 {
60 return filter_->GetTransform(entity.GetTransform());
61}

◆ IsLeaf()

bool impeller::FilterContentsFilterInput::IsLeaf ( ) const
overridevirtual

Returns true unless this input is a FilterInput, which may take other inputs.

Reimplemented from impeller::FilterInput.

Definition at line 73 of file filter_contents_filter_input.cc.

73 {
74 return false;
75}

◆ IsTranslationOnly()

bool impeller::FilterContentsFilterInput::IsTranslationOnly ( ) const
overridevirtual
See also
FilterContents::HasBasisTransforms

Reimplemented from impeller::FilterInput.

Definition at line 69 of file filter_contents_filter_input.cc.

69 {
70 return filter_->IsTranslationOnly();
71}

◆ PopulateGlyphAtlas()

void impeller::FilterContentsFilterInput::PopulateGlyphAtlas ( const std::shared_ptr< LazyGlyphAtlas > &  lazy_glyph_atlas,
Scalar  scale 
)
overridevirtual
See also
Contents::PopulateGlyphAtlas

Reimplemented from impeller::FilterInput.

Definition at line 63 of file filter_contents_filter_input.cc.

65 {
66 filter_->PopulateGlyphAtlas(lazy_glyph_atlas, scale);
67}
const Scalar scale

◆ SetEffectTransform()

void impeller::FilterContentsFilterInput::SetEffectTransform ( const Matrix matrix)
overridevirtual

Sets the effect transform of filter inputs.

Reimplemented from impeller::FilterInput.

Definition at line 82 of file filter_contents_filter_input.cc.

82 {
83 filter_->SetEffectTransform(matrix);
84}
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ SetLeafInputs()

void impeller::FilterContentsFilterInput::SetLeafInputs ( const FilterInput::Vector inputs)
overridevirtual

Replaces the inputs of all leaf FilterContents with a new set of inputs.

See also
FilterInput::IsLeaf

Reimplemented from impeller::FilterInput.

Definition at line 77 of file filter_contents_filter_input.cc.

78 {
79 filter_->SetLeafInputs(inputs);
80}

◆ SetRenderingMode()

void impeller::FilterContentsFilterInput::SetRenderingMode ( Entity::RenderingMode  rendering_mode)
overridevirtual

Turns on subpass mode for filter inputs.

Reimplemented from impeller::FilterInput.

Definition at line 86 of file filter_contents_filter_input.cc.

87 {
88 filter_->SetRenderingMode(rendering_mode);
89}

The documentation for this class was generated from the following files: