| 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 #pragma once
6
7 #include <memory>
8 #include <optional>
9 #include "impeller/entity/contents/filters/filter_contents.h"
10 #include "impeller/entity/contents/filters/inputs/filter_input.h"
11
12 namespace impeller {
13
14 class BorderMaskBlurFilterContents final : public FilterContents {
15 public:
16 BorderMaskBlurFilterContents();
17
18 ~BorderMaskBlurFilterContents() override;
19
20 void SetSigma(Sigma sigma_x, Sigma sigma_y);
21
22 void SetBlurStyle(BlurStyle blur_style);
23
24 // |FilterContents|
25 std::optional<Rect> GetFilterCoverage(
26 const FilterInput::Vector& inputs,
27 const Entity& entity,
28 const Matrix& effect_transform) const override;
29
30 private:
31 // |FilterContents|
32 std::optional<Entity> RenderFilter(
33 const FilterInput::Vector& input_textures,
34 const ContentContext& renderer,
35 const Entity& entity,
36 const Matrix& effect_transform,
37 const Rect& coverage,
38 const std::optional<Rect>& coverage_hint) const override;
39
40 Sigma sigma_x_;
41 Sigma sigma_y_;
42 BlurStyle blur_style_ = BlurStyle::kNormal;
43 bool src_color_factor_ = false;
44 bool inner_blur_factor_ = true;
45 bool outer_blur_factor_ = true;
46
47 FML_DISALLOW_COPY_AND_ASSIGN(BorderMaskBlurFilterContents);
48 };
49
50 } // namespace impeller
impeller::BorderMaskBlurFilterContents::SetSigma
void SetSigma(Sigma sigma_x, Sigma sigma_y)
Definition: border_mask_blur_filter_contents.cc:19
impeller::FilterContents::BlurStyle
BlurStyle
Definition: filter_contents.h:21
impeller::BorderMaskBlurFilterContents::BorderMaskBlurFilterContents
BorderMaskBlurFilterContents()
impeller::BorderMaskBlurFilterContents
Definition: border_mask_blur_filter_contents.h:14
impeller::BorderMaskBlurFilterContents::SetBlurStyle
void SetBlurStyle(BlurStyle blur_style)
Definition: border_mask_blur_filter_contents.cc:24
impeller::BorderMaskBlurFilterContents::~BorderMaskBlurFilterContents
~BorderMaskBlurFilterContents() override
impeller::FilterContents::BlurStyle::kNormal
@ kNormal
Blurred inside and outside.
impeller::Entity
Definition: entity.h:21
filter_contents.h
impeller::Sigma
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
Definition: sigma.h:31
filter_input.h
impeller::FilterInput::Vector
std::vector< FilterInput::Ref > Vector
Definition: filter_input.h:32
impeller::BorderMaskBlurFilterContents::GetFilterCoverage
std::optional< Rect > GetFilterCoverage(const FilterInput::Vector &inputs, const Entity &entity, const Matrix &effect_transform) const override
Definition: border_mask_blur_filter_contents.cc:154
impeller
Definition: aiks_context.cc:10
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