Flutter Engine
The Flutter Engine
SkBlendShader.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 SkBlendShader_DEFINED
9#define SkBlendShader_DEFINED
10
15
16#include <utility>
17
18class SkReadBuffer;
19class SkWriteBuffer;
20enum class SkBlendMode;
21struct SkStageRec;
22
23class SkBlendShader final : public SkShaderBase {
24public:
26 : fDst(std::move(dst)), fSrc(std::move(src)), fMode(mode) {}
27
28 ShaderType type() const override { return ShaderType::kBlend; }
29
30 sk_sp<SkShader> dst() const { return fDst; }
31 sk_sp<SkShader> src() const { return fSrc; }
32 SkBlendMode mode() const { return fMode; }
33
34protected:
36 void flatten(SkWriteBuffer&) const override;
37 bool appendStages(const SkStageRec&, const SkShaders::MatrixRec&) const override;
38
39private:
42
43 sk_sp<SkShader> fDst;
44 sk_sp<SkShader> fSrc;
45 SkBlendMode fMode;
46};
47
48#endif
SkBlendMode
Definition: SkBlendMode.h:38
void SkRegisterBlendShaderFlattenable()
#define SK_FLATTENABLE_HOOKS(type)
ShaderType type() const override
Definition: SkBlendShader.h:28
sk_sp< SkShader > dst() const
Definition: SkBlendShader.h:30
void flatten(SkWriteBuffer &) const override
bool appendStages(const SkStageRec &, const SkShaders::MatrixRec &) const override
SkBlendMode mode() const
Definition: SkBlendShader.h:32
SkBlendShader(SkReadBuffer &)
SkBlendShader(SkBlendMode mode, sk_sp< SkShader > dst, sk_sp< SkShader > src)
Definition: SkBlendShader.h:25
sk_sp< SkShader > src() const
Definition: SkBlendShader.h:31
Definition: ref_ptr.h:256