@shopify/react-native-skia 2.0.6 → 2.1.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 +20 -1
- package/cpp/api/JsiSkApi.h +3 -0
- package/cpp/api/JsiSkImageFilterFactory.h +478 -39
- package/cpp/api/JsiSkPath.h +2 -1
- package/cpp/api/JsiSkPathFactory.h +1 -1
- package/cpp/api/JsiSkSkottie.h +590 -0
- package/cpp/api/JsiSkottieFactory.h +65 -0
- package/cpp/api/recorder/Command.h +1 -0
- package/cpp/api/recorder/Convertor.h +16 -0
- package/cpp/api/recorder/Drawings.h +23 -0
- package/cpp/api/recorder/JsiRecorder.h +6 -0
- package/cpp/api/recorder/RNRecorder.h +9 -0
- package/cpp/api/third_party/SkottieUtils.cpp +333 -0
- package/cpp/api/third_party/SkottieUtils.h +172 -0
- package/cpp/skia/modules/jsonreader/SkJSONReader.cpp +980 -0
- package/cpp/skia/modules/jsonreader/SkJSONReader.h +389 -0
- package/cpp/skia/modules/skottie/include/ExternalLayer.h +56 -0
- package/cpp/skia/modules/skottie/include/Skottie.h +313 -0
- package/cpp/skia/modules/skottie/include/SkottieProperty.h +190 -0
- package/cpp/skia/modules/skottie/include/SlotManager.h +113 -0
- package/cpp/skia/modules/skottie/include/TextShaper.h +200 -0
- package/cpp/skia/modules/skottie/src/SkottieValue.h +56 -0
- package/cpp/skia/modules/skottie/src/animator/Animator.h +89 -0
- package/cpp/skia/modules/skottie/src/text/Font.h +82 -0
- package/cpp/skia/modules/skottie/src/text/TextAdapter.h +155 -0
- package/cpp/skia/modules/skottie/src/text/TextAnimator.h +121 -0
- package/cpp/skia/modules/skottie/src/text/TextValue.h +28 -0
- package/cpp/skia/modules/sksg/include/SkSGClipEffect.h +61 -0
- package/cpp/skia/modules/sksg/include/SkSGColorFilter.h +135 -0
- package/cpp/skia/modules/sksg/include/SkSGDraw.h +57 -0
- package/cpp/skia/modules/sksg/include/SkSGEffectNode.h +50 -0
- package/cpp/skia/modules/sksg/include/SkSGGeometryEffect.h +181 -0
- package/cpp/skia/modules/sksg/include/SkSGGeometryNode.h +54 -0
- package/cpp/skia/modules/sksg/include/SkSGGradient.h +108 -0
- package/cpp/skia/modules/sksg/include/SkSGGroup.h +65 -0
- package/cpp/skia/modules/sksg/include/SkSGImage.h +59 -0
- package/cpp/skia/modules/sksg/include/SkSGInvalidationController.h +46 -0
- package/cpp/skia/modules/sksg/include/SkSGMaskEffect.h +65 -0
- package/cpp/skia/modules/sksg/include/SkSGMerge.h +74 -0
- package/cpp/skia/modules/sksg/include/SkSGNode.h +128 -0
- package/cpp/skia/modules/sksg/include/SkSGOpacityEffect.h +54 -0
- package/cpp/skia/modules/sksg/include/SkSGPaint.h +112 -0
- package/cpp/skia/modules/sksg/include/SkSGPath.h +68 -0
- package/cpp/skia/modules/sksg/include/SkSGPlane.h +47 -0
- package/cpp/skia/modules/sksg/include/SkSGRect.h +122 -0
- package/cpp/skia/modules/sksg/include/SkSGRenderEffect.h +283 -0
- package/cpp/skia/modules/sksg/include/SkSGRenderNode.h +157 -0
- package/cpp/skia/modules/sksg/include/SkSGScene.h +47 -0
- package/cpp/skia/modules/sksg/include/SkSGText.h +82 -0
- package/cpp/skia/modules/sksg/include/SkSGTransform.h +127 -0
- package/cpp/skia/src/base/SkArenaAlloc.h +371 -0
- package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +15 -15
- package/lib/commonjs/dom/types/Drawings.d.ts +5 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +2 -1
- package/lib/commonjs/dom/types/NodeType.js +2 -0
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
- package/lib/commonjs/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/setup.d.ts +5 -0
- package/lib/commonjs/renderer/components/Skottie.d.ts +4 -0
- package/lib/commonjs/renderer/components/Skottie.js +13 -0
- package/lib/commonjs/renderer/components/Skottie.js.map +1 -0
- package/lib/commonjs/renderer/components/index.d.ts +1 -0
- package/lib/commonjs/renderer/components/index.js +11 -0
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
- package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +11 -2
- package/lib/commonjs/skia/types/Matrix4.js +42 -1
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/skia/types/Recorder.d.ts +2 -1
- package/lib/commonjs/skia/types/Recorder.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +2 -0
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/types/Skottie.d.ts +223 -0
- package/lib/commonjs/skia/types/Skottie.js +73 -0
- package/lib/commonjs/skia/types/Skottie.js.map +1 -0
- package/lib/commonjs/skia/types/index.d.ts +1 -0
- package/lib/commonjs/skia/types/index.js +11 -0
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +88 -19
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +2 -0
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +59 -0
- package/lib/commonjs/skia/web/JsiSkottieAnimation.js +243 -0
- package/lib/commonjs/skia/web/JsiSkottieAnimation.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkottieFactory.js +26 -0
- package/lib/commonjs/skia/web/JsiSkottieFactory.js.map +1 -0
- package/lib/commonjs/sksg/Elements.d.ts +2 -1
- package/lib/commonjs/sksg/Elements.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Core.d.ts +4 -2
- package/lib/commonjs/sksg/Recorder/Core.js +1 -0
- package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Player.js +2 -0
- package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
- package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +4 -0
- package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Recorder.d.ts +2 -1
- package/lib/commonjs/sksg/Recorder/Recorder.js +6 -0
- package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Visitor.js +3 -0
- package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +2 -2
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js +11 -4
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +1 -1
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.d.ts +15 -15
- package/lib/module/dom/types/Drawings.d.ts +5 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +2 -1
- package/lib/module/dom/types/NodeType.js +2 -0
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
- package/lib/module/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/setup.d.ts +5 -0
- package/lib/module/renderer/components/Skottie.d.ts +4 -0
- package/lib/module/renderer/components/Skottie.js +5 -0
- package/lib/module/renderer/components/Skottie.js.map +1 -0
- package/lib/module/renderer/components/index.d.ts +1 -0
- package/lib/module/renderer/components/index.js +1 -0
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
- package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +11 -2
- package/lib/module/skia/types/Matrix4.js +40 -0
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/skia/types/Recorder.d.ts +2 -1
- package/lib/module/skia/types/Recorder.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +2 -0
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/types/Skottie.d.ts +223 -0
- package/lib/module/skia/types/Skottie.js +74 -0
- package/lib/module/skia/types/Skottie.js.map +1 -0
- package/lib/module/skia/types/index.d.ts +1 -0
- package/lib/module/skia/types/index.js +1 -0
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
- package/lib/module/skia/web/JsiSkImageFilterFactory.js +88 -19
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +2 -0
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/skia/web/JsiSkottieAnimation.d.ts +59 -0
- package/lib/module/skia/web/JsiSkottieAnimation.js +236 -0
- package/lib/module/skia/web/JsiSkottieAnimation.js.map +1 -0
- package/lib/module/skia/web/JsiSkottieFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkottieFactory.js +19 -0
- package/lib/module/skia/web/JsiSkottieFactory.js.map +1 -0
- package/lib/module/sksg/Elements.d.ts +2 -1
- package/lib/module/sksg/Elements.js.map +1 -1
- package/lib/module/sksg/Recorder/Core.d.ts +4 -2
- package/lib/module/sksg/Recorder/Core.js +1 -0
- package/lib/module/sksg/Recorder/Core.js.map +1 -1
- package/lib/module/sksg/Recorder/Player.js +3 -1
- package/lib/module/sksg/Recorder/Player.js.map +1 -1
- package/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js +4 -0
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Recorder.d.ts +2 -1
- package/lib/module/sksg/Recorder/Recorder.js +6 -0
- package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Visitor.js +3 -0
- package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Drawing.d.ts +2 -2
- package/lib/module/sksg/Recorder/commands/Drawing.js +9 -2
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/ImageFilters.js +1 -1
- package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -1
- package/lib/typescript/lib/commonjs/renderer/components/Skottie.d.ts +2 -0
- package/lib/typescript/lib/commonjs/skia/types/Matrix4.d.ts +1 -0
- package/lib/typescript/lib/commonjs/skia/types/Skottie.d.ts +6 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
- package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +2 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +48 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +6 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +1 -1
- package/lib/typescript/lib/module/mock/index.d.ts +7 -0
- package/lib/typescript/lib/module/renderer/components/Skottie.d.ts +2 -0
- package/lib/typescript/lib/module/renderer/components/index.d.ts +1 -0
- package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Matrix4.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Skottie.d.ts +5 -0
- package/lib/typescript/lib/module/skia/types/index.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
- package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +2 -0
- package/lib/typescript/lib/module/skia/web/JsiSkottieAnimation.d.ts +47 -0
- package/lib/typescript/lib/module/skia/web/JsiSkottieFactory.d.ts +5 -0
- package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Recorder/commands/Drawing.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +15 -15
- package/lib/typescript/src/dom/types/Drawings.d.ts +5 -1
- package/lib/typescript/src/dom/types/NodeType.d.ts +2 -1
- package/lib/typescript/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
- package/lib/typescript/src/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/setup.d.ts +5 -0
- package/lib/typescript/src/renderer/components/Skottie.d.ts +4 -0
- package/lib/typescript/src/renderer/components/index.d.ts +1 -0
- package/lib/typescript/src/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
- package/lib/typescript/src/skia/types/Matrix4.d.ts +11 -2
- package/lib/typescript/src/skia/types/Recorder.d.ts +2 -1
- package/lib/typescript/src/skia/types/Skia.d.ts +2 -0
- package/lib/typescript/src/skia/types/Skottie.d.ts +223 -0
- package/lib/typescript/src/skia/types/index.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
- package/lib/typescript/src/skia/web/JsiSkottieAnimation.d.ts +59 -0
- package/lib/typescript/src/skia/web/JsiSkottieFactory.d.ts +9 -0
- package/lib/typescript/src/sksg/Elements.d.ts +2 -1
- package/lib/typescript/src/sksg/Recorder/Core.d.ts +4 -2
- package/lib/typescript/src/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
- package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +2 -1
- package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +2 -2
- package/libs/android/arm64-v8a/libjsonreader.a +0 -0
- package/libs/android/armeabi-v7a/libjsonreader.a +0 -0
- package/libs/android/x86/libjsonreader.a +0 -0
- package/libs/android/x86_64/libjsonreader.a +0 -0
- package/libs/apple/libpathops.xcframework/Info.plist +9 -9
- package/libs/apple/libskia.xcframework/Info.plist +14 -14
- package/libs/apple/libskottie.xcframework/Info.plist +13 -13
- package/libs/apple/libskparagraph.xcframework/Info.plist +15 -15
- package/libs/apple/libsksg.xcframework/Info.plist +13 -13
- package/libs/apple/libskshaper.xcframework/Info.plist +15 -15
- package/libs/apple/libskunicode_core.xcframework/Info.plist +9 -9
- package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +13 -13
- package/libs/apple/libsvg.xcframework/Info.plist +15 -15
- package/package.json +1 -1
- package/react-native-skia.podspec +4 -2
- package/src/__tests__/snapshots/matrix4/camera-corner.png +0 -0
- package/src/__tests__/snapshots/matrix4/camera-offset.png +0 -0
- package/src/__tests__/snapshots/matrix4/camera-top-left-center.png +0 -0
- package/src/__tests__/snapshots/matrix4/camera-zoom-out.png +0 -0
- package/src/__tests__/snapshots/matrix4/full-rect.png +0 -0
- package/src/__tests__/snapshots/matrix4/rect.png +0 -0
- package/src/__tests__/snapshots/matrix4/scaled-rect.png +0 -0
- package/src/__tests__/snapshots/matrix4/test-perspective.png +0 -0
- package/src/__tests__/snapshots/matrix4/test-perspective2.png +0 -0
- package/src/dom/types/Drawings.ts +6 -0
- package/src/dom/types/NodeType.ts +2 -0
- package/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.tsx +492 -0
- package/src/renderer/__tests__/e2e/Camera.spec.tsx +475 -0
- package/src/renderer/__tests__/e2e/LightingImageFilters.spec.tsx +1478 -0
- package/src/renderer/__tests__/e2e/Skottie.spec.tsx +440 -0
- package/src/renderer/__tests__/e2e/setup/skottie/basic_slots.json +1118 -0
- package/src/renderer/__tests__/e2e/setup/skottie/color-props.json +1 -0
- package/src/renderer/__tests__/e2e/setup/skottie/confetti.json +5899 -0
- package/src/renderer/__tests__/e2e/setup/skottie/drinks.json +43857 -0
- package/src/renderer/__tests__/e2e/setup/skottie/fingerprint.json +1 -0
- package/src/renderer/__tests__/e2e/setup/skottie/lego_loader.json +29540 -0
- package/src/renderer/__tests__/e2e/setup/skottie/new-drop.json +1 -0
- package/src/renderer/__tests__/e2e/setup/skottie/onboarding.json +1 -0
- package/src/renderer/__tests__/e2e/setup/skottie/text-layer.json +1 -0
- package/src/renderer/__tests__/setup.tsx +23 -0
- package/src/renderer/components/Skottie.tsx +8 -0
- package/src/renderer/components/index.ts +1 -0
- package/src/skia/__tests__/assets/Avenir-Heavy.ttf +0 -0
- package/src/skia/types/ImageFilter/ImageFilterFactory.ts +391 -21
- package/src/skia/types/Matrix4.ts +108 -2
- package/src/skia/types/Recorder.ts +2 -0
- package/src/skia/types/Skia.ts +2 -0
- package/src/skia/types/Skottie.ts +266 -0
- package/src/skia/types/index.ts +1 -0
- package/src/skia/web/JsiSkImageFilterFactory.ts +266 -31
- package/src/skia/web/JsiSkia.ts +2 -0
- package/src/skia/web/JsiSkottieAnimation.ts +259 -0
- package/src/skia/web/JsiSkottieFactory.ts +25 -0
- package/src/sksg/Elements.tsx +2 -0
- package/src/sksg/Recorder/Core.ts +3 -0
- package/src/sksg/Recorder/Player.ts +3 -0
- package/src/sksg/Recorder/ReanimatedRecorder.ts +6 -0
- package/src/sksg/Recorder/Recorder.ts +5 -0
- package/src/sksg/Recorder/Visitor.ts +3 -0
- package/src/sksg/Recorder/commands/Drawing.ts +7 -3
- package/src/sksg/Recorder/commands/ImageFilters.ts +1 -1
- package/cpp/skia/include/pathops/SkPathOps.h +0 -17
package/src/sksg/Elements.tsx
CHANGED
@@ -51,6 +51,7 @@ import type {
|
|
51
51
|
ChildrenProps,
|
52
52
|
MorphologyImageFilterProps,
|
53
53
|
BlendProps,
|
54
|
+
SkottieProps,
|
54
55
|
} from "../dom/types";
|
55
56
|
import type { SkiaProps } from "../renderer";
|
56
57
|
|
@@ -80,6 +81,7 @@ declare module "react" {
|
|
80
81
|
skTextBlob: SkiaProps<TextBlobProps>;
|
81
82
|
skGlyphs: SkiaProps<GlyphsProps>;
|
82
83
|
skDiffRect: SkiaProps<DiffRectProps>;
|
84
|
+
skSkottie: SkiaProps<SkottieProps>;
|
83
85
|
skPicture: SkiaProps<PictureProps>;
|
84
86
|
skImageSVG: SkiaProps<ImageSVGProps>;
|
85
87
|
|
@@ -21,6 +21,7 @@ import type {
|
|
21
21
|
ParagraphProps,
|
22
22
|
AtlasProps,
|
23
23
|
DrawingNodeProps,
|
24
|
+
SkottieProps,
|
24
25
|
} from "../../dom/types";
|
25
26
|
|
26
27
|
// export enum CommandType {
|
@@ -106,6 +107,7 @@ export enum CommandType {
|
|
106
107
|
DrawImageSVG,
|
107
108
|
DrawParagraph,
|
108
109
|
DrawAtlas,
|
110
|
+
DrawSkottie,
|
109
111
|
}
|
110
112
|
|
111
113
|
export type Command<T extends CommandType = CommandType> = {
|
@@ -165,6 +167,7 @@ interface Props {
|
|
165
167
|
[CommandType.DrawImageSVG]: ImageSVGProps;
|
166
168
|
[CommandType.DrawParagraph]: ParagraphProps;
|
167
169
|
[CommandType.DrawAtlas]: AtlasProps;
|
170
|
+
[CommandType.DrawSkottie]: SkottieProps;
|
168
171
|
}
|
169
172
|
|
170
173
|
interface DrawCommand<T extends CommandType> extends Command<T> {
|
@@ -18,6 +18,7 @@ import {
|
|
18
18
|
drawDiffRect,
|
19
19
|
drawVertices,
|
20
20
|
drawPatch,
|
21
|
+
drawSkottie,
|
21
22
|
} from "./commands/Drawing";
|
22
23
|
import { drawBox, isBoxCommand } from "./commands/Box";
|
23
24
|
import {
|
@@ -157,6 +158,8 @@ function play(ctx: DrawingContext, _command: Command) {
|
|
157
158
|
drawParagraph(ctx, command.props);
|
158
159
|
} else if (isDrawCommand(command, CommandType.DrawAtlas)) {
|
159
160
|
drawAtlas(ctx, command.props);
|
161
|
+
} else if (isDrawCommand(command, CommandType.DrawSkottie)) {
|
162
|
+
drawSkottie(ctx, command.props);
|
160
163
|
} else {
|
161
164
|
console.warn(`Unknown command: ${command.type}`);
|
162
165
|
}
|
@@ -27,6 +27,7 @@ import type {
|
|
27
27
|
ImageSVGProps,
|
28
28
|
ParagraphProps,
|
29
29
|
AtlasProps,
|
30
|
+
SkottieProps,
|
30
31
|
} from "../../dom/types";
|
31
32
|
import type { AnimatedProps } from "../../renderer";
|
32
33
|
import { isSharedValue } from "../utils";
|
@@ -268,4 +269,9 @@ export class ReanimatedRecorder implements BaseRecorder {
|
|
268
269
|
this.processAnimationValues(props);
|
269
270
|
this.recorder.drawAtlas(props);
|
270
271
|
}
|
272
|
+
|
273
|
+
drawSkottie(props: AnimatedProps<SkottieProps>): void {
|
274
|
+
this.processAnimationValues(props);
|
275
|
+
this.recorder.drawSkottie(props);
|
276
|
+
}
|
271
277
|
}
|
@@ -26,6 +26,7 @@ import type {
|
|
26
26
|
AtlasProps,
|
27
27
|
BoxProps,
|
28
28
|
BoxShadowProps,
|
29
|
+
SkottieProps,
|
29
30
|
} from "../../dom/types";
|
30
31
|
import type { AnimatedProps } from "../../renderer";
|
31
32
|
import { isSharedValue } from "../utils";
|
@@ -290,4 +291,8 @@ export class Recorder implements BaseRecorder {
|
|
290
291
|
drawAtlas(props: AnimatedProps<AtlasProps>) {
|
291
292
|
this.add({ type: CommandType.DrawAtlas, props });
|
292
293
|
}
|
294
|
+
|
295
|
+
drawSkottie(props: AnimatedProps<SkottieProps>) {
|
296
|
+
this.add({ type: CommandType.DrawSkottie, props });
|
297
|
+
}
|
293
298
|
}
|
@@ -310,6 +310,9 @@ const visitNode = (recorder: BaseRecorder, node: Node<any>) => {
|
|
310
310
|
case NodeType.Paragraph:
|
311
311
|
recorder.drawParagraph(props);
|
312
312
|
break;
|
313
|
+
case NodeType.Skottie:
|
314
|
+
recorder.drawSkottie(props);
|
315
|
+
break;
|
313
316
|
case NodeType.Atlas:
|
314
317
|
recorder.drawAtlas(props);
|
315
318
|
break;
|
@@ -11,7 +11,6 @@ import type {
|
|
11
11
|
AtlasProps,
|
12
12
|
CircleProps,
|
13
13
|
DiffRectProps,
|
14
|
-
DrawingNodeProps,
|
15
14
|
GlyphsProps,
|
16
15
|
ImageProps,
|
17
16
|
ImageSVGProps,
|
@@ -24,6 +23,7 @@ import type {
|
|
24
23
|
PointsProps,
|
25
24
|
RectProps,
|
26
25
|
RoundedRectProps,
|
26
|
+
SkottieProps,
|
27
27
|
TextBlobProps,
|
28
28
|
TextPathProps,
|
29
29
|
TextProps,
|
@@ -328,7 +328,11 @@ export const drawCircle = (ctx: DrawingContext, props: CircleProps) => {
|
|
328
328
|
ctx.canvas.drawCircle(c.x, c.y, r, ctx.paint);
|
329
329
|
};
|
330
330
|
|
331
|
-
export const
|
331
|
+
export const drawSkottie = (ctx: DrawingContext, props: SkottieProps) => {
|
332
332
|
"worklet";
|
333
|
-
|
333
|
+
const { animation, frame } = props;
|
334
|
+
if (animation) {
|
335
|
+
props.animation.seekFrame(frame);
|
336
|
+
props.animation.render(ctx.canvas);
|
337
|
+
}
|
334
338
|
};
|
@@ -151,7 +151,7 @@ const declareDisplacementMapImageFilter = (
|
|
151
151
|
if (!shader) {
|
152
152
|
throw new Error("DisplacementMap expects a shader as child");
|
153
153
|
}
|
154
|
-
const map = ctx.Skia.ImageFilter.MakeShader(shader
|
154
|
+
const map = ctx.Skia.ImageFilter.MakeShader(shader);
|
155
155
|
const imgf = ctx.Skia.ImageFilter.MakeDisplacementMap(
|
156
156
|
ColorChannel[enumKey(channelX)],
|
157
157
|
ColorChannel[enumKey(channelY)],
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2025 Google Inc.
|
3
|
-
*
|
4
|
-
* Use of this source code is governed by a BSD-style license that can be
|
5
|
-
* found in the LICENSE file.
|
6
|
-
*/
|
7
|
-
|
8
|
-
// Uncomment this to find any clients who still use the old path
|
9
|
-
// ... so we can update them
|
10
|
-
//#error
|
11
|
-
|
12
|
-
#ifndef SkPathOpsRedirect_DEFINED
|
13
|
-
#define SkPathOpsRedirect_DEFINED
|
14
|
-
|
15
|
-
#include "modules/pathops/include/SkPathOps.h"
|
16
|
-
|
17
|
-
#endif
|