| 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 #pragma once
6
7 #include "impeller/entity/contents/filters/filter_contents.h"
8 #include "impeller/entity/contents/filters/inputs/filter_input.h"
9
10 namespace impeller {
11
12 class MatrixFilterContents final : public FilterContents {
13 public:
14 MatrixFilterContents();
15
16 ~MatrixFilterContents() override;
17
18 void SetMatrix(Matrix matrix);
19
20 // |FilterContents|
21 void SetRenderingMode(Entity::RenderingMode rendering_mode) override;
22
23 // |FilterContents|
24 bool IsTranslationOnly() const override;
25
26 void SetSamplerDescriptor(SamplerDescriptor desc);
27
28 // |FilterContents|
29 std::optional<Rect> GetFilterCoverage(
30 const FilterInput::Vector& inputs,
31 const Entity& entity,
32 const Matrix& effect_transform) const override;
33
34 private:
35 // |FilterContents|
36 std::optional<Entity> RenderFilter(
37 const FilterInput::Vector& input_textures,
38 const ContentContext& renderer,
39 const Entity& entity,
40 const Matrix& effect_transform,
41 const Rect& coverage,
42 const std::optional<Rect>& coverage_hint) const override;
43
44 Matrix matrix_;
45 SamplerDescriptor sampler_descriptor_ = {};
46 Entity::RenderingMode rendering_mode_ = Entity::RenderingMode::kDirect;
47
48 FML_DISALLOW_COPY_AND_ASSIGN(MatrixFilterContents);
49 };
50
51 } // namespace impeller
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:12
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:18
impeller::Entity
Definition: entity.h:21
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:26
impeller::MatrixFilterContents::GetFilterCoverage
std::optional< Rect > GetFilterCoverage(const FilterInput::Vector &inputs, const Entity &entity, const Matrix &effect_transform) const override
Definition: matrix_filter_contents.cc:71
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:32
impeller::MatrixFilterContents::IsTranslationOnly
bool IsTranslationOnly() const override
Returns true if this filter graph doesn't perform any basis transformations to the filtered content....
Definition: matrix_filter_contents.cc:23
impeller
Definition: aiks_context.cc:10
impeller::MatrixFilterContents::SetSamplerDescriptor
void SetSamplerDescriptor(SamplerDescriptor desc)
Definition: matrix_filter_contents.cc:27
impeller::ContentContext
Definition: content_context.h:344
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:36
impeller::FilterContents
Definition: filter_contents.h:19