Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
9
10namespace impeller {
11
13 public:
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|
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_
virtual void SetRenderingMode(Entity::RenderingMode rendering_mode) override
Turns on subpass mode for filter inputs.
void PopulateGlyphAtlas(const std::shared_ptr< LazyGlyphAtlas > &lazy_glyph_atlas, Scalar scale) override
Matrix GetLocalTransform(const Entity &entity) const override
Get the local transform of this filter input. This transform is relative to the Entity transform spac...
void SetLeafInputs(const FilterInput::Vector &inputs) override
Replaces the inputs of all leaf FilterContents with a new set of inputs.
Matrix GetTransform(const Entity &entity) const override
Get the transform of this FilterInput. This is equivalent to calling entity.GetTransform() * GetLocal...
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
std::optional< Rect > GetSourceCoverage(const Matrix &effect_transform, const Rect &output_limit) const override
bool IsLeaf() const override
Returns true unless this input is a FilterInput, which may take other inputs.
virtual void SetEffectTransform(const Matrix &matrix) override
Sets the effect transform of filter inputs.
std::optional< Rect > GetCoverage(const Entity &entity) const override
std::variant< std::shared_ptr< FilterContents >, std::shared_ptr< Contents >, std::shared_ptr< Texture >, Rect > Variant
std::vector< FilterInput::Ref > Vector
float Scalar
Definition scalar.h:18
const Scalar scale
A 4x4 matrix using column-major storage.
Definition matrix.h:37