@shopify/react-native-skia 0.1.130 → 0.1.131
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +8 -0
- package/android/cpp/jni/JniSkiaDrawView.cpp +3 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +2 -1
- package/cpp/api/JsiSkCanvas.h +2 -2
- package/cpp/api/JsiSkMatrix.h +40 -27
- package/cpp/api/JsiSkPaint.h +3 -1
- package/cpp/api/JsiSkPath.h +67 -61
- package/cpp/api/JsiSkPathFactory.h +14 -1
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +18 -0
- package/cpp/api/JsiSkTypeface.h +11 -2
- package/cpp/api/JsiSkTypefaceFactory.h +5 -1
- package/cpp/rnskia/RNSkInfoParameter.h +2 -0
- package/cpp/utils/RNSkLog.h +22 -0
- package/ios/RNSkia-iOS/SkiaDrawView.mm +2 -1
- package/lib/commonjs/animation/functions/index.js +47 -17
- package/lib/commonjs/animation/functions/index.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js +45 -0
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -0
- package/lib/commonjs/animation/functions/interpolateVector.js +20 -0
- package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +19 -35
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +2 -2
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.js +10 -7
- package/lib/commonjs/renderer/components/Blend.js.map +1 -1
- package/lib/commonjs/renderer/components/Compose.js +9 -6
- package/lib/commonjs/renderer/components/Compose.js.map +1 -1
- package/lib/commonjs/renderer/components/Group.js +7 -6
- package/lib/commonjs/renderer/components/Group.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js +13 -10
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/Paint.js +7 -4
- package/lib/commonjs/renderer/components/Paint.js.map +1 -1
- package/lib/commonjs/renderer/components/Picture.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +7 -6
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Compose.js +6 -6
- package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js +8 -7
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +6 -6
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +6 -6
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js +6 -7
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +6 -6
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/image/BoxFit.js +7 -9
- package/lib/commonjs/renderer/components/image/BoxFit.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js +3 -2
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageSVG.js +3 -2
- package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js +9 -6
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js +7 -4
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +10 -7
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +10 -15
- package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +7 -6
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js +5 -4
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +13 -6
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js +8 -7
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/getInput.js +7 -7
- package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js +6 -3
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Corner.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Dash.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js +8 -6
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Sum.js +7 -4
- package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Color.js +7 -4
- package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js +5 -4
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Gradient.js +5 -5
- package/lib/commonjs/renderer/components/shaders/Gradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js +6 -5
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js +6 -5
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js +6 -43
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js +6 -5
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js +5 -4
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +6 -5
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Box.js +26 -29
- package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js +7 -5
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js +3 -2
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Patch.js +8 -5
- package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js +5 -4
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js +2 -2
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Rect.js +3 -2
- package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js +3 -2
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js +9 -8
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js +3 -2
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js +3 -2
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js +7 -11
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/index.js +13 -13
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Drawing.js +5 -5
- package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/renderer/processors/Circles.js +2 -4
- package/lib/commonjs/renderer/processors/Circles.js.map +1 -1
- package/lib/commonjs/renderer/processors/Clips.js +5 -5
- package/lib/commonjs/renderer/processors/Clips.js.map +1 -1
- package/lib/commonjs/{skia/core → renderer/processors}/Color.js +2 -6
- package/lib/commonjs/renderer/processors/Color.js.map +1 -0
- package/lib/commonjs/renderer/processors/Font.js +4 -4
- package/lib/commonjs/renderer/processors/Font.js.map +1 -1
- package/lib/commonjs/renderer/processors/Paint.js +18 -14
- package/lib/commonjs/renderer/processors/Paint.js.map +1 -1
- package/lib/commonjs/renderer/processors/Paths.js +4 -4
- package/lib/commonjs/renderer/processors/Paths.js.map +1 -1
- package/lib/commonjs/renderer/processors/Radius.js +2 -4
- package/lib/commonjs/renderer/processors/Radius.js.map +1 -1
- package/lib/commonjs/renderer/processors/Rects.js +8 -59
- package/lib/commonjs/renderer/processors/Rects.js.map +1 -1
- package/lib/commonjs/renderer/processors/Transform.js +26 -17
- package/lib/commonjs/renderer/processors/Transform.js.map +1 -1
- package/lib/commonjs/renderer/processors/index.js +26 -13
- package/lib/commonjs/renderer/processors/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/index.js +0 -26
- package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
- package/lib/commonjs/renderer/useCanvas.js +30 -0
- package/lib/commonjs/renderer/useCanvas.js.map +1 -0
- package/lib/commonjs/skia/NativeSetup.js +1 -1
- package/lib/commonjs/skia/NativeSetup.js.map +1 -1
- package/lib/commonjs/skia/Skia.web.js +12 -0
- package/lib/commonjs/skia/Skia.web.js.map +1 -0
- package/lib/commonjs/skia/core/Data.js +9 -4
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Font.js +2 -4
- package/lib/commonjs/skia/core/Font.js.map +1 -1
- package/lib/commonjs/skia/core/Matrix.js +15 -0
- package/lib/commonjs/skia/core/Matrix.js.map +1 -0
- package/lib/commonjs/skia/core/Paint.js +4 -12
- package/lib/commonjs/skia/core/Paint.js.map +1 -1
- package/lib/commonjs/skia/core/Path.js +14 -2
- package/lib/commonjs/skia/core/Path.js.map +1 -1
- package/lib/commonjs/skia/core/RRect.js +13 -0
- package/lib/commonjs/skia/core/RRect.js.map +1 -0
- package/lib/commonjs/skia/core/Rect.js +47 -0
- package/lib/commonjs/skia/core/Rect.js.map +1 -0
- package/lib/commonjs/skia/core/Vector.js +49 -0
- package/lib/commonjs/skia/core/Vector.js.map +1 -0
- package/lib/commonjs/skia/core/index.js +51 -25
- package/lib/commonjs/skia/core/index.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.js +58 -1
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.js +1 -0
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Point.js.map +1 -1
- package/lib/commonjs/skia/types/RRect.js +7 -0
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +51 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/web/{api/Host.js → Host.js} +10 -1
- package/lib/commonjs/skia/web/Host.js.map +1 -0
- package/lib/commonjs/skia/web/JsiImageFilterFactory.js +68 -0
- package/lib/commonjs/skia/web/JsiImageFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +20 -6
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +163 -4
- package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +48 -0
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +42 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +30 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkData.js +18 -0
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkDataFactory.js +44 -0
- package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFont.js +111 -0
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js +35 -0
- package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js +25 -0
- package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkImage.js.map → JsiSkImage.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +47 -0
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js +18 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js +18 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +24 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js +38 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +4 -9
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPath.js +324 -0
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js +18 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +78 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +58 -0
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js +29 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +30 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js +26 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js +32 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js +18 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +44 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js +26 -0
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkShader.js +18 -0
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +52 -0
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
- package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
- package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.js +18 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +36 -0
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.js +28 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +30 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js +28 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +27 -0
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkia.js +97 -0
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -0
- package/lib/commonjs/skia/web/index.js +4 -4
- package/lib/commonjs/skia/web/index.js.map +1 -1
- package/lib/commonjs/values/web/api.js +2 -2
- package/lib/commonjs/values/web/api.js.map +1 -1
- package/lib/commonjs/views/SkiaView.web.js +216 -0
- package/lib/commonjs/views/SkiaView.web.js.map +1 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/commonjs/views/useTouchHandler.js +70 -46
- package/lib/commonjs/views/useTouchHandler.js.map +1 -1
- package/lib/commonjs/web/index.js +20 -0
- package/lib/commonjs/web/index.js.map +1 -0
- package/lib/module/animation/functions/index.js +4 -2
- package/lib/module/animation/functions/index.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.js +36 -0
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -0
- package/lib/module/animation/functions/interpolateVector.js +7 -0
- package/lib/module/animation/functions/interpolateVector.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +15 -26
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +2 -2
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Blend.js +5 -2
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/Compose.js +5 -2
- package/lib/module/renderer/components/Compose.js.map +1 -1
- package/lib/module/renderer/components/Group.js +7 -6
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +7 -3
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +6 -3
- package/lib/module/renderer/components/Paint.js.map +1 -1
- package/lib/module/renderer/components/Picture.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.js +6 -3
- package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Compose.js +2 -2
- package/lib/module/renderer/components/colorFilters/Compose.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Lerp.js +6 -3
- package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +5 -3
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +5 -3
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Matrix.js +5 -3
- package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +5 -3
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/module/renderer/components/image/BoxFit.js +7 -8
- package/lib/module/renderer/components/image/BoxFit.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js +3 -2
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageSVG.js +3 -2
- package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js +10 -7
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js +7 -4
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js +7 -4
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/InnerShadow.js +3 -3
- package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +6 -4
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js +5 -3
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js +13 -4
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js +6 -5
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/getInput.js +2 -2
- package/lib/module/renderer/components/imageFilters/getInput.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +5 -2
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Corner.js +5 -2
- package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Dash.js +5 -2
- package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js +5 -2
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Line2D.js +5 -2
- package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path1D.js +6 -3
- package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path2D.js +6 -3
- package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Sum.js +5 -2
- package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/module/renderer/components/shaders/Color.js +6 -3
- package/lib/module/renderer/components/shaders/Color.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js +4 -2
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/Gradient.js +3 -3
- package/lib/module/renderer/components/shaders/Gradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/LinearGradient.js +5 -3
- package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/RadialGradient.js +5 -3
- package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +6 -44
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/SweepGradient.js +5 -3
- package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js +4 -2
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +5 -3
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/module/renderer/components/shapes/Box.js +20 -19
- package/lib/module/renderer/components/shapes/Box.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js +7 -4
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Line.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js +3 -2
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Patch.js +5 -3
- package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js +4 -3
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js +1 -1
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/Rect.js +3 -2
- package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js +3 -2
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js +5 -3
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js +3 -2
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js +3 -2
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js +3 -3
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/index.js +1 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/nodes/Declaration.js.map +1 -1
- package/lib/module/renderer/nodes/Drawing.js +3 -3
- package/lib/module/renderer/nodes/Drawing.js.map +1 -1
- package/lib/module/renderer/nodes/Node.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/renderer/processors/Circles.js +2 -4
- package/lib/module/renderer/processors/Circles.js.map +1 -1
- package/lib/module/renderer/processors/Clips.js +3 -3
- package/lib/module/renderer/processors/Clips.js.map +1 -1
- package/lib/module/{skia/core → renderer/processors}/Color.js +1 -2
- package/lib/module/renderer/processors/Color.js.map +1 -0
- package/lib/module/renderer/processors/Font.js +3 -2
- package/lib/module/renderer/processors/Font.js.map +1 -1
- package/lib/module/renderer/processors/Paint.js +8 -5
- package/lib/module/renderer/processors/Paint.js.map +1 -1
- package/lib/module/renderer/processors/Paths.js +2 -2
- package/lib/module/renderer/processors/Paths.js.map +1 -1
- package/lib/module/renderer/processors/Radius.js +2 -3
- package/lib/module/renderer/processors/Radius.js.map +1 -1
- package/lib/module/renderer/processors/Rects.js +7 -26
- package/lib/module/renderer/processors/Rects.js.map +1 -1
- package/lib/module/renderer/processors/Transform.js +24 -16
- package/lib/module/renderer/processors/Transform.js.map +1 -1
- package/lib/module/renderer/processors/index.js +2 -1
- package/lib/module/renderer/processors/index.js.map +1 -1
- package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
- package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
- package/lib/module/renderer/processors/math/index.js +0 -2
- package/lib/module/renderer/processors/math/index.js.map +1 -1
- package/lib/module/renderer/useCanvas.js +13 -0
- package/lib/module/renderer/useCanvas.js.map +1 -0
- package/lib/module/skia/NativeSetup.js +2 -2
- package/lib/module/skia/NativeSetup.js.map +1 -1
- package/lib/module/skia/Skia.web.js +3 -0
- package/lib/module/skia/Skia.web.js.map +1 -0
- package/lib/module/skia/core/Data.js +11 -5
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Font.js +2 -4
- package/lib/module/skia/core/Font.js.map +1 -1
- package/lib/module/skia/core/Matrix.js +4 -0
- package/lib/module/skia/core/Matrix.js.map +1 -0
- package/lib/module/skia/core/Paint.js +3 -7
- package/lib/module/skia/core/Paint.js.map +1 -1
- package/lib/module/skia/core/Path.js +11 -2
- package/lib/module/skia/core/Path.js.map +1 -1
- package/lib/module/skia/core/RRect.js +3 -0
- package/lib/module/skia/core/RRect.js.map +1 -0
- package/lib/module/skia/core/Rect.js +17 -0
- package/lib/module/skia/core/Rect.js.map +1 -0
- package/lib/module/{renderer/processors/math → skia/core}/Vector.js +2 -7
- package/lib/module/skia/core/Vector.js.map +1 -0
- package/lib/module/skia/core/index.js +5 -3
- package/lib/module/skia/core/index.js.map +1 -1
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Matrix.js +55 -0
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Path/Path.js +1 -0
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Point.js.map +1 -1
- package/lib/module/skia/types/RRect.js +3 -1
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +48 -0
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/web/{api/Host.js → Host.js} +6 -0
- package/lib/module/skia/web/Host.js.map +1 -0
- package/lib/module/skia/web/JsiImageFilterFactory.js +57 -0
- package/lib/module/skia/web/JsiImageFilterFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +19 -6
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +164 -4
- package/lib/module/skia/web/JsiSkColor.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +37 -0
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js +31 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js +19 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -0
- package/lib/module/skia/web/JsiSkData.js +8 -0
- package/lib/module/skia/web/JsiSkData.js.map +1 -0
- package/lib/module/skia/web/JsiSkDataFactory.js +33 -0
- package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkFont.js +99 -0
- package/lib/module/skia/web/JsiSkFont.js.map +1 -0
- package/lib/module/skia/web/JsiSkFontMgr.js +25 -0
- package/lib/module/skia/web/JsiSkFontMgr.js.map +1 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.js +14 -0
- package/lib/module/skia/web/JsiSkFontMgrFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkImage.js.map → JsiSkImage.js.map} +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +36 -0
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkImageFilter.js +8 -0
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js +8 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -0
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js +13 -0
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkMatrix.js +28 -0
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +5 -10
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -0
- package/lib/module/skia/web/JsiSkPath.js +311 -0
- package/lib/module/skia/web/JsiSkPath.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathEffect.js +8 -0
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +67 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathFactory.js +47 -0
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPicture.js +18 -0
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -0
- package/lib/module/skia/web/JsiSkPictureFactory.js +19 -0
- package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js +18 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -0
- package/lib/module/skia/web/JsiSkPoint.js +16 -0
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -0
- package/lib/module/skia/web/JsiSkRRect.js +21 -0
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRSXform.js +8 -0
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +33 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +19 -0
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkSVGFactory.js +16 -0
- package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkShader.js +8 -0
- package/lib/module/skia/web/JsiSkShader.js.map +1 -0
- package/lib/module/skia/web/JsiSkShaderFactory.js +41 -0
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -0
- package/lib/module/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
- package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
- package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.js +8 -0
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -0
- package/lib/module/skia/web/JsiSkTextBlobFactory.js +25 -0
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkTypeface.js +18 -0
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -0
- package/lib/module/skia/web/JsiSkTypefaceFactory.js +19 -0
- package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkVertices.js +17 -0
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -0
- package/lib/module/skia/web/JsiSkVerticesFactory.js +16 -0
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkia.js +61 -0
- package/lib/module/skia/web/JsiSkia.js.map +1 -0
- package/lib/module/skia/web/index.js +1 -1
- package/lib/module/skia/web/index.js.map +1 -1
- package/lib/module/values/web/api.js +2 -2
- package/lib/module/values/web/api.js.map +1 -1
- package/lib/module/views/SkiaView.web.js +202 -0
- package/lib/module/views/SkiaView.web.js.map +1 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/module/views/useTouchHandler.js +64 -43
- package/lib/module/views/useTouchHandler.js.map +1 -1
- package/lib/module/web/index.js +8 -0
- package/lib/module/web/index.js.map +1 -0
- package/lib/typescript/src/animation/functions/index.d.ts +4 -2
- package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +17 -0
- package/lib/typescript/src/animation/functions/interpolateVector.d.ts +10 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/renderer/Canvas.d.ts +3 -14
- package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -3
- package/lib/typescript/src/renderer/components/Blend.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Group.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Picture.d.ts +1 -1
- package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +2 -2
- package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +2 -2
- package/lib/typescript/src/renderer/components/image/BoxFit.d.ts +13 -3
- package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -1
- package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +1 -1
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +2 -2
- package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +2 -1
- package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +1 -1
- package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +2 -1
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shaders/Color.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +4 -4
- package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -8
- package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shapes/Box.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +4 -1
- package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Line.d.ts +2 -1
- package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -3
- package/lib/typescript/src/renderer/components/shapes/Path.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -2
- package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -2
- package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +1 -1
- package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +1 -1
- package/lib/typescript/src/renderer/components/text/TextPath.d.ts +1 -1
- package/lib/typescript/src/renderer/index.d.ts +1 -1
- package/lib/typescript/src/renderer/nodes/Declaration.d.ts +1 -1
- package/lib/typescript/src/renderer/nodes/Node.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +0 -2
- package/lib/typescript/src/renderer/processors/Circles.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Clips.d.ts +2 -2
- package/lib/typescript/src/{skia/core → renderer/processors}/Color.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Font.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Paint.d.ts +3 -3
- package/lib/typescript/src/renderer/processors/Paths.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Radius.d.ts +2 -2
- package/lib/typescript/src/renderer/processors/Rects.d.ts +3 -14
- package/lib/typescript/src/renderer/processors/Transform.d.ts +3 -4
- package/lib/typescript/src/renderer/processors/index.d.ts +2 -1
- package/lib/typescript/src/renderer/processors/math/Coordinates.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/math/Transforms.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/math/index.d.ts +0 -2
- package/lib/typescript/src/renderer/useCanvas.d.ts +14 -0
- package/lib/typescript/src/skia/Skia.web.d.ts +1 -0
- package/lib/typescript/src/skia/core/Data.d.ts +4 -4
- package/lib/typescript/src/skia/core/Matrix.d.ts +2 -0
- package/lib/typescript/src/skia/core/Paint.d.ts +0 -1
- package/lib/typescript/src/skia/core/RRect.d.ts +2 -0
- package/lib/typescript/src/skia/core/Rect.d.ts +8 -0
- package/lib/typescript/src/skia/core/Vector.d.ts +12 -0
- package/lib/typescript/src/skia/core/index.d.ts +5 -3
- package/lib/typescript/src/skia/types/ContourMeasure.d.ts +2 -4
- package/lib/typescript/src/skia/types/Data/Data.d.ts +1 -1
- package/lib/typescript/src/skia/types/Data/DataFactory.d.ts +4 -4
- package/lib/typescript/src/skia/types/FontMgr/FontMgr.d.ts +1 -1
- package/lib/typescript/src/skia/types/FontMgr/FontMgrFactory.d.ts +2 -2
- package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +3 -3
- package/lib/typescript/src/skia/types/Matrix.d.ts +15 -14
- package/lib/typescript/src/skia/types/Path/Path.d.ts +29 -23
- package/lib/typescript/src/skia/types/Path/PathFactory.d.ts +5 -0
- package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -2
- package/lib/typescript/src/skia/types/Point.d.ts +1 -0
- package/lib/typescript/src/skia/types/RRect.d.ts +1 -0
- package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +3 -2
- package/lib/typescript/src/skia/types/SVG/SVGFactory.d.ts +2 -2
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +8 -0
- package/lib/typescript/src/skia/types/Skia.d.ts +1 -1
- package/lib/typescript/src/skia/types/Typeface/TypefaceFactory.d.ts +2 -2
- package/lib/typescript/src/skia/web/{api/Host.d.ts → Host.d.ts} +4 -1
- package/lib/typescript/src/skia/web/JsiImageFilterFactory.d.ts +19 -0
- package/lib/typescript/src/skia/web/{api/JsiSkCanvas.d.ts → JsiSkCanvas.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkColor.d.ts +2 -0
- package/lib/typescript/src/skia/web/{api/JsiSkColorFilter.d.ts → JsiSkColorFilter.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +16 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkData.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkDataFactory.d.ts +19 -0
- package/lib/typescript/src/skia/web/JsiSkFont.d.ts +33 -0
- package/lib/typescript/src/skia/web/JsiSkFontMgr.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkFontMgrFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/{api/JsiSkImage.d.ts → JsiSkImage.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +10 -0
- package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +11 -0
- package/lib/typescript/src/skia/web/{api/JsiSkPaint.d.ts → JsiSkPaint.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +56 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
- package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +13 -0
- package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkPictureFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +11 -0
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +10 -0
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -0
- package/lib/typescript/src/skia/web/{api/JsiSkRect.d.ts → JsiSkRect.d.ts} +2 -1
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +14 -0
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkSVGFactory.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkShader.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkShaderFactory.d.ts +16 -0
- package/lib/typescript/src/skia/web/{api/JsiSkSurface.d.ts → JsiSkSurface.d.ts} +1 -1
- package/lib/typescript/src/skia/web/{api/JsiSkSurfaceFactory.d.ts → JsiSkSurfaceFactory.d.ts} +1 -1
- package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +12 -0
- package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
- package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +4 -0
- package/lib/typescript/src/skia/web/JsiSkia.d.ts +3 -0
- package/lib/typescript/src/skia/web/index.d.ts +1 -1
- package/lib/typescript/src/views/SkiaView.web.d.ts +56 -0
- package/lib/typescript/src/views/types.d.ts +1 -0
- package/lib/typescript/src/views/useTouchHandler.d.ts +11 -1
- package/lib/typescript/src/web/index.d.ts +5 -0
- package/package.json +4 -5
- package/src/animation/functions/index.ts +4 -2
- package/src/animation/functions/interpolatePaths.ts +38 -0
- package/src/animation/functions/interpolateVector.ts +26 -0
- package/src/index.ts +1 -0
- package/src/renderer/Canvas.tsx +13 -35
- package/src/renderer/DrawingContext.ts +3 -4
- package/src/renderer/HostConfig.ts +2 -2
- package/src/renderer/components/Blend.tsx +12 -10
- package/src/renderer/components/Compose.tsx +2 -2
- package/src/renderer/components/Group.tsx +11 -6
- package/src/renderer/components/Mask.tsx +5 -3
- package/src/renderer/components/Paint.tsx +5 -4
- package/src/renderer/components/Picture.tsx +1 -1
- package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
- package/src/renderer/components/colorFilters/BlendColor.tsx +4 -4
- package/src/renderer/components/colorFilters/Compose.ts +3 -2
- package/src/renderer/components/colorFilters/Lerp.tsx +3 -2
- package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +2 -3
- package/src/renderer/components/colorFilters/LumaColorFilter.tsx +2 -3
- package/src/renderer/components/colorFilters/Matrix.tsx +2 -3
- package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +2 -3
- package/src/renderer/components/image/BoxFit.ts +7 -13
- package/src/renderer/components/image/Image.tsx +3 -3
- package/src/renderer/components/image/ImageSVG.tsx +3 -3
- package/src/renderer/components/image/ImageShader.tsx +8 -7
- package/src/renderer/components/imageFilters/Blur.tsx +12 -10
- package/src/renderer/components/imageFilters/DisplacementMap.tsx +4 -4
- package/src/renderer/components/imageFilters/InnerShadow.tsx +4 -3
- package/src/renderer/components/imageFilters/Morphology.tsx +3 -4
- package/src/renderer/components/imageFilters/Offset.tsx +5 -4
- package/src/renderer/components/imageFilters/RuntimeShader.tsx +12 -4
- package/src/renderer/components/imageFilters/Shadow.tsx +10 -6
- package/src/renderer/components/imageFilters/getInput.ts +3 -2
- package/src/renderer/components/maskFilters/Blur.tsx +2 -2
- package/src/renderer/components/pathEffects/Corner.tsx +2 -2
- package/src/renderer/components/pathEffects/Dash.tsx +2 -2
- package/src/renderer/components/pathEffects/Discrete.tsx +2 -2
- package/src/renderer/components/pathEffects/Line2D.tsx +3 -3
- package/src/renderer/components/pathEffects/Path1D.tsx +3 -3
- package/src/renderer/components/pathEffects/Path2D.tsx +4 -4
- package/src/renderer/components/pathEffects/Sum.tsx +7 -5
- package/src/renderer/components/shaders/Color.tsx +7 -5
- package/src/renderer/components/shaders/FractalNoise.tsx +1 -2
- package/src/renderer/components/shaders/Gradient.ts +7 -10
- package/src/renderer/components/shaders/LinearGradient.tsx +4 -4
- package/src/renderer/components/shaders/RadialGradient.tsx +4 -4
- package/src/renderer/components/shaders/Shader.tsx +6 -56
- package/src/renderer/components/shaders/SweepGradient.tsx +4 -4
- package/src/renderer/components/shaders/Turbulence.tsx +1 -2
- package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -4
- package/src/renderer/components/shapes/Box.tsx +36 -17
- package/src/renderer/components/shapes/Circle.tsx +3 -4
- package/src/renderer/components/shapes/DiffRect.tsx +1 -1
- package/src/renderer/components/shapes/FitBox.tsx +1 -1
- package/src/renderer/components/shapes/Line.tsx +2 -1
- package/src/renderer/components/shapes/Oval.tsx +6 -4
- package/src/renderer/components/shapes/Patch.tsx +6 -10
- package/src/renderer/components/shapes/Path.tsx +3 -3
- package/src/renderer/components/shapes/Points.tsx +2 -2
- package/src/renderer/components/shapes/Rect.tsx +6 -4
- package/src/renderer/components/shapes/RoundedRect.tsx +2 -2
- package/src/renderer/components/shapes/Vertices.tsx +5 -4
- package/src/renderer/components/text/Glyphs.tsx +6 -3
- package/src/renderer/components/text/Text.tsx +2 -2
- package/src/renderer/components/text/TextBlob.tsx +1 -1
- package/src/renderer/components/text/TextPath.tsx +3 -4
- package/src/renderer/index.ts +1 -1
- package/src/renderer/nodes/Declaration.tsx +1 -1
- package/src/renderer/nodes/Drawing.tsx +3 -2
- package/src/renderer/nodes/Node.ts +1 -1
- package/src/renderer/processors/Animations/Animations.ts +0 -3
- package/src/renderer/processors/Circles.ts +4 -4
- package/src/renderer/processors/Clips.ts +9 -4
- package/src/{skia/core → renderer/processors}/Color.ts +2 -3
- package/src/renderer/processors/Font.ts +10 -3
- package/src/renderer/processors/Paint.ts +12 -7
- package/src/renderer/processors/Paths.ts +3 -3
- package/src/renderer/processors/Radius.ts +3 -4
- package/src/renderer/processors/Rects.ts +10 -45
- package/src/renderer/processors/Transform.ts +28 -19
- package/src/renderer/processors/index.ts +2 -1
- package/src/renderer/processors/math/Coordinates.ts +1 -1
- package/src/renderer/processors/math/Transforms.ts +2 -1
- package/src/renderer/processors/math/index.ts +0 -2
- package/src/renderer/useCanvas.ts +21 -0
- package/src/skia/NativeSetup.ts +2 -2
- package/src/skia/Skia.web.ts +3 -0
- package/src/skia/core/Data.ts +17 -14
- package/src/skia/core/Font.ts +2 -4
- package/src/skia/core/Matrix.ts +6 -0
- package/src/skia/core/Paint.ts +2 -6
- package/src/skia/core/Path.ts +14 -6
- package/src/skia/core/RRect.tsx +5 -0
- package/src/skia/core/Rect.ts +33 -0
- package/src/skia/core/Vector.ts +11 -0
- package/src/skia/core/index.ts +5 -3
- package/src/skia/types/ContourMeasure.tsx +2 -4
- package/src/skia/types/Data/Data.ts +1 -1
- package/src/skia/types/Data/DataFactory.ts +4 -4
- package/src/skia/types/FontMgr/FontMgr.ts +1 -1
- package/src/skia/types/FontMgr/FontMgrFactory.ts +2 -2
- package/src/skia/types/Image/ImageFactory.ts +3 -3
- package/src/skia/types/Matrix.ts +79 -14
- package/src/skia/types/Path/Path.ts +34 -23
- package/src/skia/types/Path/PathFactory.ts +7 -0
- package/src/skia/types/Picture/Picture.ts +2 -2
- package/src/skia/types/Point.ts +2 -0
- package/src/skia/types/RRect.ts +5 -0
- package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +4 -2
- package/src/skia/types/SVG/SVGFactory.ts +2 -2
- package/src/skia/types/Shader/Shader.ts +61 -0
- package/src/skia/types/Skia.ts +1 -1
- package/src/skia/types/Typeface/TypefaceFactory.ts +2 -2
- package/src/skia/web/{api/Host.ts → Host.ts} +7 -1
- package/src/skia/web/JsiImageFilterFactory.ts +144 -0
- package/src/skia/web/{api/JsiSkCanvas.ts → JsiSkCanvas.ts} +19 -11
- package/src/skia/web/{api/JsiSkColor.ts → JsiSkColor.ts} +152 -6
- package/src/skia/web/{api/JsiSkColorFilter.ts → JsiSkColorFilter.ts} +1 -1
- package/src/skia/web/JsiSkColorFilterFactory.ts +67 -0
- package/src/skia/web/JsiSkContourMeasure.ts +35 -0
- package/src/skia/web/JsiSkContourMeasureIter.ts +23 -0
- package/src/skia/web/JsiSkData.ts +13 -0
- package/src/skia/web/JsiSkDataFactory.ts +35 -0
- package/src/skia/web/JsiSkFont.ts +124 -0
- package/src/skia/web/JsiSkFontMgr.ts +42 -0
- package/src/skia/web/JsiSkFontMgrFactory.ts +18 -0
- package/src/skia/web/{api/JsiSkImage.ts → JsiSkImage.ts} +1 -1
- package/src/skia/web/JsiSkImageFactory.ts +40 -0
- package/src/skia/web/JsiSkImageFilter.ts +14 -0
- package/src/skia/web/JsiSkMaskFilter.ts +14 -0
- package/src/skia/web/JsiSkMaskFilterFactory.ts +20 -0
- package/src/skia/web/JsiSkMatrix.ts +54 -0
- package/src/skia/web/{api/JsiSkPaint.ts → JsiSkPaint.ts} +6 -5
- package/src/skia/web/JsiSkPath.ts +369 -0
- package/src/skia/web/JsiSkPathEffect.ts +14 -0
- package/src/skia/web/JsiSkPathEffectFactory.ts +85 -0
- package/src/skia/web/JsiSkPathFactory.ts +54 -0
- package/src/skia/web/JsiSkPicture.ts +45 -0
- package/src/skia/web/JsiSkPictureFactory.ts +20 -0
- package/src/skia/web/JsiSkPictureRecorder.ts +31 -0
- package/src/skia/web/JsiSkPoint.ts +19 -0
- package/src/skia/web/JsiSkRRect.ts +27 -0
- package/src/skia/web/JsiSkRSXform.ts +16 -0
- package/src/skia/web/{api/JsiSkRect.ts → JsiSkRect.ts} +11 -1
- package/src/skia/web/JsiSkRuntimeEffect.ts +57 -0
- package/src/skia/web/JsiSkRuntimeEffectFactory.ts +23 -0
- package/src/skia/web/JsiSkSVGFactory.ts +20 -0
- package/src/skia/web/JsiSkShader.ts +14 -0
- package/src/skia/web/JsiSkShaderFactory.ts +178 -0
- package/src/skia/web/{api/JsiSkSurface.ts → JsiSkSurface.ts} +1 -1
- package/src/skia/web/{api/JsiSkSurfaceFactory.ts → JsiSkSurfaceFactory.ts} +1 -1
- package/src/skia/web/JsiSkTextBlob.ts +14 -0
- package/src/skia/web/JsiSkTextBlobFactory.ts +49 -0
- package/src/skia/web/JsiSkTypeface.ts +28 -0
- package/src/skia/web/JsiSkTypefaceFactory.tsx +20 -0
- package/src/skia/web/JsiSkVertices.ts +23 -0
- package/src/skia/web/JsiSkVerticesFactory.ts +27 -0
- package/src/skia/web/JsiSkia.ts +98 -0
- package/src/skia/web/index.ts +1 -1
- package/src/values/web/api.ts +2 -2
- package/src/views/SkiaView.web.tsx +192 -0
- package/src/views/types.ts +1 -0
- package/src/views/useTouchHandler.ts +82 -51
- package/src/web/index.ts +13 -0
- package/lib/commonjs/renderer/processors/math/Matrix3.js +0 -66
- package/lib/commonjs/renderer/processors/math/Matrix3.js.map +0 -1
- package/lib/commonjs/renderer/processors/math/Vector.js +0 -60
- package/lib/commonjs/renderer/processors/math/Vector.js.map +0 -1
- package/lib/commonjs/skia/core/Color.js.map +0 -1
- package/lib/commonjs/skia/core/Shader.js +0 -18
- package/lib/commonjs/skia/core/Shader.js.map +0 -1
- package/lib/commonjs/skia/web/api/Host.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkCanvas.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkColor.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkPaint.js.map +0 -1
- package/lib/commonjs/skia/web/api/JsiSkRect.js.map +0 -1
- package/lib/commonjs/skia/web/api/index.js +0 -26
- package/lib/commonjs/skia/web/api/index.js.map +0 -1
- package/lib/module/renderer/processors/math/Matrix3.js +0 -55
- package/lib/module/renderer/processors/math/Matrix3.js.map +0 -1
- package/lib/module/renderer/processors/math/Vector.js.map +0 -1
- package/lib/module/skia/core/Color.js.map +0 -1
- package/lib/module/skia/core/Shader.js +0 -7
- package/lib/module/skia/core/Shader.js.map +0 -1
- package/lib/module/skia/web/api/Host.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkCanvas.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkColor.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkPaint.js.map +0 -1
- package/lib/module/skia/web/api/JsiSkRect.js.map +0 -1
- package/lib/module/skia/web/api/index.js +0 -13
- package/lib/module/skia/web/api/index.js.map +0 -1
- package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +0 -10
- package/lib/typescript/src/renderer/processors/math/Vector.d.ts +0 -23
- package/lib/typescript/src/skia/core/Shader.d.ts +0 -1
- package/lib/typescript/src/skia/web/api/JsiSkColor.d.ts +0 -3
- package/lib/typescript/src/skia/web/api/index.d.ts +0 -10
- package/src/animation/timing/functions/__tests__/timing.spec.ts +0 -29
- package/src/renderer/processors/math/Matrix3.ts +0 -73
- package/src/renderer/processors/math/Vector.ts +0 -38
- package/src/skia/__tests__/Rects.spec.ts +0 -40
- package/src/skia/__tests__/snapshots/lightblue-rect.png +0 -0
- package/src/skia/core/Shader.ts +0 -9
- package/src/skia/web/api/index.ts +0 -15
- package/src/values/web/__tests__/RNSkAnimation.spec.ts +0 -21
- package/src/values/web/__tests__/RNSkDerivedValue.spec.ts +0 -15
- package/src/values/web/__tests__/RNSkReadonlyValue.spec.ts +0 -8
- package/src/values/web/__tests__/RNSkValue.spec.ts +0 -11
package/README.md
CHANGED
@@ -31,6 +31,14 @@ If the NDK is not installed, you can install it via Android Studio by going to t
|
|
31
31
|
|
32
32
|
And then the _SDK Location_ section. It will show you the NDK path, or the option to download it if you don't have it installed.
|
33
33
|
|
34
|
+
### Proguard
|
35
|
+
|
36
|
+
If you're using Proguard, make sure to add the following rule:
|
37
|
+
|
38
|
+
```
|
39
|
+
-keep class com.shopify.reactnative.skia.** { *; }
|
40
|
+
```
|
41
|
+
|
34
42
|
## Playground
|
35
43
|
|
36
44
|
We have an example project you can play with [here](https://github.com/Shopify/react-native-skia/tree/main/example).
|
@@ -76,14 +76,15 @@ namespace RNSkia
|
|
76
76
|
std::vector<RNSkia::RNSkTouchPoint> points;
|
77
77
|
auto pin = touches.pin();
|
78
78
|
auto scale = _drawView->getPixelDensity();
|
79
|
-
points.reserve(pin.size() /
|
80
|
-
for (size_t i = 0; i < pin.size(); i +=
|
79
|
+
points.reserve(pin.size() / 5);
|
80
|
+
for (size_t i = 0; i < pin.size(); i += 5)
|
81
81
|
{
|
82
82
|
RNSkTouchPoint point;
|
83
83
|
point.x = pin[i] / scale;
|
84
84
|
point.y = pin[i + 1] / scale;
|
85
85
|
point.force = pin[i + 2];
|
86
86
|
point.type = (RNSkia::RNSkTouchType)pin[i + 3];
|
87
|
+
point.id = pin[i + 4];
|
87
88
|
points.push_back(point);
|
88
89
|
}
|
89
90
|
_drawView->updateTouchState(std::move(points));
|
@@ -59,7 +59,7 @@ public class SkiaDrawView extends TextureView implements TextureView.SurfaceText
|
|
59
59
|
int action = ev.getAction();
|
60
60
|
int count = ev.getPointerCount();
|
61
61
|
MotionEvent.PointerCoords r = new MotionEvent.PointerCoords();
|
62
|
-
double[] points = new double[count*
|
62
|
+
double[] points = new double[count*5];
|
63
63
|
for (int i = 0; i < count; i++) {
|
64
64
|
ev.getPointerCoords(i, r);
|
65
65
|
points[i] = r.x;
|
@@ -81,6 +81,7 @@ public class SkiaDrawView extends TextureView implements TextureView.SurfaceText
|
|
81
81
|
points[i+3] = 3;
|
82
82
|
break;
|
83
83
|
}
|
84
|
+
points[i+4] = ev.getPointerId(i);
|
84
85
|
}
|
85
86
|
updateTouchPoints(points);
|
86
87
|
return true;
|
package/cpp/api/JsiSkCanvas.h
CHANGED
@@ -456,7 +456,7 @@ public:
|
|
456
456
|
}
|
457
457
|
|
458
458
|
JSI_HOST_FUNCTION(drawColor) {
|
459
|
-
SkColor cl = arguments[0]
|
459
|
+
SkColor cl = JsiSkColor::fromValue(runtime, arguments[0]);
|
460
460
|
if (count == 1) {
|
461
461
|
_canvas->drawColor(cl);
|
462
462
|
} else {
|
@@ -467,7 +467,7 @@ public:
|
|
467
467
|
}
|
468
468
|
|
469
469
|
JSI_HOST_FUNCTION(clear) {
|
470
|
-
SkColor cl = arguments[0]
|
470
|
+
SkColor cl = JsiSkColor::fromValue(runtime, arguments[0]);
|
471
471
|
_canvas->clear(cl);
|
472
472
|
return jsi::Value::undefined();
|
473
473
|
}
|
package/cpp/api/JsiSkMatrix.h
CHANGED
@@ -18,6 +18,7 @@ namespace RNSkia {
|
|
18
18
|
|
19
19
|
using namespace facebook;
|
20
20
|
|
21
|
+
|
21
22
|
class JsiSkMatrix : public JsiSkWrappingSharedPtrHostObject<SkMatrix> {
|
22
23
|
public:
|
23
24
|
|
@@ -26,45 +27,64 @@ public:
|
|
26
27
|
context, std::make_shared<SkMatrix>(std::move(m))) {}
|
27
28
|
|
28
29
|
|
29
|
-
|
30
|
+
static SkMatrix getMatrix(jsi::Runtime &runtime, const jsi::Value& value) {
|
31
|
+
const auto& object = value.asObject(runtime);
|
32
|
+
const auto& array = object.asArray(runtime);
|
33
|
+
auto scaleX = array.getValueAtIndex(runtime, 0).asNumber();
|
34
|
+
auto skewX = array.getValueAtIndex(runtime, 1).asNumber();
|
35
|
+
auto transX = array.getValueAtIndex(runtime, 2).asNumber();
|
36
|
+
auto skewY = array.getValueAtIndex(runtime, 3).asNumber();
|
37
|
+
auto scaleY = array.getValueAtIndex(runtime, 4).asNumber();
|
38
|
+
auto transY = array.getValueAtIndex(runtime, 5).asNumber();
|
39
|
+
auto pers0 = array.getValueAtIndex(runtime, 6).asNumber();
|
40
|
+
auto pers1 = array.getValueAtIndex(runtime, 7).asNumber();
|
41
|
+
auto pers2 = array.getValueAtIndex(runtime, 8).asNumber();
|
42
|
+
return SkMatrix::MakeAll(
|
43
|
+
scaleX, skewX, transX,
|
44
|
+
skewY, scaleY, transY,
|
45
|
+
pers0, pers1, pers2
|
46
|
+
);
|
47
|
+
}
|
48
|
+
|
49
|
+
JSI_HOST_FUNCTION(concat) {
|
30
50
|
auto m3 = JsiSkMatrix::fromValue(runtime, arguments[0]);
|
31
51
|
getObject()->preConcat(*m3);
|
32
52
|
return jsi::Value::undefined();
|
33
53
|
}
|
34
54
|
|
35
|
-
JSI_HOST_FUNCTION(
|
55
|
+
JSI_HOST_FUNCTION(translate) {
|
36
56
|
auto x = arguments[0].asNumber();
|
37
57
|
auto y = arguments[1].asNumber();
|
38
58
|
getObject()->preTranslate(x, y);
|
39
59
|
return jsi::Value::undefined();
|
40
60
|
}
|
41
61
|
|
42
|
-
JSI_HOST_FUNCTION(
|
62
|
+
JSI_HOST_FUNCTION(scale) {
|
43
63
|
auto x = arguments[0].asNumber();
|
44
|
-
auto y = arguments[1].asNumber();
|
64
|
+
auto y = count > 1 ? arguments[1].asNumber() : 1;
|
45
65
|
getObject()->preScale(x, y);
|
46
66
|
return jsi::Value::undefined();
|
47
67
|
}
|
48
68
|
|
49
|
-
JSI_HOST_FUNCTION(
|
69
|
+
JSI_HOST_FUNCTION(skew) {
|
50
70
|
auto x = arguments[0].asNumber();
|
51
71
|
auto y = arguments[1].asNumber();
|
52
72
|
getObject()->preSkew(x, y);
|
53
73
|
return jsi::Value::undefined();
|
54
74
|
}
|
55
75
|
|
56
|
-
JSI_HOST_FUNCTION(
|
76
|
+
JSI_HOST_FUNCTION(rotate) {
|
57
77
|
auto a = arguments[0].asNumber();
|
58
|
-
getObject()->preRotate(a);
|
78
|
+
getObject()->preRotate(SkRadiansToDegrees(a));
|
59
79
|
return jsi::Value::undefined();
|
60
80
|
}
|
61
81
|
|
62
82
|
JSI_EXPORT_FUNCTIONS(
|
63
|
-
JSI_EXPORT_FUNC(JsiSkMatrix,
|
64
|
-
JSI_EXPORT_FUNC(JsiSkMatrix,
|
65
|
-
JSI_EXPORT_FUNC(JsiSkMatrix,
|
66
|
-
JSI_EXPORT_FUNC(JsiSkMatrix,
|
67
|
-
JSI_EXPORT_FUNC(JsiSkMatrix,
|
83
|
+
JSI_EXPORT_FUNC(JsiSkMatrix, concat),
|
84
|
+
JSI_EXPORT_FUNC(JsiSkMatrix, translate),
|
85
|
+
JSI_EXPORT_FUNC(JsiSkMatrix, scale),
|
86
|
+
JSI_EXPORT_FUNC(JsiSkMatrix, skew),
|
87
|
+
JSI_EXPORT_FUNC(JsiSkMatrix, rotate),
|
68
88
|
)
|
69
89
|
|
70
90
|
/**
|
@@ -78,28 +98,21 @@ public:
|
|
78
98
|
.asHostObject<JsiSkMatrix>(runtime)
|
79
99
|
->getObject();
|
80
100
|
} else {
|
81
|
-
|
82
|
-
auto scaleX = array.getValueAtIndex(runtime, 0).asNumber();
|
83
|
-
auto skewX = array.getValueAtIndex(runtime, 1).asNumber();
|
84
|
-
auto transX = array.getValueAtIndex(runtime, 2).asNumber();
|
85
|
-
auto skewY = array.getValueAtIndex(runtime, 3).asNumber();
|
86
|
-
auto scaleY = array.getValueAtIndex(runtime, 4).asNumber();
|
87
|
-
auto transY = array.getValueAtIndex(runtime, 5).asNumber();
|
88
|
-
auto pers0 = array.getValueAtIndex(runtime, 6).asNumber();
|
89
|
-
auto pers1 = array.getValueAtIndex(runtime, 7).asNumber();
|
90
|
-
auto pers2 = array.getValueAtIndex(runtime, 8).asNumber();
|
91
|
-
return std::make_shared<SkMatrix>(SkMatrix::MakeAll(
|
92
|
-
scaleX, skewX, transX,
|
93
|
-
skewY, scaleY, transY,
|
94
|
-
pers0, pers1, pers2));
|
101
|
+
return std::make_shared<SkMatrix>(JsiSkMatrix::getMatrix(runtime, obj));
|
95
102
|
}
|
96
103
|
}
|
97
104
|
|
98
105
|
static const jsi::HostFunctionType
|
99
106
|
createCtor(std::shared_ptr<RNSkPlatformContext> context) {
|
100
107
|
return JSI_HOST_FUNCTION_LAMBDA {
|
108
|
+
SkMatrix matrix;
|
109
|
+
if (count == 1) {
|
110
|
+
matrix = JsiSkMatrix::getMatrix(runtime, arguments[0]);
|
111
|
+
} else {
|
112
|
+
matrix = SkMatrix::I();
|
113
|
+
}
|
101
114
|
return jsi::Object::createFromHostObject(
|
102
|
-
runtime, std::make_shared<JsiSkMatrix>(std::move(context),
|
115
|
+
runtime, std::make_shared<JsiSkMatrix>(std::move(context), matrix));
|
103
116
|
};
|
104
117
|
}
|
105
118
|
};
|
package/cpp/api/JsiSkPaint.h
CHANGED
@@ -215,9 +215,11 @@ Returns the underlying object from a host object of this type
|
|
215
215
|
static const jsi::HostFunctionType
|
216
216
|
createCtor(std::shared_ptr<RNSkPlatformContext> context) {
|
217
217
|
return JSI_HOST_FUNCTION_LAMBDA {
|
218
|
+
auto paint = SkPaint();
|
219
|
+
paint.setAntiAlias(true);
|
218
220
|
// Return the newly constructed object
|
219
221
|
return jsi::Object::createFromHostObject(
|
220
|
-
runtime, std::make_shared<JsiSkPaint>(std::move(context),
|
222
|
+
runtime, std::make_shared<JsiSkPaint>(std::move(context), paint));
|
221
223
|
};
|
222
224
|
}
|
223
225
|
};
|
package/cpp/api/JsiSkPath.h
CHANGED
@@ -31,18 +31,19 @@ using namespace facebook;
|
|
31
31
|
|
32
32
|
|
33
33
|
class JsiSkPath : public JsiSkWrappingSharedPtrHostObject<SkPath> {
|
34
|
+
|
34
35
|
public:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
// TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
|
37
|
+
JSI_PROPERTY_GET(__typename__) {
|
38
|
+
return jsi::String::createFromUtf8(runtime, "Path");
|
39
|
+
}
|
39
40
|
|
40
|
-
|
41
|
+
JSI_HOST_FUNCTION(addArc) {
|
41
42
|
auto rect = JsiSkRect::fromValue(runtime, arguments[0]).get();
|
42
43
|
auto start = arguments[1].asNumber();
|
43
44
|
auto sweep = arguments[2].asNumber();
|
44
45
|
getObject()->addArc(*rect, start, sweep);
|
45
|
-
return
|
46
|
+
return thisValue.getObject(runtime);
|
46
47
|
}
|
47
48
|
|
48
49
|
JSI_HOST_FUNCTION(addOval) {
|
@@ -52,8 +53,8 @@ public:
|
|
52
53
|
direction = SkPathDirection::kCCW;
|
53
54
|
}
|
54
55
|
unsigned startIndex = count < 3 ? 0 : arguments[2].asNumber();
|
55
|
-
getObject()->addOval(*rect, direction, startIndex);
|
56
|
-
return
|
56
|
+
auto result = getObject()->addOval(*rect, direction, startIndex);
|
57
|
+
return thisValue.getObject(runtime);
|
57
58
|
}
|
58
59
|
|
59
60
|
JSI_HOST_FUNCTION(addPoly) {
|
@@ -68,7 +69,7 @@ public:
|
|
68
69
|
points.push_back(*point.get());
|
69
70
|
}
|
70
71
|
getObject()->addPoly(points.data(), (int)points.size(), close);
|
71
|
-
return
|
72
|
+
return thisValue.getObject(runtime);
|
72
73
|
}
|
73
74
|
|
74
75
|
JSI_HOST_FUNCTION(addRect) {
|
@@ -88,7 +89,7 @@ public:
|
|
88
89
|
direction = SkPathDirection::kCCW;
|
89
90
|
}
|
90
91
|
getObject()->addRRect(*rrect, direction);
|
91
|
-
return
|
92
|
+
return thisValue.getObject(runtime);
|
92
93
|
}
|
93
94
|
|
94
95
|
JSI_HOST_FUNCTION(arcToOval) {
|
@@ -97,7 +98,7 @@ public:
|
|
97
98
|
auto sweep = arguments[2].asNumber();
|
98
99
|
auto forceMoveTo = arguments[3].getBool();
|
99
100
|
getObject()->arcTo(*rect, start, sweep, forceMoveTo);
|
100
|
-
return
|
101
|
+
return thisValue.getObject(runtime);
|
101
102
|
}
|
102
103
|
|
103
104
|
JSI_HOST_FUNCTION(arcToRotated) {
|
@@ -112,7 +113,7 @@ public:
|
|
112
113
|
auto x = arguments[5].asNumber();
|
113
114
|
auto y = arguments[6].asNumber();
|
114
115
|
getObject()->arcTo(rx, ry, xAxisRotate, arcSize, sweep, x, y);
|
115
|
-
return
|
116
|
+
return thisValue.getObject(runtime);
|
116
117
|
}
|
117
118
|
|
118
119
|
JSI_HOST_FUNCTION(rArcTo) {
|
@@ -127,7 +128,7 @@ public:
|
|
127
128
|
auto x = arguments[5].asNumber();
|
128
129
|
auto y = arguments[6].asNumber();
|
129
130
|
getObject()->rArcTo(rx, ry, xAxisRotate, arcSize, sweep, x, y);
|
130
|
-
return
|
131
|
+
return thisValue.getObject(runtime);
|
131
132
|
}
|
132
133
|
|
133
134
|
JSI_HOST_FUNCTION(arcToTangent) {
|
@@ -137,7 +138,7 @@ public:
|
|
137
138
|
auto y2 = arguments[3].asNumber();
|
138
139
|
auto r = arguments[4].asNumber();
|
139
140
|
getObject()->arcTo(x1, y1, x2, y2, r);
|
140
|
-
return
|
141
|
+
return thisValue.getObject(runtime);
|
141
142
|
}
|
142
143
|
|
143
144
|
JSI_HOST_FUNCTION(computeTightBounds) {
|
@@ -160,7 +161,7 @@ public:
|
|
160
161
|
auto y2 = arguments[3].asNumber();
|
161
162
|
auto w = arguments[4].asNumber();
|
162
163
|
getObject()->conicTo(x1, y1, x2, y2, w);
|
163
|
-
return
|
164
|
+
return thisValue.getObject(runtime);
|
164
165
|
}
|
165
166
|
|
166
167
|
JSI_HOST_FUNCTION(rConicTo) {
|
@@ -170,7 +171,7 @@ public:
|
|
170
171
|
auto y2 = arguments[3].asNumber();
|
171
172
|
auto w = arguments[4].asNumber();
|
172
173
|
getObject()->rConicTo(x1, y1, x2, y2, w);
|
173
|
-
return
|
174
|
+
return thisValue.getObject(runtime);
|
174
175
|
}
|
175
176
|
|
176
177
|
JSI_HOST_FUNCTION(contains) {
|
@@ -270,7 +271,7 @@ public:
|
|
270
271
|
auto precision = jsiPrecision.isUndefined() ? 1 : jsiPrecision.asNumber();
|
271
272
|
auto result = p.getFillPath(path, &path, nullptr, precision);
|
272
273
|
getObject()->swap(path);
|
273
|
-
return jsi::Value(
|
274
|
+
return result ? thisValue.getObject(runtime) : jsi::Value::null();
|
274
275
|
}
|
275
276
|
|
276
277
|
JSI_HOST_FUNCTION(trim) {
|
@@ -284,15 +285,15 @@ public:
|
|
284
285
|
if (!pe) {
|
285
286
|
// SkDebugf("Invalid args to trim(): startT and stopT must be in
|
286
287
|
// [0,1]\n");
|
287
|
-
return jsi::Value(
|
288
|
+
return jsi::Value::null();
|
288
289
|
}
|
289
290
|
SkStrokeRec rec(SkStrokeRec::InitStyle::kHairline_InitStyle);
|
290
291
|
if (pe->filterPath(&path, path, &rec, nullptr)) {
|
291
292
|
getObject()->swap(path);
|
292
|
-
return
|
293
|
+
return thisValue.getObject(runtime);
|
293
294
|
}
|
294
295
|
SkDebugf("Could not trim path\n");
|
295
|
-
return jsi::Value(
|
296
|
+
return jsi::Value::null();
|
296
297
|
}
|
297
298
|
|
298
299
|
JSI_HOST_FUNCTION(getPoint) {
|
@@ -312,8 +313,8 @@ public:
|
|
312
313
|
JSI_HOST_FUNCTION(makeAsWinding) {
|
313
314
|
SkPath out;
|
314
315
|
if (AsWinding(*getObject(), &out)) {
|
315
|
-
|
316
|
-
|
316
|
+
getObject()->swap(out);
|
317
|
+
return thisValue.getObject(runtime);
|
317
318
|
}
|
318
319
|
return jsi::Value::null();
|
319
320
|
}
|
@@ -324,34 +325,34 @@ public:
|
|
324
325
|
SkScalar dx = arguments[0].asNumber();
|
325
326
|
SkScalar dy = arguments[1].asNumber();
|
326
327
|
getObject()->offset(dx, dy);
|
327
|
-
return
|
328
|
+
return thisValue.getObject(runtime);
|
328
329
|
}
|
329
330
|
|
330
331
|
JSI_HOST_FUNCTION(moveTo) {
|
331
332
|
SkScalar x = arguments[0].asNumber();
|
332
333
|
SkScalar y = arguments[1].asNumber();
|
333
334
|
getObject()->moveTo(x, y);
|
334
|
-
return
|
335
|
+
return thisValue.getObject(runtime);
|
335
336
|
}
|
336
337
|
|
337
338
|
JSI_HOST_FUNCTION(rMoveTo) {
|
338
339
|
SkScalar x = arguments[0].asNumber();
|
339
340
|
SkScalar y = arguments[1].asNumber();
|
340
341
|
getObject()->rMoveTo(x, y);
|
341
|
-
return
|
342
|
+
return thisValue.getObject(runtime);
|
342
343
|
}
|
343
344
|
JSI_HOST_FUNCTION(lineTo) {
|
344
345
|
SkScalar x = arguments[0].asNumber();
|
345
346
|
SkScalar y = arguments[1].asNumber();
|
346
347
|
getObject()->lineTo(x, y);
|
347
|
-
return
|
348
|
+
return thisValue.getObject(runtime);
|
348
349
|
}
|
349
350
|
|
350
351
|
JSI_HOST_FUNCTION(rlineTo) {
|
351
352
|
SkScalar x = arguments[0].asNumber();
|
352
353
|
SkScalar y = arguments[1].asNumber();
|
353
354
|
getObject()->rLineTo(x, y);
|
354
|
-
return
|
355
|
+
return thisValue.getObject(runtime);
|
355
356
|
}
|
356
357
|
|
357
358
|
JSI_HOST_FUNCTION(cubicTo) {
|
@@ -362,7 +363,7 @@ public:
|
|
362
363
|
auto x3 = arguments[4].asNumber();
|
363
364
|
auto y3 = arguments[5].asNumber();
|
364
365
|
getObject()->cubicTo(x1, y1, x2, y2, x3, y3);
|
365
|
-
return
|
366
|
+
return thisValue.getObject(runtime);
|
366
367
|
}
|
367
368
|
|
368
369
|
JSI_HOST_FUNCTION(rCubicTo) {
|
@@ -373,7 +374,7 @@ public:
|
|
373
374
|
auto x3 = arguments[4].asNumber();
|
374
375
|
auto y3 = arguments[5].asNumber();
|
375
376
|
getObject()->rCubicTo(x1, y1, x2, y2, x3, y3);
|
376
|
-
return
|
377
|
+
return thisValue.getObject(runtime);
|
377
378
|
}
|
378
379
|
|
379
380
|
JSI_HOST_FUNCTION(reset) {
|
@@ -401,7 +402,7 @@ public:
|
|
401
402
|
auto x2 = arguments[2].asNumber();
|
402
403
|
auto y2 = arguments[3].asNumber();
|
403
404
|
getObject()->rQuadTo(x1, y1, x2, y2);
|
404
|
-
return
|
405
|
+
return thisValue.getObject(runtime);
|
405
406
|
}
|
406
407
|
|
407
408
|
JSI_HOST_FUNCTION(addCircle) {
|
@@ -409,7 +410,7 @@ public:
|
|
409
410
|
auto y = arguments[1].asNumber();
|
410
411
|
auto r = arguments[2].asNumber();
|
411
412
|
getObject()->addCircle(x, y, r);
|
412
|
-
return
|
413
|
+
return thisValue.getObject(runtime);
|
413
414
|
}
|
414
415
|
|
415
416
|
JSI_HOST_FUNCTION(getLastPt) {
|
@@ -446,19 +447,6 @@ public:
|
|
446
447
|
runtime, std::make_shared<JsiSkPath>(getContext(), SkPath(*path)));
|
447
448
|
}
|
448
449
|
|
449
|
-
JSI_HOST_FUNCTION(fromText) {
|
450
|
-
auto text = arguments[0].asString(runtime).utf8(runtime);
|
451
|
-
auto x = arguments[1].asNumber();
|
452
|
-
auto y = arguments[2].asNumber();
|
453
|
-
auto font = JsiSkFont::fromValue(runtime, arguments[3]);
|
454
|
-
SkPath result;
|
455
|
-
SkTextUtils::GetPath(text.c_str(), strlen(text.c_str()),
|
456
|
-
SkTextEncoding::kUTF8, x, y, *font, &result);
|
457
|
-
|
458
|
-
getObject()->swap(result);
|
459
|
-
return jsi::Value::undefined();
|
460
|
-
}
|
461
|
-
|
462
450
|
JSI_HOST_FUNCTION(op) {
|
463
451
|
auto path2 = JsiSkPath::fromValue(runtime, arguments[0]);
|
464
452
|
int pathOp = arguments[1].asNumber();
|
@@ -479,7 +467,10 @@ public:
|
|
479
467
|
auto path2 = JsiSkPath::fromValue(runtime, arguments[0]);
|
480
468
|
auto weight = arguments[1].asNumber();
|
481
469
|
SkPath result;
|
482
|
-
getObject()->interpolate(*path2, weight, &result);
|
470
|
+
auto succeed = getObject()->interpolate(*path2, weight, &result);
|
471
|
+
if (!succeed) {
|
472
|
+
return nullptr;
|
473
|
+
}
|
483
474
|
return jsi::Object::createFromHostObject(
|
484
475
|
runtime, std::make_shared<JsiSkPath>(getContext(), std::move(result)));
|
485
476
|
}
|
@@ -514,8 +505,10 @@ public:
|
|
514
505
|
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPath, __typename__))
|
515
506
|
|
516
507
|
JSI_EXPORT_FUNCTIONS(
|
517
|
-
JSI_EXPORT_FUNC(JsiSkPath, addArc),
|
518
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
508
|
+
JSI_EXPORT_FUNC(JsiSkPath, addArc),
|
509
|
+
JSI_EXPORT_FUNC(JsiSkPath, addOval),
|
510
|
+
JSI_EXPORT_FUNC(JsiSkPath, addPoly),
|
511
|
+
JSI_EXPORT_FUNC(JsiSkPath, addRect),
|
519
512
|
JSI_EXPORT_FUNC(JsiSkPath, addRRect),
|
520
513
|
JSI_EXPORT_FUNC(JsiSkPath, arcToOval),
|
521
514
|
JSI_EXPORT_FUNC(JsiSkPath, arcToRotated),
|
@@ -523,28 +516,40 @@ public:
|
|
523
516
|
JSI_EXPORT_FUNC(JsiSkPath, arcToTangent),
|
524
517
|
JSI_EXPORT_FUNC(JsiSkPath, computeTightBounds),
|
525
518
|
JSI_EXPORT_FUNC(JsiSkPath, getBounds),
|
526
|
-
JSI_EXPORT_FUNC(JsiSkPath, conicTo),
|
527
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
519
|
+
JSI_EXPORT_FUNC(JsiSkPath, conicTo),
|
520
|
+
JSI_EXPORT_FUNC(JsiSkPath, rConicTo),
|
521
|
+
JSI_EXPORT_FUNC(JsiSkPath, contains),
|
522
|
+
JSI_EXPORT_FUNC(JsiSkPath, dash),
|
528
523
|
JSI_EXPORT_FUNC(JsiSkPath, equals),
|
529
524
|
JSI_EXPORT_FUNC(JsiSkPath, getFillType),
|
530
525
|
JSI_EXPORT_FUNC(JsiSkPath, setFillType),
|
531
526
|
JSI_EXPORT_FUNC(JsiSkPath, setIsVolatile),
|
532
527
|
JSI_EXPORT_FUNC(JsiSkPath, isVolatile),
|
533
|
-
JSI_EXPORT_FUNC(JsiSkPath, transform),
|
534
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
528
|
+
JSI_EXPORT_FUNC(JsiSkPath, transform),
|
529
|
+
JSI_EXPORT_FUNC(JsiSkPath, stroke),
|
530
|
+
JSI_EXPORT_FUNC(JsiSkPath, trim),
|
531
|
+
JSI_EXPORT_FUNC(JsiSkPath, getPoint),
|
535
532
|
JSI_EXPORT_FUNC(JsiSkPath, toSVGString),
|
536
533
|
JSI_EXPORT_FUNC(JsiSkPath, makeAsWinding),
|
537
|
-
JSI_EXPORT_FUNC(JsiSkPath, isEmpty),
|
538
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
539
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
540
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
541
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
542
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
534
|
+
JSI_EXPORT_FUNC(JsiSkPath, isEmpty),
|
535
|
+
JSI_EXPORT_FUNC(JsiSkPath, offset),
|
536
|
+
JSI_EXPORT_FUNC(JsiSkPath, moveTo),
|
537
|
+
JSI_EXPORT_FUNC(JsiSkPath, rMoveTo),
|
538
|
+
JSI_EXPORT_FUNC(JsiSkPath, lineTo),
|
539
|
+
JSI_EXPORT_FUNC(JsiSkPath, rlineTo),
|
540
|
+
JSI_EXPORT_FUNC(JsiSkPath, cubicTo),
|
541
|
+
JSI_EXPORT_FUNC(JsiSkPath, rCubicTo),
|
542
|
+
JSI_EXPORT_FUNC(JsiSkPath, reset),
|
543
|
+
JSI_EXPORT_FUNC(JsiSkPath, rewind),
|
544
|
+
JSI_EXPORT_FUNC(JsiSkPath, quadTo),
|
545
|
+
JSI_EXPORT_FUNC(JsiSkPath, rQuadTo),
|
543
546
|
JSI_EXPORT_FUNC(JsiSkPath, addCircle),
|
544
|
-
JSI_EXPORT_FUNC(JsiSkPath, getLastPt),
|
547
|
+
JSI_EXPORT_FUNC(JsiSkPath, getLastPt),
|
548
|
+
JSI_EXPORT_FUNC(JsiSkPath, close),
|
545
549
|
JSI_EXPORT_FUNC(JsiSkPath, simplify),
|
546
|
-
JSI_EXPORT_FUNC(JsiSkPath, countPoints),
|
547
|
-
JSI_EXPORT_FUNC(JsiSkPath,
|
550
|
+
JSI_EXPORT_FUNC(JsiSkPath, countPoints),
|
551
|
+
JSI_EXPORT_FUNC(JsiSkPath, copy),
|
552
|
+
JSI_EXPORT_FUNC(JsiSkPath, op),
|
548
553
|
JSI_EXPORT_FUNC(JsiSkPath, isInterpolatable),
|
549
554
|
JSI_EXPORT_FUNC(JsiSkPath, interpolate),
|
550
555
|
JSI_EXPORT_FUNC(JsiSkPath, toCmds),
|
@@ -552,7 +557,8 @@ public:
|
|
552
557
|
|
553
558
|
JsiSkPath(std::shared_ptr<RNSkPlatformContext> context, SkPath path)
|
554
559
|
: JsiSkWrappingSharedPtrHostObject<SkPath>(
|
555
|
-
std::move(context), std::make_shared<SkPath>(std::move(path))){
|
560
|
+
std::move(context), std::make_shared<SkPath>(std::move(path))) {
|
561
|
+
}
|
556
562
|
|
557
563
|
/**
|
558
564
|
Returns the underlying object from a host object of this type
|
@@ -147,10 +147,23 @@ public:
|
|
147
147
|
runtime, std::make_shared<JsiSkPath>(getContext(), std::move(path)));
|
148
148
|
}
|
149
149
|
|
150
|
+
JSI_HOST_FUNCTION(MakeFromText) {
|
151
|
+
auto text = arguments[0].asString(runtime).utf8(runtime);
|
152
|
+
auto x = arguments[1].asNumber();
|
153
|
+
auto y = arguments[2].asNumber();
|
154
|
+
auto font = JsiSkFont::fromValue(runtime, arguments[3]);
|
155
|
+
SkPath path;
|
156
|
+
SkTextUtils::GetPath(text.c_str(), strlen(text.c_str()),
|
157
|
+
SkTextEncoding::kUTF8, x, y, *font, &path);
|
158
|
+
return jsi::Object::createFromHostObject(
|
159
|
+
runtime, std::make_shared<JsiSkPath>(getContext(), std::move(path)));;
|
160
|
+
}
|
161
|
+
|
150
162
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPathFactory, Make),
|
151
163
|
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromSVGString),
|
152
164
|
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromOp),
|
153
|
-
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromCmds)
|
165
|
+
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromCmds),
|
166
|
+
JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromText))
|
154
167
|
|
155
168
|
JsiSkPathFactory(std::shared_ptr<RNSkPlatformContext> context)
|
156
169
|
: JsiSkHostObject(std::move(context)) {}
|
@@ -29,6 +29,24 @@ namespace RNSkia {
|
|
29
29
|
: JsiSkWrappingSharedPtrHostObject<SkRuntimeShaderBuilder>(
|
30
30
|
std::move(context), std::make_shared<SkRuntimeShaderBuilder>(rt)){}
|
31
31
|
|
32
|
+
JSI_HOST_FUNCTION(setUniform) {
|
33
|
+
auto name = arguments[0].asString(runtime).utf8(runtime);
|
34
|
+
auto jsiValue = arguments[1].asObject(runtime).asArray(runtime);
|
35
|
+
auto size = jsiValue.size(runtime);
|
36
|
+
std::vector<SkScalar> value;
|
37
|
+
value.reserve(size);
|
38
|
+
for (int i = 0; i < size; i++) {
|
39
|
+
auto e = jsiValue.getValueAtIndex(runtime, i).asNumber();
|
40
|
+
value.push_back(e);
|
41
|
+
}
|
42
|
+
getObject()->uniform(name.c_str()).set(value.data(), static_cast<int>(size));
|
43
|
+
return jsi::Value::undefined();
|
44
|
+
}
|
45
|
+
|
46
|
+
JSI_EXPORT_FUNCTIONS(
|
47
|
+
JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, setUniform)
|
48
|
+
)
|
49
|
+
|
32
50
|
/**
|
33
51
|
Returns the underlying object from a host object of this type
|
34
52
|
*/
|
package/cpp/api/JsiSkTypeface.h
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
#include <jsi/jsi.h>
|
7
7
|
|
8
8
|
#include "JsiSkHostObjects.h"
|
9
|
+
#include <RNSkLog.h>
|
9
10
|
|
10
11
|
#pragma clang diagnostic push
|
11
12
|
#pragma clang diagnostic ignored "-Wdocumentation"
|
@@ -21,8 +22,16 @@ using namespace facebook;
|
|
21
22
|
|
22
23
|
class JsiSkTypeface : public JsiSkWrappingSkPtrHostObject<SkTypeface> {
|
23
24
|
public:
|
24
|
-
JSI_PROPERTY_GET(bold) {
|
25
|
-
|
25
|
+
JSI_PROPERTY_GET(bold) {
|
26
|
+
RNSkLogger::warnToJavascriptConsole(runtime, "Typeface.bold is deprecated and will be removed in a future release.");
|
27
|
+
return jsi::Value(getObject()->isBold());
|
28
|
+
}
|
29
|
+
|
30
|
+
JSI_PROPERTY_GET(italic) {
|
31
|
+
RNSkLogger::warnToJavascriptConsole(runtime, "Typeface.italic is deprecated and will be removed in a future release.");
|
32
|
+
return jsi::Value(getObject()->isItalic());
|
33
|
+
}
|
34
|
+
|
26
35
|
// TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
|
27
36
|
JSI_PROPERTY_GET(__typename__) {
|
28
37
|
return jsi::String::createFromUtf8(runtime, "Typeface");
|
@@ -17,8 +17,12 @@ namespace RNSkia {
|
|
17
17
|
public:
|
18
18
|
JSI_HOST_FUNCTION(MakeFreeTypeFaceFromData) {
|
19
19
|
auto data = JsiSkData::fromValue(runtime, arguments[0]);
|
20
|
+
auto typeface = SkFontMgr::RefDefault()->makeFromData(std::move(data));
|
21
|
+
if(typeface == nullptr) {
|
22
|
+
return jsi::Value::null();
|
23
|
+
}
|
20
24
|
return jsi::Object::createFromHostObject(
|
21
|
-
runtime, std::make_shared<JsiSkTypeface>(getContext(),
|
25
|
+
runtime, std::make_shared<JsiSkTypeface>(getContext(), typeface));
|
22
26
|
}
|
23
27
|
|
24
28
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkTypefaceFactory, MakeFreeTypeFaceFromData))
|
@@ -23,6 +23,7 @@ using RNSkTouchPoint = struct {
|
|
23
23
|
double y;
|
24
24
|
double force;
|
25
25
|
RNSkTouchType type;
|
26
|
+
size_t id;
|
26
27
|
long timestamp;
|
27
28
|
};
|
28
29
|
|
@@ -45,6 +46,7 @@ public:
|
|
45
46
|
touchObj.setProperty(runtime, "force", t.force);
|
46
47
|
touchObj.setProperty(runtime, "type", (double)t.type);
|
47
48
|
touchObj.setProperty(runtime, "timestamp", (double)t.timestamp / 1000.0);
|
49
|
+
touchObj.setProperty(runtime, "id", (double)t.id);
|
48
50
|
touches.setValueAtIndex(runtime, n, touchObj);
|
49
51
|
}
|
50
52
|
ops.setValueAtIndex(runtime, i, touches);
|
package/cpp/utils/RNSkLog.h
CHANGED
@@ -49,5 +49,27 @@ public:
|
|
49
49
|
#endif
|
50
50
|
va_end(args);
|
51
51
|
}
|
52
|
+
|
53
|
+
static void logToJavascriptConsole(jsi::Runtime& runtime, const std::string& message) {
|
54
|
+
auto console = RNSkLogger::getJavascriptConsole(runtime).asObject(runtime);
|
55
|
+
auto log = console.getPropertyAsFunction(runtime, "log");
|
56
|
+
log.call(runtime, jsi::String::createFromUtf8(runtime, message));
|
57
|
+
}
|
58
|
+
|
59
|
+
static void warnToJavascriptConsole(jsi::Runtime& runtime, const std::string& message) {
|
60
|
+
auto console = RNSkLogger::getJavascriptConsole(runtime).asObject(runtime);
|
61
|
+
auto warn = console.getPropertyAsFunction(runtime, "warn");
|
62
|
+
warn.call(runtime, jsi::String::createFromUtf8(runtime, message));
|
63
|
+
}
|
64
|
+
|
65
|
+
private:
|
66
|
+
static jsi::Value getJavascriptConsole(jsi::Runtime& runtime) {
|
67
|
+
auto console = runtime.global().getProperty(runtime, "console");
|
68
|
+
if(console.isUndefined() || console.isNull()) {
|
69
|
+
jsi::detail::throwJSError(runtime, "Could not find console object.");
|
70
|
+
return jsi::Value::undefined();
|
71
|
+
}
|
72
|
+
return console;
|
73
|
+
}
|
52
74
|
};
|
53
75
|
} // namespace RNSkia
|