 |
Flutter Impeller
|
|
Go to the documentation of this file.
40 bool is_second_pass =
false,
41 Sigma secondary_sigma = {});
70 const SamplerDescriptor& desc);
74 const Matrix& matrix);
77 std::shared_ptr<Texture> y_texture,
78 std::shared_ptr<Texture> uv_texture,
102 const ContentContext& renderer,
103 const Entity& entity,
104 const std::optional<Rect>& coverage_hint)
const;
107 bool Render(
const ContentContext& renderer,
108 const Entity& entity,
109 RenderPass& pass)
const override;
112 std::optional<Rect>
GetCoverage(
const Entity& entity)
const override;
116 const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
121 const ContentContext& renderer,
122 const Entity& entity,
123 std::optional<Rect> coverage_limit = std::nullopt,
124 const std::optional<SamplerDescriptor>& sampler_descriptor = std::nullopt,
125 bool msaa_enabled =
true,
126 const std::string& label =
"Filter Snapshot")
const override;
133 Matrix
GetTransform(
const Matrix& parent_transform)
const;
163 virtual std::optional<Rect> GetFilterCoverage(
165 const Entity& entity,
166 const Matrix& effect_transform)
const;
169 virtual std::optional<Entity> RenderFilter(
171 const ContentContext& renderer,
172 const Entity& entity,
173 const Matrix& effect_transform,
174 const Rect& coverage,
175 const std::optional<Rect>& coverage_hint)
const = 0;
177 std::optional<Rect> GetLocalCoverage(
const Entity& local_entity)
const;
180 Matrix effect_transform_;
void PopulateGlyphAtlas(const std::shared_ptr< LazyGlyphAtlas > &lazy_glyph_atlas, Scalar scale) override
Add any text data to the specified lazy atlas. The scale parameter must be used again later when draw...
bool IsLeaf() const
Returns true if this filter does not have any FilterInput children.
void SetInputs(FilterInput::Vector inputs)
The input texture sources for this filter. Each input's emitted texture is expected to have premultip...
void SetEffectTransform(const Matrix &effect_transform)
Sets the transform which gets appended to the effect of this filter. Note that this is in addition to...
Matrix GetTransform(const Matrix &parent_transform) const
std::optional< Snapshot > RenderToSnapshot(const ContentContext &renderer, const Entity &entity, std::optional< Rect > coverage_limit=std::nullopt, const std::optional< SamplerDescriptor > &sampler_descriptor=std::nullopt, bool msaa_enabled=true, const std::string &label="Filter Snapshot") const override
Render this contents to a snapshot, respecting the entity's transform, path, stencil depth,...
static std::shared_ptr< FilterContents > MakeDirectionalGaussianBlur(FilterInput::Ref input, Sigma sigma, Vector2 direction, BlurStyle blur_style=BlurStyle::kNormal, Entity::TileMode tile_mode=Entity::TileMode::kDecal, bool is_second_pass=false, Sigma secondary_sigma={})
@ kNormal
Blurred inside and outside.
static std::shared_ptr< FilterContents > MakeGaussianBlur(const FilterInput::Ref &input, Sigma sigma_x, Sigma sigma_y, BlurStyle blur_style=BlurStyle::kNormal, Entity::TileMode tile_mode=Entity::TileMode::kDecal)
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
@ kSolid
Solid inside, blurred outside.
virtual bool IsTranslationOnly() const
Returns true if this filter graph doesn't perform any basis transformations to the filtered content....
static std::shared_ptr< FilterContents > MakeDirectionalMorphology(FilterInput::Ref input, Radius radius, Vector2 direction, MorphType morph_type)
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
static std::shared_ptr< FilterContents > MakeBorderMaskBlur(FilterInput::Ref input, Sigma sigma_x, Sigma sigma_y, BlurStyle blur_style=BlurStyle::kNormal)
@ kInner
Blurred inside, nothing outside.
static std::shared_ptr< FilterContents > MakeYUVToRGBFilter(std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)
@ kOuter
Nothing inside, blurred outside.
static std::shared_ptr< FilterContents > MakeMorphology(FilterInput::Ref input, Radius radius_x, Radius radius_y, MorphType morph_type)
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the screen space bounding rectangle that this contents affects.
std::optional< Entity > GetEntity(const ContentContext &renderer, const Entity &entity, const std::optional< Rect > &coverage_hint) const
Create an Entity that renders this filter's output.
void SetLeafInputs(const FilterInput::Vector &inputs)
Replaces the set of all leaf FilterContents with a new set of FilterInputs.
static std::shared_ptr< FilterContents > MakeMatrixFilter(FilterInput::Ref input, const Matrix &matrix, const SamplerDescriptor &desc)
virtual Matrix GetLocalTransform(const Matrix &parent_transform) const
virtual void SetRenderingMode(Entity::RenderingMode rendering_mode)
Marks this filter chain as applying in a subpass scenario.
static std::shared_ptr< FilterContents > MakeLocalMatrixFilter(FilterInput::Ref input, const Matrix &matrix)
~FilterContents() override
const FilterContents * AsFilter() const override
Cast to a filter. Returns nullptr if this Contents is not a filter.