Flutter Engine
The Flutter Engine
SkBlurMaskFilterImpl.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkBlurMaskFilterImpl_DEFINED
9#define SkBlurMaskFilterImpl_DEFINED
10
14#include "src/core/SkMask.h"
16
17class SkImageFilter;
18class SkMatrix;
19class SkRRect;
20class SkReadBuffer;
21class SkWriteBuffer;
22enum SkBlurStyle : int;
23struct SkIPoint;
24struct SkIRect;
25struct SkRect;
26template<typename T> class SkTLazy;
27
29public:
31
32 // From SkMaskFilterBase.h
33 SkMask::Format getFormat() const override;
34 bool filterMask(SkMaskBuilder* dst, const SkMask& src, const SkMatrix&,
35 SkIPoint* margin) const override;
37
38 void computeFastBounds(const SkRect&, SkRect*) const override;
39 bool asABlur(BlurRec*) const override;
40 sk_sp<SkImageFilter> asImageFilter(const SkMatrix& ctm) const override;
41
42
43 SkScalar computeXformedSigma(const SkMatrix& ctm) const;
44 SkBlurStyle blurStyle() const {return fBlurStyle;}
45 SkScalar sigma() const {return fSigma;}
46 bool ignoreXform() const { return !fRespectCTM; }
47
48private:
49 FilterReturn filterRectsToNine(const SkRect[], int count, const SkMatrix&,
50 const SkIRect& clipBounds,
51 SkTLazy<NinePatch>*) const override;
52
53 FilterReturn filterRRectToNine(const SkRRect&, const SkMatrix&,
54 const SkIRect& clipBounds,
55 SkTLazy<NinePatch>*) const override;
56
57 bool filterRectMask(SkMaskBuilder* dstM, const SkRect& r, const SkMatrix& matrix,
58 SkIPoint* margin, SkMaskBuilder::CreateMode createMode) const;
59 bool filterRRectMask(SkMaskBuilder* dstM, const SkRRect& r, const SkMatrix& matrix,
60 SkIPoint* margin, SkMaskBuilder::CreateMode createMode) const;
61
63
64 SkScalar fSigma;
65 SkBlurStyle fBlurStyle;
66 bool fRespectCTM;
67
69 void flatten(SkWriteBuffer&) const override;
70
71 friend class SkBlurMaskFilter;
72
74};
75
76#endif
int count
Definition: FontMgrTest.cpp:50
SkBlurStyle
Definition: SkBlurTypes.h:11
#define SK_FLATTENABLE_HOOKS(type)
SkBlurStyle blurStyle() const
SkMask::Format getFormat() const override
bool asABlur(BlurRec *) const override
SkBlurMaskFilterImpl(SkScalar sigma, SkBlurStyle, bool respectCTM)
SkMaskFilterBase::Type type() const override
sk_sp< SkImageFilter > asImageFilter(const SkMatrix &ctm) const override
bool filterMask(SkMaskBuilder *dst, const SkMask &src, const SkMatrix &, SkIPoint *margin) const override
SkScalar computeXformedSigma(const SkMatrix &ctm) const
void computeFastBounds(const SkRect &, SkRect *) const override
friend void sk_register_blur_maskfilter_createproc()
float SkScalar
Definition: extension.cpp:12
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
dst
Definition: cp.py:12
Definition: SkRect.h:32
Definition: SkMask.h:25
Format
Definition: SkMask.h:26