@shopify/react-native-skia 1.7.6 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/rnskia-android/OpenGLWindowContext.h +8 -1
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +4 -4
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +2 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +13 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaTextureView.java +24 -1
- package/cpp/rnskia/RNSkJsiViewApi.h +0 -3
- package/cpp/rnskia/RNSkView.h +6 -6
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +2 -2
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +2 -2
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +3 -7
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +58 -70
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +2 -3
- package/lib/commonjs/dom/nodes/datatypes/Circle.js +14 -6
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Enum.js +5 -1
- package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js +19 -11
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js +7 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Radius.js +2 -0
- package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +3 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js +27 -3
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +2 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.js +35 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/commonjs/dom/types/Node.d.ts +2 -5
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/dom/types/index.d.ts +0 -2
- package/lib/commonjs/dom/types/index.js +0 -22
- package/lib/commonjs/dom/types/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/renderHelpers.d.ts +2 -0
- package/lib/commonjs/external/reanimated/renderHelpers.js +11 -6
- package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/commonjs/headless/index.js +3 -5
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/index.d.ts +1 -0
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +9 -26
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.web.d.ts +10 -0
- package/lib/commonjs/renderer/Canvas.web.js +110 -0
- package/lib/commonjs/renderer/Canvas.web.js.map +1 -0
- package/lib/commonjs/renderer/Canvas2.d.ts +10 -0
- package/lib/commonjs/renderer/Canvas2.js +104 -0
- package/lib/commonjs/renderer/Canvas2.js.map +1 -0
- package/lib/commonjs/renderer/Canvas2.web.d.ts +3 -0
- package/lib/commonjs/renderer/Canvas2.web.js +9 -0
- package/lib/commonjs/renderer/Canvas2.web.js.map +1 -0
- package/lib/commonjs/renderer/Container.d.ts +3 -5
- package/lib/commonjs/renderer/Container.js +2 -7
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +3 -6
- package/lib/commonjs/renderer/HostComponents.js +1 -4
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +8 -4
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.js +3 -5
- package/lib/commonjs/renderer/Offscreen.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +2 -3
- package/lib/commonjs/renderer/Reconciler.js +2 -2
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/__tests__/setup.d.ts +2 -3
- package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +1 -2
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/renderer/typeddash.js +5 -1
- package/lib/commonjs/renderer/typeddash.js.map +1 -1
- package/lib/commonjs/skia/__tests__/setup.d.ts +0 -3
- package/lib/commonjs/skia/types/Path/Path.js +5 -1
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +13 -6
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/sksg/Container.d.ts +19 -0
- package/lib/commonjs/sksg/Container.js +102 -0
- package/lib/commonjs/sksg/Container.js.map +1 -0
- package/lib/commonjs/sksg/DeclarationContext.d.ts +56 -0
- package/lib/commonjs/sksg/DeclarationContext.js +77 -0
- package/lib/commonjs/sksg/DeclarationContext.js.map +1 -0
- package/lib/commonjs/sksg/DrawingContext.d.ts +13 -0
- package/lib/commonjs/sksg/DrawingContext.js +172 -0
- package/lib/commonjs/sksg/DrawingContext.js.map +1 -0
- package/lib/commonjs/sksg/HostConfig.d.ts +19 -0
- package/lib/commonjs/sksg/HostConfig.js +168 -0
- package/lib/commonjs/sksg/HostConfig.js.map +1 -0
- package/lib/commonjs/sksg/Reconciler.d.ts +19 -0
- package/lib/commonjs/sksg/Reconciler.js +61 -0
- package/lib/commonjs/sksg/Reconciler.js.map +1 -0
- package/lib/commonjs/sksg/__tests__/MockDeclaration.d.ts +57 -0
- package/lib/commonjs/sksg/nodes/Node.d.ts +7 -0
- package/lib/commonjs/{renderer/DrawingContext.js → sksg/nodes/Node.js} +1 -1
- package/lib/commonjs/sksg/nodes/Node.js.map +1 -0
- package/lib/commonjs/sksg/nodes/colorFilters.d.ts +10 -0
- package/lib/commonjs/sksg/nodes/colorFilters.js +79 -0
- package/lib/commonjs/sksg/nodes/colorFilters.js.map +1 -0
- package/lib/commonjs/sksg/nodes/context.d.ts +3 -0
- package/lib/commonjs/sksg/nodes/context.js +394 -0
- package/lib/commonjs/sksg/nodes/context.js.map +1 -0
- package/lib/commonjs/sksg/nodes/drawings.d.ts +30 -0
- package/lib/commonjs/sksg/nodes/drawings.js +398 -0
- package/lib/commonjs/sksg/nodes/drawings.js.map +1 -0
- package/lib/commonjs/sksg/nodes/imageFilters.d.ts +17 -0
- package/lib/commonjs/sksg/nodes/imageFilters.js +197 -0
- package/lib/commonjs/sksg/nodes/imageFilters.js.map +1 -0
- package/lib/commonjs/sksg/nodes/index.d.ts +3 -0
- package/lib/commonjs/sksg/nodes/index.js +39 -0
- package/lib/commonjs/sksg/nodes/index.js.map +1 -0
- package/lib/commonjs/sksg/nodes/paint.d.ts +3 -0
- package/lib/commonjs/sksg/nodes/paint.js +81 -0
- package/lib/commonjs/sksg/nodes/paint.js.map +1 -0
- package/lib/commonjs/sksg/nodes/pathEffects.d.ts +11 -0
- package/lib/commonjs/sksg/nodes/pathEffects.js +111 -0
- package/lib/commonjs/sksg/nodes/pathEffects.js.map +1 -0
- package/lib/commonjs/sksg/nodes/shaders.d.ts +11 -0
- package/lib/commonjs/sksg/nodes/shaders.js +173 -0
- package/lib/commonjs/sksg/nodes/shaders.js.map +1 -0
- package/lib/commonjs/sksg/nodes/utils.d.ts +3 -0
- package/lib/commonjs/sksg/nodes/utils.js +28 -0
- package/lib/commonjs/sksg/nodes/utils.js.map +1 -0
- package/lib/commonjs/views/SkiaDomView.web.d.ts +0 -7
- package/lib/commonjs/views/SkiaDomView.web.js +0 -30
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.js +0 -2
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.web.d.ts +3 -1
- package/lib/commonjs/views/SkiaPictureView.web.js +10 -0
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +4 -9
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +3 -7
- package/lib/module/dom/nodes/JsiSkDOM.js +58 -70
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.d.ts +2 -3
- package/lib/module/dom/nodes/datatypes/Circle.js +14 -6
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Enum.js +5 -1
- package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +19 -11
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Path.js +7 -1
- package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Radius.js +2 -0
- package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.d.ts +3 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +24 -2
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Transform.d.ts +2 -1
- package/lib/module/dom/nodes/datatypes/Transform.js +33 -0
- package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/module/dom/types/Node.d.ts +2 -5
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/dom/types/index.d.ts +0 -2
- package/lib/module/dom/types/index.js +0 -2
- package/lib/module/dom/types/index.js.map +1 -1
- package/lib/module/external/reanimated/renderHelpers.d.ts +2 -0
- package/lib/module/external/reanimated/renderHelpers.js +8 -4
- package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/module/headless/index.js +3 -5
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/index.d.ts +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +9 -26
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Canvas.web.d.ts +10 -0
- package/lib/module/renderer/Canvas.web.js +105 -0
- package/lib/module/renderer/Canvas.web.js.map +1 -0
- package/lib/module/renderer/Canvas2.d.ts +10 -0
- package/lib/module/renderer/Canvas2.js +97 -0
- package/lib/module/renderer/Canvas2.js.map +1 -0
- package/lib/module/renderer/Canvas2.web.d.ts +3 -0
- package/lib/module/renderer/Canvas2.web.js +3 -0
- package/lib/module/renderer/Canvas2.web.js.map +1 -0
- package/lib/module/renderer/Container.d.ts +3 -5
- package/lib/module/renderer/Container.js +2 -7
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +3 -6
- package/lib/module/renderer/HostComponents.js +0 -3
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +8 -4
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/Offscreen.js +3 -5
- package/lib/module/renderer/Offscreen.js.map +1 -1
- package/lib/module/renderer/Reconciler.d.ts +2 -3
- package/lib/module/renderer/Reconciler.js +2 -2
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/__tests__/setup.d.ts +2 -3
- package/lib/module/renderer/processors/Animations/Animations.d.ts +1 -2
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/renderer/typeddash.js +5 -1
- package/lib/module/renderer/typeddash.js.map +1 -1
- package/lib/module/skia/__tests__/setup.d.ts +0 -3
- package/lib/module/skia/types/Path/Path.js +5 -1
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +13 -6
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/sksg/Container.d.ts +19 -0
- package/lib/module/sksg/Container.js +94 -0
- package/lib/module/sksg/Container.js.map +1 -0
- package/lib/module/sksg/DeclarationContext.d.ts +56 -0
- package/lib/module/sksg/DeclarationContext.js +69 -0
- package/lib/module/sksg/DeclarationContext.js.map +1 -0
- package/lib/module/sksg/DrawingContext.d.ts +13 -0
- package/lib/module/sksg/DrawingContext.js +165 -0
- package/lib/module/sksg/DrawingContext.js.map +1 -0
- package/lib/module/sksg/HostConfig.d.ts +19 -0
- package/lib/module/sksg/HostConfig.js +161 -0
- package/lib/module/sksg/HostConfig.js.map +1 -0
- package/lib/module/sksg/Reconciler.d.ts +19 -0
- package/lib/module/sksg/Reconciler.js +53 -0
- package/lib/module/sksg/Reconciler.js.map +1 -0
- package/lib/module/sksg/__tests__/MockDeclaration.d.ts +57 -0
- package/lib/module/sksg/nodes/Node.d.ts +7 -0
- package/lib/module/sksg/nodes/Node.js +2 -0
- package/lib/module/sksg/nodes/Node.js.map +1 -0
- package/lib/module/sksg/nodes/colorFilters.d.ts +10 -0
- package/lib/module/sksg/nodes/colorFilters.js +66 -0
- package/lib/module/sksg/nodes/colorFilters.js.map +1 -0
- package/lib/module/sksg/nodes/context.d.ts +3 -0
- package/lib/module/sksg/nodes/context.js +387 -0
- package/lib/module/sksg/nodes/context.js.map +1 -0
- package/lib/module/sksg/nodes/drawings.d.ts +30 -0
- package/lib/module/sksg/nodes/drawings.js +371 -0
- package/lib/module/sksg/nodes/drawings.js.map +1 -0
- package/lib/module/sksg/nodes/imageFilters.d.ts +17 -0
- package/lib/module/sksg/nodes/imageFilters.js +181 -0
- package/lib/module/sksg/nodes/imageFilters.js.map +1 -0
- package/lib/module/sksg/nodes/index.d.ts +3 -0
- package/lib/module/sksg/nodes/index.js +4 -0
- package/lib/module/sksg/nodes/index.js.map +1 -0
- package/lib/module/sksg/nodes/paint.d.ts +3 -0
- package/lib/module/sksg/nodes/paint.js +74 -0
- package/lib/module/sksg/nodes/paint.js.map +1 -0
- package/lib/module/sksg/nodes/pathEffects.d.ts +11 -0
- package/lib/module/sksg/nodes/pathEffects.js +97 -0
- package/lib/module/sksg/nodes/pathEffects.js.map +1 -0
- package/lib/module/sksg/nodes/shaders.d.ts +11 -0
- package/lib/module/sksg/nodes/shaders.js +158 -0
- package/lib/module/sksg/nodes/shaders.js.map +1 -0
- package/lib/module/sksg/nodes/utils.d.ts +3 -0
- package/lib/module/sksg/nodes/utils.js +20 -0
- package/lib/module/sksg/nodes/utils.js.map +1 -0
- package/lib/module/views/SkiaDomView.web.d.ts +0 -7
- package/lib/module/views/SkiaDomView.web.js +1 -24
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.js +0 -2
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaPictureView.web.d.ts +3 -1
- package/lib/module/views/SkiaPictureView.web.js +10 -0
- package/lib/module/views/SkiaPictureView.web.js.map +1 -1
- package/lib/module/views/types.d.ts +4 -9
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +57 -67
- package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +1 -1
- package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +2 -0
- package/lib/typescript/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +1 -0
- package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +2 -0
- package/lib/typescript/lib/commonjs/renderer/Canvas.web.d.ts +3 -0
- package/lib/typescript/lib/commonjs/renderer/Canvas2.d.ts +3 -0
- package/lib/typescript/lib/commonjs/renderer/{DrawingContext.d.ts → Canvas2.web.d.ts} +1 -0
- package/lib/typescript/lib/commonjs/renderer/Container.d.ts +1 -2
- package/lib/typescript/lib/commonjs/renderer/HostComponents.d.ts +0 -1
- package/lib/typescript/lib/commonjs/renderer/HostConfig.d.ts +3 -1
- package/lib/typescript/lib/commonjs/renderer/Reconciler.d.ts +1 -1
- package/lib/typescript/lib/commonjs/sksg/Container.d.ts +16 -0
- package/lib/typescript/lib/commonjs/sksg/DeclarationContext.d.ts +53 -0
- package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +22 -0
- package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +50 -0
- package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +18 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +8 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/drawings.d.ts +22 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +12 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +9 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/shaders.d.ts +10 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/utils.d.ts +3 -0
- package/lib/typescript/lib/commonjs/views/SkiaDomView.web.d.ts +0 -5
- package/lib/typescript/lib/commonjs/views/SkiaPictureView.web.d.ts +2 -0
- package/lib/typescript/lib/module/dom/nodes/JsiSkDOM.d.ts +57 -117
- package/lib/typescript/lib/module/dom/nodes/datatypes/Circle.d.ts +1 -1
- package/lib/typescript/lib/module/dom/nodes/datatypes/Rect.d.ts +2 -0
- package/lib/typescript/lib/module/dom/nodes/datatypes/Transform.d.ts +1 -0
- package/lib/typescript/lib/module/dom/types/index.d.ts +0 -2
- package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +2 -0
- package/lib/typescript/lib/module/index.d.ts +1 -0
- package/lib/typescript/lib/module/mock/index.d.ts +4 -4
- package/lib/typescript/lib/module/renderer/Canvas.web.d.ts +1 -0
- package/lib/typescript/lib/module/renderer/Canvas2.d.ts +1 -0
- package/lib/typescript/lib/module/renderer/Canvas2.web.d.ts +1 -0
- package/lib/typescript/lib/module/renderer/Container.d.ts +3 -4
- package/lib/typescript/lib/module/renderer/HostComponents.d.ts +0 -1
- package/lib/typescript/lib/module/renderer/HostConfig.d.ts +3 -1
- package/lib/typescript/lib/module/renderer/Reconciler.d.ts +2 -2
- package/lib/typescript/lib/module/sksg/Container.d.ts +15 -0
- package/lib/typescript/lib/module/sksg/DeclarationContext.d.ts +52 -0
- package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +21 -0
- package/lib/typescript/lib/module/sksg/HostConfig.d.ts +49 -0
- package/lib/typescript/lib/module/sksg/Reconciler.d.ts +17 -0
- package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +7 -0
- package/lib/typescript/lib/module/sksg/nodes/context.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/nodes/drawings.d.ts +21 -0
- package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +11 -0
- package/lib/typescript/lib/module/sksg/nodes/index.d.ts +3 -0
- package/lib/typescript/lib/module/sksg/nodes/paint.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +8 -0
- package/lib/typescript/lib/module/sksg/nodes/shaders.d.ts +9 -0
- package/lib/typescript/lib/module/sksg/nodes/utils.d.ts +2 -0
- package/lib/typescript/lib/module/views/SkiaDomView.web.d.ts +0 -4
- package/lib/typescript/lib/module/views/SkiaPictureView.web.d.ts +2 -0
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +3 -7
- package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +2 -3
- package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +3 -1
- package/lib/typescript/src/dom/nodes/datatypes/Transform.d.ts +2 -1
- package/lib/typescript/src/dom/types/Node.d.ts +2 -5
- package/lib/typescript/src/dom/types/index.d.ts +0 -2
- package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +2 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/renderer/Canvas.web.d.ts +10 -0
- package/lib/typescript/src/renderer/Canvas2.d.ts +10 -0
- package/lib/typescript/src/renderer/Canvas2.web.d.ts +3 -0
- package/lib/typescript/src/renderer/Container.d.ts +3 -5
- package/lib/typescript/src/renderer/HostComponents.d.ts +3 -6
- package/lib/typescript/src/renderer/Reconciler.d.ts +2 -3
- package/lib/typescript/src/renderer/__tests__/setup.d.ts +2 -3
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -2
- package/lib/typescript/src/skia/__tests__/setup.d.ts +0 -3
- package/lib/typescript/src/sksg/Container.d.ts +19 -0
- package/lib/typescript/src/sksg/DeclarationContext.d.ts +56 -0
- package/lib/typescript/src/sksg/DrawingContext.d.ts +13 -0
- package/lib/typescript/src/sksg/HostConfig.d.ts +19 -0
- package/lib/typescript/src/sksg/Reconciler.d.ts +19 -0
- package/lib/typescript/src/sksg/__tests__/MockDeclaration.d.ts +57 -0
- package/lib/typescript/src/sksg/nodes/Node.d.ts +7 -0
- package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +10 -0
- package/lib/typescript/src/sksg/nodes/context.d.ts +3 -0
- package/lib/typescript/src/sksg/nodes/drawings.d.ts +30 -0
- package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +17 -0
- package/lib/typescript/src/sksg/nodes/index.d.ts +3 -0
- package/lib/typescript/src/sksg/nodes/paint.d.ts +3 -0
- package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +11 -0
- package/lib/typescript/src/sksg/nodes/shaders.d.ts +11 -0
- package/lib/typescript/src/sksg/nodes/utils.d.ts +3 -0
- package/lib/typescript/src/views/SkiaDomView.web.d.ts +0 -7
- package/lib/typescript/src/views/SkiaPictureView.web.d.ts +3 -1
- package/lib/typescript/src/views/types.d.ts +4 -9
- package/libs/{ios → apple}/libskia.xcframework/Info.plist +15 -0
- package/libs/{ios → apple}/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/{ios → apple}/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/macos-arm64_x86_64/libskia.a +0 -0
- package/libs/{ios → apple}/libskottie.xcframework/Info.plist +20 -5
- package/libs/{ios → apple}/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/{ios → apple}/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/macos-arm64_x86_64/libskottie.a +0 -0
- package/libs/{ios → apple}/libskparagraph.xcframework/Info.plist +20 -5
- package/libs/{ios → apple}/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/{ios → apple}/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/macos-arm64_x86_64/libskparagraph.a +0 -0
- package/libs/{ios → apple}/libsksg.xcframework/Info.plist +15 -0
- package/libs/{ios → apple}/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/{ios → apple}/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/macos-arm64_x86_64/libsksg.a +0 -0
- package/libs/{ios → apple}/libskshaper.xcframework/Info.plist +20 -5
- package/libs/{ios → apple}/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/{ios → apple}/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/macos-arm64_x86_64/libskshaper.a +0 -0
- package/libs/{ios → apple}/libskunicode_core.xcframework/Info.plist +18 -3
- package/libs/{ios → apple}/libskunicode_core.xcframework/ios-arm64_arm64e/libskunicode_core.a +0 -0
- package/libs/{ios → apple}/libskunicode_core.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/macos-arm64_x86_64/libskunicode_core.a +0 -0
- package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/Info.plist +15 -0
- package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
- package/libs/{ios → apple}/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/macos-arm64_x86_64/libskunicode_libgrapheme.a +0 -0
- package/libs/{ios → apple}/libsvg.xcframework/Info.plist +15 -0
- package/libs/{ios → apple}/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/{ios → apple}/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/macos-arm64_x86_64/libsvg.a +0 -0
- package/package.json +3 -3
- package/react-native-skia.podspec +9 -9
- package/src/__tests__/setup.ts +1 -1
- package/src/__tests__/snapshots/sksg/breathe-0.png +0 -0
- package/src/__tests__/snapshots/sksg/breathe.png +0 -0
- package/src/__tests__/snapshots/sksg/simple.png +0 -0
- package/src/__tests__/snapshots/sksg/simple2.png +0 -0
- package/src/dom/nodes/JsiSkDOM.ts +58 -238
- package/src/dom/nodes/datatypes/Circle.ts +7 -5
- package/src/dom/nodes/datatypes/Enum.ts +4 -2
- package/src/dom/nodes/datatypes/Gradient.ts +14 -14
- package/src/dom/nodes/datatypes/Path.ts +5 -2
- package/src/dom/nodes/datatypes/Radius.ts +1 -0
- package/src/dom/nodes/datatypes/Rect.ts +44 -5
- package/src/dom/nodes/datatypes/Transform.ts +31 -1
- package/src/dom/types/Node.ts +2 -5
- package/src/dom/types/index.ts +0 -2
- package/src/external/reanimated/renderHelpers.ts +8 -4
- package/src/headless/index.ts +3 -5
- package/src/index.ts +1 -0
- package/src/renderer/Canvas.tsx +12 -31
- package/src/renderer/Canvas.web.tsx +134 -0
- package/src/renderer/Canvas2.tsx +128 -0
- package/src/renderer/Canvas2.web.tsx +6 -0
- package/src/renderer/Container.tsx +4 -16
- package/src/renderer/HostComponents.ts +2 -10
- package/src/renderer/HostConfig.ts +10 -4
- package/src/renderer/Offscreen.tsx +3 -6
- package/src/renderer/Reconciler.tsx +1 -5
- package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx +2 -2
- package/src/renderer/__tests__/setup.tsx +17 -15
- package/src/renderer/processors/Animations/Animations.ts +1 -5
- package/src/renderer/typeddash.ts +4 -2
- package/src/skia/__tests__/setup.ts +1 -51
- package/src/skia/types/Path/Path.ts +4 -2
- package/src/skia/types/Shader/Shader.ts +8 -4
- package/src/sksg/Container.ts +102 -0
- package/src/sksg/DeclarationContext.ts +85 -0
- package/src/sksg/DrawingContext.ts +226 -0
- package/src/sksg/HostConfig.ts +287 -0
- package/src/sksg/Reconciler.ts +66 -0
- package/src/sksg/__tests__/Declarations.spec.tsx +235 -0
- package/src/{dom/types/DeclarationContext.ts → sksg/__tests__/MockDeclaration.ts} +54 -21
- package/src/sksg/__tests__/Simple.spec.tsx +148 -0
- package/src/sksg/nodes/Node.ts +8 -0
- package/src/sksg/nodes/colorFilters.ts +79 -0
- package/src/sksg/nodes/context.ts +412 -0
- package/src/sksg/nodes/drawings.ts +405 -0
- package/src/sksg/nodes/imageFilters.ts +235 -0
- package/src/sksg/nodes/index.ts +3 -0
- package/src/sksg/nodes/paint.ts +75 -0
- package/src/sksg/nodes/pathEffects.ts +118 -0
- package/src/sksg/nodes/shaders.ts +210 -0
- package/src/sksg/nodes/utils.ts +23 -0
- package/src/views/SkiaDomView.web.tsx +0 -23
- package/src/views/SkiaPictureView.tsx +0 -2
- package/src/views/SkiaPictureView.web.tsx +10 -1
- package/src/views/types.ts +4 -10
- package/lib/commonjs/dom/__tests__/Shaders.spec.d.ts +0 -1
- package/lib/commonjs/dom/nodes/DrawingNode.d.ts +0 -14
- package/lib/commonjs/dom/nodes/DrawingNode.js +0 -69
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/GroupNode.d.ts +0 -7
- package/lib/commonjs/dom/nodes/GroupNode.js +0 -22
- package/lib/commonjs/dom/nodes/GroupNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/LayerNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/LayerNode.js +0 -39
- package/lib/commonjs/dom/nodes/LayerNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/Node.d.ts +0 -34
- package/lib/commonjs/dom/nodes/Node.js +0 -102
- package/lib/commonjs/dom/nodes/Node.js.map +0 -1
- package/lib/commonjs/dom/nodes/PaintNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/PaintNode.js +0 -90
- package/lib/commonjs/dom/nodes/PaintNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/RenderNode.d.ts +0 -26
- package/lib/commonjs/dom/nodes/RenderNode.js +0 -132
- package/lib/commonjs/dom/nodes/RenderNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +0 -36
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +0 -42
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/Box.d.ts +0 -15
- package/lib/commonjs/dom/nodes/drawings/Box.js +0 -82
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js +0 -32
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/FillNode.js +0 -24
- package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +0 -25
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js +0 -71
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +0 -13
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +0 -57
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/LineNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/ParagraphNode.js +0 -32
- package/lib/commonjs/dom/nodes/drawings/ParagraphNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +0 -18
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js +0 -53
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/PathNode.js +0 -55
- package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js +0 -26
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js +0 -30
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +0 -10
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js +0 -32
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/RectNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/Text.d.ts +0 -30
- package/lib/commonjs/dom/nodes/drawings/Text.js +0 -159
- package/lib/commonjs/dom/nodes/drawings/Text.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +0 -43
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +0 -18
- package/lib/commonjs/dom/nodes/drawings/index.js +0 -204
- package/lib/commonjs/dom/nodes/drawings/index.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/paint/BlendNode.js +0 -37
- package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +0 -35
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js +0 -102
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +0 -42
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js +0 -183
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +0 -8
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js +0 -26
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +0 -39
- package/lib/commonjs/dom/nodes/paint/PathEffects.js +0 -136
- package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.d.ts +0 -43
- package/lib/commonjs/dom/nodes/paint/Shaders.js +0 -209
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/index.d.ts +0 -6
- package/lib/commonjs/dom/nodes/paint/index.js +0 -72
- package/lib/commonjs/dom/nodes/paint/index.js.map +0 -1
- package/lib/commonjs/dom/types/DeclarationContext.d.ts +0 -29
- package/lib/commonjs/dom/types/DeclarationContext.js +0 -91
- package/lib/commonjs/dom/types/DeclarationContext.js.map +0 -1
- package/lib/commonjs/dom/types/DrawingContext.d.ts +0 -22
- package/lib/commonjs/dom/types/DrawingContext.js +0 -263
- package/lib/commonjs/dom/types/DrawingContext.js.map +0 -1
- package/lib/commonjs/renderer/DrawingContext.d.ts +0 -7
- package/lib/commonjs/renderer/DrawingContext.js.map +0 -1
- package/lib/commonjs/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
- package/lib/commonjs/views/SkiaJSDomView.d.ts +0 -38
- package/lib/commonjs/views/SkiaJSDomView.js +0 -131
- package/lib/commonjs/views/SkiaJSDomView.js.map +0 -1
- package/lib/commonjs/views/SkiaJSDomView.web.d.ts +0 -1
- package/lib/commonjs/views/SkiaJSDomView.web.js +0 -13
- package/lib/commonjs/views/SkiaJSDomView.web.js.map +0 -1
- package/lib/module/dom/__tests__/Compose.spec.d.ts +0 -1
- package/lib/module/dom/__tests__/Demos.spec.d.ts +0 -1
- package/lib/module/dom/__tests__/DrawingContext.spec.d.ts +0 -1
- package/lib/module/dom/__tests__/Drawings.spec.d.ts +0 -1
- package/lib/module/dom/__tests__/Group.spec.d.ts +0 -1
- package/lib/module/dom/__tests__/Paint.spec.d.ts +0 -1
- package/lib/module/dom/__tests__/RenderNodes.spec.d.ts +0 -1
- package/lib/module/dom/__tests__/Shaders.spec.d.ts +0 -1
- package/lib/module/dom/nodes/DrawingNode.d.ts +0 -14
- package/lib/module/dom/nodes/DrawingNode.js +0 -62
- package/lib/module/dom/nodes/DrawingNode.js.map +0 -1
- package/lib/module/dom/nodes/GroupNode.d.ts +0 -7
- package/lib/module/dom/nodes/GroupNode.js +0 -15
- package/lib/module/dom/nodes/GroupNode.js.map +0 -1
- package/lib/module/dom/nodes/LayerNode.d.ts +0 -8
- package/lib/module/dom/nodes/LayerNode.js +0 -32
- package/lib/module/dom/nodes/LayerNode.js.map +0 -1
- package/lib/module/dom/nodes/Node.d.ts +0 -34
- package/lib/module/dom/nodes/Node.js +0 -94
- package/lib/module/dom/nodes/Node.js.map +0 -1
- package/lib/module/dom/nodes/PaintNode.d.ts +0 -8
- package/lib/module/dom/nodes/PaintNode.js +0 -83
- package/lib/module/dom/nodes/PaintNode.js.map +0 -1
- package/lib/module/dom/nodes/RenderNode.d.ts +0 -26
- package/lib/module/dom/nodes/RenderNode.js +0 -125
- package/lib/module/dom/nodes/RenderNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/AtlasNode.js +0 -29
- package/lib/module/dom/nodes/drawings/AtlasNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +0 -35
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/Box.d.ts +0 -15
- package/lib/module/dom/nodes/drawings/Box.js +0 -74
- package/lib/module/dom/nodes/drawings/Box.js.map +0 -1
- package/lib/module/dom/nodes/drawings/CircleNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/CircleNode.js +0 -25
- package/lib/module/dom/nodes/drawings/CircleNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/DiffRectNode.js +0 -21
- package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/FillNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/FillNode.js +0 -17
- package/lib/module/dom/nodes/drawings/FillNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/ImageNode.d.ts +0 -25
- package/lib/module/dom/nodes/drawings/ImageNode.js +0 -64
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +0 -13
- package/lib/module/dom/nodes/drawings/ImageSVG.js +0 -50
- package/lib/module/dom/nodes/drawings/ImageSVG.js.map +0 -1
- package/lib/module/dom/nodes/drawings/LineNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/LineNode.js +0 -21
- package/lib/module/dom/nodes/drawings/LineNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/OvalNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/OvalNode.js +0 -21
- package/lib/module/dom/nodes/drawings/OvalNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/ParagraphNode.js +0 -25
- package/lib/module/dom/nodes/drawings/ParagraphNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/PatchNode.d.ts +0 -18
- package/lib/module/dom/nodes/drawings/PatchNode.js +0 -46
- package/lib/module/dom/nodes/drawings/PatchNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/PathNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/PathNode.js +0 -48
- package/lib/module/dom/nodes/drawings/PathNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/PictureNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/PictureNode.js +0 -19
- package/lib/module/dom/nodes/drawings/PictureNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/PointsNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/PointsNode.js +0 -23
- package/lib/module/dom/nodes/drawings/PointsNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/RRectNode.d.ts +0 -10
- package/lib/module/dom/nodes/drawings/RRectNode.js +0 -25
- package/lib/module/dom/nodes/drawings/RRectNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/RectNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/RectNode.js +0 -21
- package/lib/module/dom/nodes/drawings/RectNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/Text.d.ts +0 -30
- package/lib/module/dom/nodes/drawings/Text.js +0 -149
- package/lib/module/dom/nodes/drawings/Text.js.map +0 -1
- package/lib/module/dom/nodes/drawings/VerticesNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/VerticesNode.js +0 -36
- package/lib/module/dom/nodes/drawings/VerticesNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/index.d.ts +0 -18
- package/lib/module/dom/nodes/drawings/index.js +0 -19
- package/lib/module/dom/nodes/drawings/index.js.map +0 -1
- package/lib/module/dom/nodes/paint/BlendNode.d.ts +0 -8
- package/lib/module/dom/nodes/paint/BlendNode.js +0 -30
- package/lib/module/dom/nodes/paint/BlendNode.js.map +0 -1
- package/lib/module/dom/nodes/paint/ColorFilters.d.ts +0 -35
- package/lib/module/dom/nodes/paint/ColorFilters.js +0 -89
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +0 -1
- package/lib/module/dom/nodes/paint/ImageFilters.d.ts +0 -42
- package/lib/module/dom/nodes/paint/ImageFilters.js +0 -169
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +0 -1
- package/lib/module/dom/nodes/paint/MaskFilters.d.ts +0 -8
- package/lib/module/dom/nodes/paint/MaskFilters.js +0 -19
- package/lib/module/dom/nodes/paint/MaskFilters.js.map +0 -1
- package/lib/module/dom/nodes/paint/PathEffects.d.ts +0 -39
- package/lib/module/dom/nodes/paint/PathEffects.js +0 -123
- package/lib/module/dom/nodes/paint/PathEffects.js.map +0 -1
- package/lib/module/dom/nodes/paint/Shaders.d.ts +0 -43
- package/lib/module/dom/nodes/paint/Shaders.js +0 -193
- package/lib/module/dom/nodes/paint/Shaders.js.map +0 -1
- package/lib/module/dom/nodes/paint/index.d.ts +0 -6
- package/lib/module/dom/nodes/paint/index.js +0 -7
- package/lib/module/dom/nodes/paint/index.js.map +0 -1
- package/lib/module/dom/types/DeclarationContext.d.ts +0 -29
- package/lib/module/dom/types/DeclarationContext.js +0 -83
- package/lib/module/dom/types/DeclarationContext.js.map +0 -1
- package/lib/module/dom/types/DrawingContext.d.ts +0 -22
- package/lib/module/dom/types/DrawingContext.js +0 -256
- package/lib/module/dom/types/DrawingContext.js.map +0 -1
- package/lib/module/renderer/DrawingContext.d.ts +0 -7
- package/lib/module/renderer/DrawingContext.js +0 -2
- package/lib/module/renderer/DrawingContext.js.map +0 -1
- package/lib/module/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
- package/lib/module/views/SkiaJSDomView.d.ts +0 -38
- package/lib/module/views/SkiaJSDomView.js +0 -123
- package/lib/module/views/SkiaJSDomView.js.map +0 -1
- package/lib/module/views/SkiaJSDomView.web.d.ts +0 -1
- package/lib/module/views/SkiaJSDomView.web.js +0 -2
- package/lib/module/views/SkiaJSDomView.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/dom/nodes/DrawingNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/GroupNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/LayerNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/Node.d.ts +0 -20
- package/lib/typescript/lib/commonjs/dom/nodes/PaintNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/RenderNode.d.ts +0 -16
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/Box.d.ts +0 -15
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +0 -13
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +0 -9
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/ParagraphNode.d.ts +0 -9
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +0 -14
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +0 -9
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/Text.d.ts +0 -34
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +0 -29
- package/lib/typescript/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +0 -35
- package/lib/typescript/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +0 -34
- package/lib/typescript/lib/commonjs/dom/nodes/paint/Shaders.d.ts +0 -40
- package/lib/typescript/lib/commonjs/dom/types/DeclarationContext.d.ts +0 -26
- package/lib/typescript/lib/commonjs/dom/types/DrawingContext.d.ts +0 -13
- package/lib/typescript/lib/commonjs/views/SkiaJSDomView.d.ts +0 -29
- package/lib/typescript/lib/commonjs/views/SkiaJSDomView.web.d.ts +0 -3
- package/lib/typescript/lib/module/dom/nodes/DrawingNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/GroupNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/LayerNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/Node.d.ts +0 -19
- package/lib/typescript/lib/module/dom/nodes/PaintNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/RenderNode.d.ts +0 -15
- package/lib/typescript/lib/module/dom/nodes/drawings/AtlasNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/Box.d.ts +0 -14
- package/lib/typescript/lib/module/dom/nodes/drawings/CircleNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/FillNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/ImageNode.d.ts +0 -22
- package/lib/typescript/lib/module/dom/nodes/drawings/ImageSVG.d.ts +0 -8
- package/lib/typescript/lib/module/dom/nodes/drawings/LineNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/OvalNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
- package/lib/typescript/lib/module/dom/nodes/drawings/PatchNode.d.ts +0 -13
- package/lib/typescript/lib/module/dom/nodes/drawings/PathNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/PictureNode.d.ts +0 -8
- package/lib/typescript/lib/module/dom/nodes/drawings/PointsNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/RRectNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/RectNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/Text.d.ts +0 -33
- package/lib/typescript/lib/module/dom/nodes/drawings/VerticesNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/index.d.ts +0 -18
- package/lib/typescript/lib/module/dom/nodes/paint/BlendNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/paint/ColorFilters.d.ts +0 -28
- package/lib/typescript/lib/module/dom/nodes/paint/ImageFilters.d.ts +0 -34
- package/lib/typescript/lib/module/dom/nodes/paint/MaskFilters.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/paint/PathEffects.d.ts +0 -33
- package/lib/typescript/lib/module/dom/nodes/paint/Shaders.d.ts +0 -39
- package/lib/typescript/lib/module/dom/nodes/paint/index.d.ts +0 -6
- package/lib/typescript/lib/module/dom/types/DeclarationContext.d.ts +0 -25
- package/lib/typescript/lib/module/dom/types/DrawingContext.d.ts +0 -12
- package/lib/typescript/lib/module/renderer/DrawingContext.d.ts +0 -1
- package/lib/typescript/lib/module/views/SkiaJSDomView.d.ts +0 -26
- package/lib/typescript/lib/module/views/SkiaJSDomView.web.d.ts +0 -1
- package/lib/typescript/src/dom/__tests__/Compose.spec.d.ts +0 -1
- package/lib/typescript/src/dom/__tests__/Demos.spec.d.ts +0 -1
- package/lib/typescript/src/dom/__tests__/DrawingContext.spec.d.ts +0 -1
- package/lib/typescript/src/dom/__tests__/Drawings.spec.d.ts +0 -1
- package/lib/typescript/src/dom/__tests__/Group.spec.d.ts +0 -1
- package/lib/typescript/src/dom/__tests__/Paint.spec.d.ts +0 -1
- package/lib/typescript/src/dom/__tests__/RenderNodes.spec.d.ts +0 -1
- package/lib/typescript/src/dom/__tests__/Shaders.spec.d.ts +0 -1
- package/lib/typescript/src/dom/nodes/DrawingNode.d.ts +0 -14
- package/lib/typescript/src/dom/nodes/GroupNode.d.ts +0 -7
- package/lib/typescript/src/dom/nodes/LayerNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/Node.d.ts +0 -34
- package/lib/typescript/src/dom/nodes/PaintNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/RenderNode.d.ts +0 -26
- package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +0 -15
- package/lib/typescript/src/dom/nodes/drawings/CircleNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/FillNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/ImageNode.d.ts +0 -25
- package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +0 -13
- package/lib/typescript/src/dom/nodes/drawings/LineNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/OvalNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +0 -18
- package/lib/typescript/src/dom/nodes/drawings/PathNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/PictureNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/PointsNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +0 -10
- package/lib/typescript/src/dom/nodes/drawings/RectNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/Text.d.ts +0 -30
- package/lib/typescript/src/dom/nodes/drawings/VerticesNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +0 -18
- package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +0 -35
- package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +0 -42
- package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +0 -39
- package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +0 -43
- package/lib/typescript/src/dom/nodes/paint/index.d.ts +0 -6
- package/lib/typescript/src/dom/types/DeclarationContext.d.ts +0 -29
- package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -22
- package/lib/typescript/src/renderer/DrawingContext.d.ts +0 -7
- package/lib/typescript/src/renderer/__tests__/SkiaDOM.spec.d.ts +0 -1
- package/lib/typescript/src/views/SkiaJSDomView.d.ts +0 -38
- package/lib/typescript/src/views/SkiaJSDomView.web.d.ts +0 -1
- package/src/dom/__tests__/Compose.spec.tsx +0 -42
- package/src/dom/__tests__/Demos.spec.tsx +0 -145
- package/src/dom/__tests__/DrawingContext.spec.tsx +0 -99
- package/src/dom/__tests__/Drawings.spec.tsx +0 -95
- package/src/dom/__tests__/Group.spec.tsx +0 -132
- package/src/dom/__tests__/Paint.spec.tsx +0 -100
- package/src/dom/__tests__/RenderNodes.spec.tsx +0 -44
- package/src/dom/__tests__/Shaders.spec.tsx +0 -123
- package/src/dom/nodes/DrawingNode.ts +0 -74
- package/src/dom/nodes/GroupNode.ts +0 -19
- package/src/dom/nodes/LayerNode.ts +0 -37
- package/src/dom/nodes/Node.ts +0 -121
- package/src/dom/nodes/PaintNode.ts +0 -91
- package/src/dom/nodes/RenderNode.ts +0 -172
- package/src/dom/nodes/drawings/AtlasNode.ts +0 -24
- package/src/dom/nodes/drawings/BackdropFilterNode.ts +0 -37
- package/src/dom/nodes/drawings/Box.ts +0 -110
- package/src/dom/nodes/drawings/CircleNode.ts +0 -24
- package/src/dom/nodes/drawings/DiffRectNode.ts +0 -19
- package/src/dom/nodes/drawings/FillNode.ts +0 -18
- package/src/dom/nodes/drawings/ImageNode.ts +0 -49
- package/src/dom/nodes/drawings/ImageSVG.ts +0 -38
- package/src/dom/nodes/drawings/LineNode.ts +0 -19
- package/src/dom/nodes/drawings/OvalNode.ts +0 -23
- package/src/dom/nodes/drawings/ParagraphNode.ts +0 -22
- package/src/dom/nodes/drawings/PatchNode.ts +0 -54
- package/src/dom/nodes/drawings/PathNode.ts +0 -51
- package/src/dom/nodes/drawings/PictureNode.ts +0 -19
- package/src/dom/nodes/drawings/PointsNode.ts +0 -21
- package/src/dom/nodes/drawings/RRectNode.ts +0 -25
- package/src/dom/nodes/drawings/RectNode.ts +0 -23
- package/src/dom/nodes/drawings/Text.ts +0 -145
- package/src/dom/nodes/drawings/VerticesNode.ts +0 -35
- package/src/dom/nodes/drawings/index.ts +0 -18
- package/src/dom/nodes/paint/BlendNode.ts +0 -32
- package/src/dom/nodes/paint/ColorFilters.ts +0 -106
- package/src/dom/nodes/paint/ImageFilters.ts +0 -221
- package/src/dom/nodes/paint/MaskFilters.ts +0 -23
- package/src/dom/nodes/paint/PathEffects.ts +0 -139
- package/src/dom/nodes/paint/Shaders.ts +0 -233
- package/src/dom/nodes/paint/index.ts +0 -6
- package/src/dom/types/DrawingContext.ts +0 -322
- package/src/renderer/DrawingContext.ts +0 -8
- package/src/renderer/__tests__/SkiaDOM.spec.tsx +0 -46
- package/src/views/SkiaJSDomView.tsx +0 -143
- package/src/views/SkiaJSDomView.web.tsx +0 -1
- /package/lib/commonjs/{dom/__tests__/Compose.spec.d.ts → sksg/__tests__/Declarations.spec.d.ts} +0 -0
- /package/lib/commonjs/{dom/__tests__/Demos.spec.d.ts → sksg/__tests__/Simple.spec.d.ts} +0 -0
- /package/lib/{commonjs/dom/__tests__/DrawingContext.spec.d.ts → module/sksg/__tests__/Declarations.spec.d.ts} +0 -0
- /package/lib/{commonjs/dom/__tests__/Drawings.spec.d.ts → module/sksg/__tests__/Simple.spec.d.ts} +0 -0
- /package/lib/typescript/lib/commonjs/{dom/nodes/drawings/index.d.ts → sksg/nodes/Node.d.ts} +0 -0
- /package/lib/typescript/lib/commonjs/{dom/nodes/paint → sksg/nodes}/index.d.ts +0 -0
- /package/lib/{commonjs/dom/__tests__/Group.spec.d.ts → typescript/lib/module/sksg/nodes/Node.d.ts} +0 -0
- /package/lib/{commonjs/dom/__tests__/Paint.spec.d.ts → typescript/src/sksg/__tests__/Declarations.spec.d.ts} +0 -0
- /package/lib/{commonjs/dom/__tests__/RenderNodes.spec.d.ts → typescript/src/sksg/__tests__/Simple.spec.d.ts} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["FillType","PathOp","PathVerb","isPath","obj","__typename__"],"sources":["Path.ts"],"sourcesContent":["import type { SkRect } from \"../Rect\";\nimport type { SkPoint } from \"../Point\";\nimport type { InputRRect } from \"../RRect\";\nimport type { StrokeJoin, StrokeCap } from \"../Paint\";\nimport type { InputMatrix, SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\n\n/**\n * Options used for Path.stroke(). If an option is omitted, a sensible default will be used.\n */\nexport interface StrokeOpts {\n /** The width of the stroked lines. */\n width?: number;\n miter_limit?: number;\n /**\n * if > 1, increase precision, else if (0 < resScale < 1) reduce precision to\n * favor speed and size\n */\n precision?: number;\n join?: StrokeJoin;\n cap?: StrokeCap;\n}\n\nexport enum FillType {\n Winding,\n EvenOdd,\n InverseWinding,\n InverseEvenOdd,\n}\n\nexport enum PathOp {\n Difference, //!< subtract the op path from the first path\n Intersect, //!< intersect the two paths\n Union, //!< union (inclusive-or) the two paths\n XOR, //!< exclusive-or the two paths\n ReverseDifference,\n}\n\nexport enum PathVerb {\n Move,\n Line,\n Quad,\n Conic,\n Cubic,\n Close,\n}\n\nexport type PathCommand = number[];\n\nexport const isPath = (obj: SkJSIInstance<string> | null): obj is SkPath =>\n obj !== null && obj.__typename__ === \"Path\";\n\nexport interface SkPath extends SkJSIInstance<\"Path\"> {\n /**\n * Appends arc to Path, as the start of new contour. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngle\n * @param sweepAngle\n */\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ): SkPath;\n\n /**\n * Adds oval to Path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.\n * Oval is upright ellipse bounded by Rect oval with radii equal to half oval width\n * and half oval height. Oval begins at start and continues clockwise by default.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param isCCW - if the path should be drawn counter-clockwise or not\n * @param startIndex - index of initial point of ellipse\n */\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): SkPath;\n\n /**\n * Returns the number of points in this path. Initially zero.\n */\n countPoints(): number;\n\n /**\n * Adds contour created from array of n points, adding (count - 1) line segments.\n * Contour added starts at pts[0], then adds a line for every additional point\n * in pts array. If close is true, appends kClose_Verb to Path, connecting\n * pts[count - 1] and pts[0].\n * Returns the modified path for easier chaining.\n * @param points\n * @param close - if true, will add a line connecting last point to the first point.\n */\n addPoly(points: SkPoint[], close: boolean): SkPath;\n\n /** Adds beginning of contour at SkPoint (x, y).\n\n @param x x-axis value of contour start\n @param y y-axis value of contour start\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_moveTo\n */\n moveTo(x: number, y: number): SkPath;\n /** Adds line from last point to (x, y). If SkPath is empty, or last SkPath::Verb is\n kClose_Verb, last point is set to (0, 0) before adding line.\n\n lineTo() appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed.\n lineTo() then appends kLine_Verb to verb array and (x, y) to SkPoint array.\n\n @param x end of added line on x-axis\n @param y end of added line on y-axis\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_lineTo\n */\n lineTo(x: number, y: number): SkPath;\n\n /**\n * Returns a new path that covers the same area as the original path, but with the\n * Winding FillType. This may re-draw some contours in the path as counter-clockwise\n * instead of clockwise to achieve that effect. If such a transformation cannot\n * be done, null is returned.\n */\n makeAsWinding(): SkPath | null;\n\n /**\n * Translates all the points in the path by dx, dy.\n * @param dx\n * @param dy\n */\n offset(dx: number, dy: number): SkPath;\n\n /**\n * Relative version of arcToRotated.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param dx\n * @param dy\n */\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ): SkPath;\n\n /**\n * Relative version of conicTo.\n * @param dx1\n * @param dy1\n * @param dx2\n * @param dy2\n * @param w\n */\n rConicTo(\n dx1: number,\n dy1: number,\n dx2: number,\n dy2: number,\n w: number\n ): SkPath;\n\n /**\n * Relative version of cubicTo.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Relative version of moveTo.\n * @param x\n * @param y\n */\n rMoveTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of lineTo.\n * @param x\n * @param y\n */\n rLineTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of quadTo.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\n rQuadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Sets FillType, the rule used to fill Path.\n * @param fill\n */\n setFillType(fill: FillType): SkPath;\n\n /**\n * Specifies whether Path is volatile; whether it will be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false.\n *\n * Mark animating or temporary paths as volatile to improve performance.\n * Mark unchanging Path non-volatile to improve repeated rendering.\n * @param volatile\n */\n setIsVolatile(volatile: boolean): SkPath;\n\n /**\n * Turns this path into the filled equivalent of the stroked path. Returns false if the operation\n * fails (e.g. the path is a hairline).\n * @param opts - describe how stroked path should look.\n * If such a transformation cannot be done, null is returned.\n */\n stroke(opts?: StrokeOpts): null | SkPath;\n\n /**\n * Appends CLOSE_VERB to Path. A closed contour connects the first and last point\n * with a line, forming a continuous loop.\n */\n close(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is released\n */\n reset(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is *not* released.\n * Use rewind() instead of reset() if Path storage will be reused and performance\n * is critical.\n */\n rewind(): SkPath;\n\n /**\n * Returns minimum and maximum axes values of the lines and curves in Path.\n * Returns (0, 0, 0, 0) if Path contains no points.\n * Returned bounds width and height may be larger or smaller than area affected\n * when Path is drawn.\n *\n * Behaves identically to getBounds() when Path contains\n * only lines. If Path contains curves, computed bounds includes\n * the maximum extent of the quad, conic, or cubic; is slower than getBounds();\n * and unlike getBounds(), does not cache the result.\n */\n computeTightBounds(): SkRect;\n\n /**\n * Appends arc to Path. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngleInDegrees\n * @param sweepAngleInDegrees\n * @param forceMoveTo\n */\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ): SkPath;\n\n /**\n * Appends arc to Path. Arc is implemented by one or more conics weighted to\n * describe part of oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc\n * curves from last Path Point to (x, y), choosing one of four possible routes:\n * clockwise or counterclockwise, and smaller or larger. See SkPath.h for more details.\n * Returns the modified path for easier chaining.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param x\n * @param y\n */\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Appends arc to Path, after appending line if needed. Arc is implemented by conic\n * weighted to describe part of circle. Arc is contained by tangent from\n * last Path point to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc\n * is part of circle sized to radius, positioned so it touches both tangent lines.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param radius\n */\n arcToTangent(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n radius: number\n ): SkPath;\n\n /**\n * Adds conic from last point towards (x1, y1), to (x2, y2), weighted by w.\n * If Path is empty, or path is closed, the last point is set to (0, 0)\n * before adding conic.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param w\n */\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number): SkPath;\n\n /**\n * Returns true if the point (x, y) is contained by Path, taking into\n * account FillType.\n * @param x\n * @param y\n */\n contains(x: number, y: number): boolean;\n\n /**\n * Returns a copy of this Path.\n */\n copy(): SkPath;\n\n /**\n * Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at\n * (x3, y3). If Path is empty, or path is closed, the last point is set to\n * (0, 0) before adding cubic.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Changes this path to be the dashed version of itself. This is the same effect as creating\n * a DashPathEffect and calling filterPath on this path.\n * @param on\n * @param off\n * @param phase\n */\n dash(on: number, off: number, phase: number): boolean;\n\n /**\n * Returns true if other path is equal to this path.\n * @param other\n */\n equals(other: SkPath): boolean;\n\n /**\n * Returns minimum and maximum axes values of Point array.\n * Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may\n * be larger or smaller than area affected when Path is drawn.\n */\n getBounds(): SkRect;\n\n /**\n * Return the FillType for this path.\n */\n getFillType(): FillType;\n\n /**\n Adds quad from last point towards (x1, y1), to (x2, y2).\n\n If SkPath is empty, or last SkPath::Verb is kClose_Verb, last point is set to (0, 0) before adding quad.\n\n Appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed; then appends kQuad_Verb to verb array;\n and (x1, y1), (x2, y2) to SkPoint array.\n\n Parameters\n x1\tcontrol SkPoint of quad on x-axis\n y1\tcontrol SkPoint of quad on y-axis\n x2\tend SkPoint of quad on x-axis\n y2\tend SkPoint of quad on y-axis\n Returns\n reference to SkPath\n example: https://fiddle.skia.org/c/@Path_quadTo\n */\n quadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,\n * starting with top-left corner of Rect; followed by top-right, bottom-right,\n * and bottom-left if isCCW is false; or followed by bottom-left,\n * bottom-right, and top-right if isCCW is true.\n * Returns the modified path for easier chaining.\n * @param rect\n * @param isCCW\n */\n addRect(rect: SkRect, isCCW?: boolean): SkPath;\n\n /**\n * Adds rrect to Path, creating a new closed contour.\n * Returns the modified path for easier chaining.\n * @param rrect\n * @param isCCW\n */\n addRRect(rrect: InputRRect, isCCW?: boolean): SkPath;\n\n /** Appends src to SkPath, transformed by matrix. Transformed curves may have\n different verbs, SkPoint, and conic weights.\n\n If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic\n weights are added unaltered. If mode is kExtend_AddPathMode, add line\n before appending verbs, SkPoint, and conic weights.\n\n @param src SkPath verbs, SkPoint, and conic weights to add\n @param matrix transform applied to src\n @param extend extends path with line if true\n @return reference to SkPath\n */\n addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): SkPath;\n\n /**\n * Returns the Point at index in Point array. Valid range for index is\n * 0 to countPoints() - 1.\n * @param index\n */\n getPoint(index: number): SkPoint;\n\n /**\n * Returns true if there are no verbs in the path.\n */\n isEmpty(): boolean;\n\n /**\n * Returns true if the path is volatile; it will not be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false, allowing\n * Surface to attach a cache of data which speeds repeated drawing. If true, Surface\n * may not speed repeated drawing.\n */\n isVolatile(): boolean;\n\n /** Adds circle centered at (x, y) of size radius to SkPath, appending kMove_Verb,\n four kConic_Verb, and kClose_Verb. Circle begins at: (x + radius, y), continuing\n clockwise if dir is kCW_Direction, and counterclockwise if dir is kCCW_Direction.\n\n Has no effect if radius is zero or negative.\n\n @param x center of circle\n @param y center of circle\n @param radius distance from center to edge \n @return reference to SkPath\n */\n addCircle(x: number, y: number, r: number): SkPath;\n\n getLastPt(): { x: number; y: number };\n\n /** Set this path to the result of applying the Op to this path and the\n specified path: this = (this op operand).\n The resulting path will be constructed from non-overlapping contours.\n The curve order is reduced where possible so that cubics may be turned\n into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param path The second path (for difference, the subtrahend)\n @param op The operator to apply.\n @param result The product of the operands. The result may be one of the\n inputs.\n @return True if the operation succeeded.\n */\n op(path: SkPath, op: PathOp): boolean;\n\n /** Set this path to a set of non-overlapping contours that describe the\n same area as the original path.\n The curve order is reduced where possible so that cubics may\n be turned into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param result The simplified path. The result may be the input.\n @return True if simplification succeeded.\n */\n simplify(): boolean;\n\n /**\n * Returns this path as an SVG string.\n */\n toSVGString(): string;\n\n /**\n * Take start and stop \"t\" values (values between 0...1), and modify this path such that\n * it is a subset of the original path.\n * The trim values apply to the entire path, so if it contains several contours, all of them\n * are including in the calculation.\n * Null is returned if either input value is NaN.\n * @param startT - a value in the range [0.0, 1.0]. 0.0 is the beginning of the path.\n * @param stopT - a value in the range [0.0, 1.0]. 1.0 is the end of the path.\n * @param isComplement\n */\n trim(startT: number, stopT: number, isComplement: boolean): null | SkPath;\n\n /**\n * Transforms the path by the specified matrix.\n */\n transform(m3: InputMatrix): SkPath;\n\n /**\n * Interpolates between Path with point array of equal size.\n * Copy verb array and weights to result, and set result path to a weighted\n * average of this path array and ending path.\n\n * weight is most useful when between zero (ending path) and\n one (this path); will work with values outside of this\n range.\n\n * interpolate() returns undefined if path is not\n * the same size as ending path. Call isInterpolatable() to check Path\n * compatibility prior to calling interpolate().\n\n * @param ending path to interpolate with\n * @param weight contribution of this path, and\n * one minus contribution of ending path\n * @param output path to be replaced with the interpolated averages\n * @return Path replaced by interpolated averages or null if \n * not interpolatable\n * */\n interpolate(end: SkPath, weight: number, output?: SkPath): SkPath | null;\n\n /** Returns true if Path contain equal verbs and equal weights.\n * @param compare path to compare\n * @return true if Path can be interpolated equivalent\n *\n * */\n isInterpolatable(compare: SkPath): boolean;\n\n /**\n * Serializes the contents of this path as a series of commands.\n */\n toCmds(): PathCommand[];\n}\n"],"mappings":"AAOA;AACA;AACA;;AAcA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAOpB,WAAYC,MAAM,0BAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAQlB,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAWpB,OAAO,MAAMC,MAAM,GAAIC,GAAiC,IACtDA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,MAAM","ignoreList":[]}
|
1
|
+
{"version":3,"names":["FillType","PathOp","PathVerb","isPath","obj","__typename__"],"sources":["Path.ts"],"sourcesContent":["import type { SkRect } from \"../Rect\";\nimport type { SkPoint } from \"../Point\";\nimport type { InputRRect } from \"../RRect\";\nimport type { StrokeJoin, StrokeCap } from \"../Paint\";\nimport type { InputMatrix, SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\n\n/**\n * Options used for Path.stroke(). If an option is omitted, a sensible default will be used.\n */\nexport interface StrokeOpts {\n /** The width of the stroked lines. */\n width?: number;\n miter_limit?: number;\n /**\n * if > 1, increase precision, else if (0 < resScale < 1) reduce precision to\n * favor speed and size\n */\n precision?: number;\n join?: StrokeJoin;\n cap?: StrokeCap;\n}\n\nexport enum FillType {\n Winding,\n EvenOdd,\n InverseWinding,\n InverseEvenOdd,\n}\n\nexport enum PathOp {\n Difference, //!< subtract the op path from the first path\n Intersect, //!< intersect the two paths\n Union, //!< union (inclusive-or) the two paths\n XOR, //!< exclusive-or the two paths\n ReverseDifference,\n}\n\nexport enum PathVerb {\n Move,\n Line,\n Quad,\n Conic,\n Cubic,\n Close,\n}\n\nexport type PathCommand = number[];\n\nexport const isPath = (obj: SkJSIInstance<string> | null): obj is SkPath => {\n \"worklet\";\n return obj !== null && obj.__typename__ === \"Path\";\n};\n\nexport interface SkPath extends SkJSIInstance<\"Path\"> {\n /**\n * Appends arc to Path, as the start of new contour. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngle\n * @param sweepAngle\n */\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ): SkPath;\n\n /**\n * Adds oval to Path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.\n * Oval is upright ellipse bounded by Rect oval with radii equal to half oval width\n * and half oval height. Oval begins at start and continues clockwise by default.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param isCCW - if the path should be drawn counter-clockwise or not\n * @param startIndex - index of initial point of ellipse\n */\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): SkPath;\n\n /**\n * Returns the number of points in this path. Initially zero.\n */\n countPoints(): number;\n\n /**\n * Adds contour created from array of n points, adding (count - 1) line segments.\n * Contour added starts at pts[0], then adds a line for every additional point\n * in pts array. If close is true, appends kClose_Verb to Path, connecting\n * pts[count - 1] and pts[0].\n * Returns the modified path for easier chaining.\n * @param points\n * @param close - if true, will add a line connecting last point to the first point.\n */\n addPoly(points: SkPoint[], close: boolean): SkPath;\n\n /** Adds beginning of contour at SkPoint (x, y).\n\n @param x x-axis value of contour start\n @param y y-axis value of contour start\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_moveTo\n */\n moveTo(x: number, y: number): SkPath;\n /** Adds line from last point to (x, y). If SkPath is empty, or last SkPath::Verb is\n kClose_Verb, last point is set to (0, 0) before adding line.\n\n lineTo() appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed.\n lineTo() then appends kLine_Verb to verb array and (x, y) to SkPoint array.\n\n @param x end of added line on x-axis\n @param y end of added line on y-axis\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_lineTo\n */\n lineTo(x: number, y: number): SkPath;\n\n /**\n * Returns a new path that covers the same area as the original path, but with the\n * Winding FillType. This may re-draw some contours in the path as counter-clockwise\n * instead of clockwise to achieve that effect. If such a transformation cannot\n * be done, null is returned.\n */\n makeAsWinding(): SkPath | null;\n\n /**\n * Translates all the points in the path by dx, dy.\n * @param dx\n * @param dy\n */\n offset(dx: number, dy: number): SkPath;\n\n /**\n * Relative version of arcToRotated.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param dx\n * @param dy\n */\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ): SkPath;\n\n /**\n * Relative version of conicTo.\n * @param dx1\n * @param dy1\n * @param dx2\n * @param dy2\n * @param w\n */\n rConicTo(\n dx1: number,\n dy1: number,\n dx2: number,\n dy2: number,\n w: number\n ): SkPath;\n\n /**\n * Relative version of cubicTo.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Relative version of moveTo.\n * @param x\n * @param y\n */\n rMoveTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of lineTo.\n * @param x\n * @param y\n */\n rLineTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of quadTo.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\n rQuadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Sets FillType, the rule used to fill Path.\n * @param fill\n */\n setFillType(fill: FillType): SkPath;\n\n /**\n * Specifies whether Path is volatile; whether it will be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false.\n *\n * Mark animating or temporary paths as volatile to improve performance.\n * Mark unchanging Path non-volatile to improve repeated rendering.\n * @param volatile\n */\n setIsVolatile(volatile: boolean): SkPath;\n\n /**\n * Turns this path into the filled equivalent of the stroked path. Returns false if the operation\n * fails (e.g. the path is a hairline).\n * @param opts - describe how stroked path should look.\n * If such a transformation cannot be done, null is returned.\n */\n stroke(opts?: StrokeOpts): null | SkPath;\n\n /**\n * Appends CLOSE_VERB to Path. A closed contour connects the first and last point\n * with a line, forming a continuous loop.\n */\n close(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is released\n */\n reset(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is *not* released.\n * Use rewind() instead of reset() if Path storage will be reused and performance\n * is critical.\n */\n rewind(): SkPath;\n\n /**\n * Returns minimum and maximum axes values of the lines and curves in Path.\n * Returns (0, 0, 0, 0) if Path contains no points.\n * Returned bounds width and height may be larger or smaller than area affected\n * when Path is drawn.\n *\n * Behaves identically to getBounds() when Path contains\n * only lines. If Path contains curves, computed bounds includes\n * the maximum extent of the quad, conic, or cubic; is slower than getBounds();\n * and unlike getBounds(), does not cache the result.\n */\n computeTightBounds(): SkRect;\n\n /**\n * Appends arc to Path. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngleInDegrees\n * @param sweepAngleInDegrees\n * @param forceMoveTo\n */\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ): SkPath;\n\n /**\n * Appends arc to Path. Arc is implemented by one or more conics weighted to\n * describe part of oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc\n * curves from last Path Point to (x, y), choosing one of four possible routes:\n * clockwise or counterclockwise, and smaller or larger. See SkPath.h for more details.\n * Returns the modified path for easier chaining.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param x\n * @param y\n */\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Appends arc to Path, after appending line if needed. Arc is implemented by conic\n * weighted to describe part of circle. Arc is contained by tangent from\n * last Path point to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc\n * is part of circle sized to radius, positioned so it touches both tangent lines.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param radius\n */\n arcToTangent(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n radius: number\n ): SkPath;\n\n /**\n * Adds conic from last point towards (x1, y1), to (x2, y2), weighted by w.\n * If Path is empty, or path is closed, the last point is set to (0, 0)\n * before adding conic.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param w\n */\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number): SkPath;\n\n /**\n * Returns true if the point (x, y) is contained by Path, taking into\n * account FillType.\n * @param x\n * @param y\n */\n contains(x: number, y: number): boolean;\n\n /**\n * Returns a copy of this Path.\n */\n copy(): SkPath;\n\n /**\n * Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at\n * (x3, y3). If Path is empty, or path is closed, the last point is set to\n * (0, 0) before adding cubic.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Changes this path to be the dashed version of itself. This is the same effect as creating\n * a DashPathEffect and calling filterPath on this path.\n * @param on\n * @param off\n * @param phase\n */\n dash(on: number, off: number, phase: number): boolean;\n\n /**\n * Returns true if other path is equal to this path.\n * @param other\n */\n equals(other: SkPath): boolean;\n\n /**\n * Returns minimum and maximum axes values of Point array.\n * Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may\n * be larger or smaller than area affected when Path is drawn.\n */\n getBounds(): SkRect;\n\n /**\n * Return the FillType for this path.\n */\n getFillType(): FillType;\n\n /**\n Adds quad from last point towards (x1, y1), to (x2, y2).\n\n If SkPath is empty, or last SkPath::Verb is kClose_Verb, last point is set to (0, 0) before adding quad.\n\n Appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed; then appends kQuad_Verb to verb array;\n and (x1, y1), (x2, y2) to SkPoint array.\n\n Parameters\n x1\tcontrol SkPoint of quad on x-axis\n y1\tcontrol SkPoint of quad on y-axis\n x2\tend SkPoint of quad on x-axis\n y2\tend SkPoint of quad on y-axis\n Returns\n reference to SkPath\n example: https://fiddle.skia.org/c/@Path_quadTo\n */\n quadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,\n * starting with top-left corner of Rect; followed by top-right, bottom-right,\n * and bottom-left if isCCW is false; or followed by bottom-left,\n * bottom-right, and top-right if isCCW is true.\n * Returns the modified path for easier chaining.\n * @param rect\n * @param isCCW\n */\n addRect(rect: SkRect, isCCW?: boolean): SkPath;\n\n /**\n * Adds rrect to Path, creating a new closed contour.\n * Returns the modified path for easier chaining.\n * @param rrect\n * @param isCCW\n */\n addRRect(rrect: InputRRect, isCCW?: boolean): SkPath;\n\n /** Appends src to SkPath, transformed by matrix. Transformed curves may have\n different verbs, SkPoint, and conic weights.\n\n If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic\n weights are added unaltered. If mode is kExtend_AddPathMode, add line\n before appending verbs, SkPoint, and conic weights.\n\n @param src SkPath verbs, SkPoint, and conic weights to add\n @param matrix transform applied to src\n @param extend extends path with line if true\n @return reference to SkPath\n */\n addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): SkPath;\n\n /**\n * Returns the Point at index in Point array. Valid range for index is\n * 0 to countPoints() - 1.\n * @param index\n */\n getPoint(index: number): SkPoint;\n\n /**\n * Returns true if there are no verbs in the path.\n */\n isEmpty(): boolean;\n\n /**\n * Returns true if the path is volatile; it will not be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false, allowing\n * Surface to attach a cache of data which speeds repeated drawing. If true, Surface\n * may not speed repeated drawing.\n */\n isVolatile(): boolean;\n\n /** Adds circle centered at (x, y) of size radius to SkPath, appending kMove_Verb,\n four kConic_Verb, and kClose_Verb. Circle begins at: (x + radius, y), continuing\n clockwise if dir is kCW_Direction, and counterclockwise if dir is kCCW_Direction.\n\n Has no effect if radius is zero or negative.\n\n @param x center of circle\n @param y center of circle\n @param radius distance from center to edge \n @return reference to SkPath\n */\n addCircle(x: number, y: number, r: number): SkPath;\n\n getLastPt(): { x: number; y: number };\n\n /** Set this path to the result of applying the Op to this path and the\n specified path: this = (this op operand).\n The resulting path will be constructed from non-overlapping contours.\n The curve order is reduced where possible so that cubics may be turned\n into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param path The second path (for difference, the subtrahend)\n @param op The operator to apply.\n @param result The product of the operands. The result may be one of the\n inputs.\n @return True if the operation succeeded.\n */\n op(path: SkPath, op: PathOp): boolean;\n\n /** Set this path to a set of non-overlapping contours that describe the\n same area as the original path.\n The curve order is reduced where possible so that cubics may\n be turned into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param result The simplified path. The result may be the input.\n @return True if simplification succeeded.\n */\n simplify(): boolean;\n\n /**\n * Returns this path as an SVG string.\n */\n toSVGString(): string;\n\n /**\n * Take start and stop \"t\" values (values between 0...1), and modify this path such that\n * it is a subset of the original path.\n * The trim values apply to the entire path, so if it contains several contours, all of them\n * are including in the calculation.\n * Null is returned if either input value is NaN.\n * @param startT - a value in the range [0.0, 1.0]. 0.0 is the beginning of the path.\n * @param stopT - a value in the range [0.0, 1.0]. 1.0 is the end of the path.\n * @param isComplement\n */\n trim(startT: number, stopT: number, isComplement: boolean): null | SkPath;\n\n /**\n * Transforms the path by the specified matrix.\n */\n transform(m3: InputMatrix): SkPath;\n\n /**\n * Interpolates between Path with point array of equal size.\n * Copy verb array and weights to result, and set result path to a weighted\n * average of this path array and ending path.\n\n * weight is most useful when between zero (ending path) and\n one (this path); will work with values outside of this\n range.\n\n * interpolate() returns undefined if path is not\n * the same size as ending path. Call isInterpolatable() to check Path\n * compatibility prior to calling interpolate().\n\n * @param ending path to interpolate with\n * @param weight contribution of this path, and\n * one minus contribution of ending path\n * @param output path to be replaced with the interpolated averages\n * @return Path replaced by interpolated averages or null if \n * not interpolatable\n * */\n interpolate(end: SkPath, weight: number, output?: SkPath): SkPath | null;\n\n /** Returns true if Path contain equal verbs and equal weights.\n * @param compare path to compare\n * @return true if Path can be interpolated equivalent\n *\n * */\n isInterpolatable(compare: SkPath): boolean;\n\n /**\n * Serializes the contents of this path as a series of commands.\n */\n toCmds(): PathCommand[];\n}\n"],"mappings":"AAOA;AACA;AACA;;AAcA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAOpB,WAAYC,MAAM,0BAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAQlB,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAWpB,OAAO,MAAMC,MAAM,GAAIC,GAAiC,IAAoB;EAC1E,SAAS;;EACT,OAAOA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,MAAM;AACpD,CAAC","ignoreList":[]}
|
@@ -1,9 +1,14 @@
|
|
1
1
|
export const isShader = obj => obj !== null && obj.__typename__ === "Shader";
|
2
|
-
const isVector = obj =>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
const isVector = obj => {
|
3
|
+
"worklet";
|
4
|
+
|
5
|
+
// We have an issue to check property existence on JSI backed instances
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
7
|
+
return obj.x !== undefined && obj.y !== undefined;
|
8
|
+
};
|
9
|
+
function processValue(values, value) {
|
10
|
+
"worklet";
|
11
|
+
|
7
12
|
if (typeof value === "number") {
|
8
13
|
values.push(value);
|
9
14
|
} else if (Array.isArray(value)) {
|
@@ -13,8 +18,10 @@ const processValue = (values, value) => {
|
|
13
18
|
} else if (value instanceof Float32Array) {
|
14
19
|
values.push(...value);
|
15
20
|
}
|
16
|
-
}
|
21
|
+
}
|
17
22
|
export const processUniforms = (source, uniforms, builder) => {
|
23
|
+
"worklet";
|
24
|
+
|
18
25
|
const result = [];
|
19
26
|
const uniformsCount = source.getUniformCount();
|
20
27
|
for (let i = 0; i < uniformsCount; i++) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isShader","obj","__typename__","isVector","x","undefined","y","processValue","values","value","push","Array","isArray","forEach","v","Float32Array","processUniforms","source","uniforms","builder","result","uniformsCount","getUniformCount","i","name","getUniformName","Error","uniformValue","setUniform"],"sources":["Shader.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { Vector } from \"../Point\";\nimport type { SkRuntimeEffect, SkRuntimeShaderBuilder } from \"../RuntimeEffect\";\n\nexport const isShader = (obj: SkJSIInstance<string> | null): obj is SkShader =>\n obj !== null && obj.__typename__ === \"Shader\";\n\nexport type SkShader = SkJSIInstance<\"Shader\">;\n\nexport type Uniform =\n | number\n | Vector\n | Float32Array\n | readonly Uniform[]\n | Uniform[];\n\nexport interface Uniforms {\n [name: string]: Uniform;\n}\n\nconst isVector = (obj: unknown): obj is Vector
|
1
|
+
{"version":3,"names":["isShader","obj","__typename__","isVector","x","undefined","y","processValue","values","value","push","Array","isArray","forEach","v","Float32Array","processUniforms","source","uniforms","builder","result","uniformsCount","getUniformCount","i","name","getUniformName","Error","uniformValue","setUniform"],"sources":["Shader.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { Vector } from \"../Point\";\nimport type { SkRuntimeEffect, SkRuntimeShaderBuilder } from \"../RuntimeEffect\";\n\nexport const isShader = (obj: SkJSIInstance<string> | null): obj is SkShader =>\n obj !== null && obj.__typename__ === \"Shader\";\n\nexport type SkShader = SkJSIInstance<\"Shader\">;\n\nexport type Uniform =\n | number\n | Vector\n | Float32Array\n | readonly Uniform[]\n | Uniform[];\n\nexport interface Uniforms {\n [name: string]: Uniform;\n}\n\nconst isVector = (obj: unknown): obj is Vector => {\n \"worklet\";\n // We have an issue to check property existence on JSI backed instances\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (obj as any).x !== undefined && (obj as any).y !== undefined;\n};\n\nfunction processValue(values: number[], value: Uniform) {\n \"worklet\";\n if (typeof value === \"number\") {\n values.push(value);\n } else if (Array.isArray(value)) {\n value.forEach((v) => processValue(values, v));\n } else if (isVector(value)) {\n values.push(value.x, value.y);\n } else if (value instanceof Float32Array) {\n values.push(...value);\n }\n}\n\nexport const processUniforms = (\n source: SkRuntimeEffect,\n uniforms: Uniforms,\n builder?: SkRuntimeShaderBuilder\n) => {\n \"worklet\";\n const result: number[] = [];\n const uniformsCount = source.getUniformCount();\n for (let i = 0; i < uniformsCount; i++) {\n const name = source.getUniformName(i);\n const value = uniforms[name];\n if (value === undefined) {\n throw new Error(\n // eslint-disable-next-line max-len\n `The runtime effect has the uniform value \"${name}\" declared, but it is missing from the uniforms property of the Runtime effect.`\n );\n }\n if (builder === undefined) {\n processValue(result, value);\n } else {\n const uniformValue: number[] = [];\n processValue(uniformValue, value);\n builder.setUniform(name, uniformValue);\n result.push(...uniformValue);\n }\n }\n return result;\n};\n"],"mappings":"AAIA,OAAO,MAAMA,QAAQ,GAAIC,GAAiC,IACxDA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,QAAQ;AAe/C,MAAMC,QAAQ,GAAIF,GAAY,IAAoB;EAChD,SAAS;;EACT;EACA;EACA,OAAQA,GAAG,CAASG,CAAC,KAAKC,SAAS,IAAKJ,GAAG,CAASK,CAAC,KAAKD,SAAS;AACrE,CAAC;AAED,SAASE,YAAYA,CAACC,MAAgB,EAAEC,KAAc,EAAE;EACtD,SAAS;;EACT,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7BD,MAAM,CAACE,IAAI,CAACD,KAAK,CAAC;EACpB,CAAC,MAAM,IAAIE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;IAC/BA,KAAK,CAACI,OAAO,CAAEC,CAAC,IAAKP,YAAY,CAACC,MAAM,EAAEM,CAAC,CAAC,CAAC;EAC/C,CAAC,MAAM,IAAIX,QAAQ,CAACM,KAAK,CAAC,EAAE;IAC1BD,MAAM,CAACE,IAAI,CAACD,KAAK,CAACL,CAAC,EAAEK,KAAK,CAACH,CAAC,CAAC;EAC/B,CAAC,MAAM,IAAIG,KAAK,YAAYM,YAAY,EAAE;IACxCP,MAAM,CAACE,IAAI,CAAC,GAAGD,KAAK,CAAC;EACvB;AACF;AAEA,OAAO,MAAMO,eAAe,GAAGA,CAC7BC,MAAuB,EACvBC,QAAkB,EAClBC,OAAgC,KAC7B;EACH,SAAS;;EACT,MAAMC,MAAgB,GAAG,EAAE;EAC3B,MAAMC,aAAa,GAAGJ,MAAM,CAACK,eAAe,CAAC,CAAC;EAC9C,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,aAAa,EAAEE,CAAC,EAAE,EAAE;IACtC,MAAMC,IAAI,GAAGP,MAAM,CAACQ,cAAc,CAACF,CAAC,CAAC;IACrC,MAAMd,KAAK,GAAGS,QAAQ,CAACM,IAAI,CAAC;IAC5B,IAAIf,KAAK,KAAKJ,SAAS,EAAE;MACvB,MAAM,IAAIqB,KAAK;MACb;MACA,6CAA6CF,IAAI,iFACnD,CAAC;IACH;IACA,IAAIL,OAAO,KAAKd,SAAS,EAAE;MACzBE,YAAY,CAACa,MAAM,EAAEX,KAAK,CAAC;IAC7B,CAAC,MAAM;MACL,MAAMkB,YAAsB,GAAG,EAAE;MACjCpB,YAAY,CAACoB,YAAY,EAAElB,KAAK,CAAC;MACjCU,OAAO,CAACS,UAAU,CAACJ,IAAI,EAAEG,YAAY,CAAC;MACtCP,MAAM,CAACV,IAAI,CAAC,GAAGiB,YAAY,CAAC;IAC9B;EACF;EACA,OAAOP,MAAM;AACf,CAAC","ignoreList":[]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { Skia, SkCanvas } from "../skia/types";
|
2
|
+
import type { Node } from "./nodes";
|
3
|
+
export declare class Container {
|
4
|
+
Skia: Skia;
|
5
|
+
private nativeId;
|
6
|
+
_root: Node[];
|
7
|
+
unmounted: boolean;
|
8
|
+
private values;
|
9
|
+
private mapperId;
|
10
|
+
constructor(Skia: Skia, nativeId: number);
|
11
|
+
get root(): Node[];
|
12
|
+
set root(root: Node[]);
|
13
|
+
clear(): void;
|
14
|
+
redraw(): void;
|
15
|
+
getNativeId(): number;
|
16
|
+
unregisterValues(values: object): void;
|
17
|
+
registerValues(values: object): void;
|
18
|
+
drawOnCanvas(canvas: SkCanvas): void;
|
19
|
+
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
4
|
+
import Rea from "../external/reanimated/ReanimatedProxy";
|
5
|
+
import { HAS_REANIMATED, HAS_REANIMATED_3 } from "../external/reanimated/renderHelpers";
|
6
|
+
import { createDrawingContext } from "./DrawingContext";
|
7
|
+
import { draw, isSharedValue } from "./nodes";
|
8
|
+
const drawOnscreen = (Skia, nativeId, root) => {
|
9
|
+
"worklet";
|
10
|
+
|
11
|
+
const rec = Skia.PictureRecorder();
|
12
|
+
const canvas = rec.beginRecording();
|
13
|
+
// TODO: This is only support from 3.15 and above (check the exact version)
|
14
|
+
// This could be polyfilled in C++ if needed (or in JS via functions only?)
|
15
|
+
const ctx = createDrawingContext(Skia, canvas);
|
16
|
+
root.forEach(node => {
|
17
|
+
draw(ctx, node);
|
18
|
+
});
|
19
|
+
const picture = rec.finishRecordingAsPicture();
|
20
|
+
SkiaViewApi.setJsiProperty(nativeId, "picture", picture);
|
21
|
+
};
|
22
|
+
export class Container {
|
23
|
+
constructor(Skia, nativeId) {
|
24
|
+
this.Skia = Skia;
|
25
|
+
this.nativeId = nativeId;
|
26
|
+
_defineProperty(this, "_root", []);
|
27
|
+
_defineProperty(this, "unmounted", false);
|
28
|
+
_defineProperty(this, "values", new Set());
|
29
|
+
_defineProperty(this, "mapperId", null);
|
30
|
+
}
|
31
|
+
get root() {
|
32
|
+
return this._root;
|
33
|
+
}
|
34
|
+
set root(root) {
|
35
|
+
const isOnscreen = this.nativeId !== -1;
|
36
|
+
if (HAS_REANIMATED && !HAS_REANIMATED_3) {
|
37
|
+
throw new Error("React Native Skia only supports Reanimated 3 and above");
|
38
|
+
}
|
39
|
+
if (isOnscreen) {
|
40
|
+
if (this.mapperId !== null) {
|
41
|
+
Rea.stopMapper(this.mapperId);
|
42
|
+
}
|
43
|
+
const {
|
44
|
+
nativeId,
|
45
|
+
Skia
|
46
|
+
} = this;
|
47
|
+
this.mapperId = Rea.startMapper(() => {
|
48
|
+
"worklet";
|
49
|
+
|
50
|
+
drawOnscreen(Skia, nativeId, root);
|
51
|
+
}, Array.from(this.values));
|
52
|
+
}
|
53
|
+
this._root = root;
|
54
|
+
}
|
55
|
+
clear() {
|
56
|
+
console.log("clear container");
|
57
|
+
}
|
58
|
+
redraw() {
|
59
|
+
const isOnscreen = this.nativeId !== -1;
|
60
|
+
if (HAS_REANIMATED && !HAS_REANIMATED_3) {
|
61
|
+
throw new Error("React Native Skia only supports Reanimated 3 and above");
|
62
|
+
}
|
63
|
+
if (isOnscreen) {
|
64
|
+
const {
|
65
|
+
nativeId,
|
66
|
+
Skia,
|
67
|
+
root
|
68
|
+
} = this;
|
69
|
+
Rea.runOnUI(() => {
|
70
|
+
drawOnscreen(Skia, nativeId, root);
|
71
|
+
})();
|
72
|
+
}
|
73
|
+
}
|
74
|
+
getNativeId() {
|
75
|
+
return this.nativeId;
|
76
|
+
}
|
77
|
+
unregisterValues(values) {
|
78
|
+
Object.values(values).filter(isSharedValue).forEach(value => {
|
79
|
+
this.values.delete(value);
|
80
|
+
});
|
81
|
+
}
|
82
|
+
registerValues(values) {
|
83
|
+
Object.values(values).filter(isSharedValue).forEach(value => {
|
84
|
+
this.values.add(value);
|
85
|
+
});
|
86
|
+
}
|
87
|
+
drawOnCanvas(canvas) {
|
88
|
+
const ctx = createDrawingContext(this.Skia, canvas);
|
89
|
+
this.root.forEach(node => {
|
90
|
+
draw(ctx, node);
|
91
|
+
});
|
92
|
+
}
|
93
|
+
}
|
94
|
+
//# sourceMappingURL=Container.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["Rea","HAS_REANIMATED","HAS_REANIMATED_3","createDrawingContext","draw","isSharedValue","drawOnscreen","Skia","nativeId","root","rec","PictureRecorder","canvas","beginRecording","ctx","forEach","node","picture","finishRecordingAsPicture","SkiaViewApi","setJsiProperty","Container","constructor","_defineProperty","Set","_root","isOnscreen","Error","mapperId","stopMapper","startMapper","Array","from","values","clear","console","log","redraw","runOnUI","getNativeId","unregisterValues","Object","filter","value","delete","registerValues","add","drawOnCanvas"],"sources":["Container.ts"],"sourcesContent":["import { type SharedValue } from \"react-native-reanimated\";\n\nimport Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia, SkCanvas } from \"../skia/types\";\nimport {\n HAS_REANIMATED,\n HAS_REANIMATED_3,\n} from \"../external/reanimated/renderHelpers\";\n\nimport { createDrawingContext } from \"./DrawingContext\";\nimport type { Node } from \"./nodes\";\nimport { draw, isSharedValue } from \"./nodes\";\n\nconst drawOnscreen = (Skia: Skia, nativeId: number, root: Node[]) => {\n \"worklet\";\n const rec = Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n // TODO: This is only support from 3.15 and above (check the exact version)\n // This could be polyfilled in C++ if needed (or in JS via functions only?)\n const ctx = createDrawingContext(Skia, canvas);\n root.forEach((node) => {\n draw(ctx, node);\n });\n const picture = rec.finishRecordingAsPicture();\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nexport class Container {\n public _root: Node[] = [];\n public unmounted = false;\n\n private values = new Set<SharedValue<unknown>>();\n private mapperId: number | null = null;\n\n constructor(public Skia: Skia, private nativeId: number) {}\n\n get root() {\n return this._root;\n }\n\n set root(root: Node[]) {\n const isOnscreen = this.nativeId !== -1;\n if (HAS_REANIMATED && !HAS_REANIMATED_3) {\n throw new Error(\"React Native Skia only supports Reanimated 3 and above\");\n }\n if (isOnscreen) {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n const { nativeId, Skia } = this;\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, root);\n }, Array.from(this.values));\n }\n this._root = root;\n }\n\n clear() {\n console.log(\"clear container\");\n }\n\n redraw() {\n const isOnscreen = this.nativeId !== -1;\n if (HAS_REANIMATED && !HAS_REANIMATED_3) {\n throw new Error(\"React Native Skia only supports Reanimated 3 and above\");\n }\n if (isOnscreen) {\n const { nativeId, Skia, root } = this;\n Rea.runOnUI(() => {\n drawOnscreen(Skia, nativeId, root);\n })();\n }\n }\n\n getNativeId() {\n return this.nativeId;\n }\n\n unregisterValues(values: object) {\n Object.values(values)\n .filter(isSharedValue)\n .forEach((value) => {\n this.values.delete(value);\n });\n }\n\n registerValues(values: object) {\n Object.values(values)\n .filter(isSharedValue)\n .forEach((value) => {\n this.values.add(value);\n });\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n const ctx = createDrawingContext(this.Skia, canvas);\n this.root.forEach((node) => {\n draw(ctx, node);\n });\n }\n}\n"],"mappings":";;;AAEA,OAAOA,GAAG,MAAM,wCAAwC;AAExD,SACEC,cAAc,EACdC,gBAAgB,QACX,sCAAsC;AAE7C,SAASC,oBAAoB,QAAQ,kBAAkB;AAEvD,SAASC,IAAI,EAAEC,aAAa,QAAQ,SAAS;AAE7C,MAAMC,YAAY,GAAGA,CAACC,IAAU,EAAEC,QAAgB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ACH,KAAK,CAAC;IACxB,CAAC,CAAC;EACN;EAEAI,YAAYA,CAACnC,MAAgB,EAAE;IAC7B,MAAME,GAAG,GAAGX,oBAAoB,CAAC,IAAI,CAACI,IAAI,EAAEK,MAAM,CAAC;IACnD,IAAI,CAACH,IAAI,CAACM,OAAO,CAAEC,IAAI,IAAK;MAC1BZ,IAAI,CAACU,GAAG,EAAEE,IAAI,CAAC;IACjB,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import type { SkShader, SkPaint, SkImageFilter, SkMaskFilter, SkPathEffect, Skia, SkColorFilter } from "../skia/types";
|
2
|
+
type Composer<T> = (outer: T, inner: T) => T;
|
3
|
+
export declare const composeDeclarations: <T>(filters: T[], composer: Composer<T>) => T;
|
4
|
+
export declare const createDeclarationContext: (Skia: Skia) => {
|
5
|
+
Skia: Skia;
|
6
|
+
paints: {
|
7
|
+
save: () => void;
|
8
|
+
restore: () => void;
|
9
|
+
pop: () => SkPaint | undefined;
|
10
|
+
push: (decl: SkPaint) => void;
|
11
|
+
popAll: () => SkPaint[];
|
12
|
+
popAllAsOne: () => SkPaint | undefined;
|
13
|
+
};
|
14
|
+
maskFilters: {
|
15
|
+
save: () => void;
|
16
|
+
restore: () => void;
|
17
|
+
pop: () => SkMaskFilter | undefined;
|
18
|
+
push: (decl: SkMaskFilter) => void;
|
19
|
+
popAll: () => SkMaskFilter[];
|
20
|
+
popAllAsOne: () => SkMaskFilter | undefined;
|
21
|
+
};
|
22
|
+
shaders: {
|
23
|
+
save: () => void;
|
24
|
+
restore: () => void;
|
25
|
+
pop: () => SkShader | undefined;
|
26
|
+
push: (decl: SkShader) => void;
|
27
|
+
popAll: () => SkShader[];
|
28
|
+
popAllAsOne: () => SkShader | undefined;
|
29
|
+
};
|
30
|
+
pathEffects: {
|
31
|
+
save: () => void;
|
32
|
+
restore: () => void;
|
33
|
+
pop: () => SkPathEffect | undefined;
|
34
|
+
push: (decl: SkPathEffect) => void;
|
35
|
+
popAll: () => SkPathEffect[];
|
36
|
+
popAllAsOne: () => SkPathEffect | undefined;
|
37
|
+
};
|
38
|
+
imageFilters: {
|
39
|
+
save: () => void;
|
40
|
+
restore: () => void;
|
41
|
+
pop: () => SkImageFilter | undefined;
|
42
|
+
push: (decl: SkImageFilter) => void;
|
43
|
+
popAll: () => SkImageFilter[];
|
44
|
+
popAllAsOne: () => SkImageFilter | undefined;
|
45
|
+
};
|
46
|
+
colorFilters: {
|
47
|
+
save: () => void;
|
48
|
+
restore: () => void;
|
49
|
+
pop: () => SkColorFilter | undefined;
|
50
|
+
push: (decl: SkColorFilter) => void;
|
51
|
+
popAll: () => SkColorFilter[];
|
52
|
+
popAllAsOne: () => SkColorFilter | undefined;
|
53
|
+
};
|
54
|
+
};
|
55
|
+
export type DeclarationContext = ReturnType<typeof createDeclarationContext>;
|
56
|
+
export {};
|
@@ -0,0 +1,69 @@
|
|
1
|
+
export const composeDeclarations = (filters, composer) => {
|
2
|
+
"worklet";
|
3
|
+
|
4
|
+
const len = filters.length;
|
5
|
+
if (len <= 1) {
|
6
|
+
return filters[0];
|
7
|
+
}
|
8
|
+
return filters.reduceRight((inner, outer) => inner ? composer(outer, inner) : outer);
|
9
|
+
};
|
10
|
+
const createDeclaration = composer => {
|
11
|
+
"worklet";
|
12
|
+
|
13
|
+
const state = {
|
14
|
+
decls: [],
|
15
|
+
indexes: [0]
|
16
|
+
};
|
17
|
+
return {
|
18
|
+
save: () => {
|
19
|
+
state.indexes.push(state.decls.length);
|
20
|
+
},
|
21
|
+
restore: () => {
|
22
|
+
state.indexes.pop();
|
23
|
+
},
|
24
|
+
pop: () => state.decls.pop(),
|
25
|
+
push: decl => {
|
26
|
+
state.decls.push(decl);
|
27
|
+
},
|
28
|
+
popAll: () => {
|
29
|
+
const idx = state.indexes[state.indexes.length - 1];
|
30
|
+
return state.decls.splice(idx, state.decls.length - idx);
|
31
|
+
},
|
32
|
+
popAllAsOne: () => {
|
33
|
+
if (state.decls.length === 0) {
|
34
|
+
return undefined;
|
35
|
+
}
|
36
|
+
if (!composer) {
|
37
|
+
throw new Error("No composer for this type of declaration");
|
38
|
+
}
|
39
|
+
if (!state.decls.length) {
|
40
|
+
return undefined;
|
41
|
+
}
|
42
|
+
if (!composer) {
|
43
|
+
throw new Error("No composer for this type of declaration");
|
44
|
+
}
|
45
|
+
const idx = state.indexes[state.indexes.length - 1];
|
46
|
+
const decls = state.decls.splice(idx, state.decls.length - idx);
|
47
|
+
return composeDeclarations(decls, composer);
|
48
|
+
}
|
49
|
+
};
|
50
|
+
};
|
51
|
+
export const createDeclarationContext = Skia => {
|
52
|
+
"worklet";
|
53
|
+
|
54
|
+
const composers = {
|
55
|
+
pathEffect: Skia.PathEffect.MakeCompose.bind(Skia.PathEffect),
|
56
|
+
imageFilter: Skia.ImageFilter.MakeCompose.bind(Skia.ImageFilter),
|
57
|
+
colorFilter: Skia.ColorFilter.MakeCompose.bind(Skia.ColorFilter)
|
58
|
+
};
|
59
|
+
return {
|
60
|
+
Skia,
|
61
|
+
paints: createDeclaration(),
|
62
|
+
maskFilters: createDeclaration(),
|
63
|
+
shaders: createDeclaration(),
|
64
|
+
pathEffects: createDeclaration(composers.pathEffect),
|
65
|
+
imageFilters: createDeclaration(composers.imageFilter),
|
66
|
+
colorFilters: createDeclaration(composers.colorFilter)
|
67
|
+
};
|
68
|
+
};
|
69
|
+
//# sourceMappingURL=DeclarationContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["composeDeclarations","filters","composer","len","length","reduceRight","inner","outer","createDeclaration","state","decls","indexes","save","push","restore","pop","decl","popAll","idx","splice","popAllAsOne","undefined","Error","createDeclarationContext","Skia","composers","pathEffect","PathEffect","MakeCompose","bind","imageFilter","ImageFilter","colorFilter","ColorFilter","paints","maskFilters","shaders","pathEffects","imageFilters","colorFilters"],"sources":["DeclarationContext.ts"],"sourcesContent":["import type {\n SkShader,\n SkPaint,\n SkImageFilter,\n SkMaskFilter,\n SkPathEffect,\n Skia,\n SkColorFilter,\n} from \"../skia/types\";\n\ntype Composer<T> = (outer: T, inner: T) => T;\n\nexport const composeDeclarations = <T>(filters: T[], composer: Composer<T>) => {\n \"worklet\";\n const len = filters.length;\n if (len <= 1) {\n return filters[0];\n }\n return filters.reduceRight((inner, outer) =>\n inner ? composer(outer, inner) : outer\n );\n};\n\nconst createDeclaration = <T>(composer?: Composer<T>) => {\n \"worklet\";\n const state = {\n decls: [] as T[],\n indexes: [0],\n };\n\n return {\n save: () => {\n state.indexes.push(state.decls.length);\n },\n restore: () => {\n state.indexes.pop();\n },\n pop: () => state.decls.pop(),\n push: (decl: T) => {\n state.decls.push(decl);\n },\n popAll: () => {\n const idx = state.indexes[state.indexes.length - 1];\n return state.decls.splice(idx, state.decls.length - idx);\n },\n popAllAsOne: () => {\n if (state.decls.length === 0) {\n return undefined;\n }\n if (!composer) {\n throw new Error(\"No composer for this type of declaration\");\n }\n if (!state.decls.length) {\n return undefined;\n }\n if (!composer) {\n throw new Error(\"No composer for this type of declaration\");\n }\n\n const idx = state.indexes[state.indexes.length - 1];\n const decls = state.decls.splice(idx, state.decls.length - idx);\n return composeDeclarations(decls, composer);\n },\n };\n};\n\nexport const createDeclarationContext = (Skia: Skia) => {\n \"worklet\";\n const composers = {\n pathEffect: Skia.PathEffect.MakeCompose.bind(Skia.PathEffect),\n imageFilter: Skia.ImageFilter.MakeCompose.bind(Skia.ImageFilter),\n colorFilter: Skia.ColorFilter.MakeCompose.bind(Skia.ColorFilter),\n };\n return {\n Skia,\n paints: createDeclaration<SkPaint>(),\n maskFilters: createDeclaration<SkMaskFilter>(),\n shaders: createDeclaration<SkShader>(),\n pathEffects: createDeclaration<SkPathEffect>(composers.pathEffect),\n imageFilters: createDeclaration<SkImageFilter>(composers.imageFilter),\n colorFilters: createDeclaration<SkColorFilter>(composers.colorFilter),\n };\n};\n\nexport type DeclarationContext = ReturnType<typeof createDeclarationContext>;\n"],"mappings":"AAYA,OAAO,MAAMA,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,YAAY,EAAE/B,iBAAiB,CAAgBiB,SAAS,CAACO,WAAW;EACtE,CAAC;AACH,CAAC","ignoreList":[]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { DrawingNodeProps, GroupProps } from "../dom/types";
|
2
|
+
import type { SkCanvas, Skia, SkPaint } from "../skia/types";
|
3
|
+
import type { DeclarationContext } from "./DeclarationContext";
|
4
|
+
export declare const createDrawingContext: (Skia: Skia, canvas: SkCanvas) => {
|
5
|
+
Skia: Skia;
|
6
|
+
canvas: SkCanvas;
|
7
|
+
save: () => number;
|
8
|
+
restore: () => SkPaint | undefined;
|
9
|
+
getPaint: () => SkPaint;
|
10
|
+
processPaint: ({ opacity, color, strokeWidth, blendMode, style, strokeJoin, strokeCap, strokeMiter, antiAlias, dither, paint: paintProp, }: DrawingNodeProps, declCtx: DeclarationContext) => boolean;
|
11
|
+
processMatrixAndClipping: (props: GroupProps, layer?: boolean | SkPaint) => boolean;
|
12
|
+
};
|
13
|
+
export type DrawingContext = ReturnType<typeof createDrawingContext>;
|
@@ -0,0 +1,165 @@
|
|
1
|
+
import { enumKey, isPathDef, processPath, processTransformProps2 } from "../dom/nodes";
|
2
|
+
import { BlendMode, ClipOp, isRRect, PaintStyle, StrokeCap, StrokeJoin } from "../skia/types";
|
3
|
+
const computeClip = (Skia, clip) => {
|
4
|
+
"worklet";
|
5
|
+
|
6
|
+
if (clip) {
|
7
|
+
if (isPathDef(clip)) {
|
8
|
+
return {
|
9
|
+
clipPath: processPath(Skia, clip)
|
10
|
+
};
|
11
|
+
} else if (isRRect(clip)) {
|
12
|
+
return {
|
13
|
+
clipRRect: clip
|
14
|
+
};
|
15
|
+
} else {
|
16
|
+
return {
|
17
|
+
clipRect: clip
|
18
|
+
};
|
19
|
+
}
|
20
|
+
}
|
21
|
+
return undefined;
|
22
|
+
};
|
23
|
+
const processColor = (Skia, color) => {
|
24
|
+
"worklet";
|
25
|
+
|
26
|
+
if (typeof color === "string" || typeof color === "number") {
|
27
|
+
return Skia.Color(color);
|
28
|
+
} else if (Array.isArray(color) || color instanceof Float32Array) {
|
29
|
+
return color instanceof Float32Array ? color : new Float32Array(color);
|
30
|
+
} else {
|
31
|
+
throw new Error(`Invalid color type: ${typeof color}. Expected number, string, or array.`);
|
32
|
+
}
|
33
|
+
};
|
34
|
+
export const createDrawingContext = (Skia, canvas) => {
|
35
|
+
"worklet";
|
36
|
+
|
37
|
+
const state = {
|
38
|
+
paints: [Skia.Paint()]
|
39
|
+
};
|
40
|
+
const getPaint = () => {
|
41
|
+
return state.paints[state.paints.length - 1];
|
42
|
+
};
|
43
|
+
const processPaint = ({
|
44
|
+
opacity,
|
45
|
+
color,
|
46
|
+
strokeWidth,
|
47
|
+
blendMode,
|
48
|
+
style,
|
49
|
+
strokeJoin,
|
50
|
+
strokeCap,
|
51
|
+
strokeMiter,
|
52
|
+
antiAlias,
|
53
|
+
dither,
|
54
|
+
paint: paintProp
|
55
|
+
}, declCtx) => {
|
56
|
+
if (paintProp) {
|
57
|
+
declCtx.paints.push(paintProp);
|
58
|
+
return true;
|
59
|
+
}
|
60
|
+
let shouldRestore = false;
|
61
|
+
const colorFilter = declCtx.colorFilters.popAllAsOne();
|
62
|
+
const imageFilter = declCtx.imageFilters.popAllAsOne();
|
63
|
+
const shader = declCtx.shaders.pop();
|
64
|
+
const maskFilter = declCtx.maskFilters.pop();
|
65
|
+
const pathEffect = declCtx.pathEffects.popAllAsOne();
|
66
|
+
if (opacity !== undefined || color !== undefined || strokeWidth !== undefined || blendMode !== undefined || style !== undefined || strokeJoin !== undefined || strokeCap !== undefined || strokeMiter !== undefined || antiAlias !== undefined || dither !== undefined || colorFilter !== undefined || imageFilter !== undefined || shader !== undefined || maskFilter !== undefined || pathEffect !== undefined) {
|
67
|
+
if (!shouldRestore) {
|
68
|
+
state.paints.push(getPaint().copy());
|
69
|
+
shouldRestore = true;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
const paint = getPaint();
|
73
|
+
if (opacity !== undefined) {
|
74
|
+
paint.setAlphaf(paint.getAlphaf() * opacity);
|
75
|
+
}
|
76
|
+
if (color !== undefined) {
|
77
|
+
const currentOpacity = paint.getAlphaf();
|
78
|
+
paint.setShader(null);
|
79
|
+
paint.setColor(processColor(Skia, color));
|
80
|
+
paint.setAlphaf(currentOpacity * paint.getAlphaf());
|
81
|
+
}
|
82
|
+
if (strokeWidth !== undefined) {
|
83
|
+
paint.setStrokeWidth(strokeWidth);
|
84
|
+
}
|
85
|
+
if (blendMode !== undefined) {
|
86
|
+
paint.setBlendMode(BlendMode[enumKey(blendMode)]);
|
87
|
+
}
|
88
|
+
if (style !== undefined) {
|
89
|
+
paint.setStyle(PaintStyle[enumKey(style)]);
|
90
|
+
}
|
91
|
+
if (strokeJoin !== undefined) {
|
92
|
+
paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);
|
93
|
+
}
|
94
|
+
if (strokeCap !== undefined) {
|
95
|
+
paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);
|
96
|
+
}
|
97
|
+
if (strokeMiter !== undefined) {
|
98
|
+
paint.setStrokeMiter(strokeMiter);
|
99
|
+
}
|
100
|
+
if (antiAlias !== undefined) {
|
101
|
+
paint.setAntiAlias(antiAlias);
|
102
|
+
}
|
103
|
+
if (dither !== undefined) {
|
104
|
+
paint.setDither(dither);
|
105
|
+
}
|
106
|
+
if (colorFilter) {
|
107
|
+
paint.setColorFilter(colorFilter);
|
108
|
+
}
|
109
|
+
if (imageFilter) {
|
110
|
+
paint.setImageFilter(imageFilter);
|
111
|
+
}
|
112
|
+
if (shader) {
|
113
|
+
paint.setShader(shader);
|
114
|
+
}
|
115
|
+
if (maskFilter) {
|
116
|
+
paint.setMaskFilter(maskFilter);
|
117
|
+
}
|
118
|
+
if (pathEffect) {
|
119
|
+
paint.setPathEffect(pathEffect);
|
120
|
+
}
|
121
|
+
return shouldRestore;
|
122
|
+
};
|
123
|
+
const processMatrixAndClipping = (props, layer) => {
|
124
|
+
const hasTransform = props.matrix !== undefined || props.transform !== undefined;
|
125
|
+
const clip = computeClip(Skia, props.clip);
|
126
|
+
const hasClip = clip !== undefined;
|
127
|
+
const op = props.invertClip ? ClipOp.Difference : ClipOp.Intersect;
|
128
|
+
const m3 = processTransformProps2(Skia, props);
|
129
|
+
const shouldSave = hasTransform || hasClip || !!layer;
|
130
|
+
if (shouldSave) {
|
131
|
+
if (layer) {
|
132
|
+
if (typeof layer === "boolean") {
|
133
|
+
canvas.saveLayer();
|
134
|
+
} else {
|
135
|
+
canvas.saveLayer(layer);
|
136
|
+
}
|
137
|
+
} else {
|
138
|
+
canvas.save();
|
139
|
+
}
|
140
|
+
}
|
141
|
+
if (m3) {
|
142
|
+
canvas.concat(m3);
|
143
|
+
}
|
144
|
+
if (clip) {
|
145
|
+
if ("clipRect" in clip) {
|
146
|
+
canvas.clipRect(clip.clipRect, op, true);
|
147
|
+
} else if ("clipRRect" in clip) {
|
148
|
+
canvas.clipRRect(clip.clipRRect, op, true);
|
149
|
+
} else {
|
150
|
+
canvas.clipPath(clip.clipPath, op, true);
|
151
|
+
}
|
152
|
+
}
|
153
|
+
return shouldSave;
|
154
|
+
};
|
155
|
+
return {
|
156
|
+
Skia,
|
157
|
+
canvas,
|
158
|
+
save: () => state.paints.push(getPaint().copy()),
|
159
|
+
restore: () => state.paints.pop(),
|
160
|
+
getPaint,
|
161
|
+
processPaint,
|
162
|
+
processMatrixAndClipping
|
163
|
+
};
|
164
|
+
};
|
165
|
+
//# sourceMappingURL=DrawingContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["enumKey","isPathDef","processPath","processTransformProps2","BlendMode","ClipOp","isRRect","PaintStyle","StrokeCap","StrokeJoin","computeClip","Skia","clip","clipPath","clipRRect","clipRect","undefined","processColor","color","Color","Array","isArray","Float32Array","Error","createDrawingContext","canvas","state","paints","Paint","getPaint","length","processPaint","opacity","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paint","paintProp","declCtx","push","shouldRestore","colorFilter","colorFilters","popAllAsOne","imageFilter","imageFilters","shader","shaders","pop","maskFilter","maskFilters","pathEffect","pathEffects","copy","setAlphaf","getAlphaf","currentOpacity","setShader","setColor","setStrokeWidth","setBlendMode","setStyle","setStrokeJoin","setStrokeCap","setStrokeMiter","setAntiAlias","setDither","setColorFilter","setImageFilter","setMaskFilter","setPathEffect","processMatrixAndClipping","props","layer","hasTransform","matrix","transform","hasClip","op","invertClip","Difference","Intersect","m3","shouldSave","saveLayer","save","concat","restore"],"sources":["DrawingContext.ts"],"sourcesContent":["import {\n enumKey,\n isPathDef,\n processPath,\n processTransformProps2,\n} from \"../dom/nodes\";\nimport type { ClipDef, DrawingNodeProps, GroupProps } from \"../dom/types\";\nimport {\n BlendMode,\n ClipOp,\n isRRect,\n PaintStyle,\n StrokeCap,\n StrokeJoin,\n} from \"../skia/types\";\nimport type {\n SkPath,\n SkRect,\n SkRRect,\n SkCanvas,\n Skia,\n SkPaint,\n} from \"../skia/types\";\n\nimport type { DeclarationContext } from \"./DeclarationContext\";\n\nconst computeClip = (\n Skia: Skia,\n clip: ClipDef | undefined\n):\n | undefined\n | { clipPath: SkPath }\n | { clipRect: SkRect }\n | { clipRRect: SkRRect } => {\n \"worklet\";\n if (clip) {\n if (isPathDef(clip)) {\n return { clipPath: processPath(Skia, clip) };\n } else if (isRRect(clip)) {\n return { clipRRect: clip };\n } else {\n return { clipRect: clip };\n }\n }\n return undefined;\n};\n\nconst processColor = (\n Skia: Skia,\n color: number | string | Float32Array | number[]\n) => {\n \"worklet\";\n if (typeof color === \"string\" || typeof color === \"number\") {\n return Skia.Color(color);\n } else if (Array.isArray(color) || color instanceof Float32Array) {\n return color instanceof Float32Array ? color : new Float32Array(color);\n } else {\n throw new Error(\n `Invalid color type: ${typeof color}. Expected number, string, or array.`\n );\n }\n};\n\nexport const createDrawingContext = (Skia: Skia, canvas: SkCanvas) => {\n \"worklet\";\n const state = {\n paints: [Skia.Paint()],\n };\n\n const getPaint = () => {\n return state.paints[state.paints.length - 1];\n };\n\n const processPaint = (\n {\n opacity,\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n paint: paintProp,\n }: DrawingNodeProps,\n declCtx: DeclarationContext\n ) => {\n if (paintProp) {\n declCtx.paints.push(paintProp);\n return true;\n }\n let shouldRestore = false;\n const colorFilter = declCtx.colorFilters.popAllAsOne();\n const imageFilter = declCtx.imageFilters.popAllAsOne();\n const shader = declCtx.shaders.pop();\n const maskFilter = declCtx.maskFilters.pop();\n const pathEffect = declCtx.pathEffects.popAllAsOne();\n\n if (\n opacity !== undefined ||\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n antiAlias !== undefined ||\n dither !== undefined ||\n colorFilter !== undefined ||\n imageFilter !== undefined ||\n shader !== undefined ||\n maskFilter !== undefined ||\n pathEffect !== undefined\n ) {\n if (!shouldRestore) {\n state.paints.push(getPaint().copy());\n shouldRestore = true;\n }\n }\n\n const paint = getPaint();\n if (opacity !== undefined) {\n paint.setAlphaf(paint.getAlphaf() * opacity);\n }\n if (color !== undefined) {\n const currentOpacity = paint.getAlphaf();\n paint.setShader(null);\n paint.setColor(processColor(Skia, color));\n paint.setAlphaf(currentOpacity * paint.getAlphaf());\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (dither !== undefined) {\n paint.setDither(dither);\n }\n if (colorFilter) {\n paint.setColorFilter(colorFilter);\n }\n if (imageFilter) {\n paint.setImageFilter(imageFilter);\n }\n if (shader) {\n paint.setShader(shader);\n }\n if (maskFilter) {\n paint.setMaskFilter(maskFilter);\n }\n if (pathEffect) {\n paint.setPathEffect(pathEffect);\n }\n return shouldRestore;\n };\n\n const processMatrixAndClipping = (\n props: GroupProps,\n layer?: boolean | SkPaint\n ) => {\n const hasTransform =\n props.matrix !== undefined || props.transform !== undefined;\n const clip = computeClip(Skia, props.clip);\n const hasClip = clip !== undefined;\n const op = props.invertClip ? ClipOp.Difference : ClipOp.Intersect;\n const m3 = processTransformProps2(Skia, props);\n const shouldSave = hasTransform || hasClip || !!layer;\n\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n canvas.saveLayer();\n } else {\n canvas.saveLayer(layer);\n }\n } else {\n canvas.save();\n }\n }\n\n if (m3) {\n canvas.concat(m3);\n }\n if (clip) {\n if (\"clipRect\" in clip) {\n canvas.clipRect(clip.clipRect, op, true);\n } else if (\"clipRRect\" in clip) {\n canvas.clipRRect(clip.clipRRect, op, true);\n } else {\n canvas.clipPath(clip.clipPath, op, true);\n }\n }\n return shouldSave;\n };\n\n return {\n Skia,\n canvas,\n save: () => state.paints.push(getPaint().copy()),\n restore: () => state.paints.pop(),\n getPaint,\n processPaint,\n processMatrixAndClipping,\n };\n};\n\nexport type DrawingContext = ReturnType<typeof createDrawingContext>;\n"],"mappings":"AAAA,SACEA,OAAO,EACPC,SAAS,EACTC,WAAW,EACXC,sBAAsB,QACjB,cAAc;AAErB,SACEC,SAAS,EACTC,MAAM,EACNC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,UAAU,QACL,eAAe;AAYtB,MAAMC,WAAW,GAAGA,CAClBC,IAAU,EACVC,IAAyB,KAKG;EAC5B,SAAS;;EACT,IAAIA,IAAI,EAAE;IACR,IAAIX,SAAS,CAAC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AC,MAAM;QACLrD,MAAM,CAACiE,IAAI,CAAC,CAAC;MACf;IACF;IAEA,IAAIH,EAAE,EAAE;MACN9D,MAAM,CAACkE,MAAM,CAACJ,EAAE,CAAC;IACnB;IACA,IAAI3E,IAAI,EAAE;MACR,IAAI,UAAU,IAAIA,IAAI,EAAE;QACtBa,MAAM,CAACV,QAAQ,CAACH,IAAI,CAACG,QAAQ,EAAEoE,EAAE,EAAE,IAAI,CAAC;MAC1C,CAAC,MAAM,IAAI,WAAW,IAAIvE,IAAI,EAAE;QAC9Ba,MAAM,CAACX,SAAS,CAACF,IAAI,CAACE,SAAS,EAAEqE,EAAE,EAAE,IAAI,CAAC;MAC5C,CAAC,MAAM;QACL1D,MAAM,CAACZ,QAAQ,CAACD,IAAI,CAACC,QAAQ,EAAEsE,EAAE,EAAE,IAAI,CAAC;MAC1C;IACF;IACA,OAAOK,UAAU;EACnB,CAAC;EAED,OAAO;IACL7E,IAAI;IACJc,MAAM;IACNiE,IAAI,EAAEA,CAAA,KAAMhE,KAAK,CAACC,MAAM,CAACiB,IAAI,CAACf,QAAQ,CAAC,CAAC,CAAC6B,IAAI,CAAC,CAAC,CAAC;IAChDkC,OAAO,EAAEA,CAAA,KAAMlE,KAAK,CAACC,MAAM,CAAC0B,GAAG,CAAC,CAAC;IACjCxB,QAAQ;IACRE,YAAY;IACZ6C;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { HostConfig } from "react-reconciler";
|
2
|
+
import { NodeType } from "../dom/types";
|
3
|
+
import type { Node } from "./nodes/Node";
|
4
|
+
import type { Container } from "./Container";
|
5
|
+
export declare const debug: (message?: any, ...optionalParams: any[]) => void;
|
6
|
+
type Instance = Node;
|
7
|
+
type Props = object;
|
8
|
+
type TextInstance = Node;
|
9
|
+
type SuspenseInstance = Instance;
|
10
|
+
type HydratableInstance = Instance;
|
11
|
+
type PublicInstance = Instance;
|
12
|
+
type HostContext = null;
|
13
|
+
type UpdatePayload = Container;
|
14
|
+
type ChildSet = Node[];
|
15
|
+
type TimeoutHandle = NodeJS.Timeout;
|
16
|
+
type NoTimeout = -1;
|
17
|
+
type SkiaHostConfig = HostConfig<NodeType, Props, Container, Instance, TextInstance, SuspenseInstance, HydratableInstance, PublicInstance, HostContext, UpdatePayload, ChildSet, TimeoutHandle, NoTimeout>;
|
18
|
+
export declare const sksgHostConfig: SkiaHostConfig;
|
19
|
+
export {};
|