@shopify/react-native-skia 1.7.6 → 1.7.7
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.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +2 -3
- package/lib/commonjs/dom/nodes/datatypes/Circle.js +11 -6
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Enum.js +1 -0
- package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js +1 -10
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js +3 -2
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js +4 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Radius.js +1 -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 +17 -7
- 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 +32 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.js +4 -5
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js +1 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
- package/lib/commonjs/dom/types/DeclarationContext.d.ts +4 -4
- package/lib/commonjs/dom/types/DeclarationContext.js +8 -2
- package/lib/commonjs/dom/types/DeclarationContext.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/renderer/HostConfig.js +8 -4
- package/lib/commonjs/renderer/HostConfig.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 +8 -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/DrawingContext.d.ts +16 -0
- package/lib/commonjs/sksg/DrawingContext.js +186 -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 +17 -0
- package/lib/commonjs/sksg/Reconciler.js +54 -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/sksg/nodes/Node.js +6 -0
- package/lib/commonjs/sksg/nodes/Node.js.map +1 -0
- package/lib/commonjs/sksg/nodes/colorFilters.d.ts +7 -0
- package/lib/commonjs/sksg/nodes/colorFilters.js +55 -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 +448 -0
- package/lib/commonjs/sksg/nodes/context.js.map +1 -0
- package/lib/commonjs/sksg/nodes/drawings.d.ts +31 -0
- package/lib/commonjs/sksg/nodes/drawings.js +361 -0
- package/lib/commonjs/sksg/nodes/drawings.js.map +1 -0
- package/lib/commonjs/sksg/nodes/imageFilters.d.ts +14 -0
- package/lib/commonjs/sksg/nodes/imageFilters.js +135 -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 +2 -0
- package/lib/commonjs/sksg/nodes/paint.js +80 -0
- package/lib/commonjs/sksg/nodes/paint.js.map +1 -0
- package/lib/commonjs/sksg/nodes/pathEffects.d.ts +8 -0
- package/lib/commonjs/sksg/nodes/pathEffects.js +84 -0
- package/lib/commonjs/sksg/nodes/pathEffects.js.map +1 -0
- package/lib/commonjs/sksg/nodes/shaders.d.ts +10 -0
- package/lib/commonjs/sksg/nodes/shaders.js +156 -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 +25 -0
- package/lib/commonjs/sksg/nodes/utils.js.map +1 -0
- package/lib/commonjs/views/SkiaPictureView.js +0 -2
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -2
- package/lib/commonjs/views/types.js.map +1 -1
- 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 +12 -6
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Enum.js +2 -0
- package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Fitting.js +2 -10
- package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +4 -2
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Path.js +5 -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 +14 -5
- 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 +31 -0
- package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.js +1 -2
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CircleNode.js +1 -1
- package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
- package/lib/module/dom/types/DeclarationContext.d.ts +4 -4
- package/lib/module/dom/types/DeclarationContext.js +9 -2
- package/lib/module/dom/types/DeclarationContext.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/renderer/HostConfig.js +8 -4
- package/lib/module/renderer/HostConfig.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 +9 -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/DrawingContext.d.ts +16 -0
- package/lib/module/sksg/DrawingContext.js +180 -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 +17 -0
- package/lib/module/sksg/Reconciler.js +46 -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 +7 -0
- package/lib/module/sksg/nodes/colorFilters.js +44 -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 +443 -0
- package/lib/module/sksg/nodes/context.js.map +1 -0
- package/lib/module/sksg/nodes/drawings.d.ts +31 -0
- package/lib/module/sksg/nodes/drawings.js +334 -0
- package/lib/module/sksg/nodes/drawings.js.map +1 -0
- package/lib/module/sksg/nodes/imageFilters.d.ts +14 -0
- package/lib/module/sksg/nodes/imageFilters.js +122 -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 +2 -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 +8 -0
- package/lib/module/sksg/nodes/pathEffects.js +72 -0
- package/lib/module/sksg/nodes/pathEffects.js.map +1 -0
- package/lib/module/sksg/nodes/shaders.d.ts +10 -0
- package/lib/module/sksg/nodes/shaders.js +142 -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 +18 -0
- package/lib/module/sksg/nodes/utils.js.map +1 -0
- package/lib/module/views/SkiaPictureView.js +0 -2
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -2
- package/lib/module/views/types.js.map +1 -1
- 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/HostConfig.d.ts +3 -1
- package/lib/typescript/lib/commonjs/sksg/Container.d.ts +16 -0
- package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +26 -0
- package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +50 -0
- package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +16 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/Node.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +7 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/drawings.d.ts +23 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +10 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +8 -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/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/external/reanimated/renderHelpers.d.ts +2 -0
- package/lib/typescript/lib/module/mock/index.d.ts +4 -1
- package/lib/typescript/lib/module/renderer/HostConfig.d.ts +3 -1
- package/lib/typescript/lib/module/sksg/Container.d.ts +15 -0
- package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +26 -0
- package/lib/typescript/lib/module/sksg/HostConfig.d.ts +49 -0
- package/lib/typescript/lib/module/sksg/Reconciler.d.ts +15 -0
- package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +6 -0
- package/lib/typescript/lib/module/sksg/nodes/context.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/nodes/drawings.d.ts +22 -0
- package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +9 -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 +7 -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/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/DeclarationContext.d.ts +4 -4
- package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +2 -0
- 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/DrawingContext.d.ts +16 -0
- package/lib/typescript/src/sksg/HostConfig.d.ts +19 -0
- package/lib/typescript/src/sksg/Reconciler.d.ts +17 -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 +7 -0
- package/lib/typescript/src/sksg/nodes/context.d.ts +3 -0
- package/lib/typescript/src/sksg/nodes/drawings.d.ts +31 -0
- package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +14 -0
- package/lib/typescript/src/sksg/nodes/index.d.ts +3 -0
- package/lib/typescript/src/sksg/nodes/paint.d.ts +2 -0
- package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +8 -0
- package/lib/typescript/src/sksg/nodes/shaders.d.ts +10 -0
- package/lib/typescript/src/sksg/nodes/utils.d.ts +3 -0
- package/lib/typescript/src/views/types.d.ts +2 -2
- 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 +2 -1
- package/src/dom/nodes/datatypes/Circle.ts +7 -5
- package/src/dom/nodes/datatypes/Enum.ts +2 -0
- package/src/dom/nodes/datatypes/Fitting.ts +2 -5
- package/src/dom/nodes/datatypes/Gradient.ts +4 -7
- package/src/dom/nodes/datatypes/Path.ts +5 -2
- package/src/dom/nodes/datatypes/Radius.ts +2 -0
- package/src/dom/nodes/datatypes/Rect.ts +40 -6
- package/src/dom/nodes/datatypes/Transform.ts +29 -1
- package/src/dom/nodes/drawings/Box.ts +1 -29
- package/src/dom/nodes/drawings/CircleNode.ts +1 -1
- package/src/dom/types/DeclarationContext.ts +12 -2
- package/src/external/reanimated/renderHelpers.ts +8 -4
- package/src/renderer/HostConfig.ts +10 -4
- 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 +7 -4
- package/src/sksg/Container.ts +102 -0
- package/src/sksg/DrawingContext.ts +221 -0
- package/src/sksg/HostConfig.ts +287 -0
- package/src/sksg/Reconciler.ts +59 -0
- package/src/sksg/__tests__/Declarations.spec.tsx +235 -0
- package/src/sksg/__tests__/MockDeclaration.ts +140 -0
- package/src/sksg/__tests__/Simple.spec.tsx +148 -0
- package/src/sksg/nodes/Node.ts +8 -0
- package/src/sksg/nodes/colorFilters.ts +60 -0
- package/src/sksg/nodes/context.ts +489 -0
- package/src/sksg/nodes/drawings.ts +393 -0
- package/src/sksg/nodes/imageFilters.ts +183 -0
- package/src/sksg/nodes/index.ts +3 -0
- package/src/sksg/nodes/paint.ts +75 -0
- package/src/sksg/nodes/pathEffects.ts +95 -0
- package/src/sksg/nodes/shaders.ts +203 -0
- package/src/sksg/nodes/utils.ts +23 -0
- package/src/views/SkiaPictureView.tsx +0 -2
- package/src/views/types.ts +2 -2
- package/lib/commonjs/dom/__tests__/Shaders.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/SkiaDOM.spec.d.ts +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/renderer/__tests__/SkiaDOM.spec.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/renderer/__tests__/SkiaDOM.spec.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/renderer/__tests__/SkiaDOM.spec.tsx +0 -46
- /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/{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
@@ -37,6 +37,21 @@
|
|
37
37
|
<key>SupportedPlatformVariant</key>
|
38
38
|
<string>simulator</string>
|
39
39
|
</dict>
|
40
|
+
<dict>
|
41
|
+
<key>BinaryPath</key>
|
42
|
+
<string>libskia.a</string>
|
43
|
+
<key>LibraryIdentifier</key>
|
44
|
+
<string>macos-arm64_x86_64</string>
|
45
|
+
<key>LibraryPath</key>
|
46
|
+
<string>libskia.a</string>
|
47
|
+
<key>SupportedArchitectures</key>
|
48
|
+
<array>
|
49
|
+
<string>arm64</string>
|
50
|
+
<string>x86_64</string>
|
51
|
+
</array>
|
52
|
+
<key>SupportedPlatform</key>
|
53
|
+
<string>macos</string>
|
54
|
+
</dict>
|
40
55
|
</array>
|
41
56
|
<key>CFBundlePackageType</key>
|
42
57
|
<string>XFWK</string>
|
Binary file
|
Binary file
|
Binary file
|
@@ -8,34 +8,49 @@
|
|
8
8
|
<key>BinaryPath</key>
|
9
9
|
<string>libskottie.a</string>
|
10
10
|
<key>LibraryIdentifier</key>
|
11
|
-
<string>ios-
|
11
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
12
12
|
<key>LibraryPath</key>
|
13
13
|
<string>libskottie.a</string>
|
14
14
|
<key>SupportedArchitectures</key>
|
15
15
|
<array>
|
16
16
|
<string>arm64</string>
|
17
17
|
<string>arm64e</string>
|
18
|
+
<string>x86_64</string>
|
18
19
|
</array>
|
19
20
|
<key>SupportedPlatform</key>
|
20
21
|
<string>ios</string>
|
22
|
+
<key>SupportedPlatformVariant</key>
|
23
|
+
<string>simulator</string>
|
21
24
|
</dict>
|
22
25
|
<dict>
|
23
26
|
<key>BinaryPath</key>
|
24
27
|
<string>libskottie.a</string>
|
25
28
|
<key>LibraryIdentifier</key>
|
26
|
-
<string>ios-
|
29
|
+
<string>ios-arm64_arm64e</string>
|
27
30
|
<key>LibraryPath</key>
|
28
31
|
<string>libskottie.a</string>
|
29
32
|
<key>SupportedArchitectures</key>
|
30
33
|
<array>
|
31
34
|
<string>arm64</string>
|
32
35
|
<string>arm64e</string>
|
33
|
-
<string>x86_64</string>
|
34
36
|
</array>
|
35
37
|
<key>SupportedPlatform</key>
|
36
38
|
<string>ios</string>
|
37
|
-
|
38
|
-
|
39
|
+
</dict>
|
40
|
+
<dict>
|
41
|
+
<key>BinaryPath</key>
|
42
|
+
<string>libskottie.a</string>
|
43
|
+
<key>LibraryIdentifier</key>
|
44
|
+
<string>macos-arm64_x86_64</string>
|
45
|
+
<key>LibraryPath</key>
|
46
|
+
<string>libskottie.a</string>
|
47
|
+
<key>SupportedArchitectures</key>
|
48
|
+
<array>
|
49
|
+
<string>arm64</string>
|
50
|
+
<string>x86_64</string>
|
51
|
+
</array>
|
52
|
+
<key>SupportedPlatform</key>
|
53
|
+
<string>macos</string>
|
39
54
|
</dict>
|
40
55
|
</array>
|
41
56
|
<key>CFBundlePackageType</key>
|
Binary file
|
package/libs/{ios → apple}/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a
RENAMED
Binary file
|
@@ -8,34 +8,49 @@
|
|
8
8
|
<key>BinaryPath</key>
|
9
9
|
<string>libskparagraph.a</string>
|
10
10
|
<key>LibraryIdentifier</key>
|
11
|
-
<string>ios-
|
11
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
12
12
|
<key>LibraryPath</key>
|
13
13
|
<string>libskparagraph.a</string>
|
14
14
|
<key>SupportedArchitectures</key>
|
15
15
|
<array>
|
16
16
|
<string>arm64</string>
|
17
17
|
<string>arm64e</string>
|
18
|
+
<string>x86_64</string>
|
18
19
|
</array>
|
19
20
|
<key>SupportedPlatform</key>
|
20
21
|
<string>ios</string>
|
22
|
+
<key>SupportedPlatformVariant</key>
|
23
|
+
<string>simulator</string>
|
21
24
|
</dict>
|
22
25
|
<dict>
|
23
26
|
<key>BinaryPath</key>
|
24
27
|
<string>libskparagraph.a</string>
|
25
28
|
<key>LibraryIdentifier</key>
|
26
|
-
<string>ios-
|
29
|
+
<string>ios-arm64_arm64e</string>
|
27
30
|
<key>LibraryPath</key>
|
28
31
|
<string>libskparagraph.a</string>
|
29
32
|
<key>SupportedArchitectures</key>
|
30
33
|
<array>
|
31
34
|
<string>arm64</string>
|
32
35
|
<string>arm64e</string>
|
33
|
-
<string>x86_64</string>
|
34
36
|
</array>
|
35
37
|
<key>SupportedPlatform</key>
|
36
38
|
<string>ios</string>
|
37
|
-
|
38
|
-
|
39
|
+
</dict>
|
40
|
+
<dict>
|
41
|
+
<key>BinaryPath</key>
|
42
|
+
<string>libskparagraph.a</string>
|
43
|
+
<key>LibraryIdentifier</key>
|
44
|
+
<string>macos-arm64_x86_64</string>
|
45
|
+
<key>LibraryPath</key>
|
46
|
+
<string>libskparagraph.a</string>
|
47
|
+
<key>SupportedArchitectures</key>
|
48
|
+
<array>
|
49
|
+
<string>arm64</string>
|
50
|
+
<string>x86_64</string>
|
51
|
+
</array>
|
52
|
+
<key>SupportedPlatform</key>
|
53
|
+
<string>macos</string>
|
39
54
|
</dict>
|
40
55
|
</array>
|
41
56
|
<key>CFBundlePackageType</key>
|
Binary file
|
Binary file
|
@@ -4,6 +4,21 @@
|
|
4
4
|
<dict>
|
5
5
|
<key>AvailableLibraries</key>
|
6
6
|
<array>
|
7
|
+
<dict>
|
8
|
+
<key>BinaryPath</key>
|
9
|
+
<string>libsksg.a</string>
|
10
|
+
<key>LibraryIdentifier</key>
|
11
|
+
<string>macos-arm64_x86_64</string>
|
12
|
+
<key>LibraryPath</key>
|
13
|
+
<string>libsksg.a</string>
|
14
|
+
<key>SupportedArchitectures</key>
|
15
|
+
<array>
|
16
|
+
<string>arm64</string>
|
17
|
+
<string>x86_64</string>
|
18
|
+
</array>
|
19
|
+
<key>SupportedPlatform</key>
|
20
|
+
<string>macos</string>
|
21
|
+
</dict>
|
7
22
|
<dict>
|
8
23
|
<key>BinaryPath</key>
|
9
24
|
<string>libsksg.a</string>
|
Binary file
|
Binary file
|
Binary file
|
@@ -8,19 +8,16 @@
|
|
8
8
|
<key>BinaryPath</key>
|
9
9
|
<string>libskshaper.a</string>
|
10
10
|
<key>LibraryIdentifier</key>
|
11
|
-
<string>
|
11
|
+
<string>macos-arm64_x86_64</string>
|
12
12
|
<key>LibraryPath</key>
|
13
13
|
<string>libskshaper.a</string>
|
14
14
|
<key>SupportedArchitectures</key>
|
15
15
|
<array>
|
16
16
|
<string>arm64</string>
|
17
|
-
<string>arm64e</string>
|
18
17
|
<string>x86_64</string>
|
19
18
|
</array>
|
20
19
|
<key>SupportedPlatform</key>
|
21
|
-
<string>
|
22
|
-
<key>SupportedPlatformVariant</key>
|
23
|
-
<string>simulator</string>
|
20
|
+
<string>macos</string>
|
24
21
|
</dict>
|
25
22
|
<dict>
|
26
23
|
<key>BinaryPath</key>
|
@@ -37,6 +34,24 @@
|
|
37
34
|
<key>SupportedPlatform</key>
|
38
35
|
<string>ios</string>
|
39
36
|
</dict>
|
37
|
+
<dict>
|
38
|
+
<key>BinaryPath</key>
|
39
|
+
<string>libskshaper.a</string>
|
40
|
+
<key>LibraryIdentifier</key>
|
41
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
42
|
+
<key>LibraryPath</key>
|
43
|
+
<string>libskshaper.a</string>
|
44
|
+
<key>SupportedArchitectures</key>
|
45
|
+
<array>
|
46
|
+
<string>arm64</string>
|
47
|
+
<string>arm64e</string>
|
48
|
+
<string>x86_64</string>
|
49
|
+
</array>
|
50
|
+
<key>SupportedPlatform</key>
|
51
|
+
<string>ios</string>
|
52
|
+
<key>SupportedPlatformVariant</key>
|
53
|
+
<string>simulator</string>
|
54
|
+
</dict>
|
40
55
|
</array>
|
41
56
|
<key>CFBundlePackageType</key>
|
42
57
|
<string>XFWK</string>
|
Binary file
|
package/libs/{ios → apple}/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a
RENAMED
Binary file
|
@@ -4,6 +4,21 @@
|
|
4
4
|
<dict>
|
5
5
|
<key>AvailableLibraries</key>
|
6
6
|
<array>
|
7
|
+
<dict>
|
8
|
+
<key>BinaryPath</key>
|
9
|
+
<string>libskunicode_core.a</string>
|
10
|
+
<key>LibraryIdentifier</key>
|
11
|
+
<string>ios-arm64_arm64e</string>
|
12
|
+
<key>LibraryPath</key>
|
13
|
+
<string>libskunicode_core.a</string>
|
14
|
+
<key>SupportedArchitectures</key>
|
15
|
+
<array>
|
16
|
+
<string>arm64</string>
|
17
|
+
<string>arm64e</string>
|
18
|
+
</array>
|
19
|
+
<key>SupportedPlatform</key>
|
20
|
+
<string>ios</string>
|
21
|
+
</dict>
|
7
22
|
<dict>
|
8
23
|
<key>BinaryPath</key>
|
9
24
|
<string>libskunicode_core.a</string>
|
@@ -26,16 +41,16 @@
|
|
26
41
|
<key>BinaryPath</key>
|
27
42
|
<string>libskunicode_core.a</string>
|
28
43
|
<key>LibraryIdentifier</key>
|
29
|
-
<string>
|
44
|
+
<string>macos-arm64_x86_64</string>
|
30
45
|
<key>LibraryPath</key>
|
31
46
|
<string>libskunicode_core.a</string>
|
32
47
|
<key>SupportedArchitectures</key>
|
33
48
|
<array>
|
34
49
|
<string>arm64</string>
|
35
|
-
<string>
|
50
|
+
<string>x86_64</string>
|
36
51
|
</array>
|
37
52
|
<key>SupportedPlatform</key>
|
38
|
-
<string>
|
53
|
+
<string>macos</string>
|
39
54
|
</dict>
|
40
55
|
</array>
|
41
56
|
<key>CFBundlePackageType</key>
|
package/libs/{ios → apple}/libskunicode_core.xcframework/ios-arm64_arm64e/libskunicode_core.a
RENAMED
Binary file
|
Binary file
|
Binary file
|
@@ -22,6 +22,21 @@
|
|
22
22
|
<key>SupportedPlatformVariant</key>
|
23
23
|
<string>simulator</string>
|
24
24
|
</dict>
|
25
|
+
<dict>
|
26
|
+
<key>BinaryPath</key>
|
27
|
+
<string>libskunicode_libgrapheme.a</string>
|
28
|
+
<key>LibraryIdentifier</key>
|
29
|
+
<string>macos-arm64_x86_64</string>
|
30
|
+
<key>LibraryPath</key>
|
31
|
+
<string>libskunicode_libgrapheme.a</string>
|
32
|
+
<key>SupportedArchitectures</key>
|
33
|
+
<array>
|
34
|
+
<string>arm64</string>
|
35
|
+
<string>x86_64</string>
|
36
|
+
</array>
|
37
|
+
<key>SupportedPlatform</key>
|
38
|
+
<string>macos</string>
|
39
|
+
</dict>
|
25
40
|
<dict>
|
26
41
|
<key>BinaryPath</key>
|
27
42
|
<string>libskunicode_libgrapheme.a</string>
|
Binary file
|
Binary file
|
Binary file
|
@@ -22,6 +22,21 @@
|
|
22
22
|
<key>SupportedPlatformVariant</key>
|
23
23
|
<string>simulator</string>
|
24
24
|
</dict>
|
25
|
+
<dict>
|
26
|
+
<key>BinaryPath</key>
|
27
|
+
<string>libsvg.a</string>
|
28
|
+
<key>LibraryIdentifier</key>
|
29
|
+
<string>macos-arm64_x86_64</string>
|
30
|
+
<key>LibraryPath</key>
|
31
|
+
<string>libsvg.a</string>
|
32
|
+
<key>SupportedArchitectures</key>
|
33
|
+
<array>
|
34
|
+
<string>arm64</string>
|
35
|
+
<string>x86_64</string>
|
36
|
+
</array>
|
37
|
+
<key>SupportedPlatform</key>
|
38
|
+
<string>macos</string>
|
39
|
+
</dict>
|
25
40
|
<dict>
|
26
41
|
<key>BinaryPath</key>
|
27
42
|
<string>libsvg.a</string>
|
Binary file
|
Binary file
|
Binary file
|
package/package.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
"setup-skia-web": "./scripts/setup-canvaskit.js"
|
8
8
|
},
|
9
9
|
"title": "React Native Skia",
|
10
|
-
"version": "1.7.
|
10
|
+
"version": "1.7.7",
|
11
11
|
"description": "High-performance React Native Graphics using Skia",
|
12
12
|
"main": "lib/module/index.js",
|
13
13
|
"react-native": "src/index.ts",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"jestEnv.mjs",
|
30
30
|
"cpp/**/*.{h,cpp}",
|
31
31
|
"ios/**",
|
32
|
-
"libs/
|
32
|
+
"libs/apple/*.xcframework/**",
|
33
33
|
"react-native-skia.podspec",
|
34
34
|
"scripts/setup-canvaskit.js",
|
35
35
|
"dist/**"
|
@@ -95,7 +95,7 @@
|
|
95
95
|
"@types/pixelmatch": "5.2.4",
|
96
96
|
"@types/pngjs": "6.0.1",
|
97
97
|
"@types/react": "^18.2.6",
|
98
|
-
"@types/react-reconciler": "0.
|
98
|
+
"@types/react-reconciler": "0.28.9",
|
99
99
|
"@types/ws": "8.5.3",
|
100
100
|
"eslint": "8",
|
101
101
|
"eslint-config-react-native-wcandillon": "^3.10.2",
|
@@ -13,18 +13,18 @@ preprocessor_defs = use_graphite ?
|
|
13
13
|
'$(inherited) SK_METAL=1 SK_GANESH=1 SK_IMAGE_READ_PIXELS_DISABLE_LEGACY_API=1'
|
14
14
|
|
15
15
|
# Define base frameworks
|
16
|
-
base_frameworks = ['libs/
|
17
|
-
'libs/
|
18
|
-
'libs/
|
19
|
-
'libs/
|
20
|
-
'libs/
|
21
|
-
'libs/
|
16
|
+
base_frameworks = ['libs/apple/libskia.xcframework',
|
17
|
+
'libs/apple/libsvg.xcframework',
|
18
|
+
'libs/apple/libskshaper.xcframework',
|
19
|
+
'libs/apple/libskparagraph.xcframework',
|
20
|
+
'libs/apple/libskunicode_core.xcframework',
|
21
|
+
'libs/apple/libskunicode_libgrapheme.xcframework',]
|
22
22
|
|
23
23
|
# Add Graphite frameworks if enabled
|
24
24
|
graphite_frameworks = [
|
25
|
-
'libs/
|
26
|
-
'libs/
|
27
|
-
'libs/
|
25
|
+
'libs/apple/libdawn_native_static.xcframework',
|
26
|
+
'libs/apple/libdawn_platform_static.xcframework',
|
27
|
+
'libs/apple/libdawn_proc_static.xcframework'
|
28
28
|
]
|
29
29
|
|
30
30
|
Pod::Spec.new do |s|
|
package/src/__tests__/setup.ts
CHANGED
@@ -82,7 +82,7 @@ export const checkImage = (
|
|
82
82
|
if (diffPixelsCount > maxPixelDiff && !shouldFail) {
|
83
83
|
console.log(`${p} didn't match`);
|
84
84
|
fs.writeFileSync(`${p}.test.png`, PNG.sync.write(toTest));
|
85
|
-
fs.writeFileSync(`${p}-diff-test.png`, PNG.sync.write(diffImage));
|
85
|
+
//fs.writeFileSync(`${p}-diff-test.png`, PNG.sync.write(diffImage));
|
86
86
|
}
|
87
87
|
if (shouldFail) {
|
88
88
|
expect(diffPixelsCount).not.toBeLessThanOrEqual(maxPixelDiff);
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -331,7 +331,8 @@ export class JsiSkDOM implements SkDOM {
|
|
331
331
|
}
|
332
332
|
|
333
333
|
LinearToSRGBGammaColorFilter() {
|
334
|
-
return this.native
|
334
|
+
return this.native
|
335
|
+
? global.SkiaDomApi.LinearToSRGBGammaColorFilterNode()
|
335
336
|
: new LinearToSRGBGammaColorFilterNode(this.ctx);
|
336
337
|
}
|
337
338
|
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
1
|
+
"worklet";
|
2
|
+
|
2
3
|
import type { CircleDef, ScalarCircleDef } from "../../types";
|
3
4
|
|
4
|
-
export const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef =>
|
5
|
+
export const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef => {
|
5
6
|
// We have an issue to check property existence on JSI backed instances
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
7
|
-
(def as any).cx !== undefined;
|
8
|
+
return (def as any).cx !== undefined;
|
9
|
+
};
|
8
10
|
|
9
|
-
export const processCircle = (
|
11
|
+
export const processCircle = (def: CircleDef) => {
|
10
12
|
if (isCircleScalarDef(def)) {
|
11
|
-
return { c:
|
13
|
+
return { c: { x: def.cx, y: def.cy }, r: def.r };
|
12
14
|
}
|
13
15
|
return { ...def, c: def.c ?? { x: 0, y: 0 } };
|
14
16
|
};
|
@@ -1,3 +1,5 @@
|
|
1
|
+
"worklet";
|
2
|
+
|
1
3
|
import { exhaustiveCheck } from "../../../renderer/typeddash";
|
2
4
|
import type { SkRect } from "../../../skia/types";
|
3
5
|
import type { Fit } from "../../types";
|
@@ -8,7 +10,6 @@ export interface Size {
|
|
8
10
|
}
|
9
11
|
|
10
12
|
export const size = (width = 0, height = 0) => {
|
11
|
-
"worklet";
|
12
13
|
return { width, height };
|
13
14
|
};
|
14
15
|
|
@@ -21,7 +22,6 @@ export const rect2rect = (
|
|
21
22
|
{ scaleX: number },
|
22
23
|
{ scaleY: number }
|
23
24
|
] => {
|
24
|
-
"worklet";
|
25
25
|
const scaleX = dst.width / src.width;
|
26
26
|
const scaleY = dst.height / src.height;
|
27
27
|
const translateX = dst.x - src.x * scaleX;
|
@@ -33,7 +33,6 @@ const inscribe = (
|
|
33
33
|
{ width, height }: Size,
|
34
34
|
rect: { x: number; y: number; width: number; height: number }
|
35
35
|
) => {
|
36
|
-
"worklet";
|
37
36
|
const halfWidthDelta = (rect.width - width) / 2.0;
|
38
37
|
const halfHeightDelta = (rect.height - height) / 2.0;
|
39
38
|
return {
|
@@ -45,7 +44,6 @@ const inscribe = (
|
|
45
44
|
};
|
46
45
|
|
47
46
|
const applyBoxFit = (fit: Fit, input: Size, output: Size) => {
|
48
|
-
"worklet";
|
49
47
|
let src = size(),
|
50
48
|
dst = size();
|
51
49
|
if (
|
@@ -114,7 +112,6 @@ export const fitRects = (
|
|
114
112
|
rect: SkRect,
|
115
113
|
{ x, y, width, height }: SkRect
|
116
114
|
) => {
|
117
|
-
"worklet";
|
118
115
|
const sizes = applyBoxFit(
|
119
116
|
fit,
|
120
117
|
{ width: rect.width, height: rect.height },
|
@@ -1,3 +1,5 @@
|
|
1
|
+
"worklet";
|
2
|
+
|
1
3
|
import type { Skia, SkRect, Transforms3d, Vector } from "../../../skia/types";
|
2
4
|
import { TileMode } from "../../../skia/types";
|
3
5
|
import type { GradientProps, ImageShaderProps } from "../../types";
|
@@ -35,13 +37,8 @@ export const getRect = (
|
|
35
37
|
const { x, y, width, height } = props;
|
36
38
|
if (props.rect) {
|
37
39
|
return props.rect;
|
38
|
-
} else if (
|
39
|
-
x
|
40
|
-
y !== undefined &&
|
41
|
-
width !== undefined &&
|
42
|
-
height !== undefined
|
43
|
-
) {
|
44
|
-
return Skia.XYWHRect(x, y, width, height);
|
40
|
+
} else if (width !== undefined && height !== undefined) {
|
41
|
+
return Skia.XYWHRect(x ?? 0, y ?? 0, width, height);
|
45
42
|
} else {
|
46
43
|
return undefined;
|
47
44
|
}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
"worklet";
|
2
|
+
|
1
3
|
import type { Skia } from "../../../skia/types";
|
2
4
|
import { isPath } from "../../../skia/types";
|
3
5
|
import type { PathDef } from "../../types";
|
@@ -14,5 +16,6 @@ export const processPath = (Skia: Skia, rawPath: PathDef) => {
|
|
14
16
|
};
|
15
17
|
|
16
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
17
|
-
export const isPathDef = (def: any): def is PathDef =>
|
18
|
-
typeof def === "string" || isPath(def);
|
19
|
+
export const isPathDef = (def: any): def is PathDef => {
|
20
|
+
return typeof def === "string" || isPath(def);
|
21
|
+
};
|
@@ -1,22 +1,25 @@
|
|
1
|
+
"worklet";
|
2
|
+
|
1
3
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2
|
-
import type { Skia, SkRect, Vector } from "../../../skia/types";
|
4
|
+
import type { Skia, SkRect, SkRRect, Vector } from "../../../skia/types";
|
3
5
|
import type { RectCtor, RectDef, RRectCtor, RRectDef } from "../../types";
|
4
6
|
|
5
7
|
import { processRadius } from "./Radius";
|
6
8
|
|
7
9
|
export const isEdge = (pos: Vector, b: SkRect) => {
|
8
|
-
"worklet";
|
9
10
|
return (
|
10
11
|
pos.x === b.x || pos.y === b.y || pos.x === b.width || pos.y === b.height
|
11
12
|
);
|
12
13
|
};
|
13
14
|
|
14
15
|
// We have an issue to check property existence on JSI backed instances
|
15
|
-
const isRRectCtor = (def: RRectDef): def is RRectCtor =>
|
16
|
-
(def as any).rect === undefined;
|
16
|
+
const isRRectCtor = (def: RRectDef): def is RRectCtor => {
|
17
|
+
return (def as any).rect === undefined;
|
18
|
+
};
|
17
19
|
// We have an issue to check property existence on JSI backed instances
|
18
|
-
const isRectCtor = (def: RectDef): def is RectCtor =>
|
19
|
-
(def as any).rect === undefined;
|
20
|
+
const isRectCtor = (def: RectDef): def is RectCtor => {
|
21
|
+
return (def as any).rect === undefined;
|
22
|
+
};
|
20
23
|
|
21
24
|
export const processRect = (Skia: Skia, def: RectDef) => {
|
22
25
|
if (isRectCtor(def)) {
|
@@ -38,3 +41,34 @@ export const processRRect = (Skia: Skia, def: RRectDef) => {
|
|
38
41
|
return def.rect;
|
39
42
|
}
|
40
43
|
};
|
44
|
+
|
45
|
+
export const inflate = (
|
46
|
+
Skia: Skia,
|
47
|
+
box: SkRRect,
|
48
|
+
dx: number,
|
49
|
+
dy: number,
|
50
|
+
tx = 0,
|
51
|
+
ty = 0
|
52
|
+
) => {
|
53
|
+
return Skia.RRectXY(
|
54
|
+
Skia.XYWHRect(
|
55
|
+
box.rect.x - dx + tx,
|
56
|
+
box.rect.y - dy + ty,
|
57
|
+
box.rect.width + 2 * dx,
|
58
|
+
box.rect.height + 2 * dy
|
59
|
+
),
|
60
|
+
box.rx + dx,
|
61
|
+
box.ry + dy
|
62
|
+
);
|
63
|
+
};
|
64
|
+
|
65
|
+
export const deflate = (
|
66
|
+
Skia: Skia,
|
67
|
+
box: SkRRect,
|
68
|
+
dx: number,
|
69
|
+
dy: number,
|
70
|
+
tx = 0,
|
71
|
+
ty = 0
|
72
|
+
) => {
|
73
|
+
return inflate(Skia, box, -dx, -dy, tx, ty);
|
74
|
+
};
|