| 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 bool IsTranslationOnly() const override;
42
43 // |FilterInput|
44 bool IsLeaf() const override;
45
46 // |FilterInput|
47 void SetLeafInputs(const FilterInput::Vector& inputs) override;
48
49 // |FilterInput|
50 virtual void SetEffectTransform(const Matrix& matrix) override;
51
52 // |FilterInput|
53 virtual void SetRenderingMode(Entity::RenderingMode rendering_mode) override;
54
55 private:
56 explicit FilterContentsFilterInput(std::shared_ptr<FilterContents> filter);
57
58 std::shared_ptr<FilterContents> filter_;
59 mutable std::optional<Snapshot> snapshot_;
60
61 friend FilterInput;
62 };
63
64 } // namespace impeller
65
66 #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:67
impeller::FilterContentsFilterInput
Definition: filter_contents_filter_input.h:12
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:80
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:76
impeller::FilterContentsFilterInput::IsTranslationOnly
bool IsTranslationOnly() const override
Definition: filter_contents_filter_input.cc:63
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::GetCoverage
std::optional< Rect > GetCoverage(const Entity &entity) const override
Definition: filter_contents_filter_input.cc:43
impeller::Entity::RenderingMode
RenderingMode
Definition: entity.h:27
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:33
impeller
Definition: allocation.cc:12
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:71