| Flutter Impeller |

matrix_filter_contents.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_MATRIX_FILTER_CONTENTS_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MATRIX_FILTER_CONTENTS_H_
7
8 #include "impeller/entity/contents/filters/filter_contents.h"
9 #include "impeller/entity/contents/filters/inputs/filter_input.h"
10
11 namespace impeller {
12
13 class MatrixFilterContents final : public FilterContents {
14 public:
15 MatrixFilterContents();
16
17 ~MatrixFilterContents() override;
18
19 void SetMatrix(Matrix matrix);
20
21 // |FilterContents|
22 void SetRenderingMode(Entity::RenderingMode rendering_mode) override;
23
24 void SetSamplerDescriptor(const SamplerDescriptor& desc);
25
26 // |FilterContents|
27 std::optional<Rect> GetFilterCoverage(
28 const FilterInput::Vector& inputs,
29 const Entity& entity,
30 const Matrix& effect_transform) const override;
31
32 private:
33 // |FilterContents|
34 std::optional<Entity> RenderFilter(
35 const FilterInput::Vector& input_textures,
36 const ContentContext& renderer,
37 const Entity& entity,
38 const Matrix& effect_transform,
39 const Rect& coverage,
40 const std::optional<Rect>& coverage_hint) const override;
41
42 // |FilterContents|
43 std::optional<Rect> GetFilterSourceCoverage(
44 const Matrix& effect_transform,
45 const Rect& output_limit) const override;
46
47 Matrix matrix_;
48 SamplerDescriptor sampler_descriptor_ = {};
49 Entity::RenderingMode rendering_mode_ = Entity::RenderingMode::kDirect;
50
51 MatrixFilterContents(const MatrixFilterContents&) = delete;
52
53 MatrixFilterContents& operator=(const MatrixFilterContents&) = delete;
54 };
55
56 } // namespace impeller
57
58 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MATRIX_FILTER_CONTENTS_H_
impeller::MatrixFilterContents::SetRenderingMode
void SetRenderingMode(Entity::RenderingMode rendering_mode) override
Marks this filter chain as applying in a subpass scenario.
Definition: matrix_filter_contents.cc:17
impeller::MatrixFilterContents::SetMatrix
void SetMatrix(Matrix matrix)
Definition: matrix_filter_contents.cc:13
impeller::MatrixFilterContents
Definition: matrix_filter_contents.h:13
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:14
impeller::Entity
Definition: entity.h:20
impeller::MatrixFilterContents::~MatrixFilterContents
~MatrixFilterContents() override
filter_contents.h
impeller::Entity::RenderingMode::kDirect
@ kDirect
filter_input.h
impeller::MatrixFilterContents::MatrixFilterContents
MatrixFilterContents()
impeller::Entity::RenderingMode
RenderingMode
Definition: entity.h:27
impeller::MatrixFilterContents::GetFilterCoverage
std::optional< Rect > GetFilterCoverage(const FilterInput::Vector &inputs, const Entity &entity, const Matrix &effect_transform) const override
Internal utility method for |GetLocalCoverage| that computes the output coverage of this filter acros...
Definition: matrix_filter_contents.cc:120
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:33
impeller::MatrixFilterContents::SetSamplerDescriptor
void SetSamplerDescriptor(const SamplerDescriptor &desc)
Definition: matrix_filter_contents.cc:23
impeller
Definition: allocation.cc:12
impeller::ContentContext
Definition: content_context.h:371
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::FilterContents
Definition: filter_contents.h:24