@shopify/react-native-skia 1.12.2 → 1.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +15 -11
- package/cpp/api/JsiSkCanvas.h +45 -2
- package/cpp/api/JsiSkShaderFactory.h +43 -8
- package/cpp/api/JsiSkVertices.h +14 -3
- package/cpp/api/recorder/Drawings.h +31 -2
- package/cpp/api/recorder/Shaders.h +40 -0
- package/lib/commonjs/__tests__/setup.d.ts +18 -0
- package/lib/commonjs/headless/index.d.ts +1 -0
- package/lib/commonjs/headless/index.js +12 -0
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +1 -2
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Player.d.ts +1 -1
- package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Box.js +2 -2
- package/lib/commonjs/sksg/Recorder/commands/Box.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +1 -3
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js +1 -58
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/module/__tests__/setup.d.ts +18 -0
- package/lib/module/headless/index.d.ts +1 -0
- package/lib/module/headless/index.js +1 -0
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +1 -2
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/sksg/Recorder/Player.d.ts +1 -1
- package/lib/module/sksg/Recorder/Player.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Box.js +2 -2
- package/lib/module/sksg/Recorder/commands/Box.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Drawing.d.ts +1 -3
- package/lib/module/sksg/Recorder/commands/Drawing.js +2 -58
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/typescript/lib/commonjs/mock/index.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/index.d.ts +1 -1
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +0 -1
- package/lib/typescript/lib/module/headless/index.d.ts +1 -0
- package/lib/typescript/lib/module/mock/index.d.ts +1 -1
- package/lib/typescript/lib/module/skia/Skia.d.ts +1 -1
- package/lib/typescript/lib/module/sksg/Recorder/commands/Drawing.d.ts +0 -1
- package/lib/typescript/src/__tests__/setup.d.ts +18 -0
- package/lib/typescript/src/headless/index.d.ts +1 -0
- package/lib/typescript/src/renderer/Canvas.d.ts +1 -2
- package/lib/typescript/src/sksg/Recorder/Player.d.ts +1 -1
- package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +1 -3
- package/package.json +3 -3
- package/src/__tests__/setup.ts +67 -1
- package/src/__tests__/snapshots/box/box-shadow-opacity.png +0 -0
- package/src/headless/index.ts +2 -1
- package/src/renderer/Canvas.tsx +1 -1
- package/src/renderer/__tests__/e2e/Box.spec.tsx +22 -0
- package/src/renderer/__tests__/e2e/Matrix4.spec.tsx +1 -2
- package/src/renderer/__tests__/e2e/Paths.spec.tsx +13 -11
- package/src/skia/__tests__/Enums.spec.ts +11 -23
- package/src/skia/__tests__/Path.spec.ts +2 -2
- package/src/sksg/Recorder/Player.ts +1 -1
- package/src/sksg/Recorder/commands/Box.ts +2 -2
- package/src/sksg/Recorder/commands/Drawing.ts +0 -65
- package/lib/commonjs/skia/types/Image/ColorType.web.d.ts +0 -19
- package/lib/commonjs/skia/types/Image/ColorType.web.js +0 -43
- package/lib/commonjs/skia/types/Image/ColorType.web.js.map +0 -1
- package/lib/module/skia/types/Image/ColorType.web.d.ts +0 -19
- package/lib/module/skia/types/Image/ColorType.web.js +0 -37
- package/lib/module/skia/types/Image/ColorType.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/skia/types/Image/ColorType.web.d.ts +0 -2
- package/lib/typescript/lib/module/skia/types/Image/ColorType.web.d.ts +0 -1
- package/lib/typescript/src/skia/types/Image/ColorType.web.d.ts +0 -19
- package/src/skia/types/Image/ColorType.web.ts +0 -19
package/android/build.gradle
CHANGED
@@ -19,7 +19,7 @@ import java.nio.file.Paths
|
|
19
19
|
// the minimum React Native version supported.
|
20
20
|
def DEFAULT_COMPILE_SDK_VERSION = 28
|
21
21
|
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
|
22
|
-
def DEFAULT_MIN_SDK_VERSION =
|
22
|
+
def DEFAULT_MIN_SDK_VERSION = 21
|
23
23
|
def DEFAULT_TARGET_SDK_VERSION = 28
|
24
24
|
|
25
25
|
def safeExtGet(prop, fallback) {
|
@@ -295,13 +295,17 @@ afterEvaluate { project ->
|
|
295
295
|
}
|
296
296
|
}
|
297
297
|
|
298
|
+
def localBuildDir = buildDir
|
299
|
+
def headersConfiguration = configurations.extractHeaders
|
300
|
+
def jniConfiguration = configurations.extractJNI
|
301
|
+
|
298
302
|
task extractAARHeaders {
|
299
303
|
doLast {
|
300
|
-
|
301
|
-
def
|
302
|
-
copy {
|
303
|
-
from zipTree(
|
304
|
-
into "$
|
304
|
+
headersConfiguration.files.each { file ->
|
305
|
+
def absFile = file.absoluteFile
|
306
|
+
project.copy {
|
307
|
+
from project.zipTree(absFile)
|
308
|
+
into "${localBuildDir}/${absFile.name}"
|
305
309
|
include "**/*.h"
|
306
310
|
}
|
307
311
|
}
|
@@ -310,11 +314,11 @@ task extractAARHeaders {
|
|
310
314
|
|
311
315
|
task extractJNIFiles {
|
312
316
|
doLast {
|
313
|
-
|
314
|
-
def
|
315
|
-
copy {
|
316
|
-
from zipTree(
|
317
|
-
into "$
|
317
|
+
jniConfiguration.files.each { file ->
|
318
|
+
def absFile = file.absoluteFile
|
319
|
+
project.copy {
|
320
|
+
from project.zipTree(absFile)
|
321
|
+
into "${localBuildDir}/${absFile.name}"
|
318
322
|
include "jni/**/*"
|
319
323
|
}
|
320
324
|
}
|
package/cpp/api/JsiSkCanvas.h
CHANGED
@@ -243,6 +243,12 @@ public:
|
|
243
243
|
|
244
244
|
auto jsiPoints = arguments[1].asObject(runtime).asArray(runtime);
|
245
245
|
auto pointsSize = jsiPoints.size(runtime);
|
246
|
+
|
247
|
+
// Check if we have at least one point
|
248
|
+
if (pointsSize == 0) {
|
249
|
+
throw std::invalid_argument("Points array must not be empty");
|
250
|
+
}
|
251
|
+
|
246
252
|
points.reserve(pointsSize);
|
247
253
|
|
248
254
|
for (int i = 0; i < pointsSize; i++) {
|
@@ -274,6 +280,12 @@ public:
|
|
274
280
|
|
275
281
|
auto jsiCubics = arguments[0].asObject(runtime).asArray(runtime);
|
276
282
|
auto cubicsSize = jsiCubics.size(runtime);
|
283
|
+
|
284
|
+
// Validate cubic points - must be exactly 12 points
|
285
|
+
if (cubicsSize != 12) {
|
286
|
+
throw std::invalid_argument("Cubic points array must contain exactly 12 points");
|
287
|
+
}
|
288
|
+
|
277
289
|
cubics.reserve(cubicsSize);
|
278
290
|
for (int i = 0; i < cubicsSize; i++) {
|
279
291
|
std::shared_ptr<SkPoint> point = JsiSkPoint::fromValue(
|
@@ -284,6 +296,12 @@ public:
|
|
284
296
|
if (count >= 2 && !arguments[1].isNull() && !arguments[1].isUndefined()) {
|
285
297
|
auto jsiColors = arguments[1].asObject(runtime).asArray(runtime);
|
286
298
|
auto colorsSize = jsiColors.size(runtime);
|
299
|
+
|
300
|
+
// Validate colors array - must be exactly 4 colors
|
301
|
+
if (colorsSize != 4) {
|
302
|
+
throw std::invalid_argument("Colors array must contain exactly 4 colors");
|
303
|
+
}
|
304
|
+
|
287
305
|
colors.reserve(colorsSize);
|
288
306
|
for (int i = 0; i < colorsSize; i++) {
|
289
307
|
SkColor color = JsiSkColor::fromValue(
|
@@ -295,6 +313,12 @@ public:
|
|
295
313
|
if (count >= 3 && !arguments[2].isNull() && !arguments[2].isUndefined()) {
|
296
314
|
auto jsiTexs = arguments[2].asObject(runtime).asArray(runtime);
|
297
315
|
auto texsSize = jsiTexs.size(runtime);
|
316
|
+
|
317
|
+
// Validate textures array - must be exactly 4 points
|
318
|
+
if (texsSize != 4) {
|
319
|
+
throw std::invalid_argument("Texture coordinates array must contain exactly 4 points");
|
320
|
+
}
|
321
|
+
|
298
322
|
texs.reserve(texsSize);
|
299
323
|
for (int i = 0; i < texsSize; i++) {
|
300
324
|
auto point = JsiSkPoint::fromValue(
|
@@ -306,7 +330,8 @@ public:
|
|
306
330
|
auto paint =
|
307
331
|
count >= 4 ? JsiSkPaint::fromValue(runtime, arguments[4]) : nullptr;
|
308
332
|
auto blendMode = static_cast<SkBlendMode>(arguments[3].asNumber());
|
309
|
-
_canvas->drawPatch(cubics.data(), colors.
|
333
|
+
_canvas->drawPatch(cubics.data(), colors.empty() ? nullptr : colors.data(),
|
334
|
+
texs.empty() ? nullptr : texs.data(), blendMode,
|
310
335
|
*paint);
|
311
336
|
return jsi::Value::undefined();
|
312
337
|
}
|
@@ -364,6 +389,12 @@ public:
|
|
364
389
|
|
365
390
|
std::vector<SkGlyphID> glyphs;
|
366
391
|
int glyphsSize = static_cast<int>(jsiGlyphs.size(runtime));
|
392
|
+
|
393
|
+
// Validate that glyphs and positions arrays have the same size
|
394
|
+
if (glyphsSize != pointsSize) {
|
395
|
+
throw std::invalid_argument("Glyphs and positions arrays must have the same length");
|
396
|
+
}
|
397
|
+
|
367
398
|
glyphs.reserve(glyphsSize);
|
368
399
|
for (int i = 0; i < glyphsSize; i++) {
|
369
400
|
glyphs.push_back(jsiGlyphs.getValueAtIndex(runtime, i).asNumber());
|
@@ -522,11 +553,22 @@ public:
|
|
522
553
|
runtime, rects.getValueAtIndex(runtime, i).asObject(runtime));
|
523
554
|
skRects.push_back(*rect.get());
|
524
555
|
}
|
556
|
+
|
557
|
+
// Validate transforms and rects have the same size
|
558
|
+
if (xformsSize != rectsSize) {
|
559
|
+
throw std::invalid_argument("Transforms and rects arrays must have the same length");
|
560
|
+
}
|
525
561
|
|
526
562
|
std::vector<SkColor> colors;
|
527
563
|
if (count > 5 && !arguments[5].isUndefined()) {
|
528
564
|
auto colorsArray = arguments[5].asObject(runtime).asArray(runtime);
|
529
565
|
int colorsSize = static_cast<int>(colorsArray.size(runtime));
|
566
|
+
|
567
|
+
// Validate colors array matches the size of sprites and transforms
|
568
|
+
if (colorsSize != rectsSize) {
|
569
|
+
throw std::invalid_argument("Colors array must have the same length as rects/transforms");
|
570
|
+
}
|
571
|
+
|
530
572
|
colors.reserve(colorsSize);
|
531
573
|
for (int i = 0; i < colorsSize; i++) {
|
532
574
|
// Convert from [r,g,b,a] in [0,1] to SkColor
|
@@ -551,7 +593,8 @@ public:
|
|
551
593
|
sampling = SamplingOptionsFromValue(runtime, arguments[6]);
|
552
594
|
}
|
553
595
|
_canvas->drawAtlas(atlas.get(), xforms.data(), skRects.data(),
|
554
|
-
colors.
|
596
|
+
colors.empty() ? nullptr : colors.data(),
|
597
|
+
skRects.size(), blendMode, sampling,
|
555
598
|
nullptr, paint.get());
|
556
599
|
|
557
600
|
return jsi::Value::undefined();
|
@@ -84,14 +84,22 @@ public:
|
|
84
84
|
SkPoint pts[] = {p1, p2};
|
85
85
|
|
86
86
|
std::vector<SkColor> colors = getColors(runtime, arguments[2]);
|
87
|
+
auto colorsSize = colors.size();
|
88
|
+
if (colorsSize < 2) {
|
89
|
+
throw std::invalid_argument("colors must have at least 2 colors");
|
90
|
+
}
|
87
91
|
std::vector<SkScalar> positions = getPositions(runtime, arguments[3]);
|
92
|
+
if (!positions.empty() && positions.size() != colorsSize) {
|
93
|
+
throw std::invalid_argument(
|
94
|
+
"positions must be empty or have the same size as colors");
|
95
|
+
}
|
88
96
|
auto tileMode = getTileMode(arguments, 4, count);
|
89
97
|
auto flag = getFlag(arguments, 6, count);
|
90
98
|
auto localMatrix = getLocalMatrix(runtime, arguments, 5, count);
|
91
99
|
|
92
100
|
sk_sp<SkShader> gradient = SkGradientShader::MakeLinear(
|
93
|
-
pts, colors.data(), positions.
|
94
|
-
tileMode, flag, localMatrix);
|
101
|
+
pts, colors.data(), !positions.empty() ? positions.data() : nullptr,
|
102
|
+
static_cast<int>(colorsSize), tileMode, flag, localMatrix);
|
95
103
|
return jsi::Object::createFromHostObject(
|
96
104
|
runtime,
|
97
105
|
std::make_shared<JsiSkShader>(getContext(), std::move(gradient)));
|
@@ -103,14 +111,23 @@ public:
|
|
103
111
|
auto r = arguments[1].asNumber();
|
104
112
|
|
105
113
|
std::vector<SkColor> colors = getColors(runtime, arguments[2]);
|
114
|
+
auto colorsSize = colors.size();
|
115
|
+
if (colorsSize < 2) {
|
116
|
+
throw std::invalid_argument("colors must have at least 2 colors");
|
117
|
+
}
|
106
118
|
std::vector<SkScalar> positions = getPositions(runtime, arguments[3]);
|
119
|
+
if (!positions.empty() && positions.size() != colorsSize) {
|
120
|
+
throw std::invalid_argument(
|
121
|
+
"positions must be empty or the same size as colors");
|
122
|
+
}
|
107
123
|
auto tileMode = getTileMode(arguments, 4, count);
|
108
124
|
auto flag = getFlag(arguments, 6, count);
|
109
125
|
auto localMatrix = getLocalMatrix(runtime, arguments, 5, count);
|
110
126
|
|
111
127
|
sk_sp<SkShader> gradient = SkGradientShader::MakeRadial(
|
112
|
-
center, r, colors.data(),
|
113
|
-
|
128
|
+
center, r, colors.data(),
|
129
|
+
!positions.empty() ? positions.data() : nullptr,
|
130
|
+
static_cast<int>(colorsSize), tileMode, flag, localMatrix);
|
114
131
|
return jsi::Object::createFromHostObject(
|
115
132
|
runtime,
|
116
133
|
std::make_shared<JsiSkShader>(getContext(), std::move(gradient)));
|
@@ -120,7 +137,15 @@ public:
|
|
120
137
|
auto x = arguments[0].asNumber();
|
121
138
|
auto y = arguments[1].asNumber();
|
122
139
|
std::vector<SkColor> colors = getColors(runtime, arguments[2]);
|
140
|
+
auto colorsSize = colors.size();
|
141
|
+
if (colorsSize < 2) {
|
142
|
+
throw std::invalid_argument("colors must have at least 2 colors");
|
143
|
+
}
|
123
144
|
std::vector<SkScalar> positions = getPositions(runtime, arguments[3]);
|
145
|
+
if (!positions.empty() && positions.size() != colorsSize) {
|
146
|
+
throw std::invalid_argument(
|
147
|
+
"positions must be empty or the same size as colors");
|
148
|
+
}
|
124
149
|
auto tileMode = getTileMode(arguments, 4, count);
|
125
150
|
auto localMatrix = getLocalMatrix(runtime, arguments, 5, count);
|
126
151
|
auto flag = getFlag(arguments, 6, count);
|
@@ -130,8 +155,9 @@ public:
|
|
130
155
|
? 360
|
131
156
|
: arguments[8].asNumber();
|
132
157
|
sk_sp<SkShader> gradient = SkGradientShader::MakeSweep(
|
133
|
-
x, y, colors.data(), positions.
|
134
|
-
tileMode, startAngle, endAngle, flag,
|
158
|
+
x, y, colors.data(), !positions.empty() ? positions.data() : nullptr,
|
159
|
+
static_cast<int>(colorsSize), tileMode, startAngle, endAngle, flag,
|
160
|
+
localMatrix);
|
135
161
|
return jsi::Object::createFromHostObject(
|
136
162
|
runtime,
|
137
163
|
std::make_shared<JsiSkShader>(getContext(), std::move(gradient)));
|
@@ -147,14 +173,23 @@ public:
|
|
147
173
|
auto endRadius = arguments[3].asNumber();
|
148
174
|
|
149
175
|
std::vector<SkColor> colors = getColors(runtime, arguments[4]);
|
176
|
+
auto colorsSize = colors.size();
|
177
|
+
if (colorsSize < 2) {
|
178
|
+
throw std::invalid_argument("colors must have at least 2 colors");
|
179
|
+
}
|
150
180
|
std::vector<SkScalar> positions = getPositions(runtime, arguments[5]);
|
181
|
+
if (!positions.empty() && positions.size() != colorsSize) {
|
182
|
+
throw std::invalid_argument(
|
183
|
+
"positions must be empty or the same size as colors");
|
184
|
+
}
|
151
185
|
auto tileMode = getTileMode(arguments, 6, count);
|
152
186
|
auto localMatrix = getLocalMatrix(runtime, arguments, 7, count);
|
153
187
|
auto flag = getFlag(arguments, 8, count);
|
154
188
|
|
155
189
|
sk_sp<SkShader> gradient = SkGradientShader::MakeTwoPointConical(
|
156
|
-
start, startRadius, end, endRadius, colors.data(),
|
157
|
-
|
190
|
+
start, startRadius, end, endRadius, colors.data(),
|
191
|
+
!positions.empty() ? positions.data() : nullptr,
|
192
|
+
static_cast<int>(colorsSize), tileMode, flag, localMatrix);
|
158
193
|
|
159
194
|
return jsi::Object::createFromHostObject(
|
160
195
|
runtime,
|
package/cpp/api/JsiSkVertices.h
CHANGED
@@ -70,6 +70,10 @@ public:
|
|
70
70
|
if (count >= 3 && !arguments[2].isNull() && !arguments[2].isUndefined()) {
|
71
71
|
auto jsiTexs = arguments[2].asObject(runtime).asArray(runtime);
|
72
72
|
auto texsSize = jsiTexs.size(runtime);
|
73
|
+
if (texsSize != positionsSize) {
|
74
|
+
throw jsi::JSError(runtime, "The number of texture coordinates must "
|
75
|
+
"match the number of positions");
|
76
|
+
}
|
73
77
|
texs.reserve(texsSize);
|
74
78
|
for (int i = 0; i < texsSize; i++) {
|
75
79
|
auto point = JsiSkPoint::fromValue(
|
@@ -81,6 +85,11 @@ public:
|
|
81
85
|
if (count >= 4 && !arguments[3].isNull() && !arguments[3].isUndefined()) {
|
82
86
|
auto jsiColors = arguments[3].asObject(runtime).asArray(runtime);
|
83
87
|
auto colorsSize = jsiColors.size(runtime);
|
88
|
+
if (colorsSize != positionsSize) {
|
89
|
+
throw jsi::JSError(
|
90
|
+
runtime,
|
91
|
+
"The number of colors must match the number of positions");
|
92
|
+
}
|
84
93
|
colors.reserve(colorsSize);
|
85
94
|
for (int i = 0; i < colorsSize; i++) {
|
86
95
|
SkColor color = JsiSkColor::fromValue(
|
@@ -132,9 +141,11 @@ public:
|
|
132
141
|
// builder.indices());
|
133
142
|
// }
|
134
143
|
// auto vertices = builder.detach();
|
135
|
-
auto vertices =
|
136
|
-
mode, positionsSize, positions.data(),
|
137
|
-
|
144
|
+
auto vertices =
|
145
|
+
SkVertices::MakeCopy(mode, positionsSize, positions.data(),
|
146
|
+
texs.size() > 0 ? texs.data() : nullptr,
|
147
|
+
colors.size() > 0 ? colors.data() : nullptr,
|
148
|
+
indicesSize, indices.data());
|
138
149
|
return jsi::Object::createFromHostObject(
|
139
150
|
runtime,
|
140
151
|
std::make_shared<JsiSkVertices>(context, std::move(vertices)));
|
@@ -418,7 +418,7 @@ public:
|
|
418
418
|
SkPaint shadowPaint;
|
419
419
|
shadowPaint.setAntiAlias(true);
|
420
420
|
shadowPaint.setColor(shadow.color.value_or(SK_ColorBLACK));
|
421
|
-
shadowPaint.setAlphaf(opacity);
|
421
|
+
shadowPaint.setAlphaf(opacity * shadowPaint.getAlphaf());
|
422
422
|
shadowPaint.setMaskFilter(SkMaskFilter::MakeBlur(
|
423
423
|
SkBlurStyle::kNormal_SkBlurStyle, shadow.blur, true));
|
424
424
|
|
@@ -442,7 +442,7 @@ public:
|
|
442
442
|
SkPaint shadowPaint;
|
443
443
|
shadowPaint.setAntiAlias(true);
|
444
444
|
shadowPaint.setColor(shadow.color.value_or(SK_ColorBLACK));
|
445
|
-
shadowPaint.setAlphaf(opacity);
|
445
|
+
shadowPaint.setAlphaf(opacity * shadowPaint.getAlphaf());
|
446
446
|
shadowPaint.setMaskFilter(SkMaskFilter::MakeBlur(
|
447
447
|
SkBlurStyle::kNormal_SkBlurStyle, shadow.blur, true));
|
448
448
|
|
@@ -637,6 +637,16 @@ public:
|
|
637
637
|
}
|
638
638
|
|
639
639
|
void draw(DrawingCtx *ctx) {
|
640
|
+
// Validate colors array has exactly 4 colors if provided
|
641
|
+
if (props.colors.has_value() && props.colors.value().size() != 4) {
|
642
|
+
throw std::invalid_argument("Colors array for patch must have exactly 4 colors");
|
643
|
+
}
|
644
|
+
|
645
|
+
// Validate texture array has exactly 4 points if provided
|
646
|
+
if (props.texture.has_value() && props.texture.value().size() != 4) {
|
647
|
+
throw std::invalid_argument("Texture coordinates array for patch must have exactly 4 points");
|
648
|
+
}
|
649
|
+
|
640
650
|
// Determine default blend mode based on presence of colors
|
641
651
|
SkBlendMode defaultBlendMode = props.colors.has_value()
|
642
652
|
? SkBlendMode::kDstOver
|
@@ -676,6 +686,15 @@ public:
|
|
676
686
|
}
|
677
687
|
|
678
688
|
void draw(DrawingCtx *ctx) {
|
689
|
+
// Validate array sizes
|
690
|
+
if (props.colors.has_value() && props.colors.value().size() != props.vertices.size()) {
|
691
|
+
throw std::invalid_argument("Colors array must have the same size as vertices array");
|
692
|
+
}
|
693
|
+
|
694
|
+
if (props.textures.has_value() && props.textures.value().size() != props.vertices.size()) {
|
695
|
+
throw std::invalid_argument("Textures array must have the same size as vertices array");
|
696
|
+
}
|
697
|
+
|
679
698
|
// Create vertices using MakeCopy
|
680
699
|
auto vertices = SkVertices::MakeCopy(
|
681
700
|
props.mode, static_cast<int>(props.vertices.size()),
|
@@ -909,6 +928,16 @@ public:
|
|
909
928
|
|
910
929
|
void draw(DrawingCtx *ctx) {
|
911
930
|
if (props.image) {
|
931
|
+
// Validate transforms and sprites have the same size
|
932
|
+
if (props.transforms.size() != props.sprites.size()) {
|
933
|
+
throw std::invalid_argument("transforms and sprites arrays must have the same length");
|
934
|
+
}
|
935
|
+
|
936
|
+
// Validate colors array matches if provided
|
937
|
+
if (props.colors.has_value() && props.colors.value().size() != props.transforms.size()) {
|
938
|
+
throw std::invalid_argument("colors array must have the same length as transforms/sprites");
|
939
|
+
}
|
940
|
+
|
912
941
|
auto colors =
|
913
942
|
props.colors.has_value() ? props.colors.value().data() : nullptr;
|
914
943
|
auto blendMode = props.blendMode.value_or(SkBlendMode::kDstOver);
|
@@ -239,6 +239,16 @@ public:
|
|
239
239
|
}
|
240
240
|
|
241
241
|
void pushShader(DrawingCtx *ctx) {
|
242
|
+
// Validate colors array has at least 2 colors
|
243
|
+
if (props.colors.size() < 2) {
|
244
|
+
throw std::invalid_argument("Colors array must have at least 2 colors");
|
245
|
+
}
|
246
|
+
|
247
|
+
// Validate positions array matches colors array in size
|
248
|
+
if (props.positions.has_value() && props.positions.value().size() != props.colors.size()) {
|
249
|
+
throw std::invalid_argument("Positions array must have the same size as colors array");
|
250
|
+
}
|
251
|
+
|
242
252
|
SkMatrix m3 = processTransform(props.matrix, props.transform, props.origin);
|
243
253
|
const SkPoint pts[2] = {props.start, props.end};
|
244
254
|
auto shader = SkGradientShader::MakeLinear(
|
@@ -276,6 +286,16 @@ public:
|
|
276
286
|
}
|
277
287
|
|
278
288
|
void pushShader(DrawingCtx *ctx) {
|
289
|
+
// Validate colors array has at least 2 colors
|
290
|
+
if (props.colors.size() < 2) {
|
291
|
+
throw std::invalid_argument("Colors array must have at least 2 colors");
|
292
|
+
}
|
293
|
+
|
294
|
+
// Validate positions array matches colors array in size
|
295
|
+
if (props.positions.has_value() && props.positions.value().size() != props.colors.size()) {
|
296
|
+
throw std::invalid_argument("Positions array must have the same size as colors array");
|
297
|
+
}
|
298
|
+
|
279
299
|
SkMatrix m3 = processTransform(props.matrix, props.transform, props.origin);
|
280
300
|
auto shader = SkGradientShader::MakeRadial(
|
281
301
|
props.center, props.radius, props.colors.data(),
|
@@ -314,6 +334,16 @@ public:
|
|
314
334
|
}
|
315
335
|
|
316
336
|
void pushShader(DrawingCtx *ctx) {
|
337
|
+
// Validate colors array has at least 2 colors
|
338
|
+
if (props.colors.size() < 2) {
|
339
|
+
throw std::invalid_argument("Colors array must have at least 2 colors");
|
340
|
+
}
|
341
|
+
|
342
|
+
// Validate positions array matches colors array in size
|
343
|
+
if (props.positions.has_value() && props.positions.value().size() != props.colors.size()) {
|
344
|
+
throw std::invalid_argument("Positions array must have the same size as colors array");
|
345
|
+
}
|
346
|
+
|
317
347
|
SkMatrix m3 = processTransform(props.matrix, props.transform, props.origin);
|
318
348
|
auto shader = SkGradientShader::MakeSweep(
|
319
349
|
props.center.x(), props.center.y(), props.colors.data(),
|
@@ -355,6 +385,16 @@ public:
|
|
355
385
|
}
|
356
386
|
|
357
387
|
void pushShader(DrawingCtx *ctx) {
|
388
|
+
// Validate colors array has at least 2 colors
|
389
|
+
if (props.colors.size() < 2) {
|
390
|
+
throw std::invalid_argument("Colors array must have at least 2 colors");
|
391
|
+
}
|
392
|
+
|
393
|
+
// Validate positions array matches colors array in size
|
394
|
+
if (props.positions.has_value() && props.positions.value().size() != props.colors.size()) {
|
395
|
+
throw std::invalid_argument("Positions array must have the same size as colors array");
|
396
|
+
}
|
397
|
+
|
358
398
|
SkMatrix m3 = processTransform(props.matrix, props.transform, props.origin);
|
359
399
|
auto shader = SkGradientShader::MakeTwoPointConical(
|
360
400
|
props.start, props.startRadius, props.end, props.endRadius,
|
@@ -15,4 +15,22 @@ interface CheckImageOptions {
|
|
15
15
|
shouldFail?: boolean;
|
16
16
|
}
|
17
17
|
export declare const checkImage: (image: SkImage, relPath: string, opts?: CheckImageOptions) => number;
|
18
|
+
declare global {
|
19
|
+
namespace jest {
|
20
|
+
interface Matchers<R> {
|
21
|
+
/**
|
22
|
+
* Checks if values are approximately equal within the given tolerance.
|
23
|
+
* Works with:
|
24
|
+
* - Single numbers
|
25
|
+
* - Arrays of numbers
|
26
|
+
* - Float32Arrays
|
27
|
+
* - SVG path strings (compares numeric values with tolerance)
|
28
|
+
*
|
29
|
+
* @param expected - The expected value to compare against
|
30
|
+
* @param tolerance - The maximum allowed difference between elements (default: 0.01)
|
31
|
+
*/
|
32
|
+
toBeApproximatelyEqual(expected: number | number[] | Float32Array | string, tolerance?: number): R;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
18
36
|
export {};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
2
|
import type { SkSurface } from "../skia";
|
3
3
|
export * from "../renderer/components";
|
4
|
+
export * from "../skia/types";
|
4
5
|
export declare const makeOffscreenSurface: (width: number, height: number) => SkSurface;
|
5
6
|
export declare const getSkiaExports: () => {
|
6
7
|
Skia: import("../skia/types").Skia;
|
@@ -23,6 +23,18 @@ Object.keys(_components).forEach(function (key) {
|
|
23
23
|
}
|
24
24
|
});
|
25
25
|
});
|
26
|
+
var _types = require("../skia/types");
|
27
|
+
Object.keys(_types).forEach(function (key) {
|
28
|
+
if (key === "default" || key === "__esModule") return;
|
29
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
30
|
+
if (key in exports && exports[key] === _types[key]) return;
|
31
|
+
Object.defineProperty(exports, key, {
|
32
|
+
enumerable: true,
|
33
|
+
get: function () {
|
34
|
+
return _types[key];
|
35
|
+
}
|
36
|
+
});
|
37
|
+
});
|
26
38
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
27
39
|
// @ts-ignore
|
28
40
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_web","require","_Reconciler","_components","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","Skia","makeOffscreenSurface","width","height","JsiSkApi","CanvasKit","surface","Surface","MakeOffscreen","Error","getSkiaExports","drawOffscreen","element","root","SkiaSGRoot","render","canvas","getCanvas","drawOnCanvas","unmount","flush","makeImageSnapshot"],"sources":["index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type { ReactNode } from \"react\";\n\nimport {
|
1
|
+
{"version":3,"names":["_web","require","_Reconciler","_components","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_types","Skia","makeOffscreenSurface","width","height","JsiSkApi","CanvasKit","surface","Surface","MakeOffscreen","Error","getSkiaExports","drawOffscreen","element","root","SkiaSGRoot","render","canvas","getCanvas","drawOnCanvas","unmount","flush","makeImageSnapshot"],"sources":["index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type { ReactNode } from \"react\";\n\nimport type { SkSurface } from \"../skia\";\nimport { JsiSkApi } from \"../skia/web\";\nimport { SkiaSGRoot } from \"../sksg/Reconciler\";\n\nexport * from \"../renderer/components\";\nexport * from \"../skia/types\";\n\nlet Skia: ReturnType<typeof JsiSkApi>;\n\nexport const makeOffscreenSurface = (width: number, height: number) => {\n if (!Skia) {\n Skia = JsiSkApi(CanvasKit);\n }\n const surface = Skia.Surface.MakeOffscreen(width, height);\n if (surface === null) {\n throw new Error(\"Couldn't create surface!\");\n }\n return surface;\n};\n\nexport const getSkiaExports = () => {\n if (!Skia) {\n Skia = JsiSkApi(CanvasKit);\n }\n return { Skia };\n};\n\nexport const drawOffscreen = (surface: SkSurface, element: ReactNode) => {\n const root = new SkiaSGRoot(Skia);\n root.render(element);\n const canvas = surface.getCanvas();\n root.drawOnCanvas(canvas);\n root.unmount();\n surface.flush();\n return surface.makeImageSnapshot();\n};\n"],"mappings":";;;;;;;;;;;AAMA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,WAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,WAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,MAAA,GAAAf,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAW,MAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,MAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AAVA;AACA;;AAWA,IAAIU,IAAiC;AAE9B,MAAMC,oBAAoB,GAAGA,CAACC,KAAa,EAAEC,MAAc,KAAK;EACrE,IAAI,CAACH,IAAI,EAAE;IACTA,IAAI,GAAG,IAAAI,aAAQ,EAACC,SAAS,CAAC;EAC5B;EACA,MAAMC,OAAO,GAAGN,IAAI,CAACO,OAAO,CAACC,aAAa,CAACN,KAAK,EAAEC,MAAM,CAAC;EACzD,IAAIG,OAAO,KAAK,IAAI,EAAE;IACpB,MAAM,IAAIG,KAAK,CAAC,0BAA0B,CAAC;EAC7C;EACA,OAAOH,OAAO;AAChB,CAAC;AAACX,OAAA,CAAAM,oBAAA,GAAAA,oBAAA;AAEK,MAAMS,cAAc,GAAGA,CAAA,KAAM;EAClC,IAAI,CAACV,IAAI,EAAE;IACTA,IAAI,GAAG,IAAAI,aAAQ,EAACC,SAAS,CAAC;EAC5B;EACA,OAAO;IAAEL;EAAK,CAAC;AACjB,CAAC;AAACL,OAAA,CAAAe,cAAA,GAAAA,cAAA;AAEK,MAAMC,aAAa,GAAGA,CAACL,OAAkB,EAAEM,OAAkB,KAAK;EACvE,MAAMC,IAAI,GAAG,IAAIC,sBAAU,CAACd,IAAI,CAAC;EACjCa,IAAI,CAACE,MAAM,CAACH,OAAO,CAAC;EACpB,MAAMI,MAAM,GAAGV,OAAO,CAACW,SAAS,CAAC,CAAC;EAClCJ,IAAI,CAACK,YAAY,CAACF,MAAM,CAAC;EACzBH,IAAI,CAACM,OAAO,CAAC,CAAC;EACdb,OAAO,CAACc,KAAK,CAAC,CAAC;EACf,OAAOd,OAAO,CAACe,iBAAiB,CAAC,CAAC;AACpC,CAAC;AAAC1B,OAAA,CAAAgB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
3
3
|
import type { ViewProps } from "react-native";
|
4
4
|
import type { SharedValue } from "react-native-reanimated";
|
5
5
|
import type { SkImage, SkRect, SkSize } from "../skia/types";
|
6
|
-
interface CanvasRef extends FC<CanvasProps> {
|
6
|
+
export interface CanvasRef extends FC<CanvasProps> {
|
7
7
|
makeImageSnapshot(rect?: SkRect): SkImage;
|
8
8
|
makeImageSnapshotAsync(rect?: SkRect): Promise<SkImage>;
|
9
9
|
redraw(): void;
|
@@ -17,4 +17,3 @@ export interface CanvasProps extends ViewProps {
|
|
17
17
|
mode?: "continuous" | "default";
|
18
18
|
}
|
19
19
|
export declare const Canvas: React.ForwardRefExoticComponent<CanvasProps & React.RefAttributes<unknown>>;
|
20
|
-
export {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_SkiaViewNativeId","_SkiaPictureViewNativeComponent","_interopRequireDefault","_Reconciler","_skia","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","useCanvasRef","useRef","exports","NativeSkiaPictureView","SkiaPictureViewNativeComponent","useOnSizeEvent","resultValue","onLayout","useCallback","event","width","height","nativeEvent","layout","value","Canvas","forwardRef","mode","debug","opaque","children","onSize","_onLayout","viewProps","ref","rafId","nativeId","useMemo","SkiaViewNativeId","current","root","SkiaSGRoot","Skia","useLayoutEffect","render","useEffect","unmount","requestRedraw","requestAnimationFrame","console","warn","cancelAnimationFrame","useImperativeHandle","makeImageSnapshot","rect","SkiaViewApi","makeImageSnapshotAsync","redraw","getNativeId","createElement","collapsable","nativeID"],"sources":["Canvas.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport type { LayoutChangeEvent, ViewProps } from \"react-native\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport { SkiaViewNativeId } from \"../views/SkiaViewNativeId\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\nimport type { SkImage, SkRect, SkSize } from \"../skia/types\";\nimport { SkiaSGRoot } from \"../sksg/Reconciler\";\nimport { Skia } from \"../skia\";\nimport type { SkiaBaseViewProps } from \"../views\";\n\
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_SkiaViewNativeId","_SkiaPictureViewNativeComponent","_interopRequireDefault","_Reconciler","_skia","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","useCanvasRef","useRef","exports","NativeSkiaPictureView","SkiaPictureViewNativeComponent","useOnSizeEvent","resultValue","onLayout","useCallback","event","width","height","nativeEvent","layout","value","Canvas","forwardRef","mode","debug","opaque","children","onSize","_onLayout","viewProps","ref","rafId","nativeId","useMemo","SkiaViewNativeId","current","root","SkiaSGRoot","Skia","useLayoutEffect","render","useEffect","unmount","requestRedraw","requestAnimationFrame","console","warn","cancelAnimationFrame","useImperativeHandle","makeImageSnapshot","rect","SkiaViewApi","makeImageSnapshotAsync","redraw","getNativeId","createElement","collapsable","nativeID"],"sources":["Canvas.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport type { LayoutChangeEvent, ViewProps } from \"react-native\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport { SkiaViewNativeId } from \"../views/SkiaViewNativeId\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\nimport type { SkImage, SkRect, SkSize } from \"../skia/types\";\nimport { SkiaSGRoot } from \"../sksg/Reconciler\";\nimport { Skia } from \"../skia\";\nimport type { SkiaBaseViewProps } from \"../views\";\n\nexport interface CanvasRef extends FC<CanvasProps> {\n makeImageSnapshot(rect?: SkRect): SkImage;\n makeImageSnapshotAsync(rect?: SkRect): Promise<SkImage>;\n redraw(): void;\n getNativeId(): number;\n}\n\nexport const useCanvasRef = () => useRef<CanvasRef>(null);\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\n// TODO: no need to go through the JS thread for this\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport interface CanvasProps extends ViewProps {\n debug?: boolean;\n opaque?: boolean;\n onSize?: SharedValue<SkSize>;\n mode?: \"continuous\" | \"default\";\n}\n\nexport const Canvas = forwardRef(\n (\n {\n mode,\n debug,\n opaque,\n children,\n onSize,\n onLayout: _onLayout,\n ...viewProps\n }: CanvasProps,\n ref\n ) => {\n const rafId = useRef<number | null>(null);\n const onLayout = useOnSizeEvent(onSize, _onLayout);\n // Native ID\n const nativeId = useMemo(() => {\n return SkiaViewNativeId.current++;\n }, []);\n\n // Root\n const root = useMemo(() => new SkiaSGRoot(Skia, nativeId), [nativeId]);\n\n // Render effects\n useLayoutEffect(() => {\n root.render(children);\n }, [children, root]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n\n const requestRedraw = useCallback(() => {\n rafId.current = requestAnimationFrame(() => {\n root.render(children);\n if (mode === \"continuous\") {\n requestRedraw();\n }\n });\n }, [children, mode, root]);\n\n useEffect(() => {\n if (mode === \"continuous\") {\n console.warn(\"The `mode` property in `Canvas` is deprecated.\");\n requestRedraw();\n }\n return () => {\n if (rafId.current !== null) {\n cancelAnimationFrame(rafId.current);\n }\n };\n }, [mode, requestRedraw]);\n // Component methods\n useImperativeHandle(ref, () => ({\n makeImageSnapshot: (rect?: SkRect) => {\n return SkiaViewApi.makeImageSnapshot(nativeId, rect);\n },\n makeImageSnapshotAsync: (rect?: SkRect) => {\n return SkiaViewApi.makeImageSnapshotAsync(nativeId, rect);\n },\n redraw: () => {\n SkiaViewApi.requestRedraw(nativeId);\n },\n getNativeId: () => {\n return nativeId;\n },\n }));\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${nativeId}`}\n debug={debug}\n opaque={opaque}\n onLayout={onLayout}\n {...viewProps}\n />\n );\n }\n);\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAYA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,+BAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAA+B,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,I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drawing","require","_Box","_ColorFilters","_CTM","_ImageFilters","_Paint","_PathEffects","_Shaders","_Core","play","ctx","_command","isGroup","children","forEach","child","command","materializeCommand","isCommand","CommandType","SaveBackdropFilter","saveBackdropFilter","SaveLayer","materializePaint","paint","paintDeclarations","pop","canvas","saveLayer","isDrawCommand","SavePaint","props","paints","push","savePaint","setPaintProperties","Skia","RestorePaint","restorePaint","ComposeColorFilter","composeColorFilters","RestorePaintDeclaration","Error","MaterializePaint","isPushColorFilter","pushColorFilter","isPushShader","pushShader","isPushImageFilter","pushImageFilter","isPushPathEffect","pushPathEffect","ComposePathEffect","composePathEffects","ComposeImageFilter","composeImageFilters","PushBlurMaskFilter","setBlurMaskFilter","SaveCTM","saveCTM","RestoreCTM","restore","p","isBoxCommand","drawBox","DrawPaint","drawPaint","DrawImage","drawImage","DrawCircle","drawCircle","DrawPoints","drawPoints","DrawPath","drawPath","DrawRect","drawRect","DrawRRect","drawRRect","DrawOval","drawOval","DrawLine","drawLine","DrawPatch","drawPatch","DrawVertices","drawVertices","DrawDiffRect","drawDiffRect","DrawText","drawText","DrawTextPath","drawTextPath","DrawTextBlob","drawTextBlob","DrawGlyphs","drawGlyphs","DrawPicture","drawPicture","DrawImageSVG","drawImageSVG","DrawParagraph","drawParagraph","DrawAtlas","drawAtlas","console","warn","type","replay","commands","exports"],"sources":["Player.ts"],"sourcesContent":["import {\n drawCircle,\n drawImage,\n drawOval,\n drawPath,\n drawPoints,\n drawRect,\n drawRRect,\n drawLine,\n drawAtlas,\n drawParagraph,\n drawImageSVG,\n drawPicture,\n drawGlyphs,\n drawTextBlob,\n drawTextPath,\n drawText,\n drawDiffRect,\n drawVertices,\n drawPatch,\n} from \"./commands/Drawing\";\nimport { drawBox, isBoxCommand } from \"./commands/Box\";\nimport {\n composeColorFilters,\n isPushColorFilter,\n pushColorFilter,\n} from \"./commands/ColorFilters\";\nimport { saveCTM } from \"./commands/CTM\";\nimport {\n setBlurMaskFilter,\n isPushImageFilter,\n pushImageFilter,\n composeImageFilters,\n} from \"./commands/ImageFilters\";\nimport { setPaintProperties } from \"./commands/Paint\";\nimport {\n composePathEffects,\n isPushPathEffect,\n pushPathEffect,\n} from \"./commands/PathEffects\";\nimport { isPushShader, pushShader } from \"./commands/Shaders\";\nimport {\n CommandType,\n isCommand,\n isDrawCommand,\n isGroup,\n materializeCommand,\n type Command,\n} from \"./Core\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nfunction play(ctx: DrawingContext, _command: Command) {\n \"worklet\";\n if (isGroup(_command)) {\n _command.children.forEach((child) => play(ctx, child));\n return;\n }\n const command = materializeCommand(_command);\n if (isCommand(command, CommandType.SaveBackdropFilter)) {\n ctx.saveBackdropFilter();\n } else if (isCommand(command, CommandType.SaveLayer)) {\n ctx.materializePaint();\n const paint = ctx.paintDeclarations.pop();\n ctx.canvas.saveLayer(paint);\n } else if (isDrawCommand(command, CommandType.SavePaint)) {\n if (command.props.paint) {\n ctx.paints.push(command.props.paint);\n } else {\n ctx.savePaint();\n setPaintProperties(ctx.Skia, ctx.paint, command.props);\n }\n } else if (isCommand(command, CommandType.RestorePaint)) {\n ctx.restorePaint();\n } else if (isCommand(command, CommandType.ComposeColorFilter)) {\n composeColorFilters(ctx);\n } else if (isCommand(command, CommandType.RestorePaintDeclaration)) {\n ctx.materializePaint();\n const paint = ctx.restorePaint();\n if (!paint) {\n throw new Error(\"No paint declaration to push\");\n }\n ctx.paintDeclarations.push(paint);\n } else if (isCommand(command, CommandType.MaterializePaint)) {\n ctx.materializePaint();\n } else if (isPushColorFilter(command)) {\n pushColorFilter(ctx, command);\n } else if (isPushShader(command)) {\n pushShader(ctx, command);\n } else if (isPushImageFilter(command)) {\n pushImageFilter(ctx, command);\n } else if (isPushPathEffect(command)) {\n pushPathEffect(ctx, command);\n } else if (isCommand(command, CommandType.ComposePathEffect)) {\n composePathEffects(ctx);\n } else if (isCommand(command, CommandType.ComposeImageFilter)) {\n composeImageFilters(ctx);\n } else if (isDrawCommand(command, CommandType.PushBlurMaskFilter)) {\n setBlurMaskFilter(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.SaveCTM)) {\n saveCTM(ctx, command.props);\n } else if (isCommand(command, CommandType.RestoreCTM)) {\n ctx.canvas.restore();\n } else {\n const paints = [ctx.paint, ...ctx.paintDeclarations];\n ctx.paintDeclarations = [];\n paints.forEach((p) => {\n ctx.paints.push(p);\n if (isBoxCommand(command)) {\n drawBox(ctx, command);\n } else if (isCommand(command, CommandType.DrawPaint)) {\n ctx.canvas.drawPaint(ctx.paint);\n } else if (isDrawCommand(command, CommandType.DrawImage)) {\n drawImage(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawCircle)) {\n drawCircle(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPoints)) {\n drawPoints(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPath)) {\n drawPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRect)) {\n drawRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRRect)) {\n drawRRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawOval)) {\n drawOval(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawLine)) {\n drawLine(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPatch)) {\n drawPatch(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawVertices)) {\n drawVertices(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawDiffRect)) {\n drawDiffRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawText)) {\n drawText(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextPath)) {\n drawTextPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextBlob)) {\n drawTextBlob(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawGlyphs)) {\n drawGlyphs(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPicture)) {\n drawPicture(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawImageSVG)) {\n drawImageSVG(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawParagraph)) {\n drawParagraph(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawAtlas)) {\n drawAtlas(ctx, command.props);\n } else {\n console.warn(`Unknown command: ${command.type}`);\n }\n ctx.paints.pop();\n });\n }\n}\n\nexport const replay = (ctx: DrawingContext, commands: Command[]) => {\n \"worklet\";\n commands.forEach((command) => {\n play(ctx, command);\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAqBA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAUA,SAASS,IAAIA,CAACC,GAAmB,EAAEC,QAAiB,EAAE;EACpD,SAAS;;EACT,IAAI,IAAAC,aAAO,EAACD,QAAQ,CAAC,EAAE;IACrBA,QAAQ,CAACE,QAAQ,CAACC,OAAO,CAAEC,KAAK,IAAKN,IAAI,CAACC,GAAG,EAAEK,KAAK,CAAC,CAAC;IACtD;EACF;EACA,MAAMC,OAAO,GAAG,IAAAC,wBAAkB,EAACN,QAAQ,CAAC;EAC5C,IAAI,IAAAO,eAAS,EAACF,OAAO,EAAEG,iBAAW,CAACC,kBAAkB,CAAC,EAAE;IACtDV,GAAG,CAACW,kBAAkB,CAAC,CAAC;EAC1B,CAAC,MAAM,IAAI,IAAAH,eAAS,EAACF,OAAO,EAAEG,iBAAW,CAACG,SAAS,CAAC,EAAE;IACpDZ,GAAG,CAACa,gBAAgB,CAAC,CAAC;IACtB,MAAMC,KAAK,GAAGd,GAAG,CAACe,iBAAiB,CAACC,GAAG,CAAC,CAAC;IACzChB,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S;;EACTA,QAAQ,CAAC/F,OAAO,CAAEE,OAAO,IAAK;IAC5BP,IAAI,CAACC,GAAG,EAAEM,OAAO,CAAC;EACpB,CAAC,CAAC;AACJ,CAAC;AAAC8F,OAAA,CAAAF,MAAA,GAAAA,MAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_Drawing","require","_Box","_ColorFilters","_CTM","_ImageFilters","_Paint","_PathEffects","_Shaders","_Core","play","ctx","_command","isGroup","children","forEach","child","command","materializeCommand","isCommand","CommandType","SaveBackdropFilter","saveBackdropFilter","SaveLayer","materializePaint","paint","paintDeclarations","pop","canvas","saveLayer","isDrawCommand","SavePaint","props","paints","push","savePaint","setPaintProperties","Skia","RestorePaint","restorePaint","ComposeColorFilter","composeColorFilters","RestorePaintDeclaration","Error","MaterializePaint","isPushColorFilter","pushColorFilter","isPushShader","pushShader","isPushImageFilter","pushImageFilter","isPushPathEffect","pushPathEffect","ComposePathEffect","composePathEffects","ComposeImageFilter","composeImageFilters","PushBlurMaskFilter","setBlurMaskFilter","SaveCTM","saveCTM","RestoreCTM","restore","p","isBoxCommand","drawBox","DrawPaint","drawPaint","DrawImage","drawImage","DrawCircle","drawCircle","DrawPoints","drawPoints","DrawPath","drawPath","DrawRect","drawRect","DrawRRect","drawRRect","DrawOval","drawOval","DrawLine","drawLine","DrawPatch","drawPatch","DrawVertices","drawVertices","DrawDiffRect","drawDiffRect","DrawText","drawText","DrawTextPath","drawTextPath","DrawTextBlob","drawTextBlob","DrawGlyphs","drawGlyphs","DrawPicture","drawPicture","DrawImageSVG","drawImageSVG","DrawParagraph","drawParagraph","DrawAtlas","drawAtlas","console","warn","type","replay","commands","exports"],"sources":["Player.ts"],"sourcesContent":["import {\n drawCircle,\n drawImage,\n drawOval,\n drawPath,\n drawPoints,\n drawRect,\n drawRRect,\n drawLine,\n drawAtlas,\n drawParagraph,\n drawImageSVG,\n drawPicture,\n drawGlyphs,\n drawTextBlob,\n drawTextPath,\n drawText,\n drawDiffRect,\n drawVertices,\n drawPatch,\n} from \"./commands/Drawing\";\nimport { drawBox, isBoxCommand } from \"./commands/Box\";\nimport {\n composeColorFilters,\n isPushColorFilter,\n pushColorFilter,\n} from \"./commands/ColorFilters\";\nimport { saveCTM } from \"./commands/CTM\";\nimport {\n setBlurMaskFilter,\n isPushImageFilter,\n pushImageFilter,\n composeImageFilters,\n} from \"./commands/ImageFilters\";\nimport { setPaintProperties } from \"./commands/Paint\";\nimport {\n composePathEffects,\n isPushPathEffect,\n pushPathEffect,\n} from \"./commands/PathEffects\";\nimport { isPushShader, pushShader } from \"./commands/Shaders\";\nimport {\n CommandType,\n isCommand,\n isDrawCommand,\n isGroup,\n materializeCommand,\n} from \"./Core\";\nimport type { Command } from \"./Core\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nfunction play(ctx: DrawingContext, _command: Command) {\n \"worklet\";\n if (isGroup(_command)) {\n _command.children.forEach((child) => play(ctx, child));\n return;\n }\n const command = materializeCommand(_command);\n if (isCommand(command, CommandType.SaveBackdropFilter)) {\n ctx.saveBackdropFilter();\n } else if (isCommand(command, CommandType.SaveLayer)) {\n ctx.materializePaint();\n const paint = ctx.paintDeclarations.pop();\n ctx.canvas.saveLayer(paint);\n } else if (isDrawCommand(command, CommandType.SavePaint)) {\n if (command.props.paint) {\n ctx.paints.push(command.props.paint);\n } else {\n ctx.savePaint();\n setPaintProperties(ctx.Skia, ctx.paint, command.props);\n }\n } else if (isCommand(command, CommandType.RestorePaint)) {\n ctx.restorePaint();\n } else if (isCommand(command, CommandType.ComposeColorFilter)) {\n composeColorFilters(ctx);\n } else if (isCommand(command, CommandType.RestorePaintDeclaration)) {\n ctx.materializePaint();\n const paint = ctx.restorePaint();\n if (!paint) {\n throw new Error(\"No paint declaration to push\");\n }\n ctx.paintDeclarations.push(paint);\n } else if (isCommand(command, CommandType.MaterializePaint)) {\n ctx.materializePaint();\n } else if (isPushColorFilter(command)) {\n pushColorFilter(ctx, command);\n } else if (isPushShader(command)) {\n pushShader(ctx, command);\n } else if (isPushImageFilter(command)) {\n pushImageFilter(ctx, command);\n } else if (isPushPathEffect(command)) {\n pushPathEffect(ctx, command);\n } else if (isCommand(command, CommandType.ComposePathEffect)) {\n composePathEffects(ctx);\n } else if (isCommand(command, CommandType.ComposeImageFilter)) {\n composeImageFilters(ctx);\n } else if (isDrawCommand(command, CommandType.PushBlurMaskFilter)) {\n setBlurMaskFilter(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.SaveCTM)) {\n saveCTM(ctx, command.props);\n } else if (isCommand(command, CommandType.RestoreCTM)) {\n ctx.canvas.restore();\n } else {\n const paints = [ctx.paint, ...ctx.paintDeclarations];\n ctx.paintDeclarations = [];\n paints.forEach((p) => {\n ctx.paints.push(p);\n if (isBoxCommand(command)) {\n drawBox(ctx, command);\n } else if (isCommand(command, CommandType.DrawPaint)) {\n ctx.canvas.drawPaint(ctx.paint);\n } else if (isDrawCommand(command, CommandType.DrawImage)) {\n drawImage(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawCircle)) {\n drawCircle(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPoints)) {\n drawPoints(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPath)) {\n drawPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRect)) {\n drawRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRRect)) {\n drawRRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawOval)) {\n drawOval(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawLine)) {\n drawLine(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPatch)) {\n drawPatch(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawVertices)) {\n drawVertices(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawDiffRect)) {\n drawDiffRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawText)) {\n drawText(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextPath)) {\n drawTextPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextBlob)) {\n drawTextBlob(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawGlyphs)) {\n drawGlyphs(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPicture)) {\n drawPicture(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawImageSVG)) {\n drawImageSVG(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawParagraph)) {\n drawParagraph(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawAtlas)) {\n drawAtlas(ctx, command.props);\n } else {\n console.warn(`Unknown command: ${command.type}`);\n }\n ctx.paints.pop();\n });\n }\n}\n\nexport const replay = (ctx: DrawingContext, commands: Command[]) => {\n \"worklet\";\n commands.forEach((command) => {\n play(ctx, command);\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAqBA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAUA,SAASS,IAAIA,CAACC,GAAmB,EAAEC,QAAiB,EAAE;EACpD,SAAS;;EACT,IAAI,IAAAC,aAAO,EAACD,QAAQ,CAAC,EAAE;IACrBA,QAAQ,CAACE,QAAQ,CAACC,OAAO,CAAEC,KAAK,IAAKN,IAAI,CAACC,GAAG,EAAEK,KAAK,CAAC,CAAC;IACtD;EACF;EACA,MAAMC,OAAO,GAAG,IAAAC,wBAAkB,EAACN,QAAQ,CAAC;EAC5C,IAAI,IAAAO,eAAS,EAACF,OAAO,EAAEG,iBAAW,CAACC,kBAAkB,CAAC,EAAE;IACtDV,GAAG,CAACW,kBAAkB,CAA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