Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
10
11namespace impeller {
12
14 public:
16
18
19 void SetMatrix(Matrix matrix);
20
21 // |FilterContents|
22 void SetRenderingMode(Entity::RenderingMode rendering_mode) override;
23
24 // |FilterContents|
25 bool IsTranslationOnly() const override;
26
28
29 // |FilterContents|
30 std::optional<Rect> GetFilterCoverage(
31 const FilterInput::Vector& inputs,
32 const Entity& entity,
33 const Matrix& effect_transform) const override;
34
35 private:
36 // |FilterContents|
37 std::optional<Entity> RenderFilter(
38 const FilterInput::Vector& input_textures,
39 const ContentContext& renderer,
40 const Entity& entity,
41 const Matrix& effect_transform,
42 const Rect& coverage,
43 const std::optional<Rect>& coverage_hint) const override;
44
45 // |FilterContents|
46 std::optional<Rect> GetFilterSourceCoverage(
47 const Matrix& effect_transform,
48 const Rect& output_limit) const override;
49
50 Matrix matrix_;
51 SamplerDescriptor sampler_descriptor_ = {};
53
55
56 MatrixFilterContents& operator=(const MatrixFilterContents&) = delete;
57};
58
59} // namespace impeller
60
61#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_MATRIX_FILTER_CONTENTS_H_
std::vector< FilterInput::Ref > Vector
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...
std::optional< Rect > GetFilterSourceCoverage(const Matrix &effect_transform, const Rect &output_limit) const override
Internal utility method for |GetSourceCoverage| that computes the inverse effect of this transform on...
void SetRenderingMode(Entity::RenderingMode rendering_mode) override
Marks this filter chain as applying in a subpass scenario.
std::optional< Entity > RenderFilter(const FilterInput::Vector &input_textures, const ContentContext &renderer, const Entity &entity, const Matrix &effect_transform, const Rect &coverage, const std::optional< Rect > &coverage_hint) const override
Converts zero or more filter inputs into a render instruction.
bool IsTranslationOnly() const override
Returns true if this filter graph doesn't perform any basis transforms to the filtered content....
void SetSamplerDescriptor(SamplerDescriptor desc)
A 4x4 matrix using column-major storage.
Definition matrix.h:37