Flutter Engine
The Flutter Engine
SkShaderMaskFilterImpl.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 SkShaderMaskFilterImpl_DEFINED
9#define SkShaderMaskFilterImpl_DEFINED
10
12#include "include/core/SkRect.h"
15#include "src/core/SkMask.h"
17
18#include <utility>
19
20class SkMatrix;
21class SkReadBuffer;
22class SkWriteBuffer;
23struct SkIPoint;
24
26public:
28
29 SkMask::Format getFormat() const override { return SkMask::kA8_Format; }
31
32 bool filterMask(SkMaskBuilder* dst, const SkMask& src, const SkMatrix&,
33 SkIPoint* margin) const override;
34
35 void computeFastBounds(const SkRect& src, SkRect* dst) const override {
36 *dst = src;
37 }
38
39 bool asABlur(BlurRec*) const override { return false; }
40 sk_sp<SkShader> shader() const { return fShader; }
41
42private:
44
45 sk_sp<SkShader> fShader;
46
48 void flatten(SkWriteBuffer&) const override;
49
50 friend class SkShaderMaskFilter;
51};
52
53#endif
#define SK_FLATTENABLE_HOOKS(type)
SkMaskFilterBase::Type type() const override
SkMask::Format getFormat() const override
SkShaderMaskFilterImpl(sk_sp< SkShader > shader)
void computeFastBounds(const SkRect &src, SkRect *dst) const override
bool filterMask(SkMaskBuilder *dst, const SkMask &src, const SkMatrix &, SkIPoint *margin) const override
sk_sp< SkShader > shader() const
bool asABlur(BlurRec *) const override
dst
Definition: cp.py:12
Definition: ref_ptr.h:256
Definition: SkMask.h:25
Format
Definition: SkMask.h:26
@ kA8_Format
8bits per pixel mask (e.g. antialiasing)
Definition: SkMask.h:28