#include <SkShaderBase.h>
Definition at line 186 of file SkShaderBase.h.
◆ Flags
Enumerator |
---|
kOpaqueAlpha_Flag | set if all of the colors will be opaque
|
Definition at line 260 of file SkShaderBase.h.
260 {
261
263 };
@ kOpaqueAlpha_Flag
set if all of the colors will be opaque
◆ GradientType
Definition at line 207 of file SkShaderBase.h.
207 {
209#define M(type) k##type,
211#undef M
212 };
#define SK_ALL_GRADIENTS(M)
◆ ShaderType
Definition at line 199 of file SkShaderBase.h.
199 {
200#define M(type) k##type,
202#undef M
203 };
#define SK_ALL_SHADERS(M)
◆ ~SkShaderBase()
SkShaderBase::~SkShaderBase |
( |
| ) |
|
|
overridedefault |
◆ SkShaderBase()
SkShaderBase::SkShaderBase |
( |
| ) |
|
|
protecteddefault |
◆ appendRootStages()
bool SkShaderBase::appendRootStages |
( |
const SkStageRec & |
rec, |
|
|
const SkMatrix & |
ctm |
|
) |
| const |
If this returns false, then we draw nothing (do not fall back to shader context). This should only be called on a root-level effect. It assumes that the initial device coordinates have not yet been seeded.
Definition at line 132 of file SkShaderBase.cpp.
132 {
134}
virtual bool appendStages(const SkStageRec &, const SkShaders::MatrixRec &) const =0
◆ appendStages()
Adds stages to implement this shader. To ensure that the correct input coords are present in r,g MatrixRec::apply() must be called (unless the shader doesn't require it's input coords). The default impl creates shadercontext and calls that (not very efficient).
Implemented in SkGradientBaseShader, SkBlendShader, SkColorFilterShader, SkColorShader, SkColor4Shader, SkCoordClampShader, SkEmptyShader, SkImageShader, SkLocalMatrixShader, SkPictureShader, SkCTMShader, SkTransformShader, SkTriColorShader, SkWorkingColorSpaceShader, SkPerlinNoiseShader, and SkRuntimeShader.
◆ asGradient()
◆ asLuminanceColor()
bool SkShaderBase::asLuminanceColor |
( |
SkColor4f * |
colorPtr | ) |
const |
If the shader can represent its "average" luminance in a single color, return true and if color is not NULL, return that color. If it cannot, return false and ignore the color parameter.
Note: if this returns true, the returned color will always be opaque, as only the RGB components are used to compute luminance.
Definition at line 82 of file SkShaderBase.cpp.
82 {
84 if (nullptr == colorPtr) {
85 colorPtr = &storage;
86 }
88 colorPtr->fA = 1.0f;
89 return true;
90 }
91 return false;
92}
virtual bool onAsLuminanceColor(SkColor4f *) const
◆ asRuntimeEffect()
◆ ConcatLocalMatrices()
Definition at line 384 of file SkShaderBase.h.
384 {
385#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
387#endif
389 }
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
◆ Deserialize()
Definition at line 371 of file SkShaderBase.h.
372 {
375 }
static sk_sp< SkFlattenable > Deserialize(Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
static Type GetFlattenableType()
◆ flatten()
◆ GetFlattenableType()
static Type SkShaderBase::GetFlattenableType |
( |
| ) |
|
|
inlinestatic |
◆ getFlattenableType()
Type SkShaderBase::getFlattenableType |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isConstant()
virtual bool SkShaderBase::isConstant |
( |
| ) |
const |
|
inlinevirtual |
◆ makeAsALocalMatrixShader()
DEPRECATED. skbug.com/8941 If this shader can be represented by another shader + a localMatrix, return that shader and the localMatrix. If not, return nullptr and ignore the localMatrix parameter.
Reimplemented in SkLocalMatrixShader.
Definition at line 130 of file SkShaderBase.cpp.
◆ makeContext()
Make a context using the memory provided by the arena.
- Returns
- pointer to context or nullptr if can't be created
Definition at line 94 of file SkShaderBase.cpp.
94 {
95#ifdef SK_ENABLE_LEGACY_SHADERCONTEXT
96
97 auto totalMatrix = rec.fMatrixRec.totalMatrix();
98 if (totalMatrix.hasPerspective() || !totalMatrix.invert(nullptr)) {
99 return nullptr;
100 }
101
102 return this->onMakeContext(rec, alloc);
103#else
104 return nullptr;
105#endif
106}
◆ makeInvertAlpha()
Definition at line 141 of file SkShaderBase.cpp.
141 {
143}
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
sk_sp< SkShader > makeWithColorFilter(sk_sp< SkColorFilter >) const
◆ makeWithCTM()
◆ onAsLuminanceColor()
virtual bool SkShaderBase::onAsLuminanceColor |
( |
SkColor4f * |
| ) |
const |
|
inlineprotectedvirtual |
◆ onIsAImage()
◆ RegisterFlattenables()
void SkShaderBase::RegisterFlattenables |
( |
| ) |
|
|
static |
◆ type()
Implemented in SkGradientBaseShader, SkBlendShader, SkColorFilterShader, SkColorShader, SkColor4Shader, SkCoordClampShader, SkEmptyShader, SkImageShader, SkLocalMatrixShader, SkCTMShader, SkPerlinNoiseShader, SkPictureShader, SkRuntimeShader, SkTransformShader, SkTriColorShader, and SkWorkingColorSpaceShader.
◆ SkShaders::MatrixRec
The documentation for this class was generated from the following files: