Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkEmptyShader.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#ifndef SkEmptyShader_DEFINED
8#define SkEmptyShader_DEFINED
9
11
13
14class SkReadBuffer;
15class SkWriteBuffer;
16struct SkStageRec;
17
18/**
19 * \class SkEmptyShader
20 * A Shader that always draws nothing. Its createContext always returns nullptr.
21 */
23public:
25
26protected:
27 void flatten(SkWriteBuffer& buffer) const override {
28 // Do nothing.
29 // We just don't want to fall through to SkShader::flatten(),
30 // which will write data we don't care to serialize or decode.
31 }
32
33 bool appendStages(const SkStageRec&, const SkShaders::MatrixRec&) const override {
34 return false;
35 }
36
37 ShaderType type() const override { return ShaderType::kEmpty; }
38
39private:
40 friend void ::SkRegisterEmptyShaderFlattenable();
42};
43
44#endif // SkEmptyShader_DEFINED
#define SK_FLATTENABLE_HOOKS(type)
ShaderType type() const override
bool appendStages(const SkStageRec &, const SkShaders::MatrixRec &) const override
void flatten(SkWriteBuffer &buffer) const override
static const uint8_t buffer[]