@shopify/react-native-skia 0.1.171 → 0.1.173
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +1 -0
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +5 -0
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +106 -5
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +3 -1
- package/cpp/api/JsiSkSurface.h +7 -1
- package/cpp/api/JsiSkSurfaceFactory.h +15 -2
- package/cpp/rnskia/RNSkDomView.cpp +2 -4
- package/cpp/rnskia/RNSkJsView.cpp +3 -0
- package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
- package/cpp/rnskia/RNSkPictureView.h +3 -0
- package/cpp/rnskia/RNSkPlatformContext.h +9 -0
- package/cpp/rnskia/dom/JsiDomApi.h +1 -0
- package/cpp/rnskia/dom/base/ConcatablePaint.cpp +117 -0
- package/cpp/rnskia/dom/base/ConcatablePaint.h +49 -0
- package/cpp/rnskia/dom/base/Declaration.h +88 -0
- package/cpp/rnskia/dom/base/DeclarationContext.h +79 -0
- package/cpp/rnskia/dom/base/DerivedNodeProp.h +25 -9
- package/cpp/rnskia/dom/base/DrawingContext.cpp +32 -186
- package/cpp/rnskia/dom/base/DrawingContext.h +45 -64
- package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +35 -106
- package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +28 -9
- package/cpp/rnskia/dom/base/JsiDomNode.h +46 -17
- package/cpp/rnskia/dom/base/JsiDomRenderNode.h +81 -67
- package/cpp/rnskia/dom/base/NodeProp.h +12 -2
- package/cpp/rnskia/dom/base/NodePropsContainer.h +15 -16
- package/cpp/rnskia/dom/nodes/JsiBackdropFilterNode.h +22 -11
- package/cpp/rnskia/dom/nodes/JsiBlendNode.h +43 -59
- package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +16 -17
- package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +6 -5
- package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +45 -69
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +8 -1
- package/cpp/rnskia/dom/nodes/JsiGroupNode.h +1 -1
- package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +121 -161
- package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -0
- package/cpp/rnskia/dom/nodes/JsiLayerNode.h +28 -18
- package/cpp/rnskia/dom/nodes/JsiPaintNode.h +82 -45
- package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +68 -101
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +3 -2
- package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +150 -207
- package/cpp/rnskia/dom/props/BezierProps.h +4 -2
- package/cpp/rnskia/dom/props/BlendModeProp.h +4 -2
- package/cpp/rnskia/dom/props/BoxShadowProps.h +8 -10
- package/cpp/rnskia/dom/props/CircleProp.h +6 -5
- package/cpp/rnskia/dom/props/ClipProp.h +6 -4
- package/cpp/rnskia/dom/props/ColorProp.h +8 -4
- package/cpp/rnskia/dom/props/DrawingProp.h +5 -3
- package/cpp/rnskia/dom/props/FontProp.h +4 -2
- package/cpp/rnskia/dom/props/GlyphsProp.h +4 -2
- package/cpp/rnskia/dom/props/ImageProps.h +9 -6
- package/cpp/rnskia/dom/props/LayerProp.h +6 -4
- package/cpp/rnskia/dom/props/MatrixProp.h +4 -2
- package/cpp/rnskia/dom/props/NumbersProp.h +8 -4
- package/cpp/rnskia/dom/props/PaintProps.h +55 -92
- package/cpp/rnskia/dom/props/PathProp.h +4 -2
- package/cpp/rnskia/dom/props/PictureProp.h +4 -2
- package/cpp/rnskia/dom/props/PointProp.h +4 -2
- package/cpp/rnskia/dom/props/PointsProp.h +8 -4
- package/cpp/rnskia/dom/props/RRectProp.h +23 -16
- package/cpp/rnskia/dom/props/RadiusProp.h +4 -2
- package/cpp/rnskia/dom/props/RectProp.h +18 -12
- package/cpp/rnskia/dom/props/StrokeProps.h +8 -4
- package/cpp/rnskia/dom/props/SvgProp.h +4 -2
- package/cpp/rnskia/dom/props/TextBlobProp.h +10 -8
- package/cpp/rnskia/dom/props/TileModeProp.h +4 -2
- package/cpp/rnskia/dom/props/TransformProp.h +4 -2
- package/cpp/rnskia/dom/props/TransformsProps.h +5 -7
- package/cpp/rnskia/dom/props/UniformsProp.h +4 -2
- package/cpp/rnskia/dom/props/VertexModeProp.h +4 -2
- package/cpp/rnskia/dom/props/VerticesProps.h +7 -11
- package/ios/RNSkia-iOS/DisplayLink.mm +22 -24
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +57 -50
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.h +2 -0
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +38 -25
- package/ios/RNSkia-iOS/SkiaDomViewManager.mm +17 -17
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +17 -17
- package/ios/RNSkia-iOS/SkiaManager.mm +12 -10
- package/ios/RNSkia-iOS/SkiaMetalRenderer.h +5 -0
- package/ios/RNSkia-iOS/SkiaMetalRenderer.mm +53 -0
- package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +17 -17
- package/ios/RNSkia-iOS/SkiaUIView.mm +63 -53
- package/ios/RNSkiaModule.mm +5 -7
- package/lib/commonjs/animation/decay/decay.d.ts +2 -0
- package/lib/commonjs/animation/decay/index.d.ts +1 -0
- package/lib/commonjs/animation/decay/runDecay.d.ts +10 -0
- package/lib/commonjs/animation/decay/types.d.ts +21 -0
- package/lib/commonjs/animation/functions/index.d.ts +4 -0
- package/lib/commonjs/animation/functions/interpolate.d.ts +17 -0
- package/lib/commonjs/animation/functions/interpolateColors.d.ts +3 -0
- package/lib/commonjs/animation/functions/interpolatePaths.d.ts +19 -0
- package/lib/commonjs/animation/functions/interpolateVector.d.ts +10 -0
- package/lib/commonjs/animation/index.d.ts +4 -0
- package/lib/commonjs/animation/spring/Spring.d.ts +65 -0
- package/lib/commonjs/animation/spring/functions/index.d.ts +1 -0
- package/lib/commonjs/animation/spring/functions/spring.d.ts +10 -0
- package/lib/commonjs/animation/spring/index.d.ts +3 -0
- package/lib/commonjs/animation/spring/runSpring.d.ts +16 -0
- package/lib/commonjs/animation/spring/types.d.ts +6 -0
- package/lib/commonjs/animation/spring/useSpring.d.ts +10 -0
- package/lib/commonjs/animation/timing/Easing.d.ts +19 -0
- package/lib/commonjs/animation/timing/createTiming.d.ts +17 -0
- package/lib/commonjs/animation/timing/functions/bezier.d.ts +1 -0
- package/lib/commonjs/animation/timing/functions/getResolvedParams.d.ts +7 -0
- package/lib/commonjs/animation/timing/functions/index.d.ts +4 -0
- package/lib/commonjs/animation/timing/functions/timing.d.ts +17 -0
- package/lib/commonjs/animation/timing/functions/types.d.ts +7 -0
- package/lib/commonjs/animation/timing/index.d.ts +4 -0
- package/lib/commonjs/animation/timing/runTiming.d.ts +16 -0
- package/lib/commonjs/animation/timing/useLoop.d.ts +8 -0
- package/lib/commonjs/animation/timing/useTiming.d.ts +10 -0
- package/lib/commonjs/animation/types.d.ts +18 -0
- package/lib/commonjs/dom/nodes/DrawingNode.d.ts +14 -0
- package/lib/commonjs/dom/nodes/DrawingNode.js +5 -1
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/GroupNode.d.ts +7 -0
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +64 -0
- package/lib/commonjs/dom/nodes/LayerNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/LayerNode.js +13 -6
- package/lib/commonjs/dom/nodes/LayerNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/Node.d.ts +38 -0
- package/lib/commonjs/dom/nodes/Node.js +8 -26
- package/lib/commonjs/dom/nodes/Node.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintContext.d.ts +18 -0
- package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/PaintNode.js +32 -15
- package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/RenderNode.d.ts +26 -0
- package/lib/commonjs/dom/nodes/RenderNode.js +19 -187
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +7 -0
- package/lib/commonjs/dom/nodes/datatypes/Enum.d.ts +1 -0
- package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +33 -0
- package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +92 -0
- package/lib/commonjs/dom/nodes/datatypes/Path.d.ts +4 -0
- package/lib/commonjs/dom/nodes/datatypes/Radius.d.ts +3 -0
- package/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +5 -0
- package/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +3 -0
- package/lib/commonjs/dom/nodes/datatypes/index.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +25 -7
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.d.ts +15 -0
- package/lib/commonjs/dom/nodes/drawings/Box.js +3 -0
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +25 -0
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +18 -0
- package/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +10 -0
- package/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/Text.d.ts +30 -0
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +18 -0
- package/lib/commonjs/dom/nodes/index.d.ts +3 -0
- package/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/paint/BlendNode.js +16 -47
- package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +35 -0
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js +29 -43
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +42 -0
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js +45 -42
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +8 -0
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js +3 -2
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +39 -0
- package/lib/commonjs/dom/nodes/paint/PathEffects.js +30 -72
- package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.d.ts +43 -0
- package/lib/commonjs/dom/nodes/paint/Shaders.js +28 -18
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/index.d.ts +6 -0
- package/lib/commonjs/dom/types/ColorFilters.d.ts +12 -0
- package/lib/commonjs/dom/types/Common.d.ts +56 -0
- package/lib/commonjs/dom/types/DeclarationContext.d.ts +29 -0
- package/lib/commonjs/dom/types/DeclarationContext.js +118 -0
- package/lib/commonjs/dom/types/DeclarationContext.js.map +1 -0
- package/lib/commonjs/dom/types/DrawingContext.d.ts +22 -0
- package/lib/commonjs/dom/types/DrawingContext.js +330 -0
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +104 -0
- package/lib/commonjs/dom/types/ImageFilters.d.ts +37 -0
- package/lib/commonjs/dom/types/MaskFilters.d.ts +7 -0
- package/lib/commonjs/dom/types/Node.d.ts +23 -0
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +67 -0
- package/lib/commonjs/dom/types/PathEffects.d.ts +28 -0
- package/lib/commonjs/dom/types/Shaders.d.ts +59 -0
- package/lib/commonjs/dom/types/SkDOM.d.ts +71 -0
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/dom/types/index.d.ts +12 -0
- package/lib/commonjs/dom/types/index.js +13 -0
- package/lib/commonjs/dom/types/index.js.map +1 -1
- package/lib/commonjs/external/index.d.ts +1 -0
- package/lib/commonjs/external/reanimated/index.d.ts +1 -0
- package/lib/commonjs/external/reanimated/useSharedValueEffect.d.ts +11 -0
- package/lib/commonjs/index.d.ts +11 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock/index.d.ts +16 -0
- package/lib/commonjs/renderer/Canvas.d.ts +11 -0
- package/lib/commonjs/renderer/Canvas.js +3 -3
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.d.ts +12 -0
- package/lib/commonjs/renderer/DependencyManager.d.ts +46 -0
- package/lib/commonjs/renderer/DrawingContext.d.ts +7 -0
- package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +132 -0
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.d.ts +19 -0
- package/lib/commonjs/renderer/HostConfig.js +1 -0
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.d.ts +2 -0
- package/lib/commonjs/renderer/Offscreen.js +31 -0
- package/lib/commonjs/renderer/Offscreen.js.map +1 -0
- package/lib/commonjs/renderer/Reconciler.d.ts +13 -0
- package/lib/commonjs/renderer/Reconciler.js +0 -1
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.d.ts +4 -0
- package/lib/commonjs/renderer/components/Drawing.d.ts +3 -0
- package/lib/commonjs/renderer/components/Group.d.ts +8 -0
- package/lib/commonjs/renderer/components/Mask.d.ts +9 -0
- package/lib/commonjs/renderer/components/Paint.d.ts +4 -0
- package/lib/commonjs/renderer/components/Picture.d.ts +4 -0
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.d.ts +9 -0
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.d.ts +7 -0
- package/lib/commonjs/renderer/components/backdrop/index.d.ts +2 -0
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/Lerp.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/Matrix.d.ts +5 -0
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/index.d.ts +6 -0
- package/lib/commonjs/renderer/components/image/Image.d.ts +4 -0
- package/lib/commonjs/renderer/components/image/ImageSVG.d.ts +4 -0
- package/lib/commonjs/renderer/components/image/ImageShader.d.ts +4 -0
- package/lib/commonjs/renderer/components/image/index.d.ts +3 -0
- package/lib/commonjs/renderer/components/imageFilters/Blur.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/Morphology.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/Offset.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/Shadow.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/index.d.ts +6 -0
- package/lib/commonjs/renderer/components/index.d.ts +16 -0
- package/lib/commonjs/renderer/components/maskFilters/Blur.d.ts +4 -0
- package/lib/commonjs/renderer/components/maskFilters/index.d.ts +1 -0
- package/lib/commonjs/renderer/components/pathEffects/Corner.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Dash.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Discrete.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Line2D.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Path1D.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Path2D.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Sum.d.ts +3 -0
- package/lib/commonjs/renderer/components/pathEffects/index.d.ts +7 -0
- package/lib/commonjs/renderer/components/shaders/Color.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/FractalNoise.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/LinearGradient.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/RadialGradient.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/Shader.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/ShaderLib.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/SweepGradient.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/Turbulence.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/index.d.ts +9 -0
- package/lib/commonjs/renderer/components/shapes/Box.d.ts +5 -0
- package/lib/commonjs/renderer/components/shapes/Circle.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/DiffRect.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Fill.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +20 -0
- package/lib/commonjs/renderer/components/shapes/Line.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Oval.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Patch.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Path.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Points.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Rect.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/RoundedRect.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Vertices.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/index.d.ts +13 -0
- package/lib/commonjs/renderer/components/text/Glyphs.d.ts +4 -0
- package/lib/commonjs/renderer/components/text/Text.d.ts +4 -0
- package/lib/commonjs/renderer/components/text/TextBlob.d.ts +4 -0
- package/lib/commonjs/renderer/components/text/TextPath.d.ts +4 -0
- package/lib/commonjs/renderer/components/text/index.d.ts +4 -0
- package/lib/commonjs/renderer/index.d.ts +2 -0
- package/lib/commonjs/renderer/index.js +0 -13
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +17 -0
- package/lib/commonjs/renderer/processors/Animations/index.d.ts +1 -0
- package/lib/commonjs/renderer/processors/index.d.ts +2 -0
- package/lib/commonjs/renderer/processors/math/Coordinates.d.ts +29 -0
- package/lib/commonjs/renderer/processors/math/Math.d.ts +15 -0
- package/lib/commonjs/renderer/processors/math/Transforms.d.ts +5 -0
- package/lib/commonjs/renderer/processors/math/index.d.ts +3 -0
- package/lib/commonjs/renderer/typeddash.d.ts +3 -0
- package/lib/commonjs/skia/NativeSetup.d.ts +1 -0
- package/lib/commonjs/skia/Skia.d.ts +8 -0
- package/lib/commonjs/skia/Skia.web.d.ts +1 -0
- package/lib/commonjs/skia/core/Data.d.ts +3 -0
- package/lib/commonjs/skia/core/Font.d.ts +5 -0
- package/lib/commonjs/skia/core/Image.d.ts +5 -0
- package/lib/commonjs/skia/core/Matrix.d.ts +2 -0
- package/lib/commonjs/skia/core/Picture.d.ts +8 -0
- package/lib/commonjs/skia/core/RRect.d.ts +2 -0
- package/lib/commonjs/skia/core/Rect.d.ts +8 -0
- package/lib/commonjs/skia/core/SVG.d.ts +2 -0
- package/lib/commonjs/skia/core/Typeface.d.ts +5 -0
- package/lib/commonjs/skia/core/Vector.d.ts +12 -0
- package/lib/commonjs/skia/core/index.d.ts +10 -0
- package/lib/commonjs/skia/index.d.ts +3 -0
- package/lib/commonjs/skia/types/Canvas.d.ts +381 -0
- package/lib/commonjs/skia/types/Color.d.ts +2 -0
- package/lib/commonjs/skia/types/ColorFilter/ColorFilter.d.ts +3 -0
- package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.d.ts +43 -0
- package/lib/commonjs/skia/types/ColorFilter/index.d.ts +2 -0
- package/lib/commonjs/skia/types/ContourMeasure.d.ts +41 -0
- package/lib/commonjs/skia/types/Data/Data.d.ts +12 -0
- package/lib/commonjs/skia/types/Data/DataFactory.d.ts +18 -0
- package/lib/commonjs/skia/types/Data/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Font/Font.d.ts +180 -0
- package/lib/commonjs/skia/types/Font/index.d.ts +1 -0
- package/lib/commonjs/skia/types/Image/Image.d.ts +75 -0
- package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +62 -0
- package/lib/commonjs/skia/types/Image/index.d.ts +2 -0
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.d.ts +23 -0
- package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.d.ts +130 -0
- package/lib/commonjs/skia/types/ImageFilter/index.d.ts +2 -0
- package/lib/commonjs/skia/types/JsiInstance.d.ts +3 -0
- package/lib/commonjs/skia/types/MaskFilter.d.ts +21 -0
- package/lib/commonjs/skia/types/Matrix.d.ts +34 -0
- package/lib/commonjs/skia/types/Paint/BlendMode.d.ts +58 -0
- package/lib/commonjs/skia/types/Paint/Paint.d.ts +136 -0
- package/lib/commonjs/skia/types/Paint/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Path/Path.d.ts +474 -0
- package/lib/commonjs/skia/types/Path/PathFactory.d.ts +29 -0
- package/lib/commonjs/skia/types/Path/index.d.ts +2 -0
- package/lib/commonjs/skia/types/PathEffect.d.ts +75 -0
- package/lib/commonjs/skia/types/Picture/Picture.d.ts +27 -0
- package/lib/commonjs/skia/types/Picture/PictureFactory.d.ts +8 -0
- package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +15 -0
- package/lib/commonjs/skia/types/Picture/index.d.ts +3 -0
- package/lib/commonjs/skia/types/Point.d.ts +10 -0
- package/lib/commonjs/skia/types/RRect.d.ts +7 -0
- package/lib/commonjs/skia/types/RSXform.d.ts +2 -0
- package/lib/commonjs/skia/types/Rect.d.ts +6 -0
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.d.ts +52 -0
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.d.ts +10 -0
- package/lib/commonjs/skia/types/RuntimeEffect/index.d.ts +2 -0
- package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -0
- package/lib/commonjs/skia/types/SVG/SVGFactory.d.ts +6 -0
- package/lib/commonjs/skia/types/SVG/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Shader/Shader.d.ts +10 -0
- package/lib/commonjs/skia/types/Shader/ShaderFactory.d.ts +104 -0
- package/lib/commonjs/skia/types/Shader/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Size.d.ts +4 -0
- package/lib/commonjs/skia/types/Skia.d.ts +66 -0
- package/lib/commonjs/skia/types/Surface/Surface.d.ts +29 -0
- package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.d.ts +17 -0
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/index.d.ts +2 -0
- package/lib/commonjs/skia/types/TextBlob.d.ts +44 -0
- package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -0
- package/lib/commonjs/skia/types/Typeface/TypefaceFactory.d.ts +5 -0
- package/lib/commonjs/skia/types/Typeface/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Vertices/Vertices.d.ts +17 -0
- package/lib/commonjs/skia/types/Vertices/index.d.ts +1 -0
- package/lib/commonjs/skia/types/index.d.ts +28 -0
- package/lib/commonjs/skia/web/Host.d.ts +19 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +44 -0
- package/lib/commonjs/skia/web/JsiSkColor.d.ts +2 -0
- package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +12 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkData.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkDataFactory.d.ts +19 -0
- package/lib/commonjs/skia/web/JsiSkFont.d.ts +33 -0
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +12 -0
- package/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +10 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +19 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +13 -0
- package/lib/commonjs/skia/web/JsiSkPaint.d.ts +28 -0
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +57 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
- package/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +13 -0
- package/lib/commonjs/skia/web/JsiSkPicture.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkPictureFactory.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +11 -0
- package/lib/commonjs/skia/web/JsiSkPoint.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +11 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +7 -0
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +11 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +16 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkSVGFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkShader.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkShaderFactory.d.ts +16 -0
- package/lib/commonjs/skia/web/JsiSkSurface.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js +4 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js +21 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.d.ts +13 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkVertices.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.d.ts +4 -0
- package/lib/commonjs/skia/web/JsiSkia.d.ts +3 -0
- package/lib/commonjs/skia/web/index.d.ts +1 -0
- package/lib/commonjs/values/api.d.ts +5 -0
- package/lib/commonjs/values/api.web.d.ts +2 -0
- package/lib/commonjs/values/hooks/index.d.ts +4 -0
- package/lib/commonjs/values/hooks/useClockValue.d.ts +6 -0
- package/lib/commonjs/values/hooks/useComputedValue.d.ts +8 -0
- package/lib/commonjs/values/hooks/useValue.d.ts +7 -0
- package/lib/commonjs/values/hooks/useValueEffect.d.ts +7 -0
- package/lib/commonjs/values/index.d.ts +4 -0
- package/lib/commonjs/values/selector.d.ts +14 -0
- package/lib/commonjs/values/types.d.ts +63 -0
- package/lib/commonjs/values/web/RNSkAnimation.d.ts +9 -0
- package/lib/commonjs/values/web/RNSkClockValue.d.ts +13 -0
- package/lib/commonjs/values/web/RNSkComputedValue.d.ts +10 -0
- package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +12 -0
- package/lib/commonjs/values/web/RNSkValue.d.ts +14 -0
- package/lib/commonjs/values/web/api.d.ts +2 -0
- package/lib/commonjs/values/web/index.d.ts +1 -0
- package/lib/commonjs/views/SkiaBaseWebView.d.ts +62 -0
- package/lib/commonjs/views/SkiaBaseWebView.js +6 -4
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.d.ts +31 -0
- package/lib/commonjs/views/SkiaDomView.web.d.ts +7 -0
- package/lib/commonjs/views/SkiaDomView.web.js +3 -14
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.d.ts +27 -0
- package/lib/commonjs/views/SkiaPictureView.web.d.ts +7 -0
- package/lib/commonjs/views/SkiaPictureView.web.js +0 -7
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaView.d.ts +30 -0
- package/lib/commonjs/views/SkiaView.web.d.ts +7 -0
- package/lib/commonjs/views/SkiaView.web.js +0 -7
- package/lib/commonjs/views/SkiaView.web.js.map +1 -1
- package/lib/commonjs/views/api.d.ts +5 -0
- package/lib/commonjs/views/index.d.ts +6 -0
- package/lib/commonjs/views/types.d.ts +91 -0
- package/lib/commonjs/views/useDrawCallback.d.ts +8 -0
- package/lib/commonjs/views/useTouchHandler.d.ts +22 -0
- package/lib/commonjs/web/LoadSkiaWeb.d.ts +6 -0
- package/lib/commonjs/web/WithSkiaWeb.d.ts +12 -0
- package/lib/commonjs/web/index.d.ts +2 -0
- package/lib/module/animation/decay/decay.d.ts +2 -0
- package/lib/module/animation/decay/index.d.ts +1 -0
- package/lib/module/animation/decay/runDecay.d.ts +10 -0
- package/lib/module/animation/decay/types.d.ts +21 -0
- package/lib/module/animation/functions/index.d.ts +4 -0
- package/lib/module/animation/functions/interpolate.d.ts +17 -0
- package/lib/module/animation/functions/interpolateColors.d.ts +3 -0
- package/lib/module/animation/functions/interpolatePaths.d.ts +19 -0
- package/lib/module/animation/functions/interpolateVector.d.ts +10 -0
- package/lib/module/animation/index.d.ts +4 -0
- package/lib/module/animation/spring/Spring.d.ts +65 -0
- package/lib/module/animation/spring/functions/index.d.ts +1 -0
- package/lib/module/animation/spring/functions/spring.d.ts +10 -0
- package/lib/module/animation/spring/index.d.ts +3 -0
- package/lib/module/animation/spring/runSpring.d.ts +16 -0
- package/lib/module/animation/spring/types.d.ts +6 -0
- package/lib/module/animation/spring/useSpring.d.ts +10 -0
- package/lib/module/animation/timing/Easing.d.ts +19 -0
- package/lib/module/animation/timing/createTiming.d.ts +17 -0
- package/lib/module/animation/timing/functions/bezier.d.ts +1 -0
- package/lib/module/animation/timing/functions/getResolvedParams.d.ts +7 -0
- package/lib/module/animation/timing/functions/index.d.ts +4 -0
- package/lib/module/animation/timing/functions/timing.d.ts +17 -0
- package/lib/module/animation/timing/functions/types.d.ts +7 -0
- package/lib/module/animation/timing/index.d.ts +4 -0
- package/lib/module/animation/timing/runTiming.d.ts +16 -0
- package/lib/module/animation/timing/useLoop.d.ts +8 -0
- package/lib/module/animation/timing/useTiming.d.ts +10 -0
- package/lib/module/animation/types.d.ts +18 -0
- package/lib/module/dom/nodes/DrawingNode.d.ts +14 -0
- package/lib/module/dom/nodes/DrawingNode.js +5 -1
- package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/GroupNode.d.ts +7 -0
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +64 -0
- package/lib/module/dom/nodes/LayerNode.d.ts +8 -0
- package/lib/module/dom/nodes/LayerNode.js +13 -7
- package/lib/module/dom/nodes/LayerNode.js.map +1 -1
- package/lib/module/dom/nodes/Node.d.ts +38 -0
- package/lib/module/dom/nodes/Node.js +8 -25
- package/lib/module/dom/nodes/Node.js.map +1 -1
- package/lib/module/dom/nodes/PaintContext.d.ts +18 -0
- package/lib/module/dom/nodes/PaintContext.js.map +1 -1
- package/lib/module/dom/nodes/PaintNode.d.ts +8 -0
- package/lib/module/dom/nodes/PaintNode.js +32 -15
- package/lib/module/dom/nodes/PaintNode.js.map +1 -1
- package/lib/module/dom/nodes/RenderNode.d.ts +26 -0
- package/lib/module/dom/nodes/RenderNode.js +20 -187
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.d.ts +7 -0
- package/lib/module/dom/nodes/datatypes/Enum.d.ts +1 -0
- package/lib/module/dom/nodes/datatypes/Fitting.d.ts +33 -0
- package/lib/module/dom/nodes/datatypes/Gradient.d.ts +92 -0
- package/lib/module/dom/nodes/datatypes/Path.d.ts +4 -0
- package/lib/module/dom/nodes/datatypes/Radius.d.ts +3 -0
- package/lib/module/dom/nodes/datatypes/Rect.d.ts +5 -0
- package/lib/module/dom/nodes/datatypes/Transform.d.ts +3 -0
- package/lib/module/dom/nodes/datatypes/index.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +23 -4
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.d.ts +15 -0
- package/lib/module/dom/nodes/drawings/Box.js +3 -0
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CircleNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/FillNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/ImageNode.d.ts +25 -0
- package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/LineNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/OvalNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/PatchNode.d.ts +18 -0
- package/lib/module/dom/nodes/drawings/PathNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/PictureNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/PointsNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/RRectNode.d.ts +10 -0
- package/lib/module/dom/nodes/drawings/RectNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/Text.d.ts +30 -0
- package/lib/module/dom/nodes/drawings/VerticesNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/index.d.ts +18 -0
- package/lib/module/dom/nodes/index.d.ts +3 -0
- package/lib/module/dom/nodes/paint/BlendNode.d.ts +8 -0
- package/lib/module/dom/nodes/paint/BlendNode.js +15 -46
- package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/module/dom/nodes/paint/ColorFilters.d.ts +35 -0
- package/lib/module/dom/nodes/paint/ColorFilters.js +29 -43
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.d.ts +42 -0
- package/lib/module/dom/nodes/paint/ImageFilters.js +48 -41
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/MaskFilters.d.ts +8 -0
- package/lib/module/dom/nodes/paint/MaskFilters.js +3 -2
- package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/PathEffects.d.ts +39 -0
- package/lib/module/dom/nodes/paint/PathEffects.js +29 -72
- package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/module/dom/nodes/paint/Shaders.d.ts +43 -0
- package/lib/module/dom/nodes/paint/Shaders.js +28 -18
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/module/dom/nodes/paint/index.d.ts +6 -0
- package/lib/module/dom/types/ColorFilters.d.ts +12 -0
- package/lib/module/dom/types/Common.d.ts +56 -0
- package/lib/module/dom/types/DeclarationContext.d.ts +29 -0
- package/lib/module/dom/types/DeclarationContext.js +107 -0
- package/lib/module/dom/types/DeclarationContext.js.map +1 -0
- package/lib/module/dom/types/DrawingContext.d.ts +22 -0
- package/lib/module/dom/types/DrawingContext.js +322 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +104 -0
- package/lib/module/dom/types/ImageFilters.d.ts +37 -0
- package/lib/module/dom/types/MaskFilters.d.ts +7 -0
- package/lib/module/dom/types/Node.d.ts +23 -0
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +67 -0
- package/lib/module/dom/types/PathEffects.d.ts +28 -0
- package/lib/module/dom/types/Shaders.d.ts +59 -0
- package/lib/module/dom/types/SkDOM.d.ts +71 -0
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/dom/types/index.d.ts +12 -0
- package/lib/module/dom/types/index.js +1 -0
- package/lib/module/dom/types/index.js.map +1 -1
- package/lib/module/external/index.d.ts +1 -0
- package/lib/module/external/reanimated/index.d.ts +1 -0
- package/lib/module/external/reanimated/useSharedValueEffect.d.ts +11 -0
- package/lib/module/index.d.ts +11 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock/index.d.ts +16 -0
- package/lib/module/renderer/Canvas.d.ts +11 -0
- package/lib/module/renderer/Canvas.js +3 -3
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.d.ts +12 -0
- package/lib/module/renderer/DependencyManager.d.ts +46 -0
- package/lib/module/renderer/DrawingContext.d.ts +7 -0
- package/lib/module/renderer/DrawingContext.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +132 -0
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.d.ts +19 -0
- package/lib/module/renderer/HostConfig.js +1 -0
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/Offscreen.d.ts +2 -0
- package/lib/module/renderer/Offscreen.js +19 -0
- package/lib/module/renderer/Offscreen.js.map +1 -0
- package/lib/module/renderer/Reconciler.d.ts +13 -0
- package/lib/module/renderer/Reconciler.js +0 -1
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/Blend.d.ts +4 -0
- package/lib/module/renderer/components/Drawing.d.ts +3 -0
- package/lib/module/renderer/components/Group.d.ts +8 -0
- package/lib/module/renderer/components/Mask.d.ts +9 -0
- package/lib/module/renderer/components/Paint.d.ts +4 -0
- package/lib/module/renderer/components/Picture.d.ts +4 -0
- package/lib/module/renderer/components/backdrop/BackdropBlur.d.ts +9 -0
- package/lib/module/renderer/components/backdrop/BackdropFilter.d.ts +7 -0
- package/lib/module/renderer/components/backdrop/index.d.ts +2 -0
- package/lib/module/renderer/components/colorFilters/BlendColor.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/Lerp.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/Matrix.d.ts +5 -0
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/index.d.ts +6 -0
- package/lib/module/renderer/components/image/Image.d.ts +4 -0
- package/lib/module/renderer/components/image/ImageSVG.d.ts +4 -0
- package/lib/module/renderer/components/image/ImageShader.d.ts +4 -0
- package/lib/module/renderer/components/image/index.d.ts +3 -0
- package/lib/module/renderer/components/imageFilters/Blur.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/DisplacementMap.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/Morphology.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/Offset.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/RuntimeShader.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/Shadow.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/index.d.ts +6 -0
- package/lib/module/renderer/components/index.d.ts +16 -0
- package/lib/module/renderer/components/maskFilters/Blur.d.ts +4 -0
- package/lib/module/renderer/components/maskFilters/index.d.ts +1 -0
- package/lib/module/renderer/components/pathEffects/Corner.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Dash.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Discrete.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Line2D.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Path1D.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Path2D.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Sum.d.ts +3 -0
- package/lib/module/renderer/components/pathEffects/index.d.ts +7 -0
- package/lib/module/renderer/components/shaders/Color.d.ts +4 -0
- package/lib/module/renderer/components/shaders/FractalNoise.d.ts +4 -0
- package/lib/module/renderer/components/shaders/LinearGradient.d.ts +4 -0
- package/lib/module/renderer/components/shaders/RadialGradient.d.ts +4 -0
- package/lib/module/renderer/components/shaders/Shader.d.ts +4 -0
- package/lib/module/renderer/components/shaders/ShaderLib.d.ts +4 -0
- package/lib/module/renderer/components/shaders/SweepGradient.d.ts +4 -0
- package/lib/module/renderer/components/shaders/Turbulence.d.ts +4 -0
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.d.ts +4 -0
- package/lib/module/renderer/components/shaders/index.d.ts +9 -0
- package/lib/module/renderer/components/shapes/Box.d.ts +5 -0
- package/lib/module/renderer/components/shapes/Circle.d.ts +4 -0
- package/lib/module/renderer/components/shapes/DiffRect.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Fill.d.ts +4 -0
- package/lib/module/renderer/components/shapes/FitBox.d.ts +20 -0
- package/lib/module/renderer/components/shapes/Line.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Oval.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Patch.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Path.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Points.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Rect.d.ts +4 -0
- package/lib/module/renderer/components/shapes/RoundedRect.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Vertices.d.ts +4 -0
- package/lib/module/renderer/components/shapes/index.d.ts +13 -0
- package/lib/module/renderer/components/text/Glyphs.d.ts +4 -0
- package/lib/module/renderer/components/text/Text.d.ts +4 -0
- package/lib/module/renderer/components/text/TextBlob.d.ts +4 -0
- package/lib/module/renderer/components/text/TextPath.d.ts +4 -0
- package/lib/module/renderer/components/text/index.d.ts +4 -0
- package/lib/module/renderer/index.d.ts +2 -0
- package/lib/module/renderer/index.js +0 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.d.ts +17 -0
- package/lib/module/renderer/processors/Animations/index.d.ts +1 -0
- package/lib/module/renderer/processors/index.d.ts +2 -0
- package/lib/module/renderer/processors/math/Coordinates.d.ts +29 -0
- package/lib/module/renderer/processors/math/Math.d.ts +15 -0
- package/lib/module/renderer/processors/math/Transforms.d.ts +5 -0
- package/lib/module/renderer/processors/math/index.d.ts +3 -0
- package/lib/module/renderer/typeddash.d.ts +3 -0
- package/lib/module/skia/NativeSetup.d.ts +1 -0
- package/lib/module/skia/Skia.d.ts +8 -0
- package/lib/module/skia/Skia.web.d.ts +1 -0
- package/lib/module/skia/core/Data.d.ts +3 -0
- package/lib/module/skia/core/Font.d.ts +5 -0
- package/lib/module/skia/core/Image.d.ts +5 -0
- package/lib/module/skia/core/Matrix.d.ts +2 -0
- package/lib/module/skia/core/Picture.d.ts +8 -0
- package/lib/module/skia/core/RRect.d.ts +2 -0
- package/lib/module/skia/core/Rect.d.ts +8 -0
- package/lib/module/skia/core/SVG.d.ts +2 -0
- package/lib/module/skia/core/Typeface.d.ts +5 -0
- package/lib/module/skia/core/Vector.d.ts +12 -0
- package/lib/module/skia/core/index.d.ts +10 -0
- package/lib/module/skia/index.d.ts +3 -0
- package/lib/module/skia/types/Canvas.d.ts +381 -0
- package/lib/module/skia/types/Color.d.ts +2 -0
- package/lib/module/skia/types/ColorFilter/ColorFilter.d.ts +3 -0
- package/lib/module/skia/types/ColorFilter/ColorFilterFactory.d.ts +43 -0
- package/lib/module/skia/types/ColorFilter/index.d.ts +2 -0
- package/lib/module/skia/types/ContourMeasure.d.ts +41 -0
- package/lib/module/skia/types/Data/Data.d.ts +12 -0
- package/lib/module/skia/types/Data/DataFactory.d.ts +18 -0
- package/lib/module/skia/types/Data/index.d.ts +2 -0
- package/lib/module/skia/types/Font/Font.d.ts +180 -0
- package/lib/module/skia/types/Font/index.d.ts +1 -0
- package/lib/module/skia/types/Image/Image.d.ts +75 -0
- package/lib/module/skia/types/Image/ImageFactory.d.ts +62 -0
- package/lib/module/skia/types/Image/index.d.ts +2 -0
- package/lib/module/skia/types/ImageFilter/ImageFilter.d.ts +23 -0
- package/lib/module/skia/types/ImageFilter/ImageFilterFactory.d.ts +130 -0
- package/lib/module/skia/types/ImageFilter/index.d.ts +2 -0
- package/lib/module/skia/types/JsiInstance.d.ts +3 -0
- package/lib/module/skia/types/MaskFilter.d.ts +21 -0
- package/lib/module/skia/types/Matrix.d.ts +34 -0
- package/lib/module/skia/types/Paint/BlendMode.d.ts +58 -0
- package/lib/module/skia/types/Paint/Paint.d.ts +136 -0
- package/lib/module/skia/types/Paint/index.d.ts +2 -0
- package/lib/module/skia/types/Path/Path.d.ts +474 -0
- package/lib/module/skia/types/Path/PathFactory.d.ts +29 -0
- package/lib/module/skia/types/Path/index.d.ts +2 -0
- package/lib/module/skia/types/PathEffect.d.ts +75 -0
- package/lib/module/skia/types/Picture/Picture.d.ts +27 -0
- package/lib/module/skia/types/Picture/PictureFactory.d.ts +8 -0
- package/lib/module/skia/types/Picture/PictureRecorder.d.ts +15 -0
- package/lib/module/skia/types/Picture/index.d.ts +3 -0
- package/lib/module/skia/types/Point.d.ts +10 -0
- package/lib/module/skia/types/RRect.d.ts +7 -0
- package/lib/module/skia/types/RSXform.d.ts +2 -0
- package/lib/module/skia/types/Rect.d.ts +6 -0
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.d.ts +52 -0
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.d.ts +10 -0
- package/lib/module/skia/types/RuntimeEffect/index.d.ts +2 -0
- package/lib/module/skia/types/SVG/SVG.d.ts +2 -0
- package/lib/module/skia/types/SVG/SVGFactory.d.ts +6 -0
- package/lib/module/skia/types/SVG/index.d.ts +2 -0
- package/lib/module/skia/types/Shader/Shader.d.ts +10 -0
- package/lib/module/skia/types/Shader/ShaderFactory.d.ts +104 -0
- package/lib/module/skia/types/Shader/index.d.ts +2 -0
- package/lib/module/skia/types/Size.d.ts +4 -0
- package/lib/module/skia/types/Skia.d.ts +66 -0
- package/lib/module/skia/types/Surface/Surface.d.ts +29 -0
- package/lib/module/skia/types/Surface/Surface.js.map +1 -1
- package/lib/module/skia/types/Surface/SurfaceFactory.d.ts +17 -0
- package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/module/skia/types/Surface/index.d.ts +2 -0
- package/lib/module/skia/types/TextBlob.d.ts +44 -0
- package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -0
- package/lib/module/skia/types/Typeface/TypefaceFactory.d.ts +5 -0
- package/lib/module/skia/types/Typeface/index.d.ts +2 -0
- package/lib/module/skia/types/Vertices/Vertices.d.ts +17 -0
- package/lib/module/skia/types/Vertices/index.d.ts +1 -0
- package/lib/module/skia/types/index.d.ts +28 -0
- package/lib/module/skia/web/Host.d.ts +19 -0
- package/lib/module/skia/web/JsiSkCanvas.d.ts +44 -0
- package/lib/module/skia/web/JsiSkColor.d.ts +2 -0
- package/lib/module/skia/web/JsiSkColorFilter.d.ts +6 -0
- package/lib/module/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
- package/lib/module/skia/web/JsiSkContourMeasure.d.ts +12 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
- package/lib/module/skia/web/JsiSkData.d.ts +8 -0
- package/lib/module/skia/web/JsiSkDataFactory.d.ts +19 -0
- package/lib/module/skia/web/JsiSkFont.d.ts +33 -0
- package/lib/module/skia/web/JsiSkImage.d.ts +12 -0
- package/lib/module/skia/web/JsiSkImageFactory.d.ts +10 -0
- package/lib/module/skia/web/JsiSkImageFilter.d.ts +6 -0
- package/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +19 -0
- package/lib/module/skia/web/JsiSkMaskFilter.d.ts +6 -0
- package/lib/module/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkMatrix.d.ts +13 -0
- package/lib/module/skia/web/JsiSkPaint.d.ts +28 -0
- package/lib/module/skia/web/JsiSkPath.d.ts +57 -0
- package/lib/module/skia/web/JsiSkPathEffect.d.ts +6 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
- package/lib/module/skia/web/JsiSkPathFactory.d.ts +13 -0
- package/lib/module/skia/web/JsiSkPicture.d.ts +9 -0
- package/lib/module/skia/web/JsiSkPictureFactory.d.ts +8 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +11 -0
- package/lib/module/skia/web/JsiSkPoint.d.ts +9 -0
- package/lib/module/skia/web/JsiSkRRect.d.ts +11 -0
- package/lib/module/skia/web/JsiSkRSXform.d.ts +7 -0
- package/lib/module/skia/web/JsiSkRect.d.ts +11 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +16 -0
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
- package/lib/module/skia/web/JsiSkSVGFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkShader.d.ts +6 -0
- package/lib/module/skia/web/JsiSkShaderFactory.d.ts +16 -0
- package/lib/module/skia/web/JsiSkSurface.d.ts +9 -0
- package/lib/module/skia/web/JsiSkSurface.js +4 -0
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkSurfaceFactory.js +21 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.d.ts +6 -0
- package/lib/module/skia/web/JsiSkTextBlobFactory.d.ts +13 -0
- package/lib/module/skia/web/JsiSkTypeface.d.ts +8 -0
- package/lib/module/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
- package/lib/module/skia/web/JsiSkVertices.d.ts +9 -0
- package/lib/module/skia/web/JsiSkVerticesFactory.d.ts +4 -0
- package/lib/module/skia/web/JsiSkia.d.ts +3 -0
- package/lib/module/skia/web/index.d.ts +1 -0
- package/lib/module/values/api.d.ts +5 -0
- package/lib/module/values/api.web.d.ts +2 -0
- package/lib/module/values/hooks/index.d.ts +4 -0
- package/lib/module/values/hooks/useClockValue.d.ts +6 -0
- package/lib/module/values/hooks/useComputedValue.d.ts +8 -0
- package/lib/module/values/hooks/useValue.d.ts +7 -0
- package/lib/module/values/hooks/useValueEffect.d.ts +7 -0
- package/lib/module/values/index.d.ts +4 -0
- package/lib/module/values/selector.d.ts +14 -0
- package/lib/module/values/types.d.ts +63 -0
- package/lib/module/values/web/RNSkAnimation.d.ts +9 -0
- package/lib/module/values/web/RNSkClockValue.d.ts +13 -0
- package/lib/module/values/web/RNSkComputedValue.d.ts +10 -0
- package/lib/module/values/web/RNSkReadonlyValue.d.ts +12 -0
- package/lib/module/values/web/RNSkValue.d.ts +14 -0
- package/lib/module/values/web/api.d.ts +2 -0
- package/lib/module/values/web/index.d.ts +1 -0
- package/lib/module/views/SkiaBaseWebView.d.ts +62 -0
- package/lib/module/views/SkiaBaseWebView.js +6 -4
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaDomView.d.ts +31 -0
- package/lib/module/views/SkiaDomView.web.d.ts +7 -0
- package/lib/module/views/SkiaDomView.web.js +2 -11
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.d.ts +27 -0
- package/lib/module/views/SkiaPictureView.web.d.ts +7 -0
- package/lib/module/views/SkiaPictureView.web.js +0 -5
- package/lib/module/views/SkiaPictureView.web.js.map +1 -1
- package/lib/module/views/SkiaView.d.ts +30 -0
- package/lib/module/views/SkiaView.web.d.ts +7 -0
- package/lib/module/views/SkiaView.web.js +0 -5
- package/lib/module/views/SkiaView.web.js.map +1 -1
- package/lib/module/views/api.d.ts +5 -0
- package/lib/module/views/index.d.ts +6 -0
- package/lib/module/views/types.d.ts +91 -0
- package/lib/module/views/useDrawCallback.d.ts +8 -0
- package/lib/module/views/useTouchHandler.d.ts +22 -0
- package/lib/module/web/LoadSkiaWeb.d.ts +6 -0
- package/lib/module/web/WithSkiaWeb.d.ts +12 -0
- package/lib/module/web/index.d.ts +2 -0
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +33 -34
- package/lib/typescript/src/dom/nodes/Node.d.ts +6 -11
- package/lib/typescript/src/dom/nodes/PaintNode.d.ts +3 -3
- package/lib/typescript/src/dom/nodes/RenderNode.d.ts +2 -3
- package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +3 -1
- package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +3 -7
- package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +10 -11
- package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +11 -11
- package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +3 -3
- package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +15 -18
- package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +11 -12
- package/lib/typescript/src/dom/types/DeclarationContext.d.ts +29 -0
- package/lib/typescript/src/dom/types/DrawingContext.d.ts +18 -1
- package/lib/typescript/src/dom/types/Node.d.ts +4 -10
- package/lib/typescript/src/dom/types/SkDOM.d.ts +22 -23
- package/lib/typescript/src/dom/types/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/renderer/DrawingContext.d.ts +4 -3
- package/lib/typescript/src/renderer/HostComponents.d.ts +35 -35
- package/lib/typescript/src/renderer/Offscreen.d.ts +2 -0
- package/lib/typescript/src/renderer/index.d.ts +0 -1
- package/lib/typescript/src/skia/types/Surface/Surface.d.ts +4 -0
- package/lib/typescript/src/skia/types/Surface/SurfaceFactory.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
- package/package.json +5 -4
- package/src/dom/nodes/DrawingNode.ts +5 -1
- package/src/dom/nodes/LayerNode.ts +13 -11
- package/src/dom/nodes/Node.ts +18 -41
- package/src/dom/nodes/PaintContext.ts +1 -0
- package/src/dom/nodes/PaintNode.ts +28 -18
- package/src/dom/nodes/RenderNode.ts +25 -183
- package/src/dom/nodes/drawings/BackdropFilterNode.ts +18 -11
- package/src/dom/nodes/drawings/Box.ts +6 -4
- package/src/dom/nodes/paint/BlendNode.ts +16 -63
- package/src/dom/nodes/paint/ColorFilters.ts +32 -55
- package/src/dom/nodes/paint/ImageFilters.ts +58 -53
- package/src/dom/nodes/paint/MaskFilters.ts +5 -7
- package/src/dom/nodes/paint/PathEffects.ts +37 -90
- package/src/dom/nodes/paint/Shaders.ts +31 -29
- package/src/dom/types/DeclarationContext.ts +105 -0
- package/src/dom/types/DrawingContext.ts +304 -1
- package/src/dom/types/Node.ts +4 -20
- package/src/dom/types/SkDOM.ts +22 -43
- package/src/dom/types/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/renderer/Canvas.tsx +3 -3
- package/src/renderer/DrawingContext.ts +4 -5
- package/src/renderer/HostComponents.ts +34 -53
- package/src/renderer/HostConfig.ts +1 -0
- package/src/renderer/Offscreen.tsx +24 -0
- package/src/renderer/Reconciler.tsx +0 -1
- package/src/renderer/index.ts +0 -1
- package/src/skia/types/Surface/Surface.ts +5 -0
- package/src/skia/types/Surface/SurfaceFactory.ts +7 -0
- package/src/skia/web/JsiSkSurface.ts +4 -0
- package/src/skia/web/JsiSkSurfaceFactory.ts +21 -2
- package/src/views/SkiaBaseWebView.tsx +6 -2
- package/src/views/SkiaDomView.web.tsx +2 -13
- package/src/views/SkiaPictureView.web.tsx +0 -7
- package/src/views/SkiaView.web.tsx +0 -7
- package/lib/commonjs/renderer/useContextBridge.js +0 -35
- package/lib/commonjs/renderer/useContextBridge.js.map +0 -1
- package/lib/module/renderer/useContextBridge.js +0 -21
- package/lib/module/renderer/useContextBridge.js.map +0 -1
- package/lib/typescript/src/renderer/useContextBridge.d.ts +0 -5
- package/src/renderer/useContextBridge.tsx +0 -21
@@ -24,32 +24,27 @@ export class ImageFilterDeclaration extends JsiDeclarationNode {
|
|
24
24
|
super(ctx, DeclarationType.ImageFilter, type, props);
|
25
25
|
}
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
input(ctx) {
|
28
|
+
var _ctx$imageFilters$pop;
|
29
29
|
|
30
|
-
|
31
|
-
return null;
|
32
|
-
}
|
33
|
-
|
34
|
-
return this.getMandatoryChildInstance(index);
|
30
|
+
return (_ctx$imageFilters$pop = ctx.imageFilters.pop()) !== null && _ctx$imageFilters$pop !== void 0 ? _ctx$imageFilters$pop : null;
|
35
31
|
}
|
36
32
|
|
37
|
-
|
38
|
-
|
33
|
+
composeAndPush(ctx, imgf1) {
|
34
|
+
ctx.save();
|
35
|
+
this.decorateChildren(ctx);
|
36
|
+
let imgf2 = ctx.imageFilters.popAllAsOne();
|
37
|
+
const cf = ctx.colorFilters.popAllAsOne();
|
38
|
+
ctx.restore();
|
39
39
|
|
40
|
-
if (
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
return this.Skia.ImageFilter.MakeShader(child.materialize(), null);
|
45
|
-
} else if (child.declarationType === DeclarationType.ColorFilter) {
|
46
|
-
return this.Skia.ImageFilter.MakeColorFilter(child.materialize(), null);
|
47
|
-
} else {
|
48
|
-
throw new Error(`Found invalid child ${child.type} in ${this.type}`);
|
49
|
-
}
|
50
|
-
} else {
|
51
|
-
throw new Error(`Found invalid child ${child.type} in ${this.type}`);
|
40
|
+
if (cf) {
|
41
|
+
var _imgf;
|
42
|
+
|
43
|
+
imgf2 = this.Skia.ImageFilter.MakeCompose((_imgf = imgf2) !== null && _imgf !== void 0 ? _imgf : null, this.Skia.ImageFilter.MakeColorFilter(cf, null));
|
52
44
|
}
|
45
|
+
|
46
|
+
const imgf = imgf2 ? this.Skia.ImageFilter.MakeCompose(imgf1, imgf2) : imgf1;
|
47
|
+
ctx.imageFilters.push(imgf);
|
53
48
|
}
|
54
49
|
|
55
50
|
}
|
@@ -58,12 +53,14 @@ export class OffsetImageFilterNode extends ImageFilterDeclaration {
|
|
58
53
|
super(ctx, NodeType.OffsetImageFilter, props);
|
59
54
|
}
|
60
55
|
|
61
|
-
|
56
|
+
decorate(ctx) {
|
57
|
+
this.decorateChildren(ctx);
|
62
58
|
const {
|
63
59
|
x,
|
64
60
|
y
|
65
61
|
} = this.props;
|
66
|
-
|
62
|
+
const imgf = this.Skia.ImageFilter.MakeOffset(x, y, null);
|
63
|
+
this.composeAndPush(ctx, imgf);
|
67
64
|
}
|
68
65
|
|
69
66
|
}
|
@@ -72,13 +69,14 @@ export class DisplacementMapImageFilterNode extends ImageFilterDeclaration {
|
|
72
69
|
super(ctx, NodeType.DisplacementMapImageFilter, props);
|
73
70
|
}
|
74
71
|
|
75
|
-
|
72
|
+
decorate(ctx) {
|
76
73
|
const {
|
77
74
|
channelX,
|
78
75
|
channelY,
|
79
76
|
scale
|
80
77
|
} = this.props;
|
81
|
-
|
78
|
+
const imgf = this.Skia.ImageFilter.MakeDisplacementMap(ColorChannel[enumKey(channelX)], ColorChannel[enumKey(channelY)], scale, ctx.imageFilters.pop(), this.input(ctx));
|
79
|
+
this.composeAndPush(ctx, imgf);
|
82
80
|
}
|
83
81
|
|
84
82
|
}
|
@@ -87,13 +85,14 @@ export class BlurImageFilterNode extends ImageFilterDeclaration {
|
|
87
85
|
super(ctx, NodeType.BlurImageFilter, props);
|
88
86
|
}
|
89
87
|
|
90
|
-
|
88
|
+
decorate(ctx) {
|
91
89
|
const {
|
92
90
|
mode,
|
93
91
|
blur
|
94
92
|
} = this.props;
|
95
93
|
const sigma = processRadius(this.Skia, blur);
|
96
|
-
|
94
|
+
const imgf = this.Skia.ImageFilter.MakeBlur(sigma.x, sigma.y, TileMode[enumKey(mode)], this.input(ctx));
|
95
|
+
this.composeAndPush(ctx, imgf);
|
97
96
|
}
|
98
97
|
|
99
98
|
}
|
@@ -102,7 +101,7 @@ export class DropShadowImageFilterNode extends ImageFilterDeclaration {
|
|
102
101
|
super(ctx, NodeType.DropShadowImageFilter, props);
|
103
102
|
}
|
104
103
|
|
105
|
-
|
104
|
+
decorate(ctx) {
|
106
105
|
const {
|
107
106
|
dx,
|
108
107
|
dy,
|
@@ -112,7 +111,6 @@ export class DropShadowImageFilterNode extends ImageFilterDeclaration {
|
|
112
111
|
inner
|
113
112
|
} = this.props;
|
114
113
|
const color = this.Skia.Color(cl);
|
115
|
-
const input = this.getOptionalChildInstance(0);
|
116
114
|
let factory;
|
117
115
|
|
118
116
|
if (inner) {
|
@@ -121,7 +119,8 @@ export class DropShadowImageFilterNode extends ImageFilterDeclaration {
|
|
121
119
|
factory = shadowOnly ? this.Skia.ImageFilter.MakeDropShadowOnly.bind(this.Skia.ImageFilter) : this.Skia.ImageFilter.MakeDropShadow.bind(this.Skia.ImageFilter);
|
122
120
|
}
|
123
121
|
|
124
|
-
|
122
|
+
const imgf = factory(dx, dy, blur, blur, color, this.input(ctx));
|
123
|
+
this.composeAndPush(ctx, imgf);
|
125
124
|
}
|
126
125
|
|
127
126
|
}
|
@@ -137,18 +136,20 @@ export class MorphologyImageFilterNode extends ImageFilterDeclaration {
|
|
137
136
|
super(ctx, NodeType.MorphologyImageFilter, props);
|
138
137
|
}
|
139
138
|
|
140
|
-
|
139
|
+
decorate(ctx) {
|
141
140
|
const {
|
142
141
|
operator
|
143
142
|
} = this.props;
|
144
143
|
const r = processRadius(this.Skia, this.props.radius);
|
145
|
-
|
144
|
+
let imgf;
|
146
145
|
|
147
146
|
if (MorphologyOperator[enumKey(operator)] === MorphologyOperator.Erode) {
|
148
|
-
|
147
|
+
imgf = this.Skia.ImageFilter.MakeErode(r.x, r.y, this.input(ctx));
|
148
|
+
} else {
|
149
|
+
imgf = this.Skia.ImageFilter.MakeDilate(r.x, r.y, this.input(ctx));
|
149
150
|
}
|
150
151
|
|
151
|
-
|
152
|
+
this.composeAndPush(ctx, imgf);
|
152
153
|
}
|
153
154
|
|
154
155
|
}
|
@@ -157,13 +158,19 @@ export class BlendImageFilterNode extends ImageFilterDeclaration {
|
|
157
158
|
super(ctx, NodeType.BlendImageFilter, props);
|
158
159
|
}
|
159
160
|
|
160
|
-
|
161
|
+
decorate(ctx) {
|
161
162
|
const {
|
162
163
|
mode
|
163
164
|
} = this.props;
|
164
|
-
const a =
|
165
|
-
const b =
|
166
|
-
|
165
|
+
const a = ctx.imageFilters.pop();
|
166
|
+
const b = ctx.imageFilters.pop();
|
167
|
+
|
168
|
+
if (!a || !b) {
|
169
|
+
throw new Error("BlendImageFilter requires two image filters");
|
170
|
+
}
|
171
|
+
|
172
|
+
const imgf = this.Skia.ImageFilter.MakeBlend(mode, a, b);
|
173
|
+
this.composeAndPush(ctx, imgf);
|
167
174
|
}
|
168
175
|
|
169
176
|
}
|
@@ -172,7 +179,7 @@ export class RuntimeShaderImageFilterNode extends ImageFilterDeclaration {
|
|
172
179
|
super(ctx, NodeType.RuntimeShaderImageFilter, props);
|
173
180
|
}
|
174
181
|
|
175
|
-
|
182
|
+
decorate(ctx) {
|
176
183
|
const {
|
177
184
|
source,
|
178
185
|
uniforms
|
@@ -183,8 +190,8 @@ export class RuntimeShaderImageFilterNode extends ImageFilterDeclaration {
|
|
183
190
|
processUniforms(source, uniforms, rtb);
|
184
191
|
}
|
185
192
|
|
186
|
-
const
|
187
|
-
|
193
|
+
const imgf = this.Skia.ImageFilter.MakeRuntimeShader(rtb, null, this.input(ctx));
|
194
|
+
this.composeAndPush(ctx, imgf);
|
188
195
|
}
|
189
196
|
|
190
197
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BlendMode","ColorChannel","processUniforms","TileMode","DeclarationType","NodeType","processRadius","enumKey","JsiDeclarationNode","Black","Float32Array","of","MakeInnerShadow","Skia","shadowOnly","dx","dy","sigmaX","sigmaY","color","input","sourceGraphic","ImageFilter","MakeColorFilter","ColorFilter","MakeBlend","Dst","sourceAlpha","SrcIn","f1","SrcOut","f2","MakeOffset","f3","MakeBlur","Decal","f4","MakeCompose","SrcOver","ImageFilterDeclaration","constructor","ctx","type","props","getOptionalChildInstance","index","child","_children","getMandatoryChildInstance","isImageFilter","materialize","isShader","MakeShader","declarationType","Error","OffsetImageFilterNode","OffsetImageFilter","x","y","DisplacementMapImageFilterNode","DisplacementMapImageFilter","channelX","channelY","scale","MakeDisplacementMap","BlurImageFilterNode","BlurImageFilter","mode","blur","sigma","DropShadowImageFilterNode","DropShadowImageFilter","cl","inner","Color","factory","bind","MakeDropShadowOnly","MakeDropShadow","MorphologyOperator","MorphologyImageFilterNode","MorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","BlendImageFilterNode","BlendImageFilter","a","b","RuntimeShaderImageFilterNode","RuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader"],"sources":["ImageFilters.ts"],"sourcesContent":["import type { SkImageFilter, SkColor, Skia } from \"../../../skia/types\";\nimport {\n BlendMode,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../../skia/types\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processRadius, enumKey } from \"../datatypes\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\n\nconst Black = Float32Array.of(0, 0, 0, 1);\n\nconst MakeInnerShadow = (\n Skia: Skia,\n shadowOnly: boolean | undefined,\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null\n) => {\n const sourceGraphic = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.Dst),\n null\n );\n const sourceAlpha = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn),\n null\n );\n const f1 = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut),\n null\n );\n const f2 = Skia.ImageFilter.MakeOffset(dx, dy, f1);\n const f3 = Skia.ImageFilter.MakeBlur(sigmaX, sigmaY, TileMode.Decal, f2);\n const f4 = Skia.ImageFilter.MakeBlend(BlendMode.SrcIn, sourceAlpha, f3);\n if (shadowOnly) {\n return f4;\n }\n return Skia.ImageFilter.MakeCompose(\n input,\n Skia.ImageFilter.MakeBlend(BlendMode.SrcOver, sourceGraphic, f4)\n );\n};\n\nexport abstract class ImageFilterDeclaration<\n P,\n Nullable extends null | never = never\n> extends JsiDeclarationNode<P, SkImageFilter, Nullable> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.ImageFilter, type, props);\n }\n\n getOptionalChildInstance(index: number) {\n const child = this._children[index];\n if (!child) {\n return null;\n }\n return this.getMandatoryChildInstance(index);\n }\n\n getMandatoryChildInstance(index: number) {\n const child = this._children[index];\n if (child instanceof JsiDeclarationNode) {\n if (child.isImageFilter()) {\n return child.materialize();\n } else if (child.isShader()) {\n return this.Skia.ImageFilter.MakeShader(child.materialize(), null);\n } else if (child.declarationType === DeclarationType.ColorFilter) {\n return this.Skia.ImageFilter.MakeColorFilter(child.materialize(), null);\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n }\n}\n\nexport class OffsetImageFilterNode extends ImageFilterDeclaration<OffsetImageFilterProps> {\n constructor(ctx: NodeContext, props: OffsetImageFilterProps) {\n super(ctx, NodeType.OffsetImageFilter, props);\n }\n\n materialize() {\n const { x, y } = this.props;\n return this.Skia.ImageFilter.MakeOffset(\n x,\n y,\n this.getOptionalChildInstance(0)\n );\n }\n}\n\nexport class DisplacementMapImageFilterNode extends ImageFilterDeclaration<DisplacementMapImageFilterProps> {\n constructor(ctx: NodeContext, props: DisplacementMapImageFilterProps) {\n super(ctx, NodeType.DisplacementMapImageFilter, props);\n }\n\n materialize() {\n const { channelX, channelY, scale } = this.props;\n return this.Skia.ImageFilter.MakeDisplacementMap(\n ColorChannel[enumKey(channelX)],\n ColorChannel[enumKey(channelY)],\n scale,\n this.getMandatoryChildInstance(0),\n this.getOptionalChildInstance(1)\n );\n }\n}\n\nexport class BlurImageFilterNode extends ImageFilterDeclaration<BlurImageFilterProps> {\n constructor(ctx: NodeContext, props: BlurImageFilterProps) {\n super(ctx, NodeType.BlurImageFilter, props);\n }\n\n materialize() {\n const { mode, blur } = this.props;\n const sigma = processRadius(this.Skia, blur);\n return this.Skia.ImageFilter.MakeBlur(\n sigma.x,\n sigma.y,\n TileMode[enumKey(mode)],\n this.getOptionalChildInstance(0)\n );\n }\n}\n\nexport class DropShadowImageFilterNode extends ImageFilterDeclaration<DropShadowImageFilterProps> {\n constructor(ctx: NodeContext, props: DropShadowImageFilterProps) {\n super(ctx, NodeType.DropShadowImageFilter, props);\n }\n\n materialize() {\n const { dx, dy, blur, shadowOnly, color: cl, inner } = this.props;\n const color = this.Skia.Color(cl);\n const input = this.getOptionalChildInstance(0);\n let factory;\n if (inner) {\n factory = MakeInnerShadow.bind(null, this.Skia, shadowOnly);\n } else {\n factory = shadowOnly\n ? this.Skia.ImageFilter.MakeDropShadowOnly.bind(this.Skia.ImageFilter)\n : this.Skia.ImageFilter.MakeDropShadow.bind(this.Skia.ImageFilter);\n }\n return factory(dx, dy, blur, blur, color, input);\n }\n}\n\nexport enum MorphologyOperator {\n Erode,\n Dilate,\n}\n\nexport class MorphologyImageFilterNode extends ImageFilterDeclaration<MorphologyImageFilterProps> {\n constructor(ctx: NodeContext, props: MorphologyImageFilterProps) {\n super(ctx, NodeType.MorphologyImageFilter, props);\n }\n\n materialize() {\n const { operator } = this.props;\n const r = processRadius(this.Skia, this.props.radius);\n const input = this.getOptionalChildInstance(0);\n if (MorphologyOperator[enumKey(operator)] === MorphologyOperator.Erode) {\n return this.Skia.ImageFilter.MakeErode(r.x, r.y, input);\n }\n return this.Skia.ImageFilter.MakeDilate(r.x, r.y, input);\n }\n}\n\nexport class BlendImageFilterNode extends ImageFilterDeclaration<BlendImageFilterProps> {\n constructor(ctx: NodeContext, props: BlendImageFilterProps) {\n super(ctx, NodeType.BlendImageFilter, props);\n }\n\n materialize() {\n const { mode } = this.props;\n const a = this.getMandatoryChildInstance(0);\n const b = this.getMandatoryChildInstance(1);\n return this.Skia.ImageFilter.MakeBlend(mode, a, b);\n }\n}\n\nexport class RuntimeShaderImageFilterNode extends ImageFilterDeclaration<RuntimeShaderImageFilterProps> {\n constructor(ctx: NodeContext, props: RuntimeShaderImageFilterProps) {\n super(ctx, NodeType.RuntimeShaderImageFilter, props);\n }\n\n materialize() {\n const { source, uniforms } = this.props;\n const rtb = this.Skia.RuntimeShaderBuilder(source);\n if (uniforms) {\n processUniforms(source, uniforms, rtb);\n }\n const input = this.getOptionalChildInstance(0);\n return this.Skia.ImageFilter.MakeRuntimeShader(rtb, null, input);\n }\n}\n"],"mappings":"AACA,SACEA,SADF,EAEEC,YAFF,EAGEC,eAHF,EAIEC,QAJF,QAKO,qBALP;AAeA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,aAAT,EAAwBC,OAAxB,QAAuC,cAAvC;AAEA,SAASC,kBAAT,QAAmC,SAAnC;AAEA,MAAMC,KAAK,GAAGC,YAAY,CAACC,EAAb,CAAgB,CAAhB,EAAmB,CAAnB,EAAsB,CAAtB,EAAyB,CAAzB,CAAd;;AAEA,MAAMC,eAAe,GAAG,CACtBC,IADsB,EAEtBC,UAFsB,EAGtBC,EAHsB,EAItBC,EAJsB,EAKtBC,MALsB,EAMtBC,MANsB,EAOtBC,KAPsB,EAQtBC,KARsB,KASnB;EACH,MAAMC,aAAa,GAAGR,IAAI,CAACS,WAAL,CAAiBC,eAAjB,CACpBV,IAAI,CAACW,WAAL,CAAiBC,SAAjB,CAA2BhB,KAA3B,EAAkCT,SAAS,CAAC0B,GAA5C,CADoB,EAEpB,IAFoB,CAAtB;EAIA,MAAMC,WAAW,GAAGd,IAAI,CAACS,WAAL,CAAiBC,eAAjB,CAClBV,IAAI,CAACW,WAAL,CAAiBC,SAAjB,CAA2BhB,KAA3B,EAAkCT,SAAS,CAAC4B,KAA5C,CADkB,EAElB,IAFkB,CAApB;EAIA,MAAMC,EAAE,GAAGhB,IAAI,CAACS,WAAL,CAAiBC,eAAjB,CACTV,IAAI,CAACW,WAAL,CAAiBC,SAAjB,CAA2BN,KAA3B,EAAkCnB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,MAAD,EAASC,QAAT,EAAmBC,GAAnB,CAAf;IACD;;IACD,MAAM5E,KAAK,GAAG,KAAKwB,wBAAL,CAA8B,CAA9B,CAAd;IACA,OAAO,KAAK/B,IAAL,CAAUS,WAAV,CAAsB4E,iBAAtB,CAAwCF,GAAxC,EAA6C,IAA7C,EAAmD5E,KAAnD,CAAP;EACD;;AAbqG"}
|
1
|
+
{"version":3,"names":["BlendMode","ColorChannel","processUniforms","TileMode","DeclarationType","NodeType","processRadius","enumKey","JsiDeclarationNode","Black","Float32Array","of","MakeInnerShadow","Skia","shadowOnly","dx","dy","sigmaX","sigmaY","color","input","sourceGraphic","ImageFilter","MakeColorFilter","ColorFilter","MakeBlend","Dst","sourceAlpha","SrcIn","f1","SrcOut","f2","MakeOffset","f3","MakeBlur","Decal","f4","MakeCompose","SrcOver","ImageFilterDeclaration","constructor","ctx","type","props","imageFilters","pop","composeAndPush","imgf1","save","decorateChildren","imgf2","popAllAsOne","cf","colorFilters","restore","imgf","push","OffsetImageFilterNode","OffsetImageFilter","decorate","x","y","DisplacementMapImageFilterNode","DisplacementMapImageFilter","channelX","channelY","scale","MakeDisplacementMap","BlurImageFilterNode","BlurImageFilter","mode","blur","sigma","DropShadowImageFilterNode","DropShadowImageFilter","cl","inner","Color","factory","bind","MakeDropShadowOnly","MakeDropShadow","MorphologyOperator","MorphologyImageFilterNode","MorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","BlendImageFilterNode","BlendImageFilter","a","b","Error","RuntimeShaderImageFilterNode","RuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader"],"sources":["ImageFilters.ts"],"sourcesContent":["import type { SkImageFilter, SkColor, Skia } from \"../../../skia/types\";\nimport {\n BlendMode,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../../skia/types\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n DeclarationContext,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { processRadius, enumKey } from \"../datatypes\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\n\nconst Black = Float32Array.of(0, 0, 0, 1);\n\nconst MakeInnerShadow = (\n Skia: Skia,\n shadowOnly: boolean | undefined,\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null\n) => {\n const sourceGraphic = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.Dst),\n null\n );\n const sourceAlpha = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn),\n null\n );\n const f1 = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut),\n null\n );\n const f2 = Skia.ImageFilter.MakeOffset(dx, dy, f1);\n const f3 = Skia.ImageFilter.MakeBlur(sigmaX, sigmaY, TileMode.Decal, f2);\n const f4 = Skia.ImageFilter.MakeBlend(BlendMode.SrcIn, sourceAlpha, f3);\n if (shadowOnly) {\n return f4;\n }\n return Skia.ImageFilter.MakeCompose(\n input,\n Skia.ImageFilter.MakeBlend(BlendMode.SrcOver, sourceGraphic, f4)\n );\n};\n\nexport abstract class ImageFilterDeclaration<P> extends JsiDeclarationNode<P> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.ImageFilter, type, props);\n }\n\n protected input(ctx: DeclarationContext) {\n return ctx.imageFilters.pop() ?? null;\n }\n\n protected composeAndPush(ctx: DeclarationContext, imgf1: SkImageFilter) {\n ctx.save();\n this.decorateChildren(ctx);\n let imgf2 = ctx.imageFilters.popAllAsOne();\n const cf = ctx.colorFilters.popAllAsOne();\n ctx.restore();\n if (cf) {\n imgf2 = this.Skia.ImageFilter.MakeCompose(\n imgf2 ?? null,\n this.Skia.ImageFilter.MakeColorFilter(cf, null)\n );\n }\n const imgf = imgf2\n ? this.Skia.ImageFilter.MakeCompose(imgf1, imgf2)\n : imgf1;\n ctx.imageFilters.push(imgf);\n }\n}\n\nexport class OffsetImageFilterNode extends ImageFilterDeclaration<OffsetImageFilterProps> {\n constructor(ctx: NodeContext, props: OffsetImageFilterProps) {\n super(ctx, NodeType.OffsetImageFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n this.decorateChildren(ctx);\n const { x, y } = this.props;\n const imgf = this.Skia.ImageFilter.MakeOffset(x, y, null);\n this.composeAndPush(ctx, imgf);\n }\n}\n\nexport class DisplacementMapImageFilterNode extends ImageFilterDeclaration<DisplacementMapImageFilterProps> {\n constructor(ctx: NodeContext, props: DisplacementMapImageFilterProps) {\n super(ctx, NodeType.DisplacementMapImageFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { channelX, channelY, scale } = this.props;\n const imgf = this.Skia.ImageFilter.MakeDisplacementMap(\n ColorChannel[enumKey(channelX)],\n ColorChannel[enumKey(channelY)],\n scale,\n ctx.imageFilters.pop()!,\n this.input(ctx)\n );\n this.composeAndPush(ctx, imgf);\n }\n}\n\nexport class BlurImageFilterNode extends ImageFilterDeclaration<BlurImageFilterProps> {\n constructor(ctx: NodeContext, props: BlurImageFilterProps) {\n super(ctx, NodeType.BlurImageFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { mode, blur } = this.props;\n const sigma = processRadius(this.Skia, blur);\n const imgf = this.Skia.ImageFilter.MakeBlur(\n sigma.x,\n sigma.y,\n TileMode[enumKey(mode)],\n this.input(ctx)\n );\n this.composeAndPush(ctx, imgf);\n }\n}\n\nexport class DropShadowImageFilterNode extends ImageFilterDeclaration<DropShadowImageFilterProps> {\n constructor(ctx: NodeContext, props: DropShadowImageFilterProps) {\n super(ctx, NodeType.DropShadowImageFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { dx, dy, blur, shadowOnly, color: cl, inner } = this.props;\n const color = this.Skia.Color(cl);\n let factory;\n if (inner) {\n factory = MakeInnerShadow.bind(null, this.Skia, shadowOnly);\n } else {\n factory = shadowOnly\n ? this.Skia.ImageFilter.MakeDropShadowOnly.bind(this.Skia.ImageFilter)\n : this.Skia.ImageFilter.MakeDropShadow.bind(this.Skia.ImageFilter);\n }\n const imgf = factory(dx, dy, blur, blur, color, this.input(ctx));\n this.composeAndPush(ctx, imgf);\n }\n}\n\nexport enum MorphologyOperator {\n Erode,\n Dilate,\n}\n\nexport class MorphologyImageFilterNode extends ImageFilterDeclaration<MorphologyImageFilterProps> {\n constructor(ctx: NodeContext, props: MorphologyImageFilterProps) {\n super(ctx, NodeType.MorphologyImageFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { operator } = this.props;\n const r = processRadius(this.Skia, this.props.radius);\n let imgf;\n if (MorphologyOperator[enumKey(operator)] === MorphologyOperator.Erode) {\n imgf = this.Skia.ImageFilter.MakeErode(r.x, r.y, this.input(ctx));\n } else {\n imgf = this.Skia.ImageFilter.MakeDilate(r.x, r.y, this.input(ctx));\n }\n this.composeAndPush(ctx, imgf);\n }\n}\n\nexport class BlendImageFilterNode extends ImageFilterDeclaration<BlendImageFilterProps> {\n constructor(ctx: NodeContext, props: BlendImageFilterProps) {\n super(ctx, NodeType.BlendImageFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { mode } = this.props;\n const a = ctx.imageFilters.pop();\n const b = ctx.imageFilters.pop();\n if (!a || !b) {\n throw new Error(\"BlendImageFilter requires two image filters\");\n }\n const imgf = this.Skia.ImageFilter.MakeBlend(mode, a, b);\n this.composeAndPush(ctx, imgf);\n }\n}\n\nexport class RuntimeShaderImageFilterNode extends ImageFilterDeclaration<RuntimeShaderImageFilterProps> {\n constructor(ctx: NodeContext, props: RuntimeShaderImageFilterProps) {\n super(ctx, NodeType.RuntimeShaderImageFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { source, uniforms } = this.props;\n const rtb = this.Skia.RuntimeShaderBuilder(source);\n if (uniforms) {\n processUniforms(source, uniforms, rtb);\n }\n const imgf = this.Skia.ImageFilter.MakeRuntimeShader(\n rtb,\n null,\n this.input(ctx)\n );\n this.composeAndPush(ctx, imgf);\n }\n}\n"],"mappings":"AACA,SACEA,SADF,EAEEC,YAFF,EAGEC,eAHF,EAIEC,QAJF,QAKO,qBALP;AAgBA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,aAAT,EAAwBC,OAAxB,QAAuC,cAAvC;AAEA,SAASC,kBAAT,QAAmC,SAAnC;AAEA,MAAMC,KAAK,GAAGC,YAAY,CAACC,EAAb,CAAgB,CAAhB,EAAmB,CAAnB,EAAsB,CAAtB,EAAyB,CAAzB,CAAd;;AAEA,MAAMC,eAAe,GAAG,CACtBC,IADsB,EAEtBC,UAFsB,EAGtBC,EAHsB,EAItBC,EAJsB,EAKtBC,MALsB,EAMtBC,MANsB,EAOtBC,KAPsB,EAQtBC,KARsB,KASnB;EACH,MAAMC,aAAa,GAAGR,IAAI,CAACS,WAAL,CAAiBC,eAAjB,CACpBV,IAAI,CAACW,WAAL,CAAiBC,SAAjB,CAA2BhB,KAA3B,EAAkCT,SAAS,CAAC0B,GAA5C,CADoB,EAEpB,IAFoB,CAAtB;EAIA,MAAMC,WAAW,GAAGd,IAAI,CAACS,WAAL,CAAiBC,eAAjB,CAClBV,IAAI,CAACW,WAAL,CAAiBC,SAAjB,CAA2BhB,KAA3B,EAAkCT,SAAS,CAAC4B,KAA5C,CADkB,EAElB,IAFkB,CAApB;EAIA,MAAMC,EAAE,GAAGhB,IAAI,CAACS,WAAL,CAAiBC,eAAjB,CACTV,IAAI,CAACW,WAAL,CAAiBC,SAAjB,CAA2BN,KAA3B,EAAkCnB,SAAS,CAAC8B,MAA5C,CADS,EAET,IAFS,CAAX;EAIA,MAAMC,EAAE,GAAGlB,IAAI,CAACS,WAAL,CAAiBU,UAAjB,CAA4BjB,EAA5B,EAAgCC,EAAhC,EA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,EAAWpC,QAAQ,CAAC4F,wBAApB,EAA8CtD,KAA9C;EACD;;EAEDgB,QAAQ,CAAClB,GAAD,EAA0B;IAChC,MAAM;MAAEyD,MAAF;MAAUC;IAAV,IAAuB,KAAKxD,KAAlC;IACA,MAAMyD,GAAG,GAAG,KAAKvF,IAAL,CAAUwF,oBAAV,CAA+BH,MAA/B,CAAZ;;IACA,IAAIC,QAAJ,EAAc;MACZjG,eAAe,CAACgG,MAAD,EAASC,QAAT,EAAmBC,GAAnB,CAAf;IACD;;IACD,MAAM7C,IAAI,GAAG,KAAK1C,IAAL,CAAUS,WAAV,CAAsBgF,iBAAtB,CACXF,GADW,EAEX,IAFW,EAGX,KAAKhF,KAAL,CAAWqB,GAAX,CAHW,CAAb;IAKA,KAAKK,cAAL,CAAoBL,GAApB,EAAyBc,IAAzB;EACD;;AAjBqG"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { NodeContext } from "../Node";
|
2
|
+
import { JsiDeclarationNode } from "../Node";
|
3
|
+
import type { BlurMaskFilterProps } from "../../types";
|
4
|
+
import type { DeclarationContext } from "../../types/DeclarationContext";
|
5
|
+
export declare class BlurMaskFilterNode extends JsiDeclarationNode<BlurMaskFilterProps> {
|
6
|
+
constructor(ctx: NodeContext, props: BlurMaskFilterProps);
|
7
|
+
decorate(ctx: DeclarationContext): void;
|
8
|
+
}
|
@@ -7,13 +7,14 @@ export class BlurMaskFilterNode extends JsiDeclarationNode {
|
|
7
7
|
super(ctx, DeclarationType.MaskFilter, NodeType.BlurMaskFilter, props);
|
8
8
|
}
|
9
9
|
|
10
|
-
|
10
|
+
decorate(ctx) {
|
11
11
|
const {
|
12
12
|
style,
|
13
13
|
blur,
|
14
14
|
respectCTM
|
15
15
|
} = this.props;
|
16
|
-
|
16
|
+
const mf = this.Skia.MaskFilter.MakeBlur(BlurStyle[enumKey(style)], blur, respectCTM);
|
17
|
+
ctx.maskFilters.push(mf);
|
17
18
|
}
|
18
19
|
|
19
20
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BlurStyle","JsiDeclarationNode","DeclarationType","NodeType","enumKey","BlurMaskFilterNode","constructor","ctx","props","MaskFilter","BlurMaskFilter","
|
1
|
+
{"version":3,"names":["BlurStyle","JsiDeclarationNode","DeclarationType","NodeType","enumKey","BlurMaskFilterNode","constructor","ctx","props","MaskFilter","BlurMaskFilter","decorate","style","blur","respectCTM","mf","Skia","MakeBlur","maskFilters","push"],"sources":["MaskFilters.ts"],"sourcesContent":["import { BlurStyle } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type { BlurMaskFilterProps } from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes\";\nimport type { DeclarationContext } from \"../../types/DeclarationContext\";\n\nexport class BlurMaskFilterNode extends JsiDeclarationNode<BlurMaskFilterProps> {\n constructor(ctx: NodeContext, props: BlurMaskFilterProps) {\n super(ctx, DeclarationType.MaskFilter, NodeType.BlurMaskFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { style, blur, respectCTM } = this.props;\n const mf = this.Skia.MaskFilter.MakeBlur(\n BlurStyle[enumKey(style)],\n blur,\n respectCTM\n );\n ctx.maskFilters.push(mf);\n }\n}\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,qBAA1B;AAEA,SAASC,kBAAT,QAAmC,SAAnC;AAEA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,OAAT,QAAwB,cAAxB;AAGA,OAAO,MAAMC,kBAAN,SAAiCJ,kBAAjC,CAAyE;EAC9EK,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAA+C;IACxD,MAAMD,GAAN,EAAWL,eAAe,CAACO,UAA3B,EAAuCN,QAAQ,CAACO,cAAhD,EAAgEF,KAAhE;EACD;;EAEDG,QAAQ,CAACJ,GAAD,EAA0B;IAChC,MAAM;MAAEK,KAAF;MAASC,IAAT;MAAeC;IAAf,IAA8B,KAAKN,KAAzC;IACA,MAAMO,EAAE,GAAG,KAAKC,IAAL,CAAUP,UAAV,CAAqBQ,QAArB,CACTjB,SAAS,CAACI,OAAO,CAACQ,KAAD,CAAR,CADA,EAETC,IAFS,EAGTC,UAHS,CAAX;IAKAP,GAAG,CAACW,WAAJ,CAAgBC,IAAhB,CAAqBJ,EAArB;EACD;;AAb6E"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import type { SkPathEffect } from "../../../skia/types";
|
2
|
+
import type { NodeContext } from "../Node";
|
3
|
+
import { JsiDeclarationNode } from "../Node";
|
4
|
+
import type { CornerPathEffectProps, DashPathEffectProps, DiscretePathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps } from "../../types";
|
5
|
+
import { NodeType } from "../../types";
|
6
|
+
import type { DeclarationContext } from "../../types/DeclarationContext";
|
7
|
+
declare abstract class PathEffectDeclaration<P> extends JsiDeclarationNode<P> {
|
8
|
+
constructor(ctx: NodeContext, type: NodeType, props: P);
|
9
|
+
protected composeAndPush(ctx: DeclarationContext, pe1: SkPathEffect): void;
|
10
|
+
}
|
11
|
+
export declare class DiscretePathEffectNode extends PathEffectDeclaration<DiscretePathEffectProps> {
|
12
|
+
constructor(ctx: NodeContext, props: DiscretePathEffectProps);
|
13
|
+
decorate(ctx: DeclarationContext): void;
|
14
|
+
}
|
15
|
+
export declare class Path2DPathEffectNode extends PathEffectDeclaration<Path2DPathEffectProps> {
|
16
|
+
constructor(ctx: NodeContext, props: Path2DPathEffectProps);
|
17
|
+
decorate(ctx: DeclarationContext): void;
|
18
|
+
}
|
19
|
+
export declare class DashPathEffectNode extends PathEffectDeclaration<DashPathEffectProps> {
|
20
|
+
constructor(ctx: NodeContext, props: DashPathEffectProps);
|
21
|
+
decorate(ctx: DeclarationContext): void;
|
22
|
+
}
|
23
|
+
export declare class CornerPathEffectNode extends PathEffectDeclaration<CornerPathEffectProps> {
|
24
|
+
constructor(ctx: NodeContext, props: CornerPathEffectProps);
|
25
|
+
decorate(ctx: DeclarationContext): void;
|
26
|
+
}
|
27
|
+
export declare class SumPathEffectNode extends PathEffectDeclaration<null> {
|
28
|
+
constructor(ctx: NodeContext);
|
29
|
+
decorate(ctx: DeclarationContext): void;
|
30
|
+
}
|
31
|
+
export declare class Line2DPathEffectNode extends PathEffectDeclaration<Line2DPathEffectProps> {
|
32
|
+
constructor(ctx: NodeContext, props: Line2DPathEffectProps);
|
33
|
+
decorate(ctx: DeclarationContext): void;
|
34
|
+
}
|
35
|
+
export declare class Path1DPathEffectNode extends PathEffectDeclaration<Path1DPathEffectProps> {
|
36
|
+
constructor(ctx: NodeContext, props: Path1DPathEffectProps);
|
37
|
+
decorate(ctx: DeclarationContext): void;
|
38
|
+
}
|
39
|
+
export {};
|
@@ -3,66 +3,20 @@ import { JsiDeclarationNode } from "../Node";
|
|
3
3
|
import { DeclarationType, NodeType } from "../../types";
|
4
4
|
import { enumKey } from "../datatypes/Enum";
|
5
5
|
import { processPath } from "../datatypes";
|
6
|
+
import { composeDeclarations } from "../../types/DeclarationContext";
|
6
7
|
|
7
8
|
class PathEffectDeclaration extends JsiDeclarationNode {
|
8
9
|
constructor(ctx, type, props) {
|
9
10
|
super(ctx, DeclarationType.PathEffect, type, props);
|
10
11
|
}
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
insertChildBefore(child, before) {
|
21
|
-
if (!(child instanceof PathEffectDeclaration)) {
|
22
|
-
throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);
|
23
|
-
}
|
24
|
-
|
25
|
-
super.insertChildBefore(child, before);
|
26
|
-
}
|
27
|
-
|
28
|
-
compose(pe) {
|
29
|
-
const children = this._children;
|
30
|
-
|
31
|
-
if (this._children.length === 0) {
|
32
|
-
return pe;
|
33
|
-
} else {
|
34
|
-
return this.Skia.PathEffect.MakeCompose(pe, children.reduce((acc, child) => {
|
35
|
-
if (acc === null) {
|
36
|
-
return child.materialize();
|
37
|
-
}
|
38
|
-
|
39
|
-
return this.Skia.PathEffect.MakeCompose(acc, child.materialize());
|
40
|
-
}, null));
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
getOptionalChildInstance(index) {
|
45
|
-
const child = this._children[index];
|
46
|
-
|
47
|
-
if (!child) {
|
48
|
-
return null;
|
49
|
-
}
|
50
|
-
|
51
|
-
return this.getMandatoryChildInstance(index);
|
52
|
-
}
|
53
|
-
|
54
|
-
getMandatoryChildInstance(index) {
|
55
|
-
const child = this._children[index];
|
56
|
-
|
57
|
-
if (child instanceof JsiDeclarationNode) {
|
58
|
-
if (child.isPathEffect()) {
|
59
|
-
return child.materialize();
|
60
|
-
} else {
|
61
|
-
throw new Error(`Found invalid child ${child.type} in ${this.type}`);
|
62
|
-
}
|
63
|
-
} else {
|
64
|
-
throw new Error(`Found invalid child ${child.type} in ${this.type}`);
|
65
|
-
}
|
13
|
+
composeAndPush(ctx, pe1) {
|
14
|
+
ctx.save();
|
15
|
+
this.decorateChildren(ctx);
|
16
|
+
const pe2 = ctx.pathEffects.popAllAsOne();
|
17
|
+
ctx.restore();
|
18
|
+
const pe = pe2 ? this.Skia.PathEffect.MakeCompose(pe1, pe2) : pe1;
|
19
|
+
ctx.pathEffects.push(pe);
|
66
20
|
}
|
67
21
|
|
68
22
|
}
|
@@ -72,14 +26,14 @@ export class DiscretePathEffectNode extends PathEffectDeclaration {
|
|
72
26
|
super(ctx, NodeType.DiscretePathEffect, props);
|
73
27
|
}
|
74
28
|
|
75
|
-
|
29
|
+
decorate(ctx) {
|
76
30
|
const {
|
77
31
|
length,
|
78
32
|
deviation,
|
79
33
|
seed
|
80
34
|
} = this.props;
|
81
35
|
const pe = this.Skia.PathEffect.MakeDiscrete(length, deviation, seed);
|
82
|
-
|
36
|
+
this.composeAndPush(ctx, pe);
|
83
37
|
}
|
84
38
|
|
85
39
|
}
|
@@ -88,7 +42,7 @@ export class Path2DPathEffectNode extends PathEffectDeclaration {
|
|
88
42
|
super(ctx, NodeType.Path2DPathEffect, props);
|
89
43
|
}
|
90
44
|
|
91
|
-
|
45
|
+
decorate(ctx) {
|
92
46
|
const {
|
93
47
|
matrix
|
94
48
|
} = this.props;
|
@@ -96,10 +50,10 @@ export class Path2DPathEffectNode extends PathEffectDeclaration {
|
|
96
50
|
const pe = this.Skia.PathEffect.MakePath2D(matrix, path);
|
97
51
|
|
98
52
|
if (pe === null) {
|
99
|
-
|
53
|
+
throw new Error("Path2DPathEffectNode: invalid path");
|
100
54
|
}
|
101
55
|
|
102
|
-
|
56
|
+
this.composeAndPush(ctx, pe);
|
103
57
|
}
|
104
58
|
|
105
59
|
}
|
@@ -108,13 +62,13 @@ export class DashPathEffectNode extends PathEffectDeclaration {
|
|
108
62
|
super(ctx, NodeType.DashPathEffect, props);
|
109
63
|
}
|
110
64
|
|
111
|
-
|
65
|
+
decorate(ctx) {
|
112
66
|
const {
|
113
67
|
intervals,
|
114
68
|
phase
|
115
69
|
} = this.props;
|
116
70
|
const pe = this.Skia.PathEffect.MakeDash(intervals, phase);
|
117
|
-
|
71
|
+
this.composeAndPush(ctx, pe);
|
118
72
|
}
|
119
73
|
|
120
74
|
}
|
@@ -123,17 +77,17 @@ export class CornerPathEffectNode extends PathEffectDeclaration {
|
|
123
77
|
super(ctx, NodeType.CornerPathEffect, props);
|
124
78
|
}
|
125
79
|
|
126
|
-
|
80
|
+
decorate(ctx) {
|
127
81
|
const {
|
128
82
|
r
|
129
83
|
} = this.props;
|
130
84
|
const pe = this.Skia.PathEffect.MakeCorner(r);
|
131
85
|
|
132
86
|
if (pe === null) {
|
133
|
-
|
87
|
+
throw new Error("CornerPathEffectNode: couldn't create path effect");
|
134
88
|
}
|
135
89
|
|
136
|
-
|
90
|
+
this.composeAndPush(ctx, pe);
|
137
91
|
}
|
138
92
|
|
139
93
|
}
|
@@ -142,8 +96,11 @@ export class SumPathEffectNode extends PathEffectDeclaration {
|
|
142
96
|
super(ctx, NodeType.SumPathEffect, null);
|
143
97
|
}
|
144
98
|
|
145
|
-
|
146
|
-
|
99
|
+
decorate(ctx) {
|
100
|
+
this.decorateChildren(ctx);
|
101
|
+
const pes = ctx.pathEffects.popAll();
|
102
|
+
const pe = composeDeclarations(pes, this.Skia.PathEffect.MakeSum.bind(this.Skia.PathEffect));
|
103
|
+
ctx.pathEffects.push(pe);
|
147
104
|
}
|
148
105
|
|
149
106
|
}
|
@@ -152,7 +109,7 @@ export class Line2DPathEffectNode extends PathEffectDeclaration {
|
|
152
109
|
super(ctx, NodeType.Line2DPathEffect, props);
|
153
110
|
}
|
154
111
|
|
155
|
-
|
112
|
+
decorate(ctx) {
|
156
113
|
const {
|
157
114
|
width,
|
158
115
|
matrix
|
@@ -160,10 +117,10 @@ export class Line2DPathEffectNode extends PathEffectDeclaration {
|
|
160
117
|
const pe = this.Skia.PathEffect.MakeLine2D(width, matrix);
|
161
118
|
|
162
119
|
if (pe === null) {
|
163
|
-
|
120
|
+
throw new Error("Line2DPathEffectNode: could not create path effect");
|
164
121
|
}
|
165
122
|
|
166
|
-
|
123
|
+
this.composeAndPush(ctx, pe);
|
167
124
|
}
|
168
125
|
|
169
126
|
}
|
@@ -172,7 +129,7 @@ export class Path1DPathEffectNode extends PathEffectDeclaration {
|
|
172
129
|
super(ctx, NodeType.Path1DPathEffect, props);
|
173
130
|
}
|
174
131
|
|
175
|
-
|
132
|
+
decorate(ctx) {
|
176
133
|
const {
|
177
134
|
advance,
|
178
135
|
phase,
|
@@ -182,10 +139,10 @@ export class Path1DPathEffectNode extends PathEffectDeclaration {
|
|
182
139
|
const pe = this.Skia.PathEffect.MakePath1D(path, advance, phase, Path1DEffectStyle[enumKey(style)]);
|
183
140
|
|
184
141
|
if (pe === null) {
|
185
|
-
|
142
|
+
throw new Error("Path1DPathEffectNode: could not create path effect");
|
186
143
|
}
|
187
144
|
|
188
|
-
|
145
|
+
this.composeAndPush(ctx, pe);
|
189
146
|
}
|
190
147
|
|
191
148
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Path1DEffectStyle","JsiDeclarationNode","DeclarationType","NodeType","enumKey","processPath","PathEffectDeclaration","constructor","ctx","type","props","PathEffect","addChild","child","Error","insertChildBefore","before","compose","pe","children","_children","length","Skia","MakeCompose","reduce","acc","materialize","getOptionalChildInstance","index","getMandatoryChildInstance","isPathEffect","DiscretePathEffectNode","DiscretePathEffect","deviation","seed","MakeDiscrete","Path2DPathEffectNode","Path2DPathEffect","matrix","path","MakePath2D","DashPathEffectNode","DashPathEffect","intervals","phase","MakeDash","CornerPathEffectNode","CornerPathEffect","r","MakeCorner","SumPathEffectNode","SumPathEffect","MakeSum","Line2DPathEffectNode","Line2DPathEffect","width","MakeLine2D","Path1DPathEffectNode","Path1DPathEffect","advance","style","MakePath1D"],"sources":["PathEffects.ts"],"sourcesContent":["import { Path1DEffectStyle } from \"../../../skia/types\";\nimport type { SkPathEffect } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Node,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes/Enum\";\nimport { processPath } from \"../datatypes\";\n\nabstract class PathEffectDeclaration<\n P,\n Nullable extends null | never = never\n> extends JsiDeclarationNode<P, SkPathEffect, Nullable> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.PathEffect, type, props);\n }\n\n addChild(child: Node<unknown>) {\n if (!(child instanceof PathEffectDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void {\n if (!(child instanceof PathEffectDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.insertChildBefore(child, before);\n }\n\n compose(pe: SkPathEffect) {\n const children = this._children as PathEffectDeclaration<unknown>[];\n if (this._children.length === 0) {\n return pe;\n } else {\n return this.Skia.PathEffect.MakeCompose(\n pe,\n children.reduce<SkPathEffect | null>((acc, child) => {\n if (acc === null) {\n return child.materialize();\n }\n return this.Skia.PathEffect.MakeCompose(acc, child.materialize());\n }, null) as SkPathEffect\n );\n }\n }\n getOptionalChildInstance(index: number) {\n const child = this._children[index];\n if (!child) {\n return null;\n }\n return this.getMandatoryChildInstance(index);\n }\n\n getMandatoryChildInstance(index: number) {\n const child = this._children[index];\n if (child instanceof JsiDeclarationNode) {\n if (child.isPathEffect()) {\n return child.materialize();\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n } else {\n throw new Error(`Found invalid child ${child.type} in ${this.type}`);\n }\n }\n}\n\nexport class DiscretePathEffectNode extends PathEffectDeclaration<DiscretePathEffectProps> {\n constructor(ctx: NodeContext, props: DiscretePathEffectProps) {\n super(ctx, NodeType.DiscretePathEffect, props);\n }\n\n materialize() {\n const { length, deviation, seed } = this.props;\n const pe = this.Skia.PathEffect.MakeDiscrete(length, deviation, seed);\n return this.compose(pe);\n }\n}\n\nexport class Path2DPathEffectNode extends PathEffectDeclaration<\n Path2DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Path2DPathEffectProps) {\n super(ctx, NodeType.Path2DPathEffect, props);\n }\n\n materialize() {\n const { matrix } = this.props;\n const path = processPath(this.Skia, this.props.path);\n const pe = this.Skia.PathEffect.MakePath2D(matrix, path);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class DashPathEffectNode extends PathEffectDeclaration<DashPathEffectProps> {\n constructor(ctx: NodeContext, props: DashPathEffectProps) {\n super(ctx, NodeType.DashPathEffect, props);\n }\n\n materialize() {\n const { intervals, phase } = this.props;\n const pe = this.Skia.PathEffect.MakeDash(intervals, phase);\n return this.compose(pe);\n }\n}\n\nexport class CornerPathEffectNode extends PathEffectDeclaration<\n CornerPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: CornerPathEffectProps) {\n super(ctx, NodeType.CornerPathEffect, props);\n }\n\n materialize() {\n const { r } = this.props;\n const pe = this.Skia.PathEffect.MakeCorner(r);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class SumPathEffectNode extends PathEffectDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.SumPathEffect, null);\n }\n\n materialize() {\n return this.Skia.PathEffect.MakeSum(\n this.getMandatoryChildInstance(0),\n this.getMandatoryChildInstance(1)\n );\n }\n}\n\nexport class Line2DPathEffectNode extends PathEffectDeclaration<\n Line2DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Line2DPathEffectProps) {\n super(ctx, NodeType.Line2DPathEffect, props);\n }\n\n materialize() {\n const { width, matrix } = this.props;\n const pe = this.Skia.PathEffect.MakeLine2D(width, matrix);\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n\nexport class Path1DPathEffectNode extends PathEffectDeclaration<\n Path1DPathEffectProps,\n null\n> {\n constructor(ctx: NodeContext, props: Path1DPathEffectProps) {\n super(ctx, NodeType.Path1DPathEffect, props);\n }\n\n materialize() {\n const { advance, phase, style } = this.props;\n const path = processPath(this.Skia, this.props.path);\n const pe = this.Skia.PathEffect.MakePath1D(\n path,\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (pe === null) {\n return null;\n }\n return this.compose(pe);\n }\n}\n"],"mappings":"AAAA,SAASA,iBAAT,QAAkC,qBAAlC;AAGA,SAASC,kBAAT,QAAmC,SAAnC;AAUA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,OAAT,QAAwB,mBAAxB;AACA,SAASC,WAAT,QAA4B,cAA5B;;AAEA,MAAeC,qBAAf,SAGUL,kBAHV,CAGwD;EACtDM,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KA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EAGTf,KAHS,EAIT5C,iBAAiB,CAACI,OAAO,CAACwD,KAAD,CAAR,CAJR,CAAX;;IAMA,IAAI1C,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,KAAKD,OAAL,CAAaC,EAAb,CAAP;EACD;;AAlBD"}
|
1
|
+
{"version":3,"names":["Path1DEffectStyle","JsiDeclarationNode","DeclarationType","NodeType","enumKey","processPath","composeDeclarations","PathEffectDeclaration","constructor","ctx","type","props","PathEffect","composeAndPush","pe1","save","decorateChildren","pe2","pathEffects","popAllAsOne","restore","pe","Skia","MakeCompose","push","DiscretePathEffectNode","DiscretePathEffect","decorate","length","deviation","seed","MakeDiscrete","Path2DPathEffectNode","Path2DPathEffect","matrix","path","MakePath2D","Error","DashPathEffectNode","DashPathEffect","intervals","phase","MakeDash","CornerPathEffectNode","CornerPathEffect","r","MakeCorner","SumPathEffectNode","SumPathEffect","pes","popAll","MakeSum","bind","Line2DPathEffectNode","Line2DPathEffect","width","MakeLine2D","Path1DPathEffectNode","Path1DPathEffect","advance","style","MakePath1D"],"sources":["PathEffects.ts"],"sourcesContent":["import { Path1DEffectStyle } from \"../../../skia/types\";\nimport type { SkPathEffect } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes/Enum\";\nimport { processPath } from \"../datatypes\";\nimport type { DeclarationContext } from \"../../types/DeclarationContext\";\nimport { composeDeclarations } from \"../../types/DeclarationContext\";\n\nabstract class PathEffectDeclaration<P> extends JsiDeclarationNode<P> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.PathEffect, type, props);\n }\n\n protected composeAndPush(ctx: DeclarationContext, pe1: SkPathEffect) {\n ctx.save();\n this.decorateChildren(ctx);\n const pe2 = ctx.pathEffects.popAllAsOne();\n ctx.restore();\n const pe = pe2 ? this.Skia.PathEffect.MakeCompose(pe1, pe2) : pe1;\n ctx.pathEffects.push(pe);\n }\n}\n\nexport class DiscretePathEffectNode extends PathEffectDeclaration<DiscretePathEffectProps> {\n constructor(ctx: NodeContext, props: DiscretePathEffectProps) {\n super(ctx, NodeType.DiscretePathEffect, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { length, deviation, seed } = this.props;\n const pe = this.Skia.PathEffect.MakeDiscrete(length, deviation, seed);\n this.composeAndPush(ctx, pe);\n }\n}\n\nexport class Path2DPathEffectNode extends PathEffectDeclaration<Path2DPathEffectProps> {\n constructor(ctx: NodeContext, props: Path2DPathEffectProps) {\n super(ctx, NodeType.Path2DPathEffect, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { matrix } = this.props;\n const path = processPath(this.Skia, this.props.path);\n const pe = this.Skia.PathEffect.MakePath2D(matrix, path);\n if (pe === null) {\n throw new Error(\"Path2DPathEffectNode: invalid path\");\n }\n this.composeAndPush(ctx, pe);\n }\n}\n\nexport class DashPathEffectNode extends PathEffectDeclaration<DashPathEffectProps> {\n constructor(ctx: NodeContext, props: DashPathEffectProps) {\n super(ctx, NodeType.DashPathEffect, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { intervals, phase } = this.props;\n const pe = this.Skia.PathEffect.MakeDash(intervals, phase);\n this.composeAndPush(ctx, pe);\n }\n}\n\nexport class CornerPathEffectNode extends PathEffectDeclaration<CornerPathEffectProps> {\n constructor(ctx: NodeContext, props: CornerPathEffectProps) {\n super(ctx, NodeType.CornerPathEffect, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { r } = this.props;\n const pe = this.Skia.PathEffect.MakeCorner(r);\n if (pe === null) {\n throw new Error(\"CornerPathEffectNode: couldn't create path effect\");\n }\n this.composeAndPush(ctx, pe);\n }\n}\n\nexport class SumPathEffectNode extends PathEffectDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.SumPathEffect, null);\n }\n\n decorate(ctx: DeclarationContext) {\n this.decorateChildren(ctx);\n const pes = ctx.pathEffects.popAll();\n const pe = composeDeclarations(\n pes,\n this.Skia.PathEffect.MakeSum.bind(this.Skia.PathEffect)\n );\n ctx.pathEffects.push(pe);\n }\n}\n\nexport class Line2DPathEffectNode extends PathEffectDeclaration<Line2DPathEffectProps> {\n constructor(ctx: NodeContext, props: Line2DPathEffectProps) {\n super(ctx, NodeType.Line2DPathEffect, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { width, matrix } = this.props;\n const pe = this.Skia.PathEffect.MakeLine2D(width, matrix);\n if (pe === null) {\n throw new Error(\"Line2DPathEffectNode: could not create path effect\");\n }\n this.composeAndPush(ctx, pe);\n }\n}\n\nexport class Path1DPathEffectNode extends PathEffectDeclaration<Path1DPathEffectProps> {\n constructor(ctx: NodeContext, props: Path1DPathEffectProps) {\n super(ctx, NodeType.Path1DPathEffect, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { advance, phase, style } = this.props;\n const path = processPath(this.Skia, this.props.path);\n const pe = this.Skia.PathEffect.MakePath1D(\n path,\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (pe === null) {\n throw new Error(\"Path1DPathEffectNode: could not create path effect\");\n }\n this.composeAndPush(ctx, pe);\n }\n}\n"],"mappings":"AAAA,SAASA,iBAAT,QAAkC,qBAAlC;AAGA,SAASC,kBAAT,QAAmC,SAAnC;AASA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,aAA1C;AACA,SAASC,OAAT,QAAwB,mBAAxB;AACA,SAASC,WAAT,QAA4B,cAA5B;AAEA,SAASC,mBAAT,QAAoC,gCAApC;;AAEA,MAAeC,qBAAf,SAAgDN,kBAAhD,CAAsE;EACpEO,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;IACtD,MAAMF,GAAN,EAAWP,e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C/C,KAAtC;EACD;;EAEDgB,QAAQ,CAAClB,GAAD,EAA0B;IAChC,MAAM;MAAEkD,OAAF;MAAWlB,KAAX;MAAkBmB;IAAlB,IAA4B,KAAKjD,KAAvC;IACA,MAAMwB,IAAI,GAAG9B,WAAW,CAAC,KAAKiB,IAAN,EAAY,KAAKX,KAAL,CAAWwB,IAAvB,CAAxB;IACA,MAAMd,EAAE,GAAG,KAAKC,IAAL,CAAUV,UAAV,CAAqBiD,UAArB,CACT1B,IADS,EAETwB,OAFS,EAGTlB,KAHS,EAITzC,iBAAiB,CAACI,OAAO,CAACwD,KAAD,CAAR,CAJR,CAAX;;IAMA,IAAIvC,EAAE,KAAK,IAAX,EAAiB;MACf,MAAM,IAAIgB,KAAJ,CAAU,oDAAV,CAAN;IACD;;IACD,KAAKxB,cAAL,CAAoBJ,GAApB,EAAyBY,EAAzB;EACD;;AAlBoF"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import type { NodeContext } from "../Node";
|
2
|
+
import { JsiDeclarationNode } from "../Node";
|
3
|
+
import type { ColorProps, DeclarationContext, FractalNoiseProps, ImageShaderProps, LinearGradientProps, RadialGradientProps, ShaderProps, SweepGradientProps, TurbulenceProps, TwoPointConicalGradientProps } from "../../types";
|
4
|
+
import { NodeType } from "../../types";
|
5
|
+
export declare abstract class ShaderDeclaration<P> extends JsiDeclarationNode<P> {
|
6
|
+
constructor(ctx: NodeContext, type: NodeType, props: P);
|
7
|
+
}
|
8
|
+
export declare class ShaderNode extends ShaderDeclaration<ShaderProps> {
|
9
|
+
constructor(ctx: NodeContext, props: ShaderProps);
|
10
|
+
decorate(ctx: DeclarationContext): void;
|
11
|
+
}
|
12
|
+
export declare class ImageShaderNode extends ShaderDeclaration<ImageShaderProps> {
|
13
|
+
constructor(ctx: NodeContext, props: ImageShaderProps);
|
14
|
+
decorate(ctx: DeclarationContext): void;
|
15
|
+
}
|
16
|
+
export declare class ColorNode extends ShaderDeclaration<ColorProps> {
|
17
|
+
constructor(ctx: NodeContext, props: ColorProps);
|
18
|
+
decorate(ctx: DeclarationContext): void;
|
19
|
+
}
|
20
|
+
export declare class TurbulenceNode extends ShaderDeclaration<TurbulenceProps> {
|
21
|
+
constructor(ctx: NodeContext, props: TurbulenceProps);
|
22
|
+
decorate(ctx: DeclarationContext): void;
|
23
|
+
}
|
24
|
+
export declare class FractalNoiseNode extends ShaderDeclaration<FractalNoiseProps> {
|
25
|
+
constructor(ctx: NodeContext, props: FractalNoiseProps);
|
26
|
+
decorate(ctx: DeclarationContext): void;
|
27
|
+
}
|
28
|
+
export declare class LinearGradientNode extends ShaderDeclaration<LinearGradientProps> {
|
29
|
+
constructor(ctx: NodeContext, props: LinearGradientProps);
|
30
|
+
decorate(ctx: DeclarationContext): void;
|
31
|
+
}
|
32
|
+
export declare class RadialGradientNode extends ShaderDeclaration<RadialGradientProps> {
|
33
|
+
constructor(ctx: NodeContext, props: RadialGradientProps);
|
34
|
+
decorate(ctx: DeclarationContext): void;
|
35
|
+
}
|
36
|
+
export declare class SweepGradientNode extends ShaderDeclaration<SweepGradientProps> {
|
37
|
+
constructor(ctx: NodeContext, props: SweepGradientProps);
|
38
|
+
decorate(ctx: DeclarationContext): void;
|
39
|
+
}
|
40
|
+
export declare class TwoPointConicalGradientNode extends ShaderDeclaration<TwoPointConicalGradientProps> {
|
41
|
+
constructor(ctx: NodeContext, props: TwoPointConicalGradientProps);
|
42
|
+
decorate(ctx: DeclarationContext): void;
|
43
|
+
}
|