#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, SkCoordClampShader, SkEmptyShader, SkLocalMatrixShader, SkPictureShader, SkCTMShader, SkTransformShader, SkTriColorShader, 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()
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
std::shared_ptr< const fml::Mapping > data
◆ flatten()
Override this if your subclass needs to record data that it will need to recreate itself from its CreateProc (returned by getFactory()).
DEPRECATED public : will move to protected ... use serialize() instead
Reimplemented from SkFlattenable.
Definition at line 80 of file SkShaderBase.cpp.
80{ this->INHERITED::flatten(
buffer); }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
◆ 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: