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>
12 
13 namespace impeller {
14 
16  public:
18 
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 
54 
56  delete;
57 };
58 
59 } // namespace impeller
60 
61 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_FILTERS_BORDER_MASK_BLUR_FILTER_CONTENTS_H_
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...
@ kNormal
Blurred inside and outside.
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:33
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
Definition: sigma.h:32