Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkMaskFilter.h
Go to the documentation of this file.
1/*
2 * Copyright 2006 The Android Open Source Project
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 SkMaskFilter_DEFINED
9#define SkMaskFilter_DEFINED
10
15
16#include <cstddef>
17
18enum SkBlurStyle : int;
19struct SkDeserialProcs;
20struct SkRect;
21
22/** \class SkMaskFilter
23
24 SkMaskFilter is the base class for object that perform transformations on
25 the mask before drawing it. An example subclass is Blur.
26*/
28public:
29 /** Create a blur maskfilter.
30 * @param style The SkBlurStyle to use
31 * @param sigma Standard deviation of the Gaussian blur to apply. Must be > 0.
32 * @param respectCTM if true the blur's sigma is modified by the CTM.
33 * @return The new blur maskfilter
34 */
35 static sk_sp<SkMaskFilter> MakeBlur(SkBlurStyle style, SkScalar sigma,
36 bool respectCTM = true);
37
38 /**
39 * Returns the approximate bounds that would result from filtering the src rect.
40 * The actual result may be different, but it should be contained within the
41 * returned bounds.
42 */
43 SkRect approximateFilteredBounds(const SkRect& src) const;
44
45 static sk_sp<SkMaskFilter> Deserialize(const void* data, size_t size,
46 const SkDeserialProcs* procs = nullptr);
47
48private:
49 static void RegisterFlattenables();
50 friend class SkFlattenable;
51};
52
53#endif
#define SK_API
Definition SkAPI.h:35
SkBlurStyle
Definition SkBlurTypes.h:11
Type::kYUV Type::kRGBA() int(0.7 *637)
static sk_sp< SkFlattenable > Deserialize(Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
float SkScalar
Definition extension.cpp:12