Flutter Engine
The Flutter Engine
SkCoordClampShader.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 SkCoordClampShader_DEFINED
9#define SkCoordClampShader_DEFINED
10
12#include "include/core/SkRect.h"
16
17#include <utility>
18
19class SkReadBuffer;
20class SkWriteBuffer;
21struct SkStageRec;
22
23class SkCoordClampShader final : public SkShaderBase {
24public:
26 : fShader(std::move(shader)), fSubset(subset) {}
27
28 ShaderType type() const override { return ShaderType::kCoordClamp; }
29
30 sk_sp<SkShader> shader() const { return fShader; }
31 SkRect subset() const { return fSubset; }
32
33protected:
35 void flatten(SkWriteBuffer&) const override;
36 bool appendStages(const SkStageRec&, const SkShaders::MatrixRec&) const override;
37
38private:
41
42 sk_sp<SkShader> fShader;
43 SkRect fSubset;
44};
45
46#endif
void SkRegisterCoordClampShaderFlattenable()
#define SK_FLATTENABLE_HOOKS(type)
SkRect subset() const
SkCoordClampShader(sk_sp< SkShader > shader, const SkRect &subset)
bool appendStages(const SkStageRec &, const SkShaders::MatrixRec &) const override
SkCoordClampShader(SkReadBuffer &)
sk_sp< SkShader > shader() const
void flatten(SkWriteBuffer &) const override
ShaderType type() const override
Definition: ref_ptr.h:256