Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkMatrixColorFilter.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 SkMatrixColorFilter_DEFINED
9#define SkMatrixColorFilter_DEFINED
10
13
14#include <cstdint>
15
16class SkReadBuffer;
17class SkWriteBuffer;
18struct SkStageRec;
19
21public:
22 enum class Domain : uint8_t { kRGBA, kHSLA };
23
24 explicit SkMatrixColorFilter(const float array[20], Domain);
25
26 bool appendStages(const SkStageRec& rec, bool shaderIsOpaque) const override;
27
28 bool onIsAlphaUnchanged() const override { return fAlphaIsUnchanged; }
29
30 SkColorFilterBase::Type type() const override { return SkColorFilterBase::Type::kMatrix; }
31
32 Domain domain() const { return fDomain; }
33 const float* matrix() const { return fMatrix; }
34
35private:
36 friend void ::SkRegisterMatrixColorFilterFlattenable();
38
39 void flatten(SkWriteBuffer&) const override;
40 bool onAsAColorMatrix(float matrix[20]) const override;
41
42 float fMatrix[20];
43 bool fAlphaIsUnchanged;
44 Domain fDomain;
45};
46
47#endif
#define SK_FLATTENABLE_HOOKS(type)
bool onIsAlphaUnchanged() const override
bool appendStages(const SkStageRec &rec, bool shaderIsOpaque) const override
const float * matrix() const
bool onAsAColorMatrix(float matrix[20]) const override
void flatten(SkWriteBuffer &) const override
SkColorFilterBase::Type type() const override