| Flutter Impeller |

border_mask_blur_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_BORDER_MASK_BLUR_FILTER_CONTENTS_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BORDER_MASK_BLUR_FILTER_CONTENTS_H_
7
8 #include <memory>
9 #include <optional>
10 #include "impeller/entity/contents/filters/filter_contents.h"
11 #include "impeller/entity/contents/filters/inputs/filter_input.h"
12
13 namespace impeller {
14
15 class BorderMaskBlurFilterContents final : public FilterContents {
16 public:
17 BorderMaskBlurFilterContents();
18
19 ~BorderMaskBlurFilterContents() override;
20
21 void SetSigma(Sigma sigma_x, Sigma sigma_y);
22
23 void SetBlurStyle(BlurStyle blur_style);
24
25 // |FilterContents|
26 std::optional<Rect> GetFilterCoverage(
27 const FilterInput::Vector& inputs,
28 const Entity& entity,
29 const Matrix& effect_transform) const override;
30
31 // |FilterContents|
32 std::optional<Rect> GetFilterSourceCoverage(
33 const Matrix& effect_transform,
34 const Rect& output_limit) const override;
35
36 private:
37 // |FilterContents|
38 std::optional<Entity> RenderFilter(
39 const FilterInput::Vector& input_textures,
40 const ContentContext& renderer,
41 const Entity& entity,
42 const Matrix& effect_transform,
43 const Rect& coverage,
44 const std::optional<Rect>& coverage_hint) const override;
45
46 Sigma sigma_x_;
47 Sigma sigma_y_;
48 BlurStyle blur_style_ = BlurStyle::kNormal;
49 bool src_color_factor_ = false;
50 bool inner_blur_factor_ = true;
51 bool outer_blur_factor_ = true;
52
53 BorderMaskBlurFilterContents(const BorderMaskBlurFilterContents&) = delete;
54
55 BorderMaskBlurFilterContents& operator=(const BorderMaskBlurFilterContents&) =
56 delete;
57 };
58
59 } // namespace impeller
60
61 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BORDER_MASK_BLUR_FILTER_CONTENTS_H_
impeller::BorderMaskBlurFilterContents
Definition: border_mask_blur_filter_contents.h:15
impeller::BorderMaskBlurFilterContents::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: border_mask_blur_filter_contents.cc:145
impeller::BorderMaskBlurFilterContents::SetBlurStyle
void SetBlurStyle(BlurStyle blur_style)
Definition: border_mask_blur_filter_contents.cc:24
impeller::BorderMaskBlurFilterContents::BorderMaskBlurFilterContents
BorderMaskBlurFilterContents()
impeller::BorderMaskBlurFilterContents::GetFilterSourceCoverage
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...
Definition: border_mask_blur_filter_contents.cc:164
impeller::BorderMaskBlurFilterContents::SetSigma
void SetSigma(Sigma sigma_x, Sigma sigma_y)
Definition: border_mask_blur_filter_contents.cc:19
impeller::BorderMaskBlurFilterContents::~BorderMaskBlurFilterContents
~BorderMaskBlurFilterContents() override
impeller::ContentContext
Definition: content_context.h:138
impeller::Entity
Definition: entity.h:20
impeller::FilterContents
Definition: filter_contents.h:24
impeller::FilterContents::BlurStyle
BlurStyle
Definition: filter_contents.h:28
impeller::FilterContents::BlurStyle::kNormal
@ kNormal
Blurred inside and outside.
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:33
filter_contents.h
filter_input.h
impeller
Definition: allocation.cc:12
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::Sigma
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
Definition: sigma.h:32
impeller::TRect< Scalar >