@shopify/react-native-skia 0.1.150 → 0.1.152
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +4 -5
- package/android/cpp/jni/JniLoad.cpp +7 -5
- package/android/cpp/jni/JniSkiaManager.cpp +2 -15
- package/android/cpp/jni/include/JniSkiaBaseView.h +68 -0
- package/android/cpp/jni/include/JniSkiaDrawView.h +64 -47
- package/android/cpp/jni/include/JniSkiaManager.h +8 -10
- package/android/cpp/jni/include/JniSkiaPictureView.h +96 -0
- package/android/cpp/rnskia-android/{RNSkPlatformContextImpl.h → RNSkAndroidPlatformContext.h} +4 -4
- package/android/cpp/rnskia-android/RNSkAndroidView.h +100 -0
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +91 -0
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +39 -0
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -6
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +5 -4
- package/android/src/main/java/com/shopify/reactnative/skia/PlatformContext.java +5 -11
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +143 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +17 -145
- package/android/src/main/java/com/shopify/reactnative/skia/{RNSkiaViewManager.java → SkiaDrawViewManager.java} +4 -15
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaManager.java +1 -10
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +45 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +64 -0
- package/cpp/jsi/JsiValueWrapper.h +11 -0
- package/cpp/rnskia/RNSkInfoParameter.h +4 -14
- package/cpp/rnskia/RNSkJsView.cpp +211 -0
- package/cpp/rnskia/RNSkJsView.h +115 -0
- package/cpp/rnskia/RNSkJsiViewApi.h +6 -6
- package/cpp/rnskia/RNSkManager.cpp +7 -7
- package/cpp/rnskia/RNSkManager.h +7 -7
- package/cpp/rnskia/RNSkPictureView.h +124 -0
- package/cpp/rnskia/RNSkView.h +287 -0
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +38 -0
- package/ios/RNSkia-iOS/{RNSkDrawViewImpl.mm → RNSkMetalCanvasProvider.mm} +40 -23
- package/ios/RNSkia-iOS/{PlatformContext.h → RNSkiOSPlatformContext.h} +4 -4
- package/ios/RNSkia-iOS/{PlatformContext.mm → RNSkiOSPlatformContext.mm} +5 -5
- package/ios/RNSkia-iOS/RNSkiOSView.h +34 -0
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +19 -11
- package/ios/RNSkia-iOS/SkiaManager.mm +3 -3
- package/ios/RNSkia-iOS/SkiaPictureViewManager.h +8 -0
- package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +51 -0
- package/ios/RNSkia-iOS/SkiaUIView.h +26 -0
- package/ios/RNSkia-iOS/{SkiaDrawView.mm → SkiaUIView.mm} +29 -23
- package/lib/commonjs/animation/decay/decay.js.map +1 -1
- package/lib/commonjs/animation/decay/index.js.map +1 -1
- package/lib/commonjs/animation/decay/runDecay.js.map +1 -1
- package/lib/commonjs/animation/decay/types.js.map +1 -1
- package/lib/commonjs/animation/functions/index.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolate.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -1
- package/lib/commonjs/animation/index.js.map +1 -1
- package/lib/commonjs/animation/spring/Spring.js.map +1 -1
- package/lib/commonjs/animation/spring/functions/index.js.map +1 -1
- package/lib/commonjs/animation/spring/functions/spring.js.map +1 -1
- package/lib/commonjs/animation/spring/index.js.map +1 -1
- package/lib/commonjs/animation/spring/runSpring.js +1 -1
- package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
- package/lib/commonjs/animation/spring/types.js.map +1 -1
- package/lib/commonjs/animation/spring/useSpring.js +1 -1
- package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
- package/lib/commonjs/animation/timing/Easing.js.map +1 -1
- package/lib/commonjs/animation/timing/createTiming.js +2 -6
- package/lib/commonjs/animation/timing/createTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/bezier.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js +6 -10
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/index.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/timing.js.map +1 -1
- package/lib/commonjs/animation/timing/functions/types.js.map +1 -1
- package/lib/commonjs/animation/timing/index.js.map +1 -1
- package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
- package/lib/commonjs/animation/timing/useTiming.js +1 -3
- package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
- package/lib/commonjs/animation/types.js.map +1 -1
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/Node.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Color.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js +2 -2
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.js +2 -4
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/index.js.map +1 -1
- package/lib/commonjs/dom/types/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/types/MaskFilters.js.map +1 -1
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/PathEffects.js.map +1 -1
- package/lib/commonjs/dom/types/Shaders.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/dom/types/index.js.map +1 -1
- package/lib/commonjs/external/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +6 -10
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
- package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +0 -2
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.js.map +1 -1
- package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/components/Group.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/Paint.js +1 -1
- package/lib/commonjs/renderer/components/Paint.js.map +1 -1
- package/lib/commonjs/renderer/components/Picture.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/index.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/commonjs/renderer/components/colorFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/image/index.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/index.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/index.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/ShaderLib.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/index.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/components/text/index.js.map +1 -1
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
- package/lib/commonjs/renderer/typeddash.js.map +1 -1
- package/lib/commonjs/renderer/useCanvas.js.map +1 -1
- package/lib/commonjs/renderer/useContextBridge.js.map +1 -1
- package/lib/commonjs/skia/NativeSetup.js.map +1 -1
- package/lib/commonjs/skia/Skia.js.map +1 -1
- package/lib/commonjs/skia/Skia.web.js.map +1 -1
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Font.js.map +1 -1
- package/lib/commonjs/skia/core/Image.js.map +1 -1
- package/lib/commonjs/skia/core/Matrix.js.map +1 -1
- package/lib/commonjs/skia/core/Picture.js.map +1 -1
- package/lib/commonjs/skia/core/RRect.js.map +1 -1
- package/lib/commonjs/skia/core/Rect.js.map +1 -1
- package/lib/commonjs/skia/core/SVG.js.map +1 -1
- package/lib/commonjs/skia/core/Typeface.js.map +1 -1
- package/lib/commonjs/skia/core/Vector.js +1 -1
- package/lib/commonjs/skia/core/Vector.js.map +1 -1
- package/lib/commonjs/skia/core/index.js.map +1 -1
- package/lib/commonjs/skia/index.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Color.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/ColorFilter.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/types/ColorFilter/index.js.map +1 -1
- package/lib/commonjs/skia/types/ContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Data/DataFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Data/index.js.map +1 -1
- package/lib/commonjs/skia/types/Font/Font.js.map +1 -1
- package/lib/commonjs/skia/types/Font/index.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Image/index.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/index.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/index.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Path/index.js.map +1 -1
- package/lib/commonjs/skia/types/PathEffect.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/Picture.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/index.js.map +1 -1
- package/lib/commonjs/skia/types/Point.js.map +1 -1
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/types/RSXform.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/index.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVGFactory.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/index.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/ShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/index.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/index.js.map +1 -1
- package/lib/commonjs/skia/types/TextBlob.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/TypefaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/index.js.map +1 -1
- package/lib/commonjs/skia/types/Vertices/Vertices.js.map +1 -1
- package/lib/commonjs/skia/types/Vertices/index.js.map +1 -1
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/Host.js +1 -1
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/skia/web/index.js.map +1 -1
- package/lib/commonjs/values/api.js.map +1 -1
- package/lib/commonjs/values/api.web.js.map +1 -1
- package/lib/commonjs/values/hooks/index.js.map +1 -1
- package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
- package/lib/commonjs/values/index.js.map +1 -1
- package/lib/commonjs/values/selector.js.map +1 -1
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/values/web/RNSkAnimation.js +2 -2
- package/lib/commonjs/values/web/RNSkAnimation.js.map +1 -1
- package/lib/commonjs/values/web/RNSkClockValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkValue.js.map +1 -1
- package/lib/commonjs/values/web/api.js.map +1 -1
- package/lib/commonjs/values/web/index.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js +213 -0
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -0
- package/lib/commonjs/views/SkiaPictureView.js +112 -0
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -0
- package/lib/commonjs/views/SkiaPictureView.web.js +31 -0
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -0
- package/lib/commonjs/views/SkiaView.js +2 -2
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/commonjs/views/SkiaView.web.js +14 -203
- package/lib/commonjs/views/SkiaView.web.js.map +1 -1
- package/lib/commonjs/views/api.js.map +1 -1
- package/lib/commonjs/views/index.js +13 -0
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/commonjs/views/useDrawCallback.js.map +1 -1
- package/lib/commonjs/views/useTouchHandler.js +6 -6
- package/lib/commonjs/views/useTouchHandler.js.map +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
- package/lib/commonjs/web/WithSkiaWeb.js +1 -1
- package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/module/animation/decay/decay.js.map +1 -1
- package/lib/module/animation/decay/index.js.map +1 -1
- package/lib/module/animation/decay/runDecay.js.map +1 -1
- package/lib/module/animation/decay/types.js.map +1 -1
- package/lib/module/animation/functions/index.js.map +1 -1
- package/lib/module/animation/functions/interpolate.js.map +1 -1
- package/lib/module/animation/functions/interpolateColors.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/module/animation/functions/interpolateVector.js.map +1 -1
- package/lib/module/animation/index.js.map +1 -1
- package/lib/module/animation/spring/Spring.js.map +1 -1
- package/lib/module/animation/spring/functions/index.js.map +1 -1
- package/lib/module/animation/spring/functions/spring.js.map +1 -1
- package/lib/module/animation/spring/index.js.map +1 -1
- package/lib/module/animation/spring/runSpring.js +1 -1
- package/lib/module/animation/spring/runSpring.js.map +1 -1
- package/lib/module/animation/spring/types.js.map +1 -1
- package/lib/module/animation/spring/useSpring.js +1 -1
- package/lib/module/animation/spring/useSpring.js.map +1 -1
- package/lib/module/animation/timing/Easing.js.map +1 -1
- package/lib/module/animation/timing/createTiming.js +2 -6
- package/lib/module/animation/timing/createTiming.js.map +1 -1
- package/lib/module/animation/timing/functions/bezier.js.map +1 -1
- package/lib/module/animation/timing/functions/getResolvedParams.js +6 -10
- package/lib/module/animation/timing/functions/getResolvedParams.js.map +1 -1
- package/lib/module/animation/timing/functions/index.js.map +1 -1
- package/lib/module/animation/timing/functions/timing.js.map +1 -1
- package/lib/module/animation/timing/functions/types.js.map +1 -1
- package/lib/module/animation/timing/index.js.map +1 -1
- package/lib/module/animation/timing/runTiming.js.map +1 -1
- package/lib/module/animation/timing/useLoop.js.map +1 -1
- package/lib/module/animation/timing/useTiming.js +1 -3
- package/lib/module/animation/timing/useTiming.js.map +1 -1
- package/lib/module/animation/types.js.map +1 -1
- package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/GroupNode.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/Node.js.map +1 -1
- package/lib/module/dom/nodes/PaintContext.js.map +1 -1
- package/lib/module/dom/nodes/PaintNode.js.map +1 -1
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Color.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +2 -2
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/nodes/index.js.map +1 -1
- package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/module/dom/nodes/paint/Shaders.js +2 -4
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/module/dom/nodes/paint/index.js.map +1 -1
- package/lib/module/dom/types/ColorFilters.js.map +1 -1
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/ImageFilters.js.map +1 -1
- package/lib/module/dom/types/MaskFilters.js.map +1 -1
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/PathEffects.js.map +1 -1
- package/lib/module/dom/types/Shaders.js.map +1 -1
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/dom/types/index.js.map +1 -1
- package/lib/module/external/index.js.map +1 -1
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock/index.js +6 -10
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/DependencyManager.js.map +1 -1
- package/lib/module/renderer/DrawingContext.js.map +1 -1
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +0 -2
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/Drawing.js.map +1 -1
- package/lib/module/renderer/components/Group.js.map +1 -1
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +1 -1
- package/lib/module/renderer/components/Paint.js.map +1 -1
- package/lib/module/renderer/components/Picture.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropBlur.js +1 -1
- package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/module/renderer/components/backdrop/index.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
- package/lib/module/renderer/components/colorFilters/index.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/image/index.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/index.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/index.js.map +1 -1
- package/lib/module/renderer/components/shaders/Color.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/ShaderLib.js.map +1 -1
- package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
- package/lib/module/renderer/components/shaders/index.js.map +1 -1
- package/lib/module/renderer/components/shapes/Box.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Line.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/shapes/index.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/components/text/index.js.map +1 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/renderer/processors/Animations/index.js.map +1 -1
- package/lib/module/renderer/processors/index.js.map +1 -1
- package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
- package/lib/module/renderer/processors/math/Math.js.map +1 -1
- package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
- package/lib/module/renderer/processors/math/index.js.map +1 -1
- package/lib/module/renderer/typeddash.js.map +1 -1
- package/lib/module/renderer/useCanvas.js.map +1 -1
- package/lib/module/renderer/useContextBridge.js.map +1 -1
- package/lib/module/skia/NativeSetup.js.map +1 -1
- package/lib/module/skia/Skia.js.map +1 -1
- package/lib/module/skia/Skia.web.js.map +1 -1
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Font.js.map +1 -1
- package/lib/module/skia/core/Image.js.map +1 -1
- package/lib/module/skia/core/Matrix.js.map +1 -1
- package/lib/module/skia/core/Picture.js.map +1 -1
- package/lib/module/skia/core/RRect.js.map +1 -1
- package/lib/module/skia/core/Rect.js.map +1 -1
- package/lib/module/skia/core/SVG.js.map +1 -1
- package/lib/module/skia/core/Typeface.js.map +1 -1
- package/lib/module/skia/core/Vector.js +1 -1
- package/lib/module/skia/core/Vector.js.map +1 -1
- package/lib/module/skia/core/index.js.map +1 -1
- package/lib/module/skia/index.js.map +1 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Color.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/ColorFilter.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
- package/lib/module/skia/types/ColorFilter/index.js.map +1 -1
- package/lib/module/skia/types/ContourMeasure.js.map +1 -1
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/types/Data/DataFactory.js.map +1 -1
- package/lib/module/skia/types/Data/index.js.map +1 -1
- package/lib/module/skia/types/Font/Font.js.map +1 -1
- package/lib/module/skia/types/Font/index.js.map +1 -1
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Image/index.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/index.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/skia/types/MaskFilter.js.map +1 -1
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/module/skia/types/Paint/Paint.js.map +1 -1
- package/lib/module/skia/types/Paint/index.js.map +1 -1
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/module/skia/types/Path/index.js.map +1 -1
- package/lib/module/skia/types/PathEffect.js.map +1 -1
- package/lib/module/skia/types/Picture/Picture.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureFactory.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/module/skia/types/Picture/index.js.map +1 -1
- package/lib/module/skia/types/Point.js.map +1 -1
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/types/RSXform.js.map +1 -1
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/index.js.map +1 -1
- package/lib/module/skia/types/SVG/SVG.js.map +1 -1
- package/lib/module/skia/types/SVG/SVGFactory.js.map +1 -1
- package/lib/module/skia/types/SVG/index.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/types/Shader/ShaderFactory.js.map +1 -1
- package/lib/module/skia/types/Shader/index.js.map +1 -1
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/types/Surface/Surface.js.map +1 -1
- package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/module/skia/types/Surface/index.js.map +1 -1
- package/lib/module/skia/types/TextBlob.js.map +1 -1
- package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/module/skia/types/Typeface/TypefaceFactory.js.map +1 -1
- package/lib/module/skia/types/Typeface/index.js.map +1 -1
- package/lib/module/skia/types/Vertices/Vertices.js.map +1 -1
- package/lib/module/skia/types/Vertices/index.js.map +1 -1
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/Host.js +1 -1
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColor.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkShader.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/skia/web/index.js.map +1 -1
- package/lib/module/values/api.js.map +1 -1
- package/lib/module/values/api.web.js.map +1 -1
- package/lib/module/values/hooks/index.js.map +1 -1
- package/lib/module/values/hooks/useClockValue.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/hooks/useValue.js.map +1 -1
- package/lib/module/values/hooks/useValueEffect.js.map +1 -1
- package/lib/module/values/index.js.map +1 -1
- package/lib/module/values/selector.js.map +1 -1
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/values/web/RNSkAnimation.js +2 -2
- package/lib/module/values/web/RNSkAnimation.js.map +1 -1
- package/lib/module/values/web/RNSkClockValue.js.map +1 -1
- package/lib/module/values/web/RNSkComputedValue.js +1 -1
- package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/values/web/RNSkValue.js.map +1 -1
- package/lib/module/values/web/api.js.map +1 -1
- package/lib/module/values/web/index.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +198 -0
- package/lib/module/views/SkiaBaseWebView.js.map +1 -0
- package/lib/module/views/SkiaPictureView.js +94 -0
- package/lib/module/views/SkiaPictureView.js.map +1 -0
- package/lib/module/views/SkiaPictureView.web.js +19 -0
- package/lib/module/views/SkiaPictureView.web.js.map +1 -0
- package/lib/module/views/SkiaView.js +2 -2
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/module/views/SkiaView.web.js +15 -201
- package/lib/module/views/SkiaView.web.js.map +1 -1
- package/lib/module/views/api.js.map +1 -1
- package/lib/module/views/index.js +1 -0
- package/lib/module/views/index.js.map +1 -1
- package/lib/module/views/types.js.map +1 -1
- package/lib/module/views/useDrawCallback.js.map +1 -1
- package/lib/module/views/useTouchHandler.js +6 -6
- package/lib/module/views/useTouchHandler.js.map +1 -1
- package/lib/module/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/web/WithSkiaWeb.js +1 -1
- package/lib/module/web/WithSkiaWeb.js.map +1 -1
- package/lib/module/web/index.js.map +1 -1
- package/lib/typescript/src/animation/decay/runDecay.d.ts +1 -1
- package/lib/typescript/src/animation/spring/runSpring.d.ts +1 -1
- package/lib/typescript/src/animation/spring/useSpring.d.ts +1 -1
- package/lib/typescript/src/animation/timing/createTiming.d.ts +1 -1
- package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +1 -1
- package/lib/typescript/src/animation/timing/runTiming.d.ts +1 -1
- package/lib/typescript/src/animation/timing/useLoop.d.ts +1 -1
- package/lib/typescript/src/animation/timing/useTiming.d.ts +1 -1
- package/lib/typescript/src/mock/index.d.ts +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
- package/lib/typescript/src/renderer/HostConfig.d.ts +1 -1
- package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
- package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +1 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +4 -4
- package/lib/typescript/src/renderer/typeddash.d.ts +2 -2
- package/lib/typescript/src/skia/core/Font.d.ts +1 -1
- package/lib/typescript/src/skia/core/Vector.d.ts +2 -2
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +2 -2
- package/lib/typescript/src/views/SkiaBaseWebView.d.ts +58 -0
- package/lib/typescript/src/views/SkiaPictureView.d.ts +27 -0
- package/lib/typescript/src/views/SkiaPictureView.web.d.ts +7 -0
- package/lib/typescript/src/views/SkiaView.d.ts +4 -4
- package/lib/typescript/src/views/SkiaView.web.d.ts +6 -53
- package/lib/typescript/src/views/index.d.ts +1 -0
- package/lib/typescript/src/views/types.d.ts +7 -2
- package/lib/typescript/src/web/LoadSkiaWeb.d.ts +2 -2
- package/package.json +6 -6
- package/src/renderer/HostConfig.ts +3 -4
- package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
- package/src/renderer/processors/Animations/Animations.ts +11 -4
- package/src/renderer/typeddash.ts +3 -2
- package/src/values/web/RNSkComputedValue.ts +6 -1
- package/src/views/SkiaBaseWebView.tsx +177 -0
- package/src/views/SkiaPictureView.tsx +93 -0
- package/src/views/SkiaPictureView.web.tsx +23 -0
- package/src/views/SkiaView.tsx +6 -7
- package/src/views/SkiaView.web.tsx +18 -167
- package/src/views/index.ts +1 -0
- package/src/views/types.ts +9 -2
- package/android/cpp/jni/JniSkiaDrawView.cpp +0 -113
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +0 -73
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +0 -48
- package/cpp/rnskia/RNSkDrawView.cpp +0 -315
- package/cpp/rnskia/RNSkDrawView.h +0 -226
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +0 -52
- package/ios/RNSkia-iOS/SkiaDrawView.h +0 -23
@@ -0,0 +1,177 @@
|
|
1
|
+
/* global HTMLCanvasElement */
|
2
|
+
import React from "react";
|
3
|
+
import type { PointerEvent } from "react";
|
4
|
+
import type { LayoutChangeEvent } from "react-native";
|
5
|
+
import { PixelRatio, View } from "react-native";
|
6
|
+
|
7
|
+
import type { SkRect, SkCanvas } from "../skia/types";
|
8
|
+
import type { SkiaValue } from "../values";
|
9
|
+
import { JsiSkSurface } from "../skia/web/JsiSkSurface";
|
10
|
+
|
11
|
+
import type { DrawMode, SkiaBaseViewProps, TouchInfo } from "./types";
|
12
|
+
import { TouchType } from "./types";
|
13
|
+
|
14
|
+
const pd = PixelRatio.get();
|
15
|
+
|
16
|
+
export abstract class SkiaBaseWebView<
|
17
|
+
TProps extends SkiaBaseViewProps
|
18
|
+
> extends React.Component<TProps> {
|
19
|
+
constructor(props: TProps) {
|
20
|
+
super(props);
|
21
|
+
this._mode = props.mode ?? "default";
|
22
|
+
}
|
23
|
+
|
24
|
+
private _surface: JsiSkSurface | null = null;
|
25
|
+
private _unsubscriptions: Array<() => void> = [];
|
26
|
+
private _touches: Array<TouchInfo> = [];
|
27
|
+
private _canvas: SkCanvas | null = null;
|
28
|
+
private _canvasRef = React.createRef<HTMLCanvasElement>();
|
29
|
+
private _mode: DrawMode;
|
30
|
+
private _redrawRequests = 0;
|
31
|
+
private requestId = 0;
|
32
|
+
|
33
|
+
protected width = 0;
|
34
|
+
protected height = 0;
|
35
|
+
|
36
|
+
private unsubscribeAll() {
|
37
|
+
this._unsubscriptions.forEach((u) => u());
|
38
|
+
this._unsubscriptions = [];
|
39
|
+
}
|
40
|
+
|
41
|
+
private onLayout(evt: LayoutChangeEvent) {
|
42
|
+
const { CanvasKit } = global;
|
43
|
+
const { width, height } = evt.nativeEvent.layout;
|
44
|
+
this.width = width;
|
45
|
+
this.height = height;
|
46
|
+
// Reset canvas / surface on layout change
|
47
|
+
if (this._canvasRef.current) {
|
48
|
+
const canvas = this._canvasRef.current;
|
49
|
+
canvas.width = canvas.clientWidth * pd;
|
50
|
+
canvas.height = canvas.clientHeight * pd;
|
51
|
+
const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);
|
52
|
+
if (!surface) {
|
53
|
+
throw new Error("Could not create surface");
|
54
|
+
}
|
55
|
+
this._surface = new JsiSkSurface(CanvasKit, surface);
|
56
|
+
this._canvas = this._surface.getCanvas();
|
57
|
+
this.redraw();
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
componentDidMount() {
|
62
|
+
// Start render loop
|
63
|
+
this.tick();
|
64
|
+
}
|
65
|
+
|
66
|
+
componentDidUpdate() {
|
67
|
+
this.redraw();
|
68
|
+
}
|
69
|
+
|
70
|
+
componentWillUnmount() {
|
71
|
+
this.unsubscribeAll();
|
72
|
+
cancelAnimationFrame(this.requestId);
|
73
|
+
}
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Creates a snapshot from the canvas in the surface
|
77
|
+
* @param rect Rect to use as bounds. Optional.
|
78
|
+
* @returns An Image object.
|
79
|
+
*/
|
80
|
+
public makeImageSnapshot(rect?: SkRect) {
|
81
|
+
return this._surface?.makeImageSnapshot(rect);
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Override to render
|
86
|
+
*/
|
87
|
+
protected abstract renderInCanvas(
|
88
|
+
canvas: SkCanvas,
|
89
|
+
touches: TouchInfo[]
|
90
|
+
): void;
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Sends a redraw request to the native SkiaView.
|
94
|
+
*/
|
95
|
+
private tick() {
|
96
|
+
if (this._mode === "continuous" || this._redrawRequests > 0) {
|
97
|
+
this._redrawRequests = 0;
|
98
|
+
if (this._canvas) {
|
99
|
+
const touches = [...this._touches];
|
100
|
+
this._touches = [];
|
101
|
+
this.renderInCanvas(this._canvas!, touches);
|
102
|
+
this._surface?.ref.flush();
|
103
|
+
}
|
104
|
+
}
|
105
|
+
this.requestId = requestAnimationFrame(this.tick.bind(this));
|
106
|
+
}
|
107
|
+
|
108
|
+
public redraw() {
|
109
|
+
this._redrawRequests++;
|
110
|
+
}
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Updates the drawing mode for the skia view. This is the same
|
114
|
+
* as declaratively setting the mode property on the SkiaView.
|
115
|
+
* There are two drawing modes, "continuous" and "default",
|
116
|
+
* where the continuous mode will continuously redraw the view and
|
117
|
+
* the default mode will only redraw when any of the regular react
|
118
|
+
* properties are changed like size and margins.
|
119
|
+
* @param mode Drawing mode to use.
|
120
|
+
*/
|
121
|
+
public setDrawMode(mode: DrawMode) {
|
122
|
+
this._mode = mode;
|
123
|
+
this.tick();
|
124
|
+
}
|
125
|
+
|
126
|
+
/**
|
127
|
+
* Registers one or move values as a dependant value of the Skia View. The view will
|
128
|
+
* The view will redraw itself when any of the values change.
|
129
|
+
* @param values Values to register
|
130
|
+
*/
|
131
|
+
public registerValues(_values: SkiaValue<unknown>[]) {
|
132
|
+
// Unsubscribe from dependency values
|
133
|
+
this.unsubscribeAll();
|
134
|
+
// Register redraw dependencies on values
|
135
|
+
_values.forEach((v) => {
|
136
|
+
this._unsubscriptions.push(
|
137
|
+
v.addListener(() => {
|
138
|
+
this.redraw();
|
139
|
+
})
|
140
|
+
);
|
141
|
+
});
|
142
|
+
}
|
143
|
+
|
144
|
+
private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {
|
145
|
+
this._touches.push({
|
146
|
+
id: evt.pointerId,
|
147
|
+
x: evt.clientX - evt.currentTarget.getClientRects()[0].left,
|
148
|
+
y: evt.clientY - evt.currentTarget.getClientRects()[0].top,
|
149
|
+
force: evt.pressure,
|
150
|
+
type: touchType,
|
151
|
+
timestamp: Date.now(),
|
152
|
+
});
|
153
|
+
this.redraw();
|
154
|
+
}
|
155
|
+
|
156
|
+
createTouchHandler(touchType: TouchType) {
|
157
|
+
return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);
|
158
|
+
}
|
159
|
+
|
160
|
+
render() {
|
161
|
+
const { mode, debug = false, ...viewProps } = this.props;
|
162
|
+
return (
|
163
|
+
<View {...viewProps} onLayout={this.onLayout.bind(this)}>
|
164
|
+
<canvas
|
165
|
+
ref={this._canvasRef}
|
166
|
+
style={{ display: "flex", flex: 1 }}
|
167
|
+
onPointerDown={this.createTouchHandler(TouchType.Start)}
|
168
|
+
onPointerMove={this.createTouchHandler(TouchType.Active)}
|
169
|
+
onPointerUp={this.createTouchHandler(TouchType.End)}
|
170
|
+
onPointerCancel={this.createTouchHandler(TouchType.Cancelled)}
|
171
|
+
onPointerLeave={this.createTouchHandler(TouchType.End)}
|
172
|
+
onPointerOut={this.createTouchHandler(TouchType.End)}
|
173
|
+
/>
|
174
|
+
</View>
|
175
|
+
);
|
176
|
+
}
|
177
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { requireNativeComponent } from "react-native";
|
3
|
+
|
4
|
+
import type { SkRect } from "../skia/types";
|
5
|
+
import type { SkiaValue } from "../values";
|
6
|
+
|
7
|
+
import { SkiaViewApi } from "./api";
|
8
|
+
import type { NativeSkiaViewProps, SkiaPictureViewProps } from "./types";
|
9
|
+
|
10
|
+
let SkiaViewNativeId = 1000;
|
11
|
+
|
12
|
+
const NativeSkiaPictureView =
|
13
|
+
requireNativeComponent<NativeSkiaViewProps>("SkiaPictureView");
|
14
|
+
|
15
|
+
export class SkiaPictureView extends React.Component<SkiaPictureViewProps> {
|
16
|
+
constructor(props: SkiaPictureViewProps) {
|
17
|
+
super(props);
|
18
|
+
this._nativeId = SkiaViewNativeId++;
|
19
|
+
const { picture } = props;
|
20
|
+
if (picture) {
|
21
|
+
assertSkiaViewApi();
|
22
|
+
SkiaViewApi.setJsiProperty(this._nativeId, "picture", picture);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
private _nativeId: number;
|
27
|
+
|
28
|
+
public get nativeId() {
|
29
|
+
return this._nativeId;
|
30
|
+
}
|
31
|
+
|
32
|
+
componentDidUpdate(prevProps: SkiaPictureViewProps) {
|
33
|
+
const { picture } = this.props;
|
34
|
+
if (picture !== prevProps.picture) {
|
35
|
+
assertSkiaViewApi();
|
36
|
+
SkiaViewApi.setJsiProperty(this._nativeId, "picture", picture);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Creates a snapshot from the canvas in the surface
|
42
|
+
* @param rect Rect to use as bounds. Optional.
|
43
|
+
* @returns An Image object.
|
44
|
+
*/
|
45
|
+
public makeImageSnapshot(rect?: SkRect) {
|
46
|
+
assertSkiaViewApi();
|
47
|
+
return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);
|
48
|
+
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Sends a redraw request to the native SkiaView.
|
52
|
+
*/
|
53
|
+
public redraw() {
|
54
|
+
assertSkiaViewApi();
|
55
|
+
SkiaViewApi.requestRedraw(this._nativeId);
|
56
|
+
}
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Registers one or move values as a dependant value of the Skia View. The view will
|
60
|
+
* The view will redraw itself when any of the values change.
|
61
|
+
* @param values Values to register
|
62
|
+
*/
|
63
|
+
public registerValues(values: SkiaValue<unknown>[]): () => void {
|
64
|
+
assertSkiaViewApi();
|
65
|
+
return SkiaViewApi.registerValuesInView(this._nativeId, values);
|
66
|
+
}
|
67
|
+
|
68
|
+
render() {
|
69
|
+
const { mode, debug = false, ...viewProps } = this.props;
|
70
|
+
return (
|
71
|
+
<NativeSkiaPictureView
|
72
|
+
collapsable={false}
|
73
|
+
nativeID={`${this._nativeId}`}
|
74
|
+
mode={mode}
|
75
|
+
debug={debug}
|
76
|
+
{...viewProps}
|
77
|
+
/>
|
78
|
+
);
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
const assertSkiaViewApi = () => {
|
83
|
+
if (
|
84
|
+
SkiaViewApi === null ||
|
85
|
+
SkiaViewApi.setJsiProperty === null ||
|
86
|
+
SkiaViewApi.callJsiMethod === null ||
|
87
|
+
SkiaViewApi.registerValuesInView === null ||
|
88
|
+
SkiaViewApi.requestRedraw === null ||
|
89
|
+
SkiaViewApi.makeImageSnapshot === null
|
90
|
+
) {
|
91
|
+
throw Error("Skia View Api was not found.");
|
92
|
+
}
|
93
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { PixelRatio } from "react-native";
|
2
|
+
|
3
|
+
import type { SkCanvas } from "../skia/types";
|
4
|
+
|
5
|
+
import type { SkiaPictureViewProps } from "./types";
|
6
|
+
import { SkiaBaseWebView } from "./SkiaBaseWebView";
|
7
|
+
|
8
|
+
const pd = PixelRatio.get();
|
9
|
+
|
10
|
+
export class SkiaPictureView extends SkiaBaseWebView<SkiaPictureViewProps> {
|
11
|
+
constructor(props: SkiaPictureViewProps) {
|
12
|
+
super(props);
|
13
|
+
}
|
14
|
+
|
15
|
+
protected renderInCanvas(canvas: SkCanvas): void {
|
16
|
+
if (this.props.picture) {
|
17
|
+
canvas.save();
|
18
|
+
canvas.scale(pd, pd);
|
19
|
+
canvas.drawPicture(this.props.picture);
|
20
|
+
canvas.restore();
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
package/src/views/SkiaView.tsx
CHANGED
@@ -5,16 +5,15 @@ import type { SkRect } from "../skia/types";
|
|
5
5
|
import type { SkiaValue } from "../values";
|
6
6
|
|
7
7
|
import { SkiaViewApi } from "./api";
|
8
|
-
import type { NativeSkiaViewProps,
|
8
|
+
import type { NativeSkiaViewProps, SkiaDrawViewProps } from "./types";
|
9
9
|
|
10
10
|
let SkiaViewNativeId = 1000;
|
11
11
|
|
12
|
-
const NativeSkiaView =
|
13
|
-
"
|
14
|
-
);
|
12
|
+
const NativeSkiaView =
|
13
|
+
requireNativeComponent<NativeSkiaViewProps>("SkiaDrawView");
|
15
14
|
|
16
|
-
export class SkiaView extends React.Component<
|
17
|
-
constructor(props:
|
15
|
+
export class SkiaView extends React.Component<SkiaDrawViewProps> {
|
16
|
+
constructor(props: SkiaDrawViewProps) {
|
18
17
|
super(props);
|
19
18
|
this._nativeId = SkiaViewNativeId++;
|
20
19
|
const { onDraw } = props;
|
@@ -30,7 +29,7 @@ export class SkiaView extends React.Component<SkiaViewProps> {
|
|
30
29
|
return this._nativeId;
|
31
30
|
}
|
32
31
|
|
33
|
-
componentDidUpdate(prevProps:
|
32
|
+
componentDidUpdate(prevProps: SkiaDrawViewProps) {
|
34
33
|
const { onDraw } = this.props;
|
35
34
|
if (onDraw !== prevProps.onDraw) {
|
36
35
|
assertSkiaViewApi();
|
@@ -1,178 +1,29 @@
|
|
1
|
-
|
2
|
-
import React from "react";
|
3
|
-
import type { PointerEvent } from "react";
|
4
|
-
import type { LayoutChangeEvent } from "react-native";
|
5
|
-
import { PixelRatio, View } from "react-native";
|
1
|
+
import { PixelRatio } from "react-native";
|
6
2
|
|
7
|
-
import type {
|
8
|
-
import type { SkiaValue } from "../values";
|
9
|
-
import { JsiSkSurface } from "../skia/web/JsiSkSurface";
|
3
|
+
import type { SkCanvas } from "../skia/types";
|
10
4
|
|
11
|
-
import type { DrawingInfo,
|
12
|
-
import {
|
5
|
+
import type { DrawingInfo, SkiaDrawViewProps, TouchInfo } from "./types";
|
6
|
+
import { SkiaBaseWebView } from "./SkiaBaseWebView";
|
13
7
|
|
14
8
|
const pd = PixelRatio.get();
|
15
9
|
|
16
|
-
export class SkiaView extends
|
17
|
-
constructor(props:
|
10
|
+
export class SkiaView extends SkiaBaseWebView<SkiaDrawViewProps> {
|
11
|
+
constructor(props: SkiaDrawViewProps) {
|
18
12
|
super(props);
|
19
|
-
this._mode = props.mode ?? "default";
|
20
13
|
}
|
21
14
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
this._unsubscriptions.forEach((u) => u());
|
35
|
-
this._unsubscriptions = [];
|
36
|
-
}
|
37
|
-
|
38
|
-
private onLayout(evt: LayoutChangeEvent) {
|
39
|
-
const { CanvasKit } = global;
|
40
|
-
const { width, height } = evt.nativeEvent.layout;
|
41
|
-
this.width = width;
|
42
|
-
this.height = height;
|
43
|
-
// Reset canvas / surface on layout change
|
44
|
-
if (this._canvasRef.current) {
|
45
|
-
const canvas = this._canvasRef.current;
|
46
|
-
canvas.width = canvas.clientWidth * pd;
|
47
|
-
canvas.height = canvas.clientHeight * pd;
|
48
|
-
const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);
|
49
|
-
if (!surface) {
|
50
|
-
throw new Error("Could not create surface");
|
51
|
-
}
|
52
|
-
this._surface = new JsiSkSurface(CanvasKit, surface);
|
53
|
-
this._canvas = this._surface.getCanvas();
|
54
|
-
this.redraw();
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
componentDidMount() {
|
59
|
-
// Start render loop
|
60
|
-
this.tick();
|
61
|
-
}
|
62
|
-
|
63
|
-
componentDidUpdate() {
|
64
|
-
this.redraw();
|
65
|
-
}
|
66
|
-
|
67
|
-
componentWillUnmount() {
|
68
|
-
this.unsubscribeAll();
|
69
|
-
cancelAnimationFrame(this.requestId);
|
70
|
-
}
|
71
|
-
|
72
|
-
/**
|
73
|
-
* Creates a snapshot from the canvas in the surface
|
74
|
-
* @param rect Rect to use as bounds. Optional.
|
75
|
-
* @returns An Image object.
|
76
|
-
*/
|
77
|
-
public makeImageSnapshot(rect?: SkRect) {
|
78
|
-
return this._surface?.makeImageSnapshot(rect);
|
79
|
-
}
|
80
|
-
|
81
|
-
/**
|
82
|
-
* Sends a redraw request to the native SkiaView.
|
83
|
-
*/
|
84
|
-
private tick() {
|
85
|
-
if (this._mode === "continuous" || this._redrawRequests > 0) {
|
86
|
-
this._redrawRequests = 0;
|
87
|
-
if (this._canvas && this.props.onDraw) {
|
88
|
-
const touches = [...this._touches];
|
89
|
-
this._touches = [];
|
90
|
-
const info: DrawingInfo = {
|
91
|
-
height: this.height,
|
92
|
-
width: this.width,
|
93
|
-
timestamp: Date.now(),
|
94
|
-
touches: touches.map((t) => [t]),
|
95
|
-
};
|
96
|
-
if (this.props.onDraw) {
|
97
|
-
const canvas = this._canvas!;
|
98
|
-
canvas.save();
|
99
|
-
canvas.scale(pd, pd);
|
100
|
-
this.props.onDraw(canvas, info);
|
101
|
-
canvas.restore();
|
102
|
-
}
|
103
|
-
this._surface?.ref.flush();
|
104
|
-
}
|
15
|
+
protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void {
|
16
|
+
if (this.props.onDraw) {
|
17
|
+
const info: DrawingInfo = {
|
18
|
+
height: this.height,
|
19
|
+
width: this.width,
|
20
|
+
timestamp: Date.now(),
|
21
|
+
touches: touches.map((t) => [t]),
|
22
|
+
};
|
23
|
+
canvas.save();
|
24
|
+
canvas.scale(pd, pd);
|
25
|
+
this.props.onDraw(canvas, info);
|
26
|
+
canvas.restore();
|
105
27
|
}
|
106
|
-
this.requestId = requestAnimationFrame(this.tick.bind(this));
|
107
|
-
}
|
108
|
-
|
109
|
-
public redraw() {
|
110
|
-
this._redrawRequests++;
|
111
|
-
}
|
112
|
-
|
113
|
-
/**
|
114
|
-
* Updates the drawing mode for the skia view. This is the same
|
115
|
-
* as declaratively setting the mode property on the SkiaView.
|
116
|
-
* There are two drawing modes, "continuous" and "default",
|
117
|
-
* where the continuous mode will continuously redraw the view and
|
118
|
-
* the default mode will only redraw when any of the regular react
|
119
|
-
* properties are changed like size and margins.
|
120
|
-
* @param mode Drawing mode to use.
|
121
|
-
*/
|
122
|
-
public setDrawMode(mode: DrawMode) {
|
123
|
-
this._mode = mode;
|
124
|
-
this.tick();
|
125
|
-
}
|
126
|
-
|
127
|
-
/**
|
128
|
-
* Registers one or move values as a dependant value of the Skia View. The view will
|
129
|
-
* The view will redraw itself when any of the values change.
|
130
|
-
* @param values Values to register
|
131
|
-
*/
|
132
|
-
public registerValues(_values: SkiaValue<unknown>[]) {
|
133
|
-
// Unsubscribe from dependency values
|
134
|
-
this.unsubscribeAll();
|
135
|
-
// Register redraw dependencies on values
|
136
|
-
_values.forEach((v) => {
|
137
|
-
this._unsubscriptions.push(
|
138
|
-
v.addListener(() => {
|
139
|
-
this.redraw();
|
140
|
-
})
|
141
|
-
);
|
142
|
-
});
|
143
|
-
}
|
144
|
-
|
145
|
-
private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {
|
146
|
-
this._touches.push({
|
147
|
-
id: evt.pointerId,
|
148
|
-
x: evt.clientX - evt.currentTarget.getClientRects()[0].left,
|
149
|
-
y: evt.clientY - evt.currentTarget.getClientRects()[0].top,
|
150
|
-
force: evt.pressure,
|
151
|
-
type: touchType,
|
152
|
-
timestamp: Date.now(),
|
153
|
-
});
|
154
|
-
this.redraw();
|
155
|
-
}
|
156
|
-
|
157
|
-
createTouchHandler(touchType: TouchType) {
|
158
|
-
return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);
|
159
|
-
}
|
160
|
-
|
161
|
-
render() {
|
162
|
-
const { mode, debug = false, ...viewProps } = this.props;
|
163
|
-
return (
|
164
|
-
<View {...viewProps} onLayout={this.onLayout.bind(this)}>
|
165
|
-
<canvas
|
166
|
-
ref={this._canvasRef}
|
167
|
-
style={{ display: "flex", flex: 1 }}
|
168
|
-
onPointerDown={this.createTouchHandler(TouchType.Start)}
|
169
|
-
onPointerMove={this.createTouchHandler(TouchType.Active)}
|
170
|
-
onPointerUp={this.createTouchHandler(TouchType.End)}
|
171
|
-
onPointerCancel={this.createTouchHandler(TouchType.Cancelled)}
|
172
|
-
onPointerLeave={this.createTouchHandler(TouchType.End)}
|
173
|
-
onPointerOut={this.createTouchHandler(TouchType.End)}
|
174
|
-
/>
|
175
|
-
</View>
|
176
|
-
);
|
177
28
|
}
|
178
29
|
}
|
package/src/views/index.ts
CHANGED
package/src/views/types.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ViewProps } from "react-native";
|
2
2
|
|
3
|
-
import type { SkCanvas, SkImage, SkRect } from "../skia/types";
|
3
|
+
import type { SkCanvas, SkImage, SkPicture, SkRect } from "../skia/types";
|
4
4
|
import type { SkiaValue } from "../values";
|
5
5
|
|
6
6
|
export type DrawMode = "continuous" | "default";
|
@@ -72,7 +72,7 @@ export interface ISkiaViewApi {
|
|
72
72
|
makeImageSnapshot: (nativeId: number, rect?: SkRect) => SkImage;
|
73
73
|
}
|
74
74
|
|
75
|
-
export interface
|
75
|
+
export interface SkiaBaseViewProps extends ViewProps {
|
76
76
|
/**
|
77
77
|
* Sets the drawing mode for the skia view. There are two drawing
|
78
78
|
* modes, "continuous" and "default", where the continuous mode will
|
@@ -86,6 +86,9 @@ export interface SkiaViewProps extends ViewProps {
|
|
86
86
|
* average time it takes to render.
|
87
87
|
*/
|
88
88
|
debug?: boolean;
|
89
|
+
}
|
90
|
+
|
91
|
+
export interface SkiaDrawViewProps extends SkiaBaseViewProps {
|
89
92
|
/**
|
90
93
|
* Draw callback. Will be called whenever the view is invalidated and
|
91
94
|
* needs to redraw. This is either caused by a change in a react
|
@@ -95,3 +98,7 @@ export interface SkiaViewProps extends ViewProps {
|
|
95
98
|
*/
|
96
99
|
onDraw?: RNSkiaDrawCallback;
|
97
100
|
}
|
101
|
+
|
102
|
+
export interface SkiaPictureViewProps extends SkiaBaseViewProps {
|
103
|
+
picture?: SkPicture;
|
104
|
+
}
|
@@ -1,113 +0,0 @@
|
|
1
|
-
#include "JniSkiaDrawView.h"
|
2
|
-
#include "RNSkLog.h"
|
3
|
-
|
4
|
-
#include <memory>
|
5
|
-
#include <string>
|
6
|
-
#include <utility>
|
7
|
-
#include <vector>
|
8
|
-
|
9
|
-
#include <GLES2/gl2.h>
|
10
|
-
#include <EGL/eglplatform.h>
|
11
|
-
#include <android/native_window.h>
|
12
|
-
#include <android/native_window_jni.h>
|
13
|
-
|
14
|
-
#include <SkCanvas.h>
|
15
|
-
#include <SkImageInfo.h>
|
16
|
-
#include <SkSurface.h>
|
17
|
-
#include <gpu/GrDirectContext.h>
|
18
|
-
#include <gpu/GrBackendSurface.h>
|
19
|
-
#include <gpu/gl/GrGLInterface.h>
|
20
|
-
#include <gpu/gl/GrGLTypes.h>
|
21
|
-
#include <gpu/GrTypes.h>
|
22
|
-
#include <RNSkInfoParameter.h>
|
23
|
-
|
24
|
-
namespace RNSkia
|
25
|
-
{
|
26
|
-
using namespace facebook;
|
27
|
-
using namespace jni;
|
28
|
-
|
29
|
-
using TSelf = local_ref<HybridClass<JniSkiaDrawView>::jhybriddata>;
|
30
|
-
|
31
|
-
/**** DTOR ***/
|
32
|
-
JniSkiaDrawView::~JniSkiaDrawView()
|
33
|
-
{
|
34
|
-
}
|
35
|
-
|
36
|
-
/**** JNI ****/
|
37
|
-
|
38
|
-
TSelf JniSkiaDrawView::initHybrid(
|
39
|
-
alias_ref<HybridClass::jhybridobject> jThis,
|
40
|
-
JavaSkiaManager skiaManager)
|
41
|
-
{
|
42
|
-
return makeCxxInstance(jThis, skiaManager);
|
43
|
-
}
|
44
|
-
|
45
|
-
void JniSkiaDrawView::registerNatives()
|
46
|
-
{
|
47
|
-
registerHybrid({makeNativeMethod("initHybrid", JniSkiaDrawView::initHybrid),
|
48
|
-
makeNativeMethod("surfaceAvailable", JniSkiaDrawView::surfaceAvailable),
|
49
|
-
makeNativeMethod("surfaceDestroyed", JniSkiaDrawView::surfaceDestroyed),
|
50
|
-
makeNativeMethod("surfaceSizeChanged", JniSkiaDrawView::surfaceSizeChanged),
|
51
|
-
makeNativeMethod("setMode", JniSkiaDrawView::setMode),
|
52
|
-
makeNativeMethod("setDebugMode", JniSkiaDrawView::setDebugMode),
|
53
|
-
makeNativeMethod("updateTouchPoints", JniSkiaDrawView::updateTouchPoints)});
|
54
|
-
}
|
55
|
-
|
56
|
-
void JniSkiaDrawView::setMode(std::string mode)
|
57
|
-
{
|
58
|
-
if (mode.compare("continuous") == 0)
|
59
|
-
{
|
60
|
-
_drawView->setDrawingMode(RNSkDrawingMode::Continuous);
|
61
|
-
}
|
62
|
-
else
|
63
|
-
{
|
64
|
-
_drawView->setDrawingMode(RNSkDrawingMode::Default);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
void JniSkiaDrawView::setDebugMode(bool show)
|
69
|
-
{
|
70
|
-
_drawView->setShowDebugOverlays(show);
|
71
|
-
}
|
72
|
-
|
73
|
-
void JniSkiaDrawView::updateTouchPoints(jni::JArrayDouble touches)
|
74
|
-
{
|
75
|
-
// Create touch points
|
76
|
-
std::vector<RNSkia::RNSkTouchPoint> points;
|
77
|
-
auto pin = touches.pin();
|
78
|
-
auto scale = _drawView->getPixelDensity();
|
79
|
-
points.reserve(pin.size() / 5);
|
80
|
-
for (size_t i = 0; i < pin.size(); i += 5)
|
81
|
-
{
|
82
|
-
RNSkTouchPoint point;
|
83
|
-
point.x = pin[i] / scale;
|
84
|
-
point.y = pin[i + 1] / scale;
|
85
|
-
point.force = pin[i + 2];
|
86
|
-
point.type = (RNSkia::RNSkTouchType)pin[i + 3];
|
87
|
-
point.id = pin[i + 4];
|
88
|
-
points.push_back(point);
|
89
|
-
}
|
90
|
-
_drawView->updateTouchState(std::move(points));
|
91
|
-
}
|
92
|
-
|
93
|
-
void JniSkiaDrawView::surfaceAvailable(jobject surface, int width, int height)
|
94
|
-
{
|
95
|
-
_drawView->surfaceAvailable(ANativeWindow_fromSurface(Environment::current(), surface), width, height);
|
96
|
-
}
|
97
|
-
|
98
|
-
void JniSkiaDrawView::surfaceSizeChanged(int width, int height)
|
99
|
-
{
|
100
|
-
_drawView->surfaceSizeChanged(width, height);
|
101
|
-
}
|
102
|
-
|
103
|
-
void JniSkiaDrawView::surfaceDestroyed()
|
104
|
-
{
|
105
|
-
_drawView->surfaceDestroyed();
|
106
|
-
}
|
107
|
-
|
108
|
-
void JniSkiaDrawView::releaseSurface() {
|
109
|
-
jni::ThreadScope ts;
|
110
|
-
static auto method = javaPart_->getClass()->getMethod<void(void)>("releaseSurface");
|
111
|
-
method(javaPart_.get());
|
112
|
-
}
|
113
|
-
} // namespace RNSkia
|