@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
@@ -1,73 +0,0 @@
|
|
1
|
-
#include <RNSkDrawViewImpl.h>
|
2
|
-
|
3
|
-
#pragma clang diagnostic push
|
4
|
-
#pragma clang diagnostic ignored "-Wdocumentation"
|
5
|
-
|
6
|
-
#include <SkSurface.h>
|
7
|
-
#include <SkCanvas.h>
|
8
|
-
|
9
|
-
#pragma clang diagnostic pop
|
10
|
-
|
11
|
-
#include <RNSkLog.h>
|
12
|
-
|
13
|
-
namespace RNSkia {
|
14
|
-
RNSkDrawViewImpl::RNSkDrawViewImpl(std::shared_ptr <RNSkia::RNSkPlatformContext> context, std::function<void()> releaseSurfaceCallback) :
|
15
|
-
RNSkia::RNSkDrawView(context),
|
16
|
-
_releaseSurfaceCallback(std::move(releaseSurfaceCallback)) {}
|
17
|
-
|
18
|
-
void RNSkDrawViewImpl::surfaceAvailable(ANativeWindow* surface, int width, int height) {
|
19
|
-
_scaledWidth = width;
|
20
|
-
_scaledHeight = height;
|
21
|
-
|
22
|
-
if (_renderer == nullptr)
|
23
|
-
{
|
24
|
-
// Create renderer!
|
25
|
-
_renderer = std::make_unique<SkiaOpenGLRenderer>(surface, getNativeId());
|
26
|
-
|
27
|
-
// Redraw
|
28
|
-
requestRedraw();
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
|
-
void RNSkDrawViewImpl::surfaceDestroyed() {
|
33
|
-
if (_renderer != nullptr)
|
34
|
-
{
|
35
|
-
// Start teardown
|
36
|
-
_renderer->teardown();
|
37
|
-
|
38
|
-
// Teardown renderer on the render thread since OpenGL demands
|
39
|
-
// same thread access for OpenGL contexts.
|
40
|
-
getPlatformContext()->runOnRenderThread([weakSelf = weak_from_this()]() {
|
41
|
-
auto self = weakSelf.lock();
|
42
|
-
if(self) {
|
43
|
-
auto drawViewImpl = std::dynamic_pointer_cast<RNSkDrawViewImpl>(self);
|
44
|
-
if(drawViewImpl->_renderer != nullptr) {
|
45
|
-
drawViewImpl->_renderer->run(nullptr, 0, 0);
|
46
|
-
}
|
47
|
-
// Remove renderer
|
48
|
-
drawViewImpl->_renderer = nullptr;
|
49
|
-
drawViewImpl->_releaseSurfaceCallback();
|
50
|
-
}
|
51
|
-
});
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
void RNSkDrawViewImpl::surfaceSizeChanged(int width, int height) {
|
56
|
-
if(width == 0 && height == 0) {
|
57
|
-
// Setting width/height to zero is nothing we need to care about when
|
58
|
-
// it comes to invalidating the surface.
|
59
|
-
return;
|
60
|
-
}
|
61
|
-
_scaledWidth = width;
|
62
|
-
_scaledHeight = height;
|
63
|
-
|
64
|
-
// Redraw after size change
|
65
|
-
requestRedraw();
|
66
|
-
}
|
67
|
-
|
68
|
-
void RNSkDrawViewImpl::renderToSkiaCanvas(const std::function<void(SkCanvas*)>& cb) {
|
69
|
-
if(_renderer != nullptr) {
|
70
|
-
_renderer->run(cb, _scaledWidth, _scaledHeight);
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
@@ -1,48 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <RNSkDrawView.h>
|
4
|
-
|
5
|
-
#include <SkiaOpenGLRenderer.h>
|
6
|
-
#include <android/native_window.h>
|
7
|
-
|
8
|
-
#pragma clang diagnostic push
|
9
|
-
#pragma clang diagnostic ignored "-Wdocumentation"
|
10
|
-
|
11
|
-
#include <SkPicture.h>
|
12
|
-
#include <SkRefCnt.h>
|
13
|
-
|
14
|
-
#pragma clang diagnostic pop
|
15
|
-
|
16
|
-
namespace RNSkia {
|
17
|
-
class RNSkDrawViewImpl : public RNSkia::RNSkDrawView {
|
18
|
-
public:
|
19
|
-
RNSkDrawViewImpl(std::shared_ptr <RNSkia::RNSkPlatformContext> context,
|
20
|
-
std::function<void()> releaseSurfaceCallback);
|
21
|
-
|
22
|
-
void surfaceAvailable(ANativeWindow* surface, int, int);
|
23
|
-
void surfaceDestroyed();
|
24
|
-
void surfaceSizeChanged(int, int);
|
25
|
-
|
26
|
-
float getPixelDensity() {
|
27
|
-
return getPlatformContext()->getPixelDensity();
|
28
|
-
}
|
29
|
-
|
30
|
-
protected:
|
31
|
-
float getScaledWidth() override { return _scaledWidth; };
|
32
|
-
|
33
|
-
float getScaledHeight() override { return _scaledHeight; };
|
34
|
-
|
35
|
-
void renderToSkiaCanvas(const std::function<void(SkCanvas*)>&) override;
|
36
|
-
|
37
|
-
private:
|
38
|
-
bool createSkiaSurface();
|
39
|
-
|
40
|
-
std::unique_ptr<SkiaOpenGLRenderer> _renderer = nullptr;
|
41
|
-
|
42
|
-
int _nativeId;
|
43
|
-
float _scaledWidth = -1;
|
44
|
-
float _scaledHeight = -1;
|
45
|
-
|
46
|
-
std::function<void()> _releaseSurfaceCallback;
|
47
|
-
};
|
48
|
-
}
|
@@ -1,315 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// Created by Christian Falch on 23/08/2021.
|
3
|
-
//
|
4
|
-
|
5
|
-
#include "RNSkDrawView.h"
|
6
|
-
|
7
|
-
#include <chrono>
|
8
|
-
#include <functional>
|
9
|
-
#include <sstream>
|
10
|
-
#include <string>
|
11
|
-
#include <memory>
|
12
|
-
#include <vector>
|
13
|
-
#include <utility>
|
14
|
-
|
15
|
-
#include <JsiSkCanvas.h>
|
16
|
-
#include <RNSkLog.h>
|
17
|
-
#include <RNSkPlatformContext.h>
|
18
|
-
|
19
|
-
#pragma clang diagnostic push
|
20
|
-
#pragma clang diagnostic ignored "-Wdocumentation"
|
21
|
-
|
22
|
-
#include <SkBBHFactory.h>
|
23
|
-
#include <SkCanvas.h>
|
24
|
-
#include <SkFont.h>
|
25
|
-
#include <SkFontTypes.h>
|
26
|
-
#include <SkGraphics.h>
|
27
|
-
#include <SkPaint.h>
|
28
|
-
#include <SkPictureRecorder.h>
|
29
|
-
#include <SkSurface.h>
|
30
|
-
#include <SkRect.h>
|
31
|
-
|
32
|
-
#pragma clang diagnostic pop
|
33
|
-
|
34
|
-
namespace RNSkia {
|
35
|
-
|
36
|
-
using namespace std::chrono;
|
37
|
-
|
38
|
-
RNSkDrawView::RNSkDrawView(std::shared_ptr<RNSkPlatformContext> context)
|
39
|
-
: _jsiCanvas(std::make_shared<JsiSkCanvas>(context)),
|
40
|
-
_platformContext(std::move(context)),
|
41
|
-
_infoObject(std::make_shared<RNSkInfoObject>()),
|
42
|
-
_jsDrawingLock(std::make_shared<std::timed_mutex>()),
|
43
|
-
_gpuDrawingLock(std::make_shared<std::timed_mutex>()),
|
44
|
-
_jsTimingInfo("SKIA/JS"),
|
45
|
-
_gpuTimingInfo("SKIA/GPU")
|
46
|
-
{}
|
47
|
-
|
48
|
-
RNSkDrawView::~RNSkDrawView() {
|
49
|
-
endDrawingLoop();
|
50
|
-
}
|
51
|
-
|
52
|
-
void RNSkDrawView::setJsiProperties(std::unordered_map<std::string, JsiValueWrapper> &props) {
|
53
|
-
for(auto& prop: props) {
|
54
|
-
if(prop.first == "drawCallback") {
|
55
|
-
if(prop.second.isUndefinedOrNull()) {
|
56
|
-
// Clear drawcallback
|
57
|
-
_drawCallback = nullptr;
|
58
|
-
// We can just reset everything - this is a signal that we're done.
|
59
|
-
endDrawingLoop();
|
60
|
-
return;
|
61
|
-
} else if (prop.second.getType() != JsiWrapperValueType::Function) {
|
62
|
-
// We expect a function for the draw callback custom property
|
63
|
-
throw std::runtime_error("Expected a function for the drawCallback custom property.");
|
64
|
-
}
|
65
|
-
|
66
|
-
// Save callback
|
67
|
-
_drawCallback = prop.second.getAsFunction();
|
68
|
-
|
69
|
-
// Request redraw
|
70
|
-
requestRedraw();
|
71
|
-
|
72
|
-
} else {
|
73
|
-
throw std::runtime_error("Property " + prop.first + " not found.");
|
74
|
-
}
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
jsi::Value RNSkDrawView::callJsiMethod(jsi::Runtime& runtime,
|
79
|
-
const std::string& name,
|
80
|
-
const jsi::Value *arguments,
|
81
|
-
size_t count) {
|
82
|
-
|
83
|
-
// This subclass doesn't support any jsi methods at the moment, but
|
84
|
-
// new subclasses created in the future will.
|
85
|
-
throw std::runtime_error("RNSkDrawView does not support any JSI methods. Method " + name + "() not found.");
|
86
|
-
return jsi::Value::undefined();
|
87
|
-
}
|
88
|
-
|
89
|
-
void RNSkDrawView::setNativeId(size_t nativeId) {
|
90
|
-
_nativeId = nativeId;
|
91
|
-
beginDrawingLoop();
|
92
|
-
}
|
93
|
-
|
94
|
-
void RNSkDrawView::callJsDrawCallback(std::shared_ptr<JsiSkCanvas> canvas,
|
95
|
-
int width,
|
96
|
-
int height,
|
97
|
-
double timestamp) {
|
98
|
-
if(_drawCallback == nullptr) {
|
99
|
-
return;
|
100
|
-
}
|
101
|
-
|
102
|
-
// Reset timing info
|
103
|
-
_jsTimingInfo.reset();
|
104
|
-
_gpuTimingInfo.reset();
|
105
|
-
|
106
|
-
auto runtime = getPlatformContext()->getJsRuntime();
|
107
|
-
|
108
|
-
// Update info parameter
|
109
|
-
_infoObject->beginDrawOperation(width, height, timestamp);
|
110
|
-
|
111
|
-
// Set up arguments array
|
112
|
-
std::vector<jsi::Value> args(2);
|
113
|
-
args[0] = jsi::Object::createFromHostObject(*runtime, canvas);
|
114
|
-
args[1] = jsi::Object::createFromHostObject(*runtime, _infoObject);
|
115
|
-
|
116
|
-
// To be able to call the drawing function we'll wrap it once again
|
117
|
-
_drawCallback->call(*runtime,
|
118
|
-
static_cast<const jsi::Value *>(args.data()),
|
119
|
-
(size_t)2);
|
120
|
-
|
121
|
-
// Reset touches
|
122
|
-
_infoObject->endDrawOperation();
|
123
|
-
|
124
|
-
// Draw debug overlays
|
125
|
-
if (_showDebugOverlay) {
|
126
|
-
|
127
|
-
// Display average rendering timer
|
128
|
-
auto jsAvg = _jsTimingInfo.getAverage();
|
129
|
-
//auto jsFps = _jsTimingInfo.getFps();
|
130
|
-
|
131
|
-
auto gpuAvg = _gpuTimingInfo.getAverage();
|
132
|
-
//auto gpuFps = _gpuTimingInfo.getFps();
|
133
|
-
|
134
|
-
auto total = jsAvg + gpuAvg;
|
135
|
-
|
136
|
-
// Build string
|
137
|
-
std::ostringstream stream;
|
138
|
-
stream << "js: " << jsAvg << "ms gpu: " << gpuAvg << "ms " << " total: " << total << "ms";
|
139
|
-
|
140
|
-
std::string debugString = stream.str();
|
141
|
-
|
142
|
-
// Set up debug font/paints
|
143
|
-
auto font = SkFont();
|
144
|
-
font.setSize(14);
|
145
|
-
auto paint = SkPaint();
|
146
|
-
paint.setColor(SkColors::kRed);
|
147
|
-
canvas->getCanvas()->drawSimpleText(
|
148
|
-
debugString.c_str(), debugString.size(), SkTextEncoding::kUTF8, 8,
|
149
|
-
18, font, paint);
|
150
|
-
}
|
151
|
-
}
|
152
|
-
|
153
|
-
void RNSkDrawView::drawInCanvas(std::shared_ptr<JsiSkCanvas> canvas,
|
154
|
-
int width,
|
155
|
-
int height,
|
156
|
-
double time) {
|
157
|
-
|
158
|
-
// Call the draw drawCallback and perform js based drawing
|
159
|
-
auto skCanvas = canvas->getCanvas();
|
160
|
-
if (_drawCallback != nullptr && skCanvas != nullptr) {
|
161
|
-
// Make sure to scale correctly
|
162
|
-
auto pd = _platformContext->getPixelDensity();
|
163
|
-
skCanvas->save();
|
164
|
-
skCanvas->scale(pd, pd);
|
165
|
-
|
166
|
-
// Call draw function.
|
167
|
-
callJsDrawCallback(canvas, width / pd, height / pd, time);
|
168
|
-
|
169
|
-
// Restore and flush canvas
|
170
|
-
skCanvas->restore();
|
171
|
-
skCanvas->flush();
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
sk_sp<SkImage> RNSkDrawView::makeImageSnapshot(std::shared_ptr<SkRect> bounds) {
|
176
|
-
// Assert width/height
|
177
|
-
auto surface = SkSurface::MakeRasterN32Premul(getScaledWidth(), getScaledHeight());
|
178
|
-
auto canvas = surface->getCanvas();
|
179
|
-
auto jsiCanvas = std::make_shared<JsiSkCanvas>(_platformContext);
|
180
|
-
jsiCanvas->setCanvas(canvas);
|
181
|
-
|
182
|
-
milliseconds ms = duration_cast<milliseconds>(
|
183
|
-
system_clock::now().time_since_epoch());
|
184
|
-
|
185
|
-
drawInCanvas(jsiCanvas, getScaledWidth(), getScaledHeight(), ms.count() / 1000);
|
186
|
-
|
187
|
-
if(bounds != nullptr) {
|
188
|
-
SkIRect b = SkIRect::MakeXYWH(bounds->x(), bounds->y(), bounds->width(), bounds->height());
|
189
|
-
return surface->makeImageSnapshot(b);
|
190
|
-
} else {
|
191
|
-
return surface->makeImageSnapshot();
|
192
|
-
}
|
193
|
-
}
|
194
|
-
|
195
|
-
void RNSkDrawView::updateTouchState(std::vector<RNSkTouchPoint>&& points) {
|
196
|
-
_infoObject->updateTouches(std::move(points));
|
197
|
-
requestRedraw();
|
198
|
-
}
|
199
|
-
|
200
|
-
void RNSkDrawView::performDraw() {
|
201
|
-
// Start timing
|
202
|
-
_jsTimingInfo.beginTiming();
|
203
|
-
|
204
|
-
// Record the drawing operations on the JS thread so that we can
|
205
|
-
// move the actual drawing onto the render thread later
|
206
|
-
SkPictureRecorder recorder;
|
207
|
-
SkRTreeFactory factory;
|
208
|
-
SkCanvas* canvas = recorder.beginRecording(getScaledWidth(), getScaledHeight(), &factory);
|
209
|
-
_jsiCanvas->setCanvas(canvas);
|
210
|
-
|
211
|
-
// Get current milliseconds
|
212
|
-
milliseconds ms = duration_cast<milliseconds>(
|
213
|
-
system_clock::now().time_since_epoch());
|
214
|
-
|
215
|
-
try {
|
216
|
-
// Perform the javascript drawing
|
217
|
-
drawInCanvas(_jsiCanvas, getScaledWidth(), getScaledHeight(), ms.count() / 1000.0);
|
218
|
-
} catch(...) {
|
219
|
-
_jsTimingInfo.stopTiming();
|
220
|
-
_jsDrawingLock->unlock();
|
221
|
-
throw;
|
222
|
-
}
|
223
|
-
|
224
|
-
// Finish drawing operations
|
225
|
-
auto p = recorder.finishRecordingAsPicture();
|
226
|
-
|
227
|
-
_jsiCanvas->setCanvas(nullptr);
|
228
|
-
|
229
|
-
// Calculate duration
|
230
|
-
_jsTimingInfo.stopTiming();
|
231
|
-
|
232
|
-
if(_gpuDrawingLock->try_lock()) {
|
233
|
-
|
234
|
-
// Post drawing message to the render thread where the picture recorded
|
235
|
-
// will be sent to the GPU/backend for rendering to screen.
|
236
|
-
auto gpuLock = _gpuDrawingLock;
|
237
|
-
_platformContext->runOnRenderThread([weakSelf = weak_from_this(), p = std::move(p), gpuLock]() {
|
238
|
-
auto self = weakSelf.lock();
|
239
|
-
if (self) {
|
240
|
-
// Draw the picture recorded on the real GPU canvas
|
241
|
-
self->_gpuTimingInfo.beginTiming();
|
242
|
-
self->renderToSkiaCanvas([p = std::move(p)](SkCanvas* canvas) {
|
243
|
-
canvas->drawPicture(p);
|
244
|
-
});
|
245
|
-
self->_gpuTimingInfo.stopTiming();
|
246
|
-
}
|
247
|
-
// Unlock GPU drawing
|
248
|
-
gpuLock->unlock();
|
249
|
-
});
|
250
|
-
} else {
|
251
|
-
#ifdef DEBUG
|
252
|
-
_gpuTimingInfo.markSkipped();
|
253
|
-
#endif
|
254
|
-
// Request a new redraw since the last frame was skipped.
|
255
|
-
requestRedraw();
|
256
|
-
}
|
257
|
-
|
258
|
-
// Unlock JS drawing
|
259
|
-
_jsDrawingLock->unlock();
|
260
|
-
}
|
261
|
-
|
262
|
-
void RNSkDrawView::requestRedraw() {
|
263
|
-
_redrawRequestCounter++;
|
264
|
-
}
|
265
|
-
|
266
|
-
void RNSkDrawView::beginDrawingLoop() {
|
267
|
-
if (_drawingLoopId != 0 || _nativeId == 0) {
|
268
|
-
return;
|
269
|
-
}
|
270
|
-
// Set to zero to avoid calling beginDrawLoop before we return
|
271
|
-
_drawingLoopId = _platformContext->beginDrawLoop(_nativeId,
|
272
|
-
[weakSelf = weak_from_this()](bool invalidated) {
|
273
|
-
auto self = weakSelf.lock();
|
274
|
-
if(self) {
|
275
|
-
self->drawLoopCallback(invalidated);
|
276
|
-
}
|
277
|
-
});
|
278
|
-
}
|
279
|
-
|
280
|
-
void RNSkDrawView::drawLoopCallback(bool invalidated) {
|
281
|
-
if(_redrawRequestCounter > 0 || _drawingMode == RNSkDrawingMode::Continuous) {
|
282
|
-
_redrawRequestCounter = 0;
|
283
|
-
|
284
|
-
// We render on the javascript thread.
|
285
|
-
if(_jsDrawingLock->try_lock()) {
|
286
|
-
_platformContext->runOnJavascriptThread([weakSelf = weak_from_this()](){
|
287
|
-
auto self = weakSelf.lock();
|
288
|
-
if(self) {
|
289
|
-
self->performDraw();
|
290
|
-
}
|
291
|
-
});
|
292
|
-
} else {
|
293
|
-
#ifdef DEBUG
|
294
|
-
_jsTimingInfo.markSkipped();
|
295
|
-
#endif
|
296
|
-
requestRedraw();
|
297
|
-
}
|
298
|
-
}
|
299
|
-
}
|
300
|
-
|
301
|
-
void RNSkDrawView::endDrawingLoop() {
|
302
|
-
if(_drawingLoopId != 0) {
|
303
|
-
_drawingLoopId = 0;
|
304
|
-
_platformContext->endDrawLoop(_nativeId);
|
305
|
-
}
|
306
|
-
}
|
307
|
-
|
308
|
-
void RNSkDrawView::setDrawingMode(RNSkDrawingMode mode) {
|
309
|
-
if(mode == _drawingMode || _nativeId == 0) {
|
310
|
-
return;
|
311
|
-
}
|
312
|
-
_drawingMode = mode;
|
313
|
-
}
|
314
|
-
|
315
|
-
} // namespace RNSkia
|
@@ -1,226 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#include <functional>
|
4
|
-
#include <memory>
|
5
|
-
#include <mutex>
|
6
|
-
#include <vector>
|
7
|
-
#include <string>
|
8
|
-
|
9
|
-
#include <jsi/jsi.h>
|
10
|
-
|
11
|
-
#include <JsiValueWrapper.h>
|
12
|
-
|
13
|
-
#include <RNSkInfoParameter.h>
|
14
|
-
#include <RNSkPlatformContext.h>
|
15
|
-
#include <RNSkTimingInfo.h>
|
16
|
-
#include <RNSkLog.h>
|
17
|
-
|
18
|
-
#pragma clang diagnostic push
|
19
|
-
#pragma clang diagnostic ignored "-Wdocumentation"
|
20
|
-
|
21
|
-
#include <SkCanvas.h>
|
22
|
-
|
23
|
-
#pragma clang diagnostic pop
|
24
|
-
|
25
|
-
class SkPicture;
|
26
|
-
class SkRect;
|
27
|
-
class SkImage;
|
28
|
-
|
29
|
-
namespace RNSkia {
|
30
|
-
class JsiSkCanvas;
|
31
|
-
using namespace facebook;
|
32
|
-
|
33
|
-
enum RNSkDrawingMode { Default, Continuous };
|
34
|
-
|
35
|
-
class RNSkDrawView: public std::enable_shared_from_this<RNSkDrawView> {
|
36
|
-
public:
|
37
|
-
/**
|
38
|
-
* Constructor
|
39
|
-
*/
|
40
|
-
RNSkDrawView(std::shared_ptr<RNSkPlatformContext> context);
|
41
|
-
|
42
|
-
/**
|
43
|
-
Destructor
|
44
|
-
*/
|
45
|
-
virtual ~RNSkDrawView();
|
46
|
-
|
47
|
-
/**
|
48
|
-
Sets custom properties. Custom properties are properties that are set directly from Javascript without having
|
49
|
-
to go through the async bridge.
|
50
|
-
*/
|
51
|
-
void setJsiProperties(std::unordered_map<std::string, JsiValueWrapper> &props);
|
52
|
-
|
53
|
-
/**
|
54
|
-
Calls a custom action.
|
55
|
-
*/
|
56
|
-
jsi::Value callJsiMethod(jsi::Runtime& runtime,
|
57
|
-
const std::string& name,
|
58
|
-
const jsi::Value *arguments,
|
59
|
-
size_t count);
|
60
|
-
|
61
|
-
/**
|
62
|
-
* Repaints the Skia view using the underlying context and the drawcallback.
|
63
|
-
* This method schedules a draw request that will be run on the correct
|
64
|
-
* thread and js runtime.
|
65
|
-
*/
|
66
|
-
void requestRedraw();
|
67
|
-
|
68
|
-
/**
|
69
|
-
Calls the drawing callback on the javascript thread
|
70
|
-
*/
|
71
|
-
void performDraw();
|
72
|
-
|
73
|
-
/**
|
74
|
-
Sets the native id of the view
|
75
|
-
*/
|
76
|
-
void setNativeId(size_t nativeId);
|
77
|
-
|
78
|
-
/**
|
79
|
-
Returns the native id
|
80
|
-
*/
|
81
|
-
size_t getNativeId() { return _nativeId; }
|
82
|
-
|
83
|
-
/**
|
84
|
-
Sets the drawing mode for the view
|
85
|
-
*/
|
86
|
-
void setDrawingMode(RNSkDrawingMode mode);
|
87
|
-
|
88
|
-
/**
|
89
|
-
* Set to true to show the debug overlays on render
|
90
|
-
*/
|
91
|
-
void setShowDebugOverlays(bool show) { _showDebugOverlay = show; }
|
92
|
-
|
93
|
-
/**
|
94
|
-
Update touch state with new touch points
|
95
|
-
*/
|
96
|
-
void updateTouchState(std::vector<RNSkTouchPoint>&& points);
|
97
|
-
|
98
|
-
/**
|
99
|
-
Draws the view's surface into an image
|
100
|
-
return an SkImage
|
101
|
-
*/
|
102
|
-
sk_sp<SkImage> makeImageSnapshot(std::shared_ptr<SkRect> bounds);
|
103
|
-
|
104
|
-
protected:
|
105
|
-
/**
|
106
|
-
Returns the scaled width of the view
|
107
|
-
*/
|
108
|
-
virtual float getScaledWidth() = 0;
|
109
|
-
|
110
|
-
/**
|
111
|
-
Returns the scaled height of the view
|
112
|
-
*/
|
113
|
-
virtual float getScaledHeight() = 0;
|
114
|
-
|
115
|
-
/**
|
116
|
-
Override to render to a canvas
|
117
|
-
*/
|
118
|
-
virtual void renderToSkiaCanvas(const std::function<void(SkCanvas*)>&) = 0;
|
119
|
-
|
120
|
-
/**
|
121
|
-
* @return The platformcontext
|
122
|
-
*/
|
123
|
-
std::shared_ptr<RNSkPlatformContext> getPlatformContext() {
|
124
|
-
return _platformContext;
|
125
|
-
}
|
126
|
-
|
127
|
-
private:
|
128
|
-
/**
|
129
|
-
* Calls the JS draw callback. This is the JS function that does the actual drawing so this
|
130
|
-
* method must be called from the JS thread.
|
131
|
-
*/
|
132
|
-
void callJsDrawCallback(std::shared_ptr<JsiSkCanvas> canvas, int width, int height, double timestamp);
|
133
|
-
|
134
|
-
/**
|
135
|
-
Starts beginDrawCallback loop if the drawing mode is continuous
|
136
|
-
*/
|
137
|
-
void beginDrawingLoop();
|
138
|
-
|
139
|
-
/**
|
140
|
-
Ends an ongoing beginDrawCallback loop for this view
|
141
|
-
*/
|
142
|
-
void endDrawingLoop();
|
143
|
-
|
144
|
-
/**
|
145
|
-
Draw loop callback
|
146
|
-
*/
|
147
|
-
void drawLoopCallback(bool invalidated);
|
148
|
-
|
149
|
-
/**
|
150
|
-
Draw in canvas
|
151
|
-
*/
|
152
|
-
void drawInCanvas(std::shared_ptr<JsiSkCanvas> canvas,
|
153
|
-
int width,
|
154
|
-
int height,
|
155
|
-
double time);
|
156
|
-
|
157
|
-
/**
|
158
|
-
* Stores the draw drawCallback
|
159
|
-
*/
|
160
|
-
std::shared_ptr<jsi::Function> _drawCallback;
|
161
|
-
|
162
|
-
/**
|
163
|
-
* Stores a pointer to the jsi wrapper for the canvas. The reason for
|
164
|
-
* storing this pointer and not recreate it is that it creates a set of
|
165
|
-
* functions that we don't want to recreate on each render
|
166
|
-
*/
|
167
|
-
std::shared_ptr<JsiSkCanvas> _jsiCanvas;
|
168
|
-
|
169
|
-
/**
|
170
|
-
* JS Drawing mutex
|
171
|
-
*/
|
172
|
-
std::shared_ptr<std::timed_mutex> _jsDrawingLock;
|
173
|
-
|
174
|
-
/**
|
175
|
-
* SKIA Drawing mutex
|
176
|
-
*/
|
177
|
-
std::shared_ptr<std::timed_mutex> _gpuDrawingLock;
|
178
|
-
|
179
|
-
/**
|
180
|
-
* Pointer to the platform context
|
181
|
-
*/
|
182
|
-
std::shared_ptr<RNSkPlatformContext> _platformContext;
|
183
|
-
|
184
|
-
/**
|
185
|
-
Drawing mode
|
186
|
-
*/
|
187
|
-
RNSkDrawingMode _drawingMode;
|
188
|
-
|
189
|
-
/**
|
190
|
-
* Show debug overlays
|
191
|
-
*/
|
192
|
-
bool _showDebugOverlay = false;
|
193
|
-
|
194
|
-
/**
|
195
|
-
* True if the drawing loop has been requested
|
196
|
-
*/
|
197
|
-
size_t _drawingLoopId = 0;
|
198
|
-
|
199
|
-
/**
|
200
|
-
* Info object parameter
|
201
|
-
*/
|
202
|
-
std::shared_ptr<RNSkInfoObject> _infoObject;
|
203
|
-
|
204
|
-
/**
|
205
|
-
Timing information for javascript drawing
|
206
|
-
*/
|
207
|
-
RNSkTimingInfo _jsTimingInfo;
|
208
|
-
|
209
|
-
/**
|
210
|
-
Timing information for GPU rendering
|
211
|
-
*/
|
212
|
-
RNSkTimingInfo _gpuTimingInfo;
|
213
|
-
|
214
|
-
/**
|
215
|
-
Redraw queue counter
|
216
|
-
*/
|
217
|
-
std::atomic<int> _redrawRequestCounter = { 1 };
|
218
|
-
|
219
|
-
/**
|
220
|
-
* Native id
|
221
|
-
*/
|
222
|
-
size_t _nativeId;
|
223
|
-
|
224
|
-
};
|
225
|
-
|
226
|
-
} // namespace RNSkia
|
@@ -1,52 +0,0 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#import "PlatformContext.h"
|
4
|
-
#import "RNSKDrawView.h"
|
5
|
-
#import <CoreFoundation/CoreFoundation.h>
|
6
|
-
#import <UIKit/UIKit.h>
|
7
|
-
|
8
|
-
#import <GrMtlBackendContext.h>
|
9
|
-
#import <MetalKit/MetalKit.h>
|
10
|
-
#import <QuartzCore/CAMetalLayer.h>
|
11
|
-
|
12
|
-
#pragma clang diagnostic push
|
13
|
-
#pragma clang diagnostic ignored "-Wdocumentation"
|
14
|
-
|
15
|
-
#import <SkPicture.h>
|
16
|
-
#import <SkRefCnt.h>
|
17
|
-
#import <include/gpu/GrDirectContext.h>
|
18
|
-
|
19
|
-
#pragma clang diagnostic pop
|
20
|
-
|
21
|
-
class RNSkDrawViewImpl : public RNSkia::RNSkDrawView {
|
22
|
-
public:
|
23
|
-
RNSkDrawViewImpl(std::shared_ptr<RNSkia::RNSkPlatformContext> context);
|
24
|
-
~RNSkDrawViewImpl();
|
25
|
-
|
26
|
-
CALayer* getLayer() { return _layer; }
|
27
|
-
|
28
|
-
void setSize(int width, int height);
|
29
|
-
|
30
|
-
protected:
|
31
|
-
float getScaledWidth() override { return _width * _context->getPixelDensity(); };
|
32
|
-
float getScaledHeight() override { return _height * _context->getPixelDensity(); };
|
33
|
-
|
34
|
-
private:
|
35
|
-
void renderToSkiaCanvas(const std::function<void(SkCanvas*)>& cb) override;
|
36
|
-
bool createSkiaSurface();
|
37
|
-
|
38
|
-
int _nativeId;
|
39
|
-
float _width = -1;
|
40
|
-
float _height = -1;
|
41
|
-
|
42
|
-
#pragma clang diagnostic push
|
43
|
-
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
|
44
|
-
CAMetalLayer *_layer;
|
45
|
-
#pragma clang diagnostic pop
|
46
|
-
|
47
|
-
static id<MTLCommandQueue> _commandQueue;
|
48
|
-
static id<MTLDevice> _device;
|
49
|
-
static sk_sp<GrDirectContext> _skContext;
|
50
|
-
|
51
|
-
std::shared_ptr<RNSkia::RNSkPlatformContext> _context;
|
52
|
-
};
|