@shopify/react-native-skia 2.13.1 → 2.14.0
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/CMakeLists.txt +2 -0
- package/android/cpp/jni/include/JniSkiaPictureView.h +16 -15
- package/apple/RNSkApplePlatformContext.h +3 -4
- package/apple/RNSkiaModule.h +11 -3
- package/apple/RNSkiaModule.mm +46 -19
- package/apple/SkiaPictureView.mm +2 -2
- package/apple/SkiaUIView.h +0 -1
- package/apple/SkiaUIView.mm +1 -1
- package/apple/ViewScreenshotService.h +2 -2
- package/apple/ViewScreenshotService.mm +5 -4
- package/cpp/api/JsiSkPath.h +0 -431
- package/cpp/api/JsiSkSkottie.h +2 -3
- package/cpp/api/JsiSkStrutStyle.h +1 -1
- package/cpp/api/JsiSkSurfaceFactory.h +41 -0
- package/cpp/api/recorder/Convertor.h +152 -131
- package/cpp/api/recorder/DataTypes.h +11 -11
- package/cpp/api/recorder/ImageFit.h +8 -5
- package/cpp/api/recorder/JsiRecorder.h +9 -29
- package/cpp/api/recorder/Paint.h +3 -3
- package/cpp/api/recorder/RNRecorder.h +56 -0
- package/cpp/jsi/ViewProperty.cpp +23 -0
- package/cpp/jsi/ViewProperty.h +31 -10
- package/cpp/rnskia/RNDawnContext.h +33 -0
- package/cpp/rnskia/RNSkJsiViewApi.h +69 -2
- package/cpp/rnskia/RNSkPictureView.cpp +58 -0
- package/cpp/rnskia/RNSkPictureView.h +110 -24
- package/lib/commonjs/Platform/IPlatform.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolate.js.map +1 -1
- package/lib/commonjs/skia/core/Image.js.map +1 -1
- package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.d.ts +2 -336
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Recorder.d.ts +10 -0
- package/lib/commonjs/skia/types/Recorder.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.d.ts +16 -0
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +4 -38
- package/lib/commonjs/skia/web/JsiSkPath.js +3 -275
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js +3 -0
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/commonjs/sksg/Container.native.d.ts +15 -1
- package/lib/commonjs/sksg/Container.native.js +34 -33
- package/lib/commonjs/sksg/Container.native.js.map +1 -1
- package/lib/commonjs/specs/NativeSkiaModule.web.js +4 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +9 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/Platform/IPlatform.js.map +1 -1
- package/lib/module/animation/functions/interpolate.js.map +1 -1
- package/lib/module/skia/core/Image.js.map +1 -1
- package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.js.map +1 -1
- package/lib/module/skia/types/Path/Path.d.ts +2 -336
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Recorder.d.ts +10 -0
- package/lib/module/skia/types/Recorder.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/types/Surface/SurfaceFactory.d.ts +16 -0
- package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +4 -38
- package/lib/module/skia/web/JsiSkPath.js +4 -276
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js +4 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/module/sksg/Container.native.d.ts +15 -1
- package/lib/module/sksg/Container.native.js +34 -33
- package/lib/module/sksg/Container.native.js.map +1 -1
- package/lib/module/specs/NativeSkiaModule.web.js +4 -0
- package/lib/module/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/module/views/types.d.ts +9 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPath.d.ts +1 -35
- package/lib/typescript/lib/commonjs/skia/web/JsiSkSurfaceFactory.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/Container.native.d.ts +15 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPath.d.ts +3 -37
- package/lib/typescript/lib/module/skia/web/JsiSkSurfaceFactory.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Container.native.d.ts +15 -1
- package/lib/typescript/src/skia/types/Path/Path.d.ts +2 -336
- package/lib/typescript/src/skia/types/Recorder.d.ts +10 -0
- package/lib/typescript/src/skia/types/Surface/SurfaceFactory.d.ts +16 -0
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +4 -38
- package/lib/typescript/src/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
- package/lib/typescript/src/sksg/Container.native.d.ts +15 -1
- package/lib/typescript/src/views/types.d.ts +9 -0
- package/package.json +2 -2
- package/src/Platform/IPlatform.ts +1 -4
- package/src/animation/functions/interpolate.ts +1 -4
- package/src/skia/core/Image.ts +1 -2
- package/src/skia/types/NativeBuffer/NativeBufferFactory.ts +2 -5
- package/src/skia/types/Path/Path.ts +2 -420
- package/src/skia/types/Recorder.ts +10 -0
- package/src/skia/types/Shader/Shader.ts +1 -5
- package/src/skia/types/Surface/SurfaceFactory.ts +17 -0
- package/src/skia/web/JsiSkPath.ts +4 -495
- package/src/skia/web/JsiSkSurfaceFactory.ts +6 -2
- package/src/sksg/Container.native.ts +34 -37
- package/src/specs/NativeSkiaModule.web.ts +4 -0
- package/src/views/types.ts +13 -0
- package/apple/SkiaManager.h +0 -23
- package/apple/SkiaManager.mm +0 -63
|
@@ -40,7 +40,7 @@ struct GlyphData {
|
|
|
40
40
|
std::vector<SkPoint> positions;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
bool isSharedValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
43
|
+
inline bool isSharedValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
44
44
|
return value.isObject() &&
|
|
45
45
|
value.asObject(runtime).hasProperty(runtime,
|
|
46
46
|
"_isReanimatedSharedValue") &&
|
|
@@ -103,7 +103,8 @@ bool convertSelectorProperty(jsi::Runtime &runtime, const jsi::Value &prop,
|
|
|
103
103
|
|
|
104
104
|
auto selected = values.getProperty(runtime, key.c_str());
|
|
105
105
|
if (selected.isUndefined() || selected.isNull() ||
|
|
106
|
-
(selected.isObject() &&
|
|
106
|
+
(selected.isObject() &&
|
|
107
|
+
selected.asObject(runtime).isFunction(runtime))) {
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
109
110
|
*target = getPropertyValue<T>(runtime, selected);
|
|
@@ -130,8 +131,9 @@ void convertPropertyImpl(jsi::Runtime &runtime, const jsi::Object &object,
|
|
|
130
131
|
|
|
131
132
|
if (isSharedValue(runtime, prop)) {
|
|
132
133
|
auto sharedValue = prop.asObject(runtime);
|
|
133
|
-
auto name =
|
|
134
|
-
|
|
134
|
+
auto name = sharedValue.getProperty(runtime, "name")
|
|
135
|
+
.asString(runtime)
|
|
136
|
+
.utf8(runtime);
|
|
135
137
|
auto conv = [target = &target](jsi::Runtime &runtime,
|
|
136
138
|
const jsi::Object &val) {
|
|
137
139
|
auto value = val.getProperty(runtime, "value");
|
|
@@ -155,7 +157,7 @@ void convertProperty(jsi::Runtime &runtime, const jsi::Object &object,
|
|
|
155
157
|
|
|
156
158
|
// Base property value getter implementations
|
|
157
159
|
template <>
|
|
158
|
-
float getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
160
|
+
inline float getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
159
161
|
if (value.isNumber()) {
|
|
160
162
|
return static_cast<float>(value.asNumber());
|
|
161
163
|
}
|
|
@@ -163,7 +165,7 @@ float getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
template <>
|
|
166
|
-
int getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
168
|
+
inline int getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
167
169
|
if (value.isNumber()) {
|
|
168
170
|
return static_cast<int>(value.asNumber());
|
|
169
171
|
}
|
|
@@ -171,7 +173,8 @@ int getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
template <>
|
|
174
|
-
std::string getPropertyValue(jsi::Runtime &runtime,
|
|
176
|
+
inline std::string getPropertyValue(jsi::Runtime &runtime,
|
|
177
|
+
const jsi::Value &value) {
|
|
175
178
|
if (value.isString()) {
|
|
176
179
|
return value.asString(runtime).utf8(runtime);
|
|
177
180
|
}
|
|
@@ -179,7 +182,8 @@ std::string getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
179
182
|
}
|
|
180
183
|
|
|
181
184
|
template <>
|
|
182
|
-
SkPoint getPropertyValue(jsi::Runtime &runtime,
|
|
185
|
+
inline SkPoint getPropertyValue(jsi::Runtime &runtime,
|
|
186
|
+
const jsi::Value &value) {
|
|
183
187
|
if (value.isObject()) {
|
|
184
188
|
auto x = value.asObject(runtime).getProperty(runtime, "x").asNumber();
|
|
185
189
|
auto y = value.asObject(runtime).getProperty(runtime, "y").asNumber();
|
|
@@ -189,7 +193,8 @@ SkPoint getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
189
193
|
}
|
|
190
194
|
|
|
191
195
|
template <>
|
|
192
|
-
SkColor getPropertyValue(jsi::Runtime &runtime,
|
|
196
|
+
inline SkColor getPropertyValue(jsi::Runtime &runtime,
|
|
197
|
+
const jsi::Value &value) {
|
|
193
198
|
if (value.isNumber()) {
|
|
194
199
|
return static_cast<SkColor>(value.asNumber());
|
|
195
200
|
} else if (value.isString()) {
|
|
@@ -241,8 +246,8 @@ SkColor getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
241
246
|
}
|
|
242
247
|
|
|
243
248
|
template <>
|
|
244
|
-
std::vector<SkColor> getPropertyValue(jsi::Runtime &runtime,
|
|
245
|
-
|
|
249
|
+
inline std::vector<SkColor> getPropertyValue(jsi::Runtime &runtime,
|
|
250
|
+
const jsi::Value &value) {
|
|
246
251
|
std::vector<SkColor> result;
|
|
247
252
|
if (value.isObject() && value.asObject(runtime).isArray(runtime)) {
|
|
248
253
|
auto array = value.asObject(runtime).asArray(runtime);
|
|
@@ -258,7 +263,8 @@ std::vector<SkColor> getPropertyValue(jsi::Runtime &runtime,
|
|
|
258
263
|
}
|
|
259
264
|
|
|
260
265
|
template <>
|
|
261
|
-
SkTileMode getPropertyValue(jsi::Runtime &runtime,
|
|
266
|
+
inline SkTileMode getPropertyValue(jsi::Runtime &runtime,
|
|
267
|
+
const jsi::Value &val) {
|
|
262
268
|
if (val.isString()) {
|
|
263
269
|
auto value = val.asString(runtime).utf8(runtime);
|
|
264
270
|
if (value == "clamp") {
|
|
@@ -275,7 +281,8 @@ SkTileMode getPropertyValue(jsi::Runtime &runtime, const jsi::Value &val) {
|
|
|
275
281
|
}
|
|
276
282
|
|
|
277
283
|
template <>
|
|
278
|
-
SkColorChannel getPropertyValue(jsi::Runtime &runtime,
|
|
284
|
+
inline SkColorChannel getPropertyValue(jsi::Runtime &runtime,
|
|
285
|
+
const jsi::Value &val) {
|
|
279
286
|
if (val.isString()) {
|
|
280
287
|
auto value = val.asString(runtime).utf8(runtime);
|
|
281
288
|
if (value == "r") {
|
|
@@ -292,8 +299,8 @@ SkColorChannel getPropertyValue(jsi::Runtime &runtime, const jsi::Value &val) {
|
|
|
292
299
|
}
|
|
293
300
|
|
|
294
301
|
template <>
|
|
295
|
-
SkVertices::VertexMode getPropertyValue(jsi::Runtime &runtime,
|
|
296
|
-
|
|
302
|
+
inline SkVertices::VertexMode getPropertyValue(jsi::Runtime &runtime,
|
|
303
|
+
const jsi::Value &val) {
|
|
297
304
|
if (val.isString()) {
|
|
298
305
|
auto value = val.asString(runtime).utf8(runtime);
|
|
299
306
|
if (value == "triangles") {
|
|
@@ -308,7 +315,7 @@ SkVertices::VertexMode getPropertyValue(jsi::Runtime &runtime,
|
|
|
308
315
|
}
|
|
309
316
|
|
|
310
317
|
template <>
|
|
311
|
-
SkM44 getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
318
|
+
inline SkM44 getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
312
319
|
if (value.isObject()) {
|
|
313
320
|
auto object = value.asObject(runtime);
|
|
314
321
|
// Get array of property names
|
|
@@ -416,8 +423,8 @@ SkM44 getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
416
423
|
}
|
|
417
424
|
|
|
418
425
|
template <>
|
|
419
|
-
SkSamplingOptions getPropertyValue(jsi::Runtime &runtime,
|
|
420
|
-
|
|
426
|
+
inline SkSamplingOptions getPropertyValue(jsi::Runtime &runtime,
|
|
427
|
+
const jsi::Value &value) {
|
|
421
428
|
if (value.isObject()) {
|
|
422
429
|
SkSamplingOptions samplingOptions(SkFilterMode::kLinear);
|
|
423
430
|
auto object = value.asObject(runtime);
|
|
@@ -443,7 +450,7 @@ SkSamplingOptions getPropertyValue(jsi::Runtime &runtime,
|
|
|
443
450
|
}
|
|
444
451
|
|
|
445
452
|
template <>
|
|
446
|
-
SkFont getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
453
|
+
inline SkFont getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
447
454
|
if (value.isObject()) {
|
|
448
455
|
auto font = getJsiObject<JsiSkFont>(runtime, value)->getObject();
|
|
449
456
|
return SkFont(*font);
|
|
@@ -452,7 +459,8 @@ SkFont getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
452
459
|
}
|
|
453
460
|
|
|
454
461
|
template <>
|
|
455
|
-
GlyphData getPropertyValue(jsi::Runtime &runtime,
|
|
462
|
+
inline GlyphData getPropertyValue(jsi::Runtime &runtime,
|
|
463
|
+
const jsi::Value &value) {
|
|
456
464
|
GlyphData result;
|
|
457
465
|
if (value.isObject() && value.asObject(runtime).isArray(runtime)) {
|
|
458
466
|
auto array = value.asObject(runtime).asArray(runtime);
|
|
@@ -475,7 +483,8 @@ GlyphData getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
475
483
|
}
|
|
476
484
|
|
|
477
485
|
template <>
|
|
478
|
-
SkRSXform getPropertyValue(jsi::Runtime &runtime,
|
|
486
|
+
inline SkRSXform getPropertyValue(jsi::Runtime &runtime,
|
|
487
|
+
const jsi::Value &value) {
|
|
479
488
|
if (value.isObject()) {
|
|
480
489
|
auto form = getJsiObject<JsiSkRSXform>(runtime, value)->getObject();
|
|
481
490
|
return SkRSXform::Make(form->fSCos, form->fSSin, form->fTx, form->fTy);
|
|
@@ -484,8 +493,8 @@ SkRSXform getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
484
493
|
}
|
|
485
494
|
|
|
486
495
|
template <>
|
|
487
|
-
sk_sp<SkSVGDOM> getPropertyValue(jsi::Runtime &runtime,
|
|
488
|
-
|
|
496
|
+
inline sk_sp<SkSVGDOM> getPropertyValue(jsi::Runtime &runtime,
|
|
497
|
+
const jsi::Value &value) {
|
|
489
498
|
auto ptr = tryGetJsiObject<JsiSkSVG>(runtime, value);
|
|
490
499
|
if (ptr != nullptr) {
|
|
491
500
|
return ptr->getObject();
|
|
@@ -498,8 +507,8 @@ sk_sp<SkSVGDOM> getPropertyValue(jsi::Runtime &runtime,
|
|
|
498
507
|
}
|
|
499
508
|
|
|
500
509
|
template <>
|
|
501
|
-
sk_sp<skottie::Animation> getPropertyValue(jsi::Runtime &runtime,
|
|
502
|
-
|
|
510
|
+
inline sk_sp<skottie::Animation> getPropertyValue(jsi::Runtime &runtime,
|
|
511
|
+
const jsi::Value &value) {
|
|
503
512
|
auto ptr = tryGetJsiObject<JsiSkSkottie>(runtime, value);
|
|
504
513
|
if (ptr != nullptr) {
|
|
505
514
|
return ptr->getObject()->_animation;
|
|
@@ -512,8 +521,8 @@ sk_sp<skottie::Animation> getPropertyValue(jsi::Runtime &runtime,
|
|
|
512
521
|
}
|
|
513
522
|
|
|
514
523
|
template <>
|
|
515
|
-
sk_sp<SkImageFilter> getPropertyValue(jsi::Runtime &runtime,
|
|
516
|
-
|
|
524
|
+
inline sk_sp<SkImageFilter> getPropertyValue(jsi::Runtime &runtime,
|
|
525
|
+
const jsi::Value &value) {
|
|
517
526
|
auto ptr = tryGetJsiObject<JsiSkImageFilter>(runtime, value);
|
|
518
527
|
if (ptr != nullptr) {
|
|
519
528
|
return ptr->getObject();
|
|
@@ -526,8 +535,8 @@ sk_sp<SkImageFilter> getPropertyValue(jsi::Runtime &runtime,
|
|
|
526
535
|
}
|
|
527
536
|
|
|
528
537
|
template <>
|
|
529
|
-
sk_sp<SkPicture> getPropertyValue(jsi::Runtime &runtime,
|
|
530
|
-
|
|
538
|
+
inline sk_sp<SkPicture> getPropertyValue(jsi::Runtime &runtime,
|
|
539
|
+
const jsi::Value &value) {
|
|
531
540
|
if (value.isObject()) {
|
|
532
541
|
auto picture = getJsiObject<JsiSkPicture>(runtime, value)->getObject();
|
|
533
542
|
return picture;
|
|
@@ -536,7 +545,8 @@ sk_sp<SkPicture> getPropertyValue(jsi::Runtime &runtime,
|
|
|
536
545
|
}
|
|
537
546
|
|
|
538
547
|
template <>
|
|
539
|
-
SkPaint getPropertyValue(jsi::Runtime &runtime,
|
|
548
|
+
inline SkPaint getPropertyValue(jsi::Runtime &runtime,
|
|
549
|
+
const jsi::Value &value) {
|
|
540
550
|
if (value.isObject()) {
|
|
541
551
|
auto paint = getJsiObject<JsiSkPaint>(runtime, value)->getObject();
|
|
542
552
|
return SkPaint(*paint);
|
|
@@ -545,15 +555,15 @@ SkPaint getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
545
555
|
}
|
|
546
556
|
|
|
547
557
|
template <>
|
|
548
|
-
std::shared_ptr<JsiSkParagraph>
|
|
549
|
-
|
|
558
|
+
inline std::shared_ptr<JsiSkParagraph>
|
|
559
|
+
getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
550
560
|
// Return a shared_ptr instead of raw pointer
|
|
551
561
|
return tryGetJsiObject<JsiSkParagraph>(runtime, value);
|
|
552
562
|
}
|
|
553
563
|
|
|
554
564
|
template <>
|
|
555
|
-
sk_sp<SkTextBlob> getPropertyValue(jsi::Runtime &runtime,
|
|
556
|
-
|
|
565
|
+
inline sk_sp<SkTextBlob> getPropertyValue(jsi::Runtime &runtime,
|
|
566
|
+
const jsi::Value &value) {
|
|
557
567
|
if (value.isObject()) {
|
|
558
568
|
auto blob = getJsiObject<JsiSkTextBlob>(runtime, value)->getObject();
|
|
559
569
|
return blob;
|
|
@@ -562,8 +572,8 @@ sk_sp<SkTextBlob> getPropertyValue(jsi::Runtime &runtime,
|
|
|
562
572
|
}
|
|
563
573
|
|
|
564
574
|
template <>
|
|
565
|
-
sk_sp<SkRuntimeEffect> getPropertyValue(jsi::Runtime &runtime,
|
|
566
|
-
|
|
575
|
+
inline sk_sp<SkRuntimeEffect> getPropertyValue(jsi::Runtime &runtime,
|
|
576
|
+
const jsi::Value &value) {
|
|
567
577
|
if (value.isObject()) {
|
|
568
578
|
auto effect = getJsiObject<JsiSkRuntimeEffect>(runtime, value)->getObject();
|
|
569
579
|
return effect;
|
|
@@ -572,8 +582,8 @@ sk_sp<SkRuntimeEffect> getPropertyValue(jsi::Runtime &runtime,
|
|
|
572
582
|
}
|
|
573
583
|
|
|
574
584
|
template <>
|
|
575
|
-
sk_sp<SkImage> getPropertyValue(jsi::Runtime &runtime,
|
|
576
|
-
|
|
585
|
+
inline sk_sp<SkImage> getPropertyValue(jsi::Runtime &runtime,
|
|
586
|
+
const jsi::Value &value) {
|
|
577
587
|
|
|
578
588
|
if (value.isObject()) {
|
|
579
589
|
auto effect = getJsiObject<JsiSkImage>(runtime, value)->getObject();
|
|
@@ -585,7 +595,8 @@ sk_sp<SkImage> getPropertyValue(jsi::Runtime &runtime,
|
|
|
585
595
|
}
|
|
586
596
|
|
|
587
597
|
template <>
|
|
588
|
-
SkMatrix getPropertyValue(jsi::Runtime &runtime,
|
|
598
|
+
inline SkMatrix getPropertyValue(jsi::Runtime &runtime,
|
|
599
|
+
const jsi::Value &value) {
|
|
589
600
|
if (value.isObject()) {
|
|
590
601
|
auto ptr = tryGetJsiObject<JsiSkMatrix>(runtime, value);
|
|
591
602
|
if (ptr != nullptr) {
|
|
@@ -599,7 +610,7 @@ SkMatrix getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
599
610
|
}
|
|
600
611
|
|
|
601
612
|
template <>
|
|
602
|
-
Radius getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
613
|
+
inline Radius getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
603
614
|
if (value.isObject()) {
|
|
604
615
|
auto object = value.asObject(runtime);
|
|
605
616
|
auto rX = static_cast<float>(object.getProperty(runtime, "x").asNumber());
|
|
@@ -613,8 +624,8 @@ Radius getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
613
624
|
}
|
|
614
625
|
|
|
615
626
|
template <>
|
|
616
|
-
SkCanvas::PointMode getPropertyValue(jsi::Runtime &runtime,
|
|
617
|
-
|
|
627
|
+
inline SkCanvas::PointMode getPropertyValue(jsi::Runtime &runtime,
|
|
628
|
+
const jsi::Value &val) {
|
|
618
629
|
if (val.isString()) {
|
|
619
630
|
auto value = val.asString(runtime).utf8(runtime);
|
|
620
631
|
if (value == "points") {
|
|
@@ -630,7 +641,8 @@ SkCanvas::PointMode getPropertyValue(jsi::Runtime &runtime,
|
|
|
630
641
|
}
|
|
631
642
|
|
|
632
643
|
template <>
|
|
633
|
-
SkPaint::Style getPropertyValue(jsi::Runtime &runtime,
|
|
644
|
+
inline SkPaint::Style getPropertyValue(jsi::Runtime &runtime,
|
|
645
|
+
const jsi::Value &val) {
|
|
634
646
|
if (val.isString()) {
|
|
635
647
|
auto value = val.asString(runtime).utf8(runtime);
|
|
636
648
|
if (value == "fill") {
|
|
@@ -643,7 +655,8 @@ SkPaint::Style getPropertyValue(jsi::Runtime &runtime, const jsi::Value &val) {
|
|
|
643
655
|
}
|
|
644
656
|
|
|
645
657
|
template <>
|
|
646
|
-
SkPaint::Join getPropertyValue(jsi::Runtime &runtime,
|
|
658
|
+
inline SkPaint::Join getPropertyValue(jsi::Runtime &runtime,
|
|
659
|
+
const jsi::Value &val) {
|
|
647
660
|
if (val.isString()) {
|
|
648
661
|
auto value = val.asString(runtime).utf8(runtime);
|
|
649
662
|
if (value == "miter") {
|
|
@@ -658,7 +671,8 @@ SkPaint::Join getPropertyValue(jsi::Runtime &runtime, const jsi::Value &val) {
|
|
|
658
671
|
}
|
|
659
672
|
|
|
660
673
|
template <>
|
|
661
|
-
SkPaint::Cap getPropertyValue(jsi::Runtime &runtime,
|
|
674
|
+
inline SkPaint::Cap getPropertyValue(jsi::Runtime &runtime,
|
|
675
|
+
const jsi::Value &val) {
|
|
662
676
|
if (val.isString()) {
|
|
663
677
|
auto value = val.asString(runtime).utf8(runtime);
|
|
664
678
|
if (value == "butt") {
|
|
@@ -673,8 +687,8 @@ SkPaint::Cap getPropertyValue(jsi::Runtime &runtime, const jsi::Value &val) {
|
|
|
673
687
|
}
|
|
674
688
|
|
|
675
689
|
template <>
|
|
676
|
-
SkPath1DPathEffect::Style getPropertyValue(jsi::Runtime &runtime,
|
|
677
|
-
|
|
690
|
+
inline SkPath1DPathEffect::Style getPropertyValue(jsi::Runtime &runtime,
|
|
691
|
+
const jsi::Value &val) {
|
|
678
692
|
if (val.isString()) {
|
|
679
693
|
auto value = val.asString(runtime).utf8(runtime);
|
|
680
694
|
if (value == "translate") {
|
|
@@ -697,7 +711,8 @@ struct BlendModeValue {
|
|
|
697
711
|
};
|
|
698
712
|
|
|
699
713
|
template <>
|
|
700
|
-
BlendModeValue getPropertyValue(jsi::Runtime &runtime,
|
|
714
|
+
inline BlendModeValue getPropertyValue(jsi::Runtime &runtime,
|
|
715
|
+
const jsi::Value &val) {
|
|
701
716
|
if (val.isString()) {
|
|
702
717
|
auto value = val.asString(runtime).utf8(runtime);
|
|
703
718
|
if (value == "clear") {
|
|
@@ -770,7 +785,8 @@ BlendModeValue getPropertyValue(jsi::Runtime &runtime, const jsi::Value &val) {
|
|
|
770
785
|
// Keep SkBlendMode specialization for other usages (Shaders, ImageFilters,
|
|
771
786
|
// ColorFilters, Drawings)
|
|
772
787
|
template <>
|
|
773
|
-
SkBlendMode getPropertyValue(jsi::Runtime &runtime,
|
|
788
|
+
inline SkBlendMode getPropertyValue(jsi::Runtime &runtime,
|
|
789
|
+
const jsi::Value &val) {
|
|
774
790
|
if (val.isString()) {
|
|
775
791
|
auto value = val.asString(runtime).utf8(runtime);
|
|
776
792
|
if (value == "clear") {
|
|
@@ -840,7 +856,8 @@ using ClipDef = std::variant<SkPath, SkRRect, SkRect, std::string>;
|
|
|
840
856
|
using Layer = std::variant<SkPaint, bool>;
|
|
841
857
|
|
|
842
858
|
template <>
|
|
843
|
-
Uniforms getPropertyValue(jsi::Runtime &runtime,
|
|
859
|
+
inline Uniforms getPropertyValue(jsi::Runtime &runtime,
|
|
860
|
+
const jsi::Value &value) {
|
|
844
861
|
if (value.isObject()) {
|
|
845
862
|
Uniforms result;
|
|
846
863
|
auto obj = value.asObject(runtime);
|
|
@@ -886,7 +903,8 @@ Uniforms getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
886
903
|
}
|
|
887
904
|
|
|
888
905
|
template <>
|
|
889
|
-
SkBlurStyle getPropertyValue(jsi::Runtime &runtime,
|
|
906
|
+
inline SkBlurStyle getPropertyValue(jsi::Runtime &runtime,
|
|
907
|
+
const jsi::Value &value) {
|
|
890
908
|
if (value.isString()) {
|
|
891
909
|
auto valueStr = value.asString(runtime).utf8(runtime);
|
|
892
910
|
if (valueStr == "normal") {
|
|
@@ -903,8 +921,8 @@ SkBlurStyle getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
903
921
|
}
|
|
904
922
|
|
|
905
923
|
template <>
|
|
906
|
-
SkPathFillType getPropertyValue(jsi::Runtime &runtime,
|
|
907
|
-
|
|
924
|
+
inline SkPathFillType getPropertyValue(jsi::Runtime &runtime,
|
|
925
|
+
const jsi::Value &value) {
|
|
908
926
|
if (value.isString()) {
|
|
909
927
|
auto valueStr = value.asString(runtime).utf8(runtime);
|
|
910
928
|
if (valueStr == "winding") {
|
|
@@ -929,7 +947,8 @@ struct StrokeOpts {
|
|
|
929
947
|
};
|
|
930
948
|
|
|
931
949
|
template <>
|
|
932
|
-
StrokeOpts getPropertyValue(jsi::Runtime &runtime,
|
|
950
|
+
inline StrokeOpts getPropertyValue(jsi::Runtime &runtime,
|
|
951
|
+
const jsi::Value &value) {
|
|
933
952
|
if (value.isObject()) {
|
|
934
953
|
StrokeOpts opts;
|
|
935
954
|
auto object = value.asObject(runtime);
|
|
@@ -956,7 +975,8 @@ StrokeOpts getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
956
975
|
}
|
|
957
976
|
|
|
958
977
|
template <>
|
|
959
|
-
SkRRect getPropertyValue(jsi::Runtime &runtime,
|
|
978
|
+
inline SkRRect getPropertyValue(jsi::Runtime &runtime,
|
|
979
|
+
const jsi::Value &value) {
|
|
960
980
|
if (value.isObject()) {
|
|
961
981
|
auto rect = processRRect(runtime, value);
|
|
962
982
|
if (!rect) {
|
|
@@ -968,7 +988,7 @@ SkRRect getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
968
988
|
}
|
|
969
989
|
|
|
970
990
|
template <>
|
|
971
|
-
SkRect getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
991
|
+
inline SkRect getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
972
992
|
if (value.isObject()) {
|
|
973
993
|
auto rect = processRect(runtime, value);
|
|
974
994
|
if (!rect) {
|
|
@@ -980,8 +1000,8 @@ SkRect getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
980
1000
|
}
|
|
981
1001
|
|
|
982
1002
|
template <>
|
|
983
|
-
std::variant<SkRect, SkRRect> getPropertyValue(jsi::Runtime &runtime,
|
|
984
|
-
|
|
1003
|
+
inline std::variant<SkRect, SkRRect> getPropertyValue(jsi::Runtime &runtime,
|
|
1004
|
+
const jsi::Value &value) {
|
|
985
1005
|
if (value.isObject()) {
|
|
986
1006
|
auto rect = processRect(runtime, value);
|
|
987
1007
|
if (rect) {
|
|
@@ -996,7 +1016,7 @@ std::variant<SkRect, SkRRect> getPropertyValue(jsi::Runtime &runtime,
|
|
|
996
1016
|
}
|
|
997
1017
|
|
|
998
1018
|
template <>
|
|
999
|
-
SkPath getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1019
|
+
inline SkPath getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1000
1020
|
auto path = processPath(runtime, value);
|
|
1001
1021
|
if (!path) {
|
|
1002
1022
|
throw std::runtime_error("Invalid prop value for SkPath received");
|
|
@@ -1005,7 +1025,8 @@ SkPath getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
1005
1025
|
}
|
|
1006
1026
|
|
|
1007
1027
|
template <>
|
|
1008
|
-
ClipDef getPropertyValue(jsi::Runtime &runtime,
|
|
1028
|
+
inline ClipDef getPropertyValue(jsi::Runtime &runtime,
|
|
1029
|
+
const jsi::Value &value) {
|
|
1009
1030
|
auto path = processPath(runtime, value);
|
|
1010
1031
|
if (path) {
|
|
1011
1032
|
ClipDef def = SkPath(*path);
|
|
@@ -1025,7 +1046,7 @@ ClipDef getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
1025
1046
|
}
|
|
1026
1047
|
|
|
1027
1048
|
template <>
|
|
1028
|
-
Layer getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1049
|
+
inline Layer getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1029
1050
|
if (value.isBool()) {
|
|
1030
1051
|
Layer layer = value.asBool();
|
|
1031
1052
|
return layer;
|
|
@@ -1040,7 +1061,7 @@ Layer getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
1040
1061
|
}
|
|
1041
1062
|
|
|
1042
1063
|
template <>
|
|
1043
|
-
Patch getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1064
|
+
inline Patch getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1044
1065
|
if (value.isObject() && value.asObject(runtime).isArray(runtime)) {
|
|
1045
1066
|
auto array = value.asObject(runtime).asArray(runtime);
|
|
1046
1067
|
if (array.size(runtime) != 4) {
|
|
@@ -1098,8 +1119,8 @@ Patch getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
|
1098
1119
|
}
|
|
1099
1120
|
|
|
1100
1121
|
template <>
|
|
1101
|
-
std::vector<SkRSXform> getPropertyValue(jsi::Runtime &runtime,
|
|
1102
|
-
|
|
1122
|
+
inline std::vector<SkRSXform> getPropertyValue(jsi::Runtime &runtime,
|
|
1123
|
+
const jsi::Value &value) {
|
|
1103
1124
|
std::vector<SkRSXform> result;
|
|
1104
1125
|
if (value.isObject() && value.asObject(runtime).isArray(runtime)) {
|
|
1105
1126
|
auto array = value.asObject(runtime).asArray(runtime);
|
|
@@ -1115,8 +1136,8 @@ std::vector<SkRSXform> getPropertyValue(jsi::Runtime &runtime,
|
|
|
1115
1136
|
}
|
|
1116
1137
|
|
|
1117
1138
|
template <>
|
|
1118
|
-
std::vector<SkPoint> getPropertyValue(jsi::Runtime &runtime,
|
|
1119
|
-
|
|
1139
|
+
inline std::vector<SkPoint> getPropertyValue(jsi::Runtime &runtime,
|
|
1140
|
+
const jsi::Value &value) {
|
|
1120
1141
|
std::vector<SkPoint> result;
|
|
1121
1142
|
if (value.isObject() && value.asObject(runtime).isArray(runtime)) {
|
|
1122
1143
|
auto array = value.asObject(runtime).asArray(runtime);
|
|
@@ -1132,8 +1153,8 @@ std::vector<SkPoint> getPropertyValue(jsi::Runtime &runtime,
|
|
|
1132
1153
|
}
|
|
1133
1154
|
|
|
1134
1155
|
template <>
|
|
1135
|
-
std::vector<SkRect> getPropertyValue(jsi::Runtime &runtime,
|
|
1136
|
-
|
|
1156
|
+
inline std::vector<SkRect> getPropertyValue(jsi::Runtime &runtime,
|
|
1157
|
+
const jsi::Value &value) {
|
|
1137
1158
|
std::vector<SkRect> result;
|
|
1138
1159
|
if (value.isObject() && value.asObject(runtime).isArray(runtime)) {
|
|
1139
1160
|
auto array = value.asObject(runtime).asArray(runtime);
|
|
@@ -1154,8 +1175,8 @@ std::vector<SkRect> getPropertyValue(jsi::Runtime &runtime,
|
|
|
1154
1175
|
}
|
|
1155
1176
|
|
|
1156
1177
|
template <>
|
|
1157
|
-
std::vector<float> getPropertyValue(jsi::Runtime &runtime,
|
|
1158
|
-
|
|
1178
|
+
inline std::vector<float> getPropertyValue(jsi::Runtime &runtime,
|
|
1179
|
+
const jsi::Value &value) {
|
|
1159
1180
|
std::vector<float> result;
|
|
1160
1181
|
|
|
1161
1182
|
if (value.isNumber()) {
|
|
@@ -1187,8 +1208,8 @@ std::vector<float> getPropertyValue(jsi::Runtime &runtime,
|
|
|
1187
1208
|
}
|
|
1188
1209
|
|
|
1189
1210
|
template <>
|
|
1190
|
-
std::vector<uint16_t> getPropertyValue(jsi::Runtime &runtime,
|
|
1191
|
-
|
|
1211
|
+
inline std::vector<uint16_t> getPropertyValue(jsi::Runtime &runtime,
|
|
1212
|
+
const jsi::Value &value) {
|
|
1192
1213
|
std::vector<uint16_t> result;
|
|
1193
1214
|
|
|
1194
1215
|
if (value.isNumber()) {
|
|
@@ -1220,7 +1241,7 @@ std::vector<uint16_t> getPropertyValue(jsi::Runtime &runtime,
|
|
|
1220
1241
|
}
|
|
1221
1242
|
|
|
1222
1243
|
template <>
|
|
1223
|
-
bool getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1244
|
+
inline bool getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1224
1245
|
if (value.isBool()) {
|
|
1225
1246
|
return value.asBool();
|
|
1226
1247
|
}
|
|
@@ -1242,176 +1263,176 @@ std::optional<T> makeOptionalPropertyValue(jsi::Runtime &runtime,
|
|
|
1242
1263
|
}
|
|
1243
1264
|
|
|
1244
1265
|
template <>
|
|
1245
|
-
std::optional<float> getPropertyValue(jsi::Runtime &runtime,
|
|
1246
|
-
|
|
1266
|
+
inline std::optional<float> getPropertyValue(jsi::Runtime &runtime,
|
|
1267
|
+
const jsi::Value &value) {
|
|
1247
1268
|
return makeOptionalPropertyValue<float>(runtime, value);
|
|
1248
1269
|
}
|
|
1249
1270
|
|
|
1250
1271
|
template <>
|
|
1251
|
-
std::optional<SkPoint> getPropertyValue(jsi::Runtime &runtime,
|
|
1252
|
-
|
|
1272
|
+
inline std::optional<SkPoint> getPropertyValue(jsi::Runtime &runtime,
|
|
1273
|
+
const jsi::Value &value) {
|
|
1253
1274
|
return makeOptionalPropertyValue<SkPoint>(runtime, value);
|
|
1254
1275
|
}
|
|
1255
1276
|
|
|
1256
1277
|
template <>
|
|
1257
|
-
std::optional<SkColor> getPropertyValue(jsi::Runtime &runtime,
|
|
1258
|
-
|
|
1278
|
+
inline std::optional<SkColor> getPropertyValue(jsi::Runtime &runtime,
|
|
1279
|
+
const jsi::Value &value) {
|
|
1259
1280
|
return makeOptionalPropertyValue<SkColor>(runtime, value);
|
|
1260
1281
|
}
|
|
1261
1282
|
|
|
1262
1283
|
template <>
|
|
1263
|
-
std::optional<BlendModeValue> getPropertyValue(jsi::Runtime &runtime,
|
|
1264
|
-
|
|
1284
|
+
inline std::optional<BlendModeValue> getPropertyValue(jsi::Runtime &runtime,
|
|
1285
|
+
const jsi::Value &value) {
|
|
1265
1286
|
return makeOptionalPropertyValue<BlendModeValue>(runtime, value);
|
|
1266
1287
|
}
|
|
1267
1288
|
|
|
1268
1289
|
template <>
|
|
1269
|
-
std::optional<SkBlendMode> getPropertyValue(jsi::Runtime &runtime,
|
|
1270
|
-
|
|
1290
|
+
inline std::optional<SkBlendMode> getPropertyValue(jsi::Runtime &runtime,
|
|
1291
|
+
const jsi::Value &value) {
|
|
1271
1292
|
return makeOptionalPropertyValue<SkBlendMode>(runtime, value);
|
|
1272
1293
|
}
|
|
1273
1294
|
|
|
1274
1295
|
template <>
|
|
1275
|
-
std::optional<SkMatrix> getPropertyValue(jsi::Runtime &runtime,
|
|
1276
|
-
|
|
1296
|
+
inline std::optional<SkMatrix> getPropertyValue(jsi::Runtime &runtime,
|
|
1297
|
+
const jsi::Value &value) {
|
|
1277
1298
|
return makeOptionalPropertyValue<SkMatrix>(runtime, value);
|
|
1278
1299
|
}
|
|
1279
1300
|
|
|
1280
1301
|
template <>
|
|
1281
|
-
std::optional<SkM44> getPropertyValue(jsi::Runtime &runtime,
|
|
1282
|
-
|
|
1302
|
+
inline std::optional<SkM44> getPropertyValue(jsi::Runtime &runtime,
|
|
1303
|
+
const jsi::Value &value) {
|
|
1283
1304
|
return makeOptionalPropertyValue<SkM44>(runtime, value);
|
|
1284
1305
|
}
|
|
1285
1306
|
|
|
1286
1307
|
template <>
|
|
1287
|
-
std::optional<bool> getPropertyValue(jsi::Runtime &runtime,
|
|
1288
|
-
|
|
1308
|
+
inline std::optional<bool> getPropertyValue(jsi::Runtime &runtime,
|
|
1309
|
+
const jsi::Value &value) {
|
|
1289
1310
|
return makeOptionalPropertyValue<bool>(runtime, value);
|
|
1290
1311
|
}
|
|
1291
1312
|
|
|
1292
1313
|
template <>
|
|
1293
|
-
std::optional<ClipDef> getPropertyValue(jsi::Runtime &runtime,
|
|
1294
|
-
|
|
1314
|
+
inline std::optional<ClipDef> getPropertyValue(jsi::Runtime &runtime,
|
|
1315
|
+
const jsi::Value &value) {
|
|
1295
1316
|
return makeOptionalPropertyValue<ClipDef>(runtime, value);
|
|
1296
1317
|
}
|
|
1297
1318
|
|
|
1298
1319
|
template <>
|
|
1299
|
-
std::optional<Layer> getPropertyValue(jsi::Runtime &runtime,
|
|
1300
|
-
|
|
1320
|
+
inline std::optional<Layer> getPropertyValue(jsi::Runtime &runtime,
|
|
1321
|
+
const jsi::Value &value) {
|
|
1301
1322
|
return makeOptionalPropertyValue<Layer>(runtime, value);
|
|
1302
1323
|
}
|
|
1303
1324
|
|
|
1304
1325
|
template <>
|
|
1305
|
-
std::optional<SkFont> getPropertyValue(jsi::Runtime &runtime,
|
|
1306
|
-
|
|
1326
|
+
inline std::optional<SkFont> getPropertyValue(jsi::Runtime &runtime,
|
|
1327
|
+
const jsi::Value &value) {
|
|
1307
1328
|
return makeOptionalPropertyValue<SkFont>(runtime, value);
|
|
1308
1329
|
}
|
|
1309
1330
|
|
|
1310
1331
|
template <>
|
|
1311
|
-
std::optional<SkPaint::Style> getPropertyValue(jsi::Runtime &runtime,
|
|
1312
|
-
|
|
1332
|
+
inline std::optional<SkPaint::Style> getPropertyValue(jsi::Runtime &runtime,
|
|
1333
|
+
const jsi::Value &value) {
|
|
1313
1334
|
return makeOptionalPropertyValue<SkPaint::Style>(runtime, value);
|
|
1314
1335
|
}
|
|
1315
1336
|
|
|
1316
1337
|
template <>
|
|
1317
|
-
std::optional<SkPaint::Join> getPropertyValue(jsi::Runtime &runtime,
|
|
1318
|
-
|
|
1338
|
+
inline std::optional<SkPaint::Join> getPropertyValue(jsi::Runtime &runtime,
|
|
1339
|
+
const jsi::Value &value) {
|
|
1319
1340
|
return makeOptionalPropertyValue<SkPaint::Join>(runtime, value);
|
|
1320
1341
|
}
|
|
1321
1342
|
|
|
1322
1343
|
template <>
|
|
1323
|
-
std::optional<SkPaint::Cap> getPropertyValue(jsi::Runtime &runtime,
|
|
1324
|
-
|
|
1344
|
+
inline std::optional<SkPaint::Cap> getPropertyValue(jsi::Runtime &runtime,
|
|
1345
|
+
const jsi::Value &value) {
|
|
1325
1346
|
return makeOptionalPropertyValue<SkPaint::Cap>(runtime, value);
|
|
1326
1347
|
}
|
|
1327
1348
|
|
|
1328
1349
|
template <>
|
|
1329
|
-
std::optional<SkRect> getPropertyValue(jsi::Runtime &runtime,
|
|
1330
|
-
|
|
1350
|
+
inline std::optional<SkRect> getPropertyValue(jsi::Runtime &runtime,
|
|
1351
|
+
const jsi::Value &value) {
|
|
1331
1352
|
return makeOptionalPropertyValue<SkRect>(runtime, value);
|
|
1332
1353
|
}
|
|
1333
1354
|
|
|
1334
1355
|
template <>
|
|
1335
|
-
std::optional<sk_sp<SkImage>> getPropertyValue(jsi::Runtime &runtime,
|
|
1336
|
-
|
|
1356
|
+
inline std::optional<sk_sp<SkImage>> getPropertyValue(jsi::Runtime &runtime,
|
|
1357
|
+
const jsi::Value &value) {
|
|
1337
1358
|
return makeOptionalPropertyValue<sk_sp<SkImage>>(runtime, value);
|
|
1338
1359
|
}
|
|
1339
1360
|
|
|
1340
1361
|
template <>
|
|
1341
|
-
std::optional<SkSamplingOptions>
|
|
1342
|
-
|
|
1362
|
+
inline std::optional<SkSamplingOptions>
|
|
1363
|
+
getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1343
1364
|
return makeOptionalPropertyValue<SkSamplingOptions>(runtime, value);
|
|
1344
1365
|
}
|
|
1345
1366
|
|
|
1346
1367
|
template <>
|
|
1347
|
-
std::optional<StrokeOpts> getPropertyValue(jsi::Runtime &runtime,
|
|
1348
|
-
|
|
1368
|
+
inline std::optional<StrokeOpts> getPropertyValue(jsi::Runtime &runtime,
|
|
1369
|
+
const jsi::Value &value) {
|
|
1349
1370
|
return makeOptionalPropertyValue<StrokeOpts>(runtime, value);
|
|
1350
1371
|
}
|
|
1351
1372
|
|
|
1352
1373
|
template <>
|
|
1353
|
-
std::optional<std::vector<SkColor>>
|
|
1354
|
-
|
|
1374
|
+
inline std::optional<std::vector<SkColor>>
|
|
1375
|
+
getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1355
1376
|
return makeOptionalPropertyValue<std::vector<SkColor>>(runtime, value);
|
|
1356
1377
|
}
|
|
1357
1378
|
|
|
1358
1379
|
template <>
|
|
1359
|
-
std::optional<std::vector<float>>
|
|
1360
|
-
|
|
1380
|
+
inline std::optional<std::vector<float>>
|
|
1381
|
+
getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1361
1382
|
return makeOptionalPropertyValue<std::vector<float>>(runtime, value);
|
|
1362
1383
|
}
|
|
1363
1384
|
|
|
1364
1385
|
template <>
|
|
1365
|
-
std::optional<SkTileMode> getPropertyValue(jsi::Runtime &runtime,
|
|
1366
|
-
|
|
1386
|
+
inline std::optional<SkTileMode> getPropertyValue(jsi::Runtime &runtime,
|
|
1387
|
+
const jsi::Value &value) {
|
|
1367
1388
|
return makeOptionalPropertyValue<SkTileMode>(runtime, value);
|
|
1368
1389
|
}
|
|
1369
1390
|
|
|
1370
1391
|
template <>
|
|
1371
|
-
std::optional<SkPathFillType> getPropertyValue(jsi::Runtime &runtime,
|
|
1372
|
-
|
|
1392
|
+
inline std::optional<SkPathFillType> getPropertyValue(jsi::Runtime &runtime,
|
|
1393
|
+
const jsi::Value &value) {
|
|
1373
1394
|
return makeOptionalPropertyValue<SkPathFillType>(runtime, value);
|
|
1374
1395
|
}
|
|
1375
1396
|
|
|
1376
1397
|
template <>
|
|
1377
|
-
std::optional<SkColorChannel> getPropertyValue(jsi::Runtime &runtime,
|
|
1378
|
-
|
|
1398
|
+
inline std::optional<SkColorChannel> getPropertyValue(jsi::Runtime &runtime,
|
|
1399
|
+
const jsi::Value &value) {
|
|
1379
1400
|
return makeOptionalPropertyValue<SkColorChannel>(runtime, value);
|
|
1380
1401
|
}
|
|
1381
1402
|
|
|
1382
1403
|
template <>
|
|
1383
|
-
std::optional<Uniforms> getPropertyValue(jsi::Runtime &runtime,
|
|
1384
|
-
|
|
1404
|
+
inline std::optional<Uniforms> getPropertyValue(jsi::Runtime &runtime,
|
|
1405
|
+
const jsi::Value &value) {
|
|
1385
1406
|
return makeOptionalPropertyValue<Uniforms>(runtime, value);
|
|
1386
1407
|
}
|
|
1387
1408
|
|
|
1388
1409
|
template <>
|
|
1389
|
-
std::optional<Radius> getPropertyValue(jsi::Runtime &runtime,
|
|
1390
|
-
|
|
1410
|
+
inline std::optional<Radius> getPropertyValue(jsi::Runtime &runtime,
|
|
1411
|
+
const jsi::Value &value) {
|
|
1391
1412
|
return makeOptionalPropertyValue<Radius>(runtime, value);
|
|
1392
1413
|
}
|
|
1393
1414
|
|
|
1394
1415
|
template <>
|
|
1395
|
-
std::optional<SkRRect> getPropertyValue(jsi::Runtime &runtime,
|
|
1396
|
-
|
|
1416
|
+
inline std::optional<SkRRect> getPropertyValue(jsi::Runtime &runtime,
|
|
1417
|
+
const jsi::Value &value) {
|
|
1397
1418
|
return makeOptionalPropertyValue<SkRRect>(runtime, value);
|
|
1398
1419
|
}
|
|
1399
1420
|
|
|
1400
1421
|
template <>
|
|
1401
|
-
std::optional<SkPaint> getPropertyValue(jsi::Runtime &runtime,
|
|
1402
|
-
|
|
1422
|
+
inline std::optional<SkPaint> getPropertyValue(jsi::Runtime &runtime,
|
|
1423
|
+
const jsi::Value &value) {
|
|
1403
1424
|
return makeOptionalPropertyValue<SkPaint>(runtime, value);
|
|
1404
1425
|
}
|
|
1405
1426
|
|
|
1406
1427
|
template <>
|
|
1407
|
-
std::optional<std::vector<SkPoint>>
|
|
1408
|
-
|
|
1428
|
+
inline std::optional<std::vector<SkPoint>>
|
|
1429
|
+
getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1409
1430
|
return makeOptionalPropertyValue<std::vector<SkPoint>>(runtime, value);
|
|
1410
1431
|
}
|
|
1411
1432
|
|
|
1412
1433
|
template <>
|
|
1413
|
-
std::optional<std::vector<uint16_t>>
|
|
1414
|
-
|
|
1434
|
+
inline std::optional<std::vector<uint16_t>>
|
|
1435
|
+
getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
|
|
1415
1436
|
return makeOptionalPropertyValue<std::vector<uint16_t>>(runtime, value);
|
|
1416
1437
|
}
|
|
1417
1438
|
|