Go to the source code of this file.
|
SKWASM_EXPORT SkShader * | shader_createLinearGradient (SkPoint *endPoints, SkColor *colors, SkScalar *stops, int count, SkTileMode tileMode, SkScalar *matrix33) |
|
SKWASM_EXPORT SkShader * | shader_createRadialGradient (SkScalar centerX, SkScalar centerY, SkScalar radius, SkColor *colors, SkScalar *stops, int count, SkTileMode tileMode, SkScalar *matrix33) |
|
SKWASM_EXPORT SkShader * | shader_createConicalGradient (SkPoint *endPoints, SkScalar startRadius, SkScalar endRadius, SkColor *colors, SkScalar *stops, int count, SkTileMode tileMode, SkScalar *matrix33) |
|
SKWASM_EXPORT SkShader * | shader_createSweepGradient (SkScalar centerX, SkScalar centerY, SkColor *colors, SkScalar *stops, int count, SkTileMode tileMode, SkScalar startAngle, SkScalar endAngle, SkScalar *matrix33) |
|
SKWASM_EXPORT void | shader_dispose (SkShader *shader) |
|
SKWASM_EXPORT SkRuntimeEffect * | runtimeEffect_create (SkString *source) |
|
SKWASM_EXPORT void | runtimeEffect_dispose (SkRuntimeEffect *effect) |
|
SKWASM_EXPORT size_t | runtimeEffect_getUniformSize (SkRuntimeEffect *effect) |
|
SKWASM_EXPORT SkShader * | shader_createRuntimeEffectShader (SkRuntimeEffect *runtimeEffect, SkData *uniforms, SkShader **children, size_t childCount) |
|
SKWASM_EXPORT SkShader * | shader_createFromImage (SkImage *image, SkTileMode tileModeX, SkTileMode tileModeY, FilterQuality quality, SkScalar *matrix33) |
|
◆ runtimeEffect_create()
Definition at line 105 of file shaders.cpp.
105 {
107 if (
result.effect ==
nullptr) {
108 printf(
"Failed to compile shader. Error text:\n%s",
110 return nullptr;
111 } else {
112 return result.effect.release();
113 }
114}
static Result MakeForShader(SkString sksl, const Options &)
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
◆ runtimeEffect_dispose()
◆ runtimeEffect_getUniformSize()
Definition at line 120 of file shaders.cpp.
120 {
122}
size_t uniformSize() const
◆ shader_createConicalGradient()
Definition at line 54 of file shaders.cpp.
62 {
63 if (matrix33) {
66 endPoints[0], startRadius, endPoints[1], endRadius,
colors,
67 stops,
count, tileMode, 0, &localMatrix)
69
70 } else {
72 endPoints[1], endRadius,
75 }
76}
static sk_sp< SkShader > MakeTwoPointConical(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
PODArray< SkColor > colors
SkMatrix createMatrix(const SkScalar *f)
◆ shader_createFromImage()
Definition at line 139 of file shaders.cpp.
143 {
144 if (matrix33) {
148 &localMatrix)
150 } else {
154 }
155}
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
sk_sp< const SkImage > image
SkSamplingOptions samplingOptionsForQuality(FilterQuality quality)
◆ shader_createLinearGradient()
Definition at line 14 of file shaders.cpp.
21 {
22 if (matrix33) {
25 tileMode, 0, &localMatrix)
27 } else {
29 tileMode)
31 }
32}
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
◆ shader_createRadialGradient()
Definition at line 34 of file shaders.cpp.
41 {
42 if (matrix33) {
45 stops,
count, tileMode, 0, &localMatrix)
46 .release();
47 } else {
49 stops,
count, tileMode)
50 .release();
51 }
52}
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
◆ shader_createRuntimeEffectShader()
Definition at line 124 of file shaders.cpp.
128 {
129 std::vector<sk_sp<SkShader>> childPointers;
130 for (
size_t i = 0;
i < childCount;
i++) {
131 childPointers.emplace_back(sk_ref_sp<SkShader>(children[
i]));
132 }
133 return runtimeEffect
135 childPointers.data(), childCount, nullptr)
137}
const void * data() const
static sk_sp< SkData > MakeWithCopy(const void *data, size_t length)
sk_sp< SkShader > makeShader(sk_sp< const SkData > uniforms, sk_sp< SkShader > children[], size_t childCount, const SkMatrix *localMatrix=nullptr) const
◆ shader_createSweepGradient()
Definition at line 78 of file shaders.cpp.
86 {
87 if (matrix33) {
91 &localMatrix)
93 } else {
96 nullptr)
98 }
99}
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
◆ shader_dispose()