| Flutter Impeller |

filter_contents_filter_input.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_CONTENTS_FILTER_INPUT_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_CONTENTS_FILTER_INPUT_H_
7
8 #include "impeller/entity/contents/filters/inputs/filter_input.h"
9
10 namespace impeller {
11
12 class FilterContentsFilterInput final : public FilterInput {
13 public:
14 ~FilterContentsFilterInput() override;
15
16 // |FilterInput|
17 Variant GetInput() const override;
18
19 // |FilterInput|
20 std::optional<Snapshot> GetSnapshot(const std::string& label,
21 const ContentContext& renderer,
22 const Entity& entity,
23 std::optional<Rect> coverage_limit,
24 int32_t mip_count) const override;
25
26 // |FilterInput|
27 std::optional<Rect> GetCoverage(const Entity& entity) const override;
28
29 // |FilterInput|
30 std::optional<Rect> GetSourceCoverage(
31 const Matrix& effect_transform,
32 const Rect& output_limit) const override;
33
34 // |FilterInput|
35 Matrix GetLocalTransform(const Entity& entity) const override;
36
37 // |FilterInput|
38 Matrix GetTransform(const Entity& entity) const override;
39
40 // |FilterInput|
41 void PopulateGlyphAtlas(
42 const std::shared_ptr<LazyGlyphAtlas>& lazy_glyph_atlas,
43 Scalar scale) override;
44
45 // |FilterInput|
46 bool IsTranslationOnly() const override;
47
48 // |FilterInput|
49 bool IsLeaf() const override;
50
51 // |FilterInput|
52 void SetLeafInputs(const FilterInput::Vector& inputs) override;
53
54 // |FilterInput|
55 virtual void SetEffectTransform(const Matrix& matrix) override;
56
57 // |FilterInput|
58 virtual void SetRenderingMode(Entity::RenderingMode rendering_mode) override;
59
60 private:
61 explicit FilterContentsFilterInput(std::shared_ptr<FilterContents> filter);
62
63 std::shared_ptr<FilterContents> filter_;
64 mutable std::optional<Snapshot> snapshot_;
65
66 friend FilterInput;
67 };
68
69 } // namespace impeller
70
71 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_INPUTS_FILTER_CONTENTS_FILTER_INPUT_H_
impeller::FilterContentsFilterInput::IsLeaf
bool IsLeaf() const override
Returns true unless this input is a FilterInput, which may take other inputs.
Definition: filter_contents_filter_input.cc:73
impeller::FilterContentsFilterInput
Definition: filter_contents_filter_input.h:12
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::FilterContentsFilterInput::GetSourceCoverage
std::optional< Rect > GetSourceCoverage(const Matrix &effect_transform, const Rect &output_limit) const override
Definition: filter_contents_filter_input.cc:48
impeller::FilterContentsFilterInput::GetSnapshot
std::optional< Snapshot > GetSnapshot(const std::string &label, const ContentContext &renderer, const Entity &entity, std::optional< Rect > coverage_limit, int32_t mip_count) const override
Definition: filter_contents_filter_input.cc:24
impeller::FilterContentsFilterInput::SetRenderingMode
virtual void SetRenderingMode(Entity::RenderingMode rendering_mode) override
Turns on subpass mode for filter inputs.
Definition: filter_contents_filter_input.cc:86
impeller::FilterContentsFilterInput::GetTransform
Matrix GetTransform(const Entity &entity) const override
Get the transform of this FilterInput. This is equivalent to calling entity.GetTransform() * GetLocal...
Definition: filter_contents_filter_input.cc:59
impeller::FilterContentsFilterInput::GetInput
Variant GetInput() const override
Definition: filter_contents_filter_input.cc:20
impeller::Entity
Definition: entity.h:20
impeller::FilterContentsFilterInput::GetLocalTransform
Matrix GetLocalTransform(const Entity &entity) const override
Get the local transform of this filter input. This transform is relative to the Entity transform spac...
Definition: filter_contents_filter_input.cc:54
impeller::FilterContentsFilterInput::SetEffectTransform
virtual void SetEffectTransform(const Matrix &matrix) override
Sets the effect transform of filter inputs.
Definition: filter_contents_filter_input.cc:82
impeller::FilterContentsFilterInput::IsTranslationOnly
bool IsTranslationOnly() const override
Definition: filter_contents_filter_input.cc:69
impeller::FilterInput
Definition: filter_input.h:30
impeller::FilterInput::Variant
std::variant< std::shared_ptr< FilterContents >, std::shared_ptr< Contents >, std::shared_ptr< Texture >, Rect > Variant
Definition: filter_input.h:37
filter_input.h
impeller::FilterContentsFilterInput::PopulateGlyphAtlas
void PopulateGlyphAtlas(const std::shared_ptr< LazyGlyphAtlas > &lazy_glyph_atlas, Scalar scale) override
Definition: filter_contents_filter_input.cc:63
impeller::FilterContentsFilterInput::GetCoverage
std::optional< Rect > GetCoverage(const Entity &entity) const override
Definition: filter_contents_filter_input.cc:43
scale
const Scalar scale
Definition: stroke_path_geometry.cc:308
impeller::Entity::RenderingMode
RenderingMode
Definition: entity.h:27
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:33
impeller
Definition: aiks_blend_unittests.cc:18
impeller::FilterContentsFilterInput::~FilterContentsFilterInput
~FilterContentsFilterInput() override
impeller::ContentContext
Definition: content_context.h:366
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::FilterContentsFilterInput::SetLeafInputs
void SetLeafInputs(const FilterInput::Vector &inputs) override
Replaces the inputs of all leaf FilterContents with a new set of inputs.
Definition: filter_contents_filter_input.cc:77