@shopify/react-native-skia 0.1.171 → 0.1.173
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +1 -0
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +5 -0
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +106 -5
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +3 -1
- package/cpp/api/JsiSkSurface.h +7 -1
- package/cpp/api/JsiSkSurfaceFactory.h +15 -2
- package/cpp/rnskia/RNSkDomView.cpp +2 -4
- package/cpp/rnskia/RNSkJsView.cpp +3 -0
- package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
- package/cpp/rnskia/RNSkPictureView.h +3 -0
- package/cpp/rnskia/RNSkPlatformContext.h +9 -0
- package/cpp/rnskia/dom/JsiDomApi.h +1 -0
- package/cpp/rnskia/dom/base/ConcatablePaint.cpp +117 -0
- package/cpp/rnskia/dom/base/ConcatablePaint.h +49 -0
- package/cpp/rnskia/dom/base/Declaration.h +88 -0
- package/cpp/rnskia/dom/base/DeclarationContext.h +79 -0
- package/cpp/rnskia/dom/base/DerivedNodeProp.h +25 -9
- package/cpp/rnskia/dom/base/DrawingContext.cpp +32 -186
- package/cpp/rnskia/dom/base/DrawingContext.h +45 -64
- package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +35 -106
- package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +28 -9
- package/cpp/rnskia/dom/base/JsiDomNode.h +46 -17
- package/cpp/rnskia/dom/base/JsiDomRenderNode.h +81 -67
- package/cpp/rnskia/dom/base/NodeProp.h +12 -2
- package/cpp/rnskia/dom/base/NodePropsContainer.h +15 -16
- package/cpp/rnskia/dom/nodes/JsiBackdropFilterNode.h +22 -11
- package/cpp/rnskia/dom/nodes/JsiBlendNode.h +43 -59
- package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +16 -17
- package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +6 -5
- package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +45 -69
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +8 -1
- package/cpp/rnskia/dom/nodes/JsiGroupNode.h +1 -1
- package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +121 -161
- package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -0
- package/cpp/rnskia/dom/nodes/JsiLayerNode.h +28 -18
- package/cpp/rnskia/dom/nodes/JsiPaintNode.h +82 -45
- package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +68 -101
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +3 -2
- package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +150 -207
- package/cpp/rnskia/dom/props/BezierProps.h +4 -2
- package/cpp/rnskia/dom/props/BlendModeProp.h +4 -2
- package/cpp/rnskia/dom/props/BoxShadowProps.h +8 -10
- package/cpp/rnskia/dom/props/CircleProp.h +6 -5
- package/cpp/rnskia/dom/props/ClipProp.h +6 -4
- package/cpp/rnskia/dom/props/ColorProp.h +8 -4
- package/cpp/rnskia/dom/props/DrawingProp.h +5 -3
- package/cpp/rnskia/dom/props/FontProp.h +4 -2
- package/cpp/rnskia/dom/props/GlyphsProp.h +4 -2
- package/cpp/rnskia/dom/props/ImageProps.h +9 -6
- package/cpp/rnskia/dom/props/LayerProp.h +6 -4
- package/cpp/rnskia/dom/props/MatrixProp.h +4 -2
- package/cpp/rnskia/dom/props/NumbersProp.h +8 -4
- package/cpp/rnskia/dom/props/PaintProps.h +55 -92
- package/cpp/rnskia/dom/props/PathProp.h +4 -2
- package/cpp/rnskia/dom/props/PictureProp.h +4 -2
- package/cpp/rnskia/dom/props/PointProp.h +4 -2
- package/cpp/rnskia/dom/props/PointsProp.h +8 -4
- package/cpp/rnskia/dom/props/RRectProp.h +23 -16
- package/cpp/rnskia/dom/props/RadiusProp.h +4 -2
- package/cpp/rnskia/dom/props/RectProp.h +18 -12
- package/cpp/rnskia/dom/props/StrokeProps.h +8 -4
- package/cpp/rnskia/dom/props/SvgProp.h +4 -2
- package/cpp/rnskia/dom/props/TextBlobProp.h +10 -8
- package/cpp/rnskia/dom/props/TileModeProp.h +4 -2
- package/cpp/rnskia/dom/props/TransformProp.h +4 -2
- package/cpp/rnskia/dom/props/TransformsProps.h +5 -7
- package/cpp/rnskia/dom/props/UniformsProp.h +4 -2
- package/cpp/rnskia/dom/props/VertexModeProp.h +4 -2
- package/cpp/rnskia/dom/props/VerticesProps.h +7 -11
- package/ios/RNSkia-iOS/DisplayLink.mm +22 -24
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +57 -50
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.h +2 -0
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +38 -25
- package/ios/RNSkia-iOS/SkiaDomViewManager.mm +17 -17
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +17 -17
- package/ios/RNSkia-iOS/SkiaManager.mm +12 -10
- package/ios/RNSkia-iOS/SkiaMetalRenderer.h +5 -0
- package/ios/RNSkia-iOS/SkiaMetalRenderer.mm +53 -0
- package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +17 -17
- package/ios/RNSkia-iOS/SkiaUIView.mm +63 -53
- package/ios/RNSkiaModule.mm +5 -7
- package/lib/commonjs/animation/decay/decay.d.ts +2 -0
- package/lib/commonjs/animation/decay/index.d.ts +1 -0
- package/lib/commonjs/animation/decay/runDecay.d.ts +10 -0
- package/lib/commonjs/animation/decay/types.d.ts +21 -0
- package/lib/commonjs/animation/functions/index.d.ts +4 -0
- package/lib/commonjs/animation/functions/interpolate.d.ts +17 -0
- package/lib/commonjs/animation/functions/interpolateColors.d.ts +3 -0
- package/lib/commonjs/animation/functions/interpolatePaths.d.ts +19 -0
- package/lib/commonjs/animation/functions/interpolateVector.d.ts +10 -0
- package/lib/commonjs/animation/index.d.ts +4 -0
- package/lib/commonjs/animation/spring/Spring.d.ts +65 -0
- package/lib/commonjs/animation/spring/functions/index.d.ts +1 -0
- package/lib/commonjs/animation/spring/functions/spring.d.ts +10 -0
- package/lib/commonjs/animation/spring/index.d.ts +3 -0
- package/lib/commonjs/animation/spring/runSpring.d.ts +16 -0
- package/lib/commonjs/animation/spring/types.d.ts +6 -0
- package/lib/commonjs/animation/spring/useSpring.d.ts +10 -0
- package/lib/commonjs/animation/timing/Easing.d.ts +19 -0
- package/lib/commonjs/animation/timing/createTiming.d.ts +17 -0
- package/lib/commonjs/animation/timing/functions/bezier.d.ts +1 -0
- package/lib/commonjs/animation/timing/functions/getResolvedParams.d.ts +7 -0
- package/lib/commonjs/animation/timing/functions/index.d.ts +4 -0
- package/lib/commonjs/animation/timing/functions/timing.d.ts +17 -0
- package/lib/commonjs/animation/timing/functions/types.d.ts +7 -0
- package/lib/commonjs/animation/timing/index.d.ts +4 -0
- package/lib/commonjs/animation/timing/runTiming.d.ts +16 -0
- package/lib/commonjs/animation/timing/useLoop.d.ts +8 -0
- package/lib/commonjs/animation/timing/useTiming.d.ts +10 -0
- package/lib/commonjs/animation/types.d.ts +18 -0
- package/lib/commonjs/dom/nodes/DrawingNode.d.ts +14 -0
- package/lib/commonjs/dom/nodes/DrawingNode.js +5 -1
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/GroupNode.d.ts +7 -0
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +64 -0
- package/lib/commonjs/dom/nodes/LayerNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/LayerNode.js +13 -6
- package/lib/commonjs/dom/nodes/LayerNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/Node.d.ts +38 -0
- package/lib/commonjs/dom/nodes/Node.js +8 -26
- package/lib/commonjs/dom/nodes/Node.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintContext.d.ts +18 -0
- package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/PaintNode.js +32 -15
- package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/RenderNode.d.ts +26 -0
- package/lib/commonjs/dom/nodes/RenderNode.js +19 -187
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.d.ts +7 -0
- package/lib/commonjs/dom/nodes/datatypes/Enum.d.ts +1 -0
- package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +33 -0
- package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +92 -0
- package/lib/commonjs/dom/nodes/datatypes/Path.d.ts +4 -0
- package/lib/commonjs/dom/nodes/datatypes/Radius.d.ts +3 -0
- package/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +5 -0
- package/lib/commonjs/dom/nodes/datatypes/Transform.d.ts +3 -0
- package/lib/commonjs/dom/nodes/datatypes/index.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +25 -7
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.d.ts +15 -0
- package/lib/commonjs/dom/nodes/drawings/Box.js +3 -0
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +25 -0
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +18 -0
- package/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +10 -0
- package/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/Text.d.ts +30 -0
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +9 -0
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +18 -0
- package/lib/commonjs/dom/nodes/index.d.ts +3 -0
- package/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/paint/BlendNode.js +16 -47
- package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +35 -0
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js +29 -43
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +42 -0
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js +45 -42
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +8 -0
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js +3 -2
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +39 -0
- package/lib/commonjs/dom/nodes/paint/PathEffects.js +30 -72
- package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.d.ts +43 -0
- package/lib/commonjs/dom/nodes/paint/Shaders.js +28 -18
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/index.d.ts +6 -0
- package/lib/commonjs/dom/types/ColorFilters.d.ts +12 -0
- package/lib/commonjs/dom/types/Common.d.ts +56 -0
- package/lib/commonjs/dom/types/DeclarationContext.d.ts +29 -0
- package/lib/commonjs/dom/types/DeclarationContext.js +118 -0
- package/lib/commonjs/dom/types/DeclarationContext.js.map +1 -0
- package/lib/commonjs/dom/types/DrawingContext.d.ts +22 -0
- package/lib/commonjs/dom/types/DrawingContext.js +330 -0
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +104 -0
- package/lib/commonjs/dom/types/ImageFilters.d.ts +37 -0
- package/lib/commonjs/dom/types/MaskFilters.d.ts +7 -0
- package/lib/commonjs/dom/types/Node.d.ts +23 -0
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +67 -0
- package/lib/commonjs/dom/types/PathEffects.d.ts +28 -0
- package/lib/commonjs/dom/types/Shaders.d.ts +59 -0
- package/lib/commonjs/dom/types/SkDOM.d.ts +71 -0
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/dom/types/index.d.ts +12 -0
- package/lib/commonjs/dom/types/index.js +13 -0
- package/lib/commonjs/dom/types/index.js.map +1 -1
- package/lib/commonjs/external/index.d.ts +1 -0
- package/lib/commonjs/external/reanimated/index.d.ts +1 -0
- package/lib/commonjs/external/reanimated/useSharedValueEffect.d.ts +11 -0
- package/lib/commonjs/index.d.ts +11 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock/index.d.ts +16 -0
- package/lib/commonjs/renderer/Canvas.d.ts +11 -0
- package/lib/commonjs/renderer/Canvas.js +3 -3
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.d.ts +12 -0
- package/lib/commonjs/renderer/DependencyManager.d.ts +46 -0
- package/lib/commonjs/renderer/DrawingContext.d.ts +7 -0
- package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +132 -0
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.d.ts +19 -0
- package/lib/commonjs/renderer/HostConfig.js +1 -0
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.d.ts +2 -0
- package/lib/commonjs/renderer/Offscreen.js +31 -0
- package/lib/commonjs/renderer/Offscreen.js.map +1 -0
- package/lib/commonjs/renderer/Reconciler.d.ts +13 -0
- package/lib/commonjs/renderer/Reconciler.js +0 -1
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.d.ts +4 -0
- package/lib/commonjs/renderer/components/Drawing.d.ts +3 -0
- package/lib/commonjs/renderer/components/Group.d.ts +8 -0
- package/lib/commonjs/renderer/components/Mask.d.ts +9 -0
- package/lib/commonjs/renderer/components/Paint.d.ts +4 -0
- package/lib/commonjs/renderer/components/Picture.d.ts +4 -0
- package/lib/commonjs/renderer/components/backdrop/BackdropBlur.d.ts +9 -0
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.d.ts +7 -0
- package/lib/commonjs/renderer/components/backdrop/index.d.ts +2 -0
- package/lib/commonjs/renderer/components/colorFilters/BlendColor.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/Lerp.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/Matrix.d.ts +5 -0
- package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +4 -0
- package/lib/commonjs/renderer/components/colorFilters/index.d.ts +6 -0
- package/lib/commonjs/renderer/components/image/Image.d.ts +4 -0
- package/lib/commonjs/renderer/components/image/ImageSVG.d.ts +4 -0
- package/lib/commonjs/renderer/components/image/ImageShader.d.ts +4 -0
- package/lib/commonjs/renderer/components/image/index.d.ts +3 -0
- package/lib/commonjs/renderer/components/imageFilters/Blur.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/Morphology.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/Offset.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/Shadow.d.ts +4 -0
- package/lib/commonjs/renderer/components/imageFilters/index.d.ts +6 -0
- package/lib/commonjs/renderer/components/index.d.ts +16 -0
- package/lib/commonjs/renderer/components/maskFilters/Blur.d.ts +4 -0
- package/lib/commonjs/renderer/components/maskFilters/index.d.ts +1 -0
- package/lib/commonjs/renderer/components/pathEffects/Corner.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Dash.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Discrete.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Line2D.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Path1D.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Path2D.d.ts +4 -0
- package/lib/commonjs/renderer/components/pathEffects/Sum.d.ts +3 -0
- package/lib/commonjs/renderer/components/pathEffects/index.d.ts +7 -0
- package/lib/commonjs/renderer/components/shaders/Color.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/FractalNoise.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/LinearGradient.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/RadialGradient.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/Shader.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/ShaderLib.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/SweepGradient.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/Turbulence.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.d.ts +4 -0
- package/lib/commonjs/renderer/components/shaders/index.d.ts +9 -0
- package/lib/commonjs/renderer/components/shapes/Box.d.ts +5 -0
- package/lib/commonjs/renderer/components/shapes/Circle.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/DiffRect.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Fill.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +20 -0
- package/lib/commonjs/renderer/components/shapes/Line.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Oval.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Patch.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Path.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Points.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Rect.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/RoundedRect.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Vertices.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/index.d.ts +13 -0
- package/lib/commonjs/renderer/components/text/Glyphs.d.ts +4 -0
- package/lib/commonjs/renderer/components/text/Text.d.ts +4 -0
- package/lib/commonjs/renderer/components/text/TextBlob.d.ts +4 -0
- package/lib/commonjs/renderer/components/text/TextPath.d.ts +4 -0
- package/lib/commonjs/renderer/components/text/index.d.ts +4 -0
- package/lib/commonjs/renderer/index.d.ts +2 -0
- package/lib/commonjs/renderer/index.js +0 -13
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +17 -0
- package/lib/commonjs/renderer/processors/Animations/index.d.ts +1 -0
- package/lib/commonjs/renderer/processors/index.d.ts +2 -0
- package/lib/commonjs/renderer/processors/math/Coordinates.d.ts +29 -0
- package/lib/commonjs/renderer/processors/math/Math.d.ts +15 -0
- package/lib/commonjs/renderer/processors/math/Transforms.d.ts +5 -0
- package/lib/commonjs/renderer/processors/math/index.d.ts +3 -0
- package/lib/commonjs/renderer/typeddash.d.ts +3 -0
- package/lib/commonjs/skia/NativeSetup.d.ts +1 -0
- package/lib/commonjs/skia/Skia.d.ts +8 -0
- package/lib/commonjs/skia/Skia.web.d.ts +1 -0
- package/lib/commonjs/skia/core/Data.d.ts +3 -0
- package/lib/commonjs/skia/core/Font.d.ts +5 -0
- package/lib/commonjs/skia/core/Image.d.ts +5 -0
- package/lib/commonjs/skia/core/Matrix.d.ts +2 -0
- package/lib/commonjs/skia/core/Picture.d.ts +8 -0
- package/lib/commonjs/skia/core/RRect.d.ts +2 -0
- package/lib/commonjs/skia/core/Rect.d.ts +8 -0
- package/lib/commonjs/skia/core/SVG.d.ts +2 -0
- package/lib/commonjs/skia/core/Typeface.d.ts +5 -0
- package/lib/commonjs/skia/core/Vector.d.ts +12 -0
- package/lib/commonjs/skia/core/index.d.ts +10 -0
- package/lib/commonjs/skia/index.d.ts +3 -0
- package/lib/commonjs/skia/types/Canvas.d.ts +381 -0
- package/lib/commonjs/skia/types/Color.d.ts +2 -0
- package/lib/commonjs/skia/types/ColorFilter/ColorFilter.d.ts +3 -0
- package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.d.ts +43 -0
- package/lib/commonjs/skia/types/ColorFilter/index.d.ts +2 -0
- package/lib/commonjs/skia/types/ContourMeasure.d.ts +41 -0
- package/lib/commonjs/skia/types/Data/Data.d.ts +12 -0
- package/lib/commonjs/skia/types/Data/DataFactory.d.ts +18 -0
- package/lib/commonjs/skia/types/Data/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Font/Font.d.ts +180 -0
- package/lib/commonjs/skia/types/Font/index.d.ts +1 -0
- package/lib/commonjs/skia/types/Image/Image.d.ts +75 -0
- package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +62 -0
- package/lib/commonjs/skia/types/Image/index.d.ts +2 -0
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.d.ts +23 -0
- package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.d.ts +130 -0
- package/lib/commonjs/skia/types/ImageFilter/index.d.ts +2 -0
- package/lib/commonjs/skia/types/JsiInstance.d.ts +3 -0
- package/lib/commonjs/skia/types/MaskFilter.d.ts +21 -0
- package/lib/commonjs/skia/types/Matrix.d.ts +34 -0
- package/lib/commonjs/skia/types/Paint/BlendMode.d.ts +58 -0
- package/lib/commonjs/skia/types/Paint/Paint.d.ts +136 -0
- package/lib/commonjs/skia/types/Paint/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Path/Path.d.ts +474 -0
- package/lib/commonjs/skia/types/Path/PathFactory.d.ts +29 -0
- package/lib/commonjs/skia/types/Path/index.d.ts +2 -0
- package/lib/commonjs/skia/types/PathEffect.d.ts +75 -0
- package/lib/commonjs/skia/types/Picture/Picture.d.ts +27 -0
- package/lib/commonjs/skia/types/Picture/PictureFactory.d.ts +8 -0
- package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +15 -0
- package/lib/commonjs/skia/types/Picture/index.d.ts +3 -0
- package/lib/commonjs/skia/types/Point.d.ts +10 -0
- package/lib/commonjs/skia/types/RRect.d.ts +7 -0
- package/lib/commonjs/skia/types/RSXform.d.ts +2 -0
- package/lib/commonjs/skia/types/Rect.d.ts +6 -0
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.d.ts +52 -0
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.d.ts +10 -0
- package/lib/commonjs/skia/types/RuntimeEffect/index.d.ts +2 -0
- package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -0
- package/lib/commonjs/skia/types/SVG/SVGFactory.d.ts +6 -0
- package/lib/commonjs/skia/types/SVG/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Shader/Shader.d.ts +10 -0
- package/lib/commonjs/skia/types/Shader/ShaderFactory.d.ts +104 -0
- package/lib/commonjs/skia/types/Shader/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Size.d.ts +4 -0
- package/lib/commonjs/skia/types/Skia.d.ts +66 -0
- package/lib/commonjs/skia/types/Surface/Surface.d.ts +29 -0
- package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.d.ts +17 -0
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/index.d.ts +2 -0
- package/lib/commonjs/skia/types/TextBlob.d.ts +44 -0
- package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -0
- package/lib/commonjs/skia/types/Typeface/TypefaceFactory.d.ts +5 -0
- package/lib/commonjs/skia/types/Typeface/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Vertices/Vertices.d.ts +17 -0
- package/lib/commonjs/skia/types/Vertices/index.d.ts +1 -0
- package/lib/commonjs/skia/types/index.d.ts +28 -0
- package/lib/commonjs/skia/web/Host.d.ts +19 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +44 -0
- package/lib/commonjs/skia/web/JsiSkColor.d.ts +2 -0
- package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +12 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkData.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkDataFactory.d.ts +19 -0
- package/lib/commonjs/skia/web/JsiSkFont.d.ts +33 -0
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +12 -0
- package/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +10 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +19 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +13 -0
- package/lib/commonjs/skia/web/JsiSkPaint.d.ts +28 -0
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +57 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
- package/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +13 -0
- package/lib/commonjs/skia/web/JsiSkPicture.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkPictureFactory.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +11 -0
- package/lib/commonjs/skia/web/JsiSkPoint.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +11 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +7 -0
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +11 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +16 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkSVGFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkShader.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkShaderFactory.d.ts +16 -0
- package/lib/commonjs/skia/web/JsiSkSurface.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js +4 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js +21 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +6 -0
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.d.ts +13 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
- package/lib/commonjs/skia/web/JsiSkVertices.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.d.ts +4 -0
- package/lib/commonjs/skia/web/JsiSkia.d.ts +3 -0
- package/lib/commonjs/skia/web/index.d.ts +1 -0
- package/lib/commonjs/values/api.d.ts +5 -0
- package/lib/commonjs/values/api.web.d.ts +2 -0
- package/lib/commonjs/values/hooks/index.d.ts +4 -0
- package/lib/commonjs/values/hooks/useClockValue.d.ts +6 -0
- package/lib/commonjs/values/hooks/useComputedValue.d.ts +8 -0
- package/lib/commonjs/values/hooks/useValue.d.ts +7 -0
- package/lib/commonjs/values/hooks/useValueEffect.d.ts +7 -0
- package/lib/commonjs/values/index.d.ts +4 -0
- package/lib/commonjs/values/selector.d.ts +14 -0
- package/lib/commonjs/values/types.d.ts +63 -0
- package/lib/commonjs/values/web/RNSkAnimation.d.ts +9 -0
- package/lib/commonjs/values/web/RNSkClockValue.d.ts +13 -0
- package/lib/commonjs/values/web/RNSkComputedValue.d.ts +10 -0
- package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +12 -0
- package/lib/commonjs/values/web/RNSkValue.d.ts +14 -0
- package/lib/commonjs/values/web/api.d.ts +2 -0
- package/lib/commonjs/values/web/index.d.ts +1 -0
- package/lib/commonjs/views/SkiaBaseWebView.d.ts +62 -0
- package/lib/commonjs/views/SkiaBaseWebView.js +6 -4
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.d.ts +31 -0
- package/lib/commonjs/views/SkiaDomView.web.d.ts +7 -0
- package/lib/commonjs/views/SkiaDomView.web.js +3 -14
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.d.ts +27 -0
- package/lib/commonjs/views/SkiaPictureView.web.d.ts +7 -0
- package/lib/commonjs/views/SkiaPictureView.web.js +0 -7
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaView.d.ts +30 -0
- package/lib/commonjs/views/SkiaView.web.d.ts +7 -0
- package/lib/commonjs/views/SkiaView.web.js +0 -7
- package/lib/commonjs/views/SkiaView.web.js.map +1 -1
- package/lib/commonjs/views/api.d.ts +5 -0
- package/lib/commonjs/views/index.d.ts +6 -0
- package/lib/commonjs/views/types.d.ts +91 -0
- package/lib/commonjs/views/useDrawCallback.d.ts +8 -0
- package/lib/commonjs/views/useTouchHandler.d.ts +22 -0
- package/lib/commonjs/web/LoadSkiaWeb.d.ts +6 -0
- package/lib/commonjs/web/WithSkiaWeb.d.ts +12 -0
- package/lib/commonjs/web/index.d.ts +2 -0
- package/lib/module/animation/decay/decay.d.ts +2 -0
- package/lib/module/animation/decay/index.d.ts +1 -0
- package/lib/module/animation/decay/runDecay.d.ts +10 -0
- package/lib/module/animation/decay/types.d.ts +21 -0
- package/lib/module/animation/functions/index.d.ts +4 -0
- package/lib/module/animation/functions/interpolate.d.ts +17 -0
- package/lib/module/animation/functions/interpolateColors.d.ts +3 -0
- package/lib/module/animation/functions/interpolatePaths.d.ts +19 -0
- package/lib/module/animation/functions/interpolateVector.d.ts +10 -0
- package/lib/module/animation/index.d.ts +4 -0
- package/lib/module/animation/spring/Spring.d.ts +65 -0
- package/lib/module/animation/spring/functions/index.d.ts +1 -0
- package/lib/module/animation/spring/functions/spring.d.ts +10 -0
- package/lib/module/animation/spring/index.d.ts +3 -0
- package/lib/module/animation/spring/runSpring.d.ts +16 -0
- package/lib/module/animation/spring/types.d.ts +6 -0
- package/lib/module/animation/spring/useSpring.d.ts +10 -0
- package/lib/module/animation/timing/Easing.d.ts +19 -0
- package/lib/module/animation/timing/createTiming.d.ts +17 -0
- package/lib/module/animation/timing/functions/bezier.d.ts +1 -0
- package/lib/module/animation/timing/functions/getResolvedParams.d.ts +7 -0
- package/lib/module/animation/timing/functions/index.d.ts +4 -0
- package/lib/module/animation/timing/functions/timing.d.ts +17 -0
- package/lib/module/animation/timing/functions/types.d.ts +7 -0
- package/lib/module/animation/timing/index.d.ts +4 -0
- package/lib/module/animation/timing/runTiming.d.ts +16 -0
- package/lib/module/animation/timing/useLoop.d.ts +8 -0
- package/lib/module/animation/timing/useTiming.d.ts +10 -0
- package/lib/module/animation/types.d.ts +18 -0
- package/lib/module/dom/nodes/DrawingNode.d.ts +14 -0
- package/lib/module/dom/nodes/DrawingNode.js +5 -1
- package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/GroupNode.d.ts +7 -0
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +64 -0
- package/lib/module/dom/nodes/LayerNode.d.ts +8 -0
- package/lib/module/dom/nodes/LayerNode.js +13 -7
- package/lib/module/dom/nodes/LayerNode.js.map +1 -1
- package/lib/module/dom/nodes/Node.d.ts +38 -0
- package/lib/module/dom/nodes/Node.js +8 -25
- package/lib/module/dom/nodes/Node.js.map +1 -1
- package/lib/module/dom/nodes/PaintContext.d.ts +18 -0
- package/lib/module/dom/nodes/PaintContext.js.map +1 -1
- package/lib/module/dom/nodes/PaintNode.d.ts +8 -0
- package/lib/module/dom/nodes/PaintNode.js +32 -15
- package/lib/module/dom/nodes/PaintNode.js.map +1 -1
- package/lib/module/dom/nodes/RenderNode.d.ts +26 -0
- package/lib/module/dom/nodes/RenderNode.js +20 -187
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.d.ts +7 -0
- package/lib/module/dom/nodes/datatypes/Enum.d.ts +1 -0
- package/lib/module/dom/nodes/datatypes/Fitting.d.ts +33 -0
- package/lib/module/dom/nodes/datatypes/Gradient.d.ts +92 -0
- package/lib/module/dom/nodes/datatypes/Path.d.ts +4 -0
- package/lib/module/dom/nodes/datatypes/Radius.d.ts +3 -0
- package/lib/module/dom/nodes/datatypes/Rect.d.ts +5 -0
- package/lib/module/dom/nodes/datatypes/Transform.d.ts +3 -0
- package/lib/module/dom/nodes/datatypes/index.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +23 -4
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.d.ts +15 -0
- package/lib/module/dom/nodes/drawings/Box.js +3 -0
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/CircleNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/FillNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/ImageNode.d.ts +25 -0
- package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/LineNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/OvalNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/PatchNode.d.ts +18 -0
- package/lib/module/dom/nodes/drawings/PathNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/PictureNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/PointsNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/RRectNode.d.ts +10 -0
- package/lib/module/dom/nodes/drawings/RectNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/Text.d.ts +30 -0
- package/lib/module/dom/nodes/drawings/VerticesNode.d.ts +9 -0
- package/lib/module/dom/nodes/drawings/index.d.ts +18 -0
- package/lib/module/dom/nodes/index.d.ts +3 -0
- package/lib/module/dom/nodes/paint/BlendNode.d.ts +8 -0
- package/lib/module/dom/nodes/paint/BlendNode.js +15 -46
- package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
- package/lib/module/dom/nodes/paint/ColorFilters.d.ts +35 -0
- package/lib/module/dom/nodes/paint/ColorFilters.js +29 -43
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.d.ts +42 -0
- package/lib/module/dom/nodes/paint/ImageFilters.js +48 -41
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/MaskFilters.d.ts +8 -0
- package/lib/module/dom/nodes/paint/MaskFilters.js +3 -2
- package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/PathEffects.d.ts +39 -0
- package/lib/module/dom/nodes/paint/PathEffects.js +29 -72
- package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
- package/lib/module/dom/nodes/paint/Shaders.d.ts +43 -0
- package/lib/module/dom/nodes/paint/Shaders.js +28 -18
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/module/dom/nodes/paint/index.d.ts +6 -0
- package/lib/module/dom/types/ColorFilters.d.ts +12 -0
- package/lib/module/dom/types/Common.d.ts +56 -0
- package/lib/module/dom/types/DeclarationContext.d.ts +29 -0
- package/lib/module/dom/types/DeclarationContext.js +107 -0
- package/lib/module/dom/types/DeclarationContext.js.map +1 -0
- package/lib/module/dom/types/DrawingContext.d.ts +22 -0
- package/lib/module/dom/types/DrawingContext.js +322 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +104 -0
- package/lib/module/dom/types/ImageFilters.d.ts +37 -0
- package/lib/module/dom/types/MaskFilters.d.ts +7 -0
- package/lib/module/dom/types/Node.d.ts +23 -0
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +67 -0
- package/lib/module/dom/types/PathEffects.d.ts +28 -0
- package/lib/module/dom/types/Shaders.d.ts +59 -0
- package/lib/module/dom/types/SkDOM.d.ts +71 -0
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/dom/types/index.d.ts +12 -0
- package/lib/module/dom/types/index.js +1 -0
- package/lib/module/dom/types/index.js.map +1 -1
- package/lib/module/external/index.d.ts +1 -0
- package/lib/module/external/reanimated/index.d.ts +1 -0
- package/lib/module/external/reanimated/useSharedValueEffect.d.ts +11 -0
- package/lib/module/index.d.ts +11 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock/index.d.ts +16 -0
- package/lib/module/renderer/Canvas.d.ts +11 -0
- package/lib/module/renderer/Canvas.js +3 -3
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.d.ts +12 -0
- package/lib/module/renderer/DependencyManager.d.ts +46 -0
- package/lib/module/renderer/DrawingContext.d.ts +7 -0
- package/lib/module/renderer/DrawingContext.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +132 -0
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.d.ts +19 -0
- package/lib/module/renderer/HostConfig.js +1 -0
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/Offscreen.d.ts +2 -0
- package/lib/module/renderer/Offscreen.js +19 -0
- package/lib/module/renderer/Offscreen.js.map +1 -0
- package/lib/module/renderer/Reconciler.d.ts +13 -0
- package/lib/module/renderer/Reconciler.js +0 -1
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/Blend.d.ts +4 -0
- package/lib/module/renderer/components/Drawing.d.ts +3 -0
- package/lib/module/renderer/components/Group.d.ts +8 -0
- package/lib/module/renderer/components/Mask.d.ts +9 -0
- package/lib/module/renderer/components/Paint.d.ts +4 -0
- package/lib/module/renderer/components/Picture.d.ts +4 -0
- package/lib/module/renderer/components/backdrop/BackdropBlur.d.ts +9 -0
- package/lib/module/renderer/components/backdrop/BackdropFilter.d.ts +7 -0
- package/lib/module/renderer/components/backdrop/index.d.ts +2 -0
- package/lib/module/renderer/components/colorFilters/BlendColor.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/Lerp.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/LumaColorFilter.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/Matrix.d.ts +5 -0
- package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.d.ts +4 -0
- package/lib/module/renderer/components/colorFilters/index.d.ts +6 -0
- package/lib/module/renderer/components/image/Image.d.ts +4 -0
- package/lib/module/renderer/components/image/ImageSVG.d.ts +4 -0
- package/lib/module/renderer/components/image/ImageShader.d.ts +4 -0
- package/lib/module/renderer/components/image/index.d.ts +3 -0
- package/lib/module/renderer/components/imageFilters/Blur.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/DisplacementMap.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/Morphology.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/Offset.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/RuntimeShader.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/Shadow.d.ts +4 -0
- package/lib/module/renderer/components/imageFilters/index.d.ts +6 -0
- package/lib/module/renderer/components/index.d.ts +16 -0
- package/lib/module/renderer/components/maskFilters/Blur.d.ts +4 -0
- package/lib/module/renderer/components/maskFilters/index.d.ts +1 -0
- package/lib/module/renderer/components/pathEffects/Corner.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Dash.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Discrete.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Line2D.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Path1D.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Path2D.d.ts +4 -0
- package/lib/module/renderer/components/pathEffects/Sum.d.ts +3 -0
- package/lib/module/renderer/components/pathEffects/index.d.ts +7 -0
- package/lib/module/renderer/components/shaders/Color.d.ts +4 -0
- package/lib/module/renderer/components/shaders/FractalNoise.d.ts +4 -0
- package/lib/module/renderer/components/shaders/LinearGradient.d.ts +4 -0
- package/lib/module/renderer/components/shaders/RadialGradient.d.ts +4 -0
- package/lib/module/renderer/components/shaders/Shader.d.ts +4 -0
- package/lib/module/renderer/components/shaders/ShaderLib.d.ts +4 -0
- package/lib/module/renderer/components/shaders/SweepGradient.d.ts +4 -0
- package/lib/module/renderer/components/shaders/Turbulence.d.ts +4 -0
- package/lib/module/renderer/components/shaders/TwoPointConicalGradient.d.ts +4 -0
- package/lib/module/renderer/components/shaders/index.d.ts +9 -0
- package/lib/module/renderer/components/shapes/Box.d.ts +5 -0
- package/lib/module/renderer/components/shapes/Circle.d.ts +4 -0
- package/lib/module/renderer/components/shapes/DiffRect.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Fill.d.ts +4 -0
- package/lib/module/renderer/components/shapes/FitBox.d.ts +20 -0
- package/lib/module/renderer/components/shapes/Line.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Oval.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Patch.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Path.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Points.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Rect.d.ts +4 -0
- package/lib/module/renderer/components/shapes/RoundedRect.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Vertices.d.ts +4 -0
- package/lib/module/renderer/components/shapes/index.d.ts +13 -0
- package/lib/module/renderer/components/text/Glyphs.d.ts +4 -0
- package/lib/module/renderer/components/text/Text.d.ts +4 -0
- package/lib/module/renderer/components/text/TextBlob.d.ts +4 -0
- package/lib/module/renderer/components/text/TextPath.d.ts +4 -0
- package/lib/module/renderer/components/text/index.d.ts +4 -0
- package/lib/module/renderer/index.d.ts +2 -0
- package/lib/module/renderer/index.js +0 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.d.ts +17 -0
- package/lib/module/renderer/processors/Animations/index.d.ts +1 -0
- package/lib/module/renderer/processors/index.d.ts +2 -0
- package/lib/module/renderer/processors/math/Coordinates.d.ts +29 -0
- package/lib/module/renderer/processors/math/Math.d.ts +15 -0
- package/lib/module/renderer/processors/math/Transforms.d.ts +5 -0
- package/lib/module/renderer/processors/math/index.d.ts +3 -0
- package/lib/module/renderer/typeddash.d.ts +3 -0
- package/lib/module/skia/NativeSetup.d.ts +1 -0
- package/lib/module/skia/Skia.d.ts +8 -0
- package/lib/module/skia/Skia.web.d.ts +1 -0
- package/lib/module/skia/core/Data.d.ts +3 -0
- package/lib/module/skia/core/Font.d.ts +5 -0
- package/lib/module/skia/core/Image.d.ts +5 -0
- package/lib/module/skia/core/Matrix.d.ts +2 -0
- package/lib/module/skia/core/Picture.d.ts +8 -0
- package/lib/module/skia/core/RRect.d.ts +2 -0
- package/lib/module/skia/core/Rect.d.ts +8 -0
- package/lib/module/skia/core/SVG.d.ts +2 -0
- package/lib/module/skia/core/Typeface.d.ts +5 -0
- package/lib/module/skia/core/Vector.d.ts +12 -0
- package/lib/module/skia/core/index.d.ts +10 -0
- package/lib/module/skia/index.d.ts +3 -0
- package/lib/module/skia/types/Canvas.d.ts +381 -0
- package/lib/module/skia/types/Color.d.ts +2 -0
- package/lib/module/skia/types/ColorFilter/ColorFilter.d.ts +3 -0
- package/lib/module/skia/types/ColorFilter/ColorFilterFactory.d.ts +43 -0
- package/lib/module/skia/types/ColorFilter/index.d.ts +2 -0
- package/lib/module/skia/types/ContourMeasure.d.ts +41 -0
- package/lib/module/skia/types/Data/Data.d.ts +12 -0
- package/lib/module/skia/types/Data/DataFactory.d.ts +18 -0
- package/lib/module/skia/types/Data/index.d.ts +2 -0
- package/lib/module/skia/types/Font/Font.d.ts +180 -0
- package/lib/module/skia/types/Font/index.d.ts +1 -0
- package/lib/module/skia/types/Image/Image.d.ts +75 -0
- package/lib/module/skia/types/Image/ImageFactory.d.ts +62 -0
- package/lib/module/skia/types/Image/index.d.ts +2 -0
- package/lib/module/skia/types/ImageFilter/ImageFilter.d.ts +23 -0
- package/lib/module/skia/types/ImageFilter/ImageFilterFactory.d.ts +130 -0
- package/lib/module/skia/types/ImageFilter/index.d.ts +2 -0
- package/lib/module/skia/types/JsiInstance.d.ts +3 -0
- package/lib/module/skia/types/MaskFilter.d.ts +21 -0
- package/lib/module/skia/types/Matrix.d.ts +34 -0
- package/lib/module/skia/types/Paint/BlendMode.d.ts +58 -0
- package/lib/module/skia/types/Paint/Paint.d.ts +136 -0
- package/lib/module/skia/types/Paint/index.d.ts +2 -0
- package/lib/module/skia/types/Path/Path.d.ts +474 -0
- package/lib/module/skia/types/Path/PathFactory.d.ts +29 -0
- package/lib/module/skia/types/Path/index.d.ts +2 -0
- package/lib/module/skia/types/PathEffect.d.ts +75 -0
- package/lib/module/skia/types/Picture/Picture.d.ts +27 -0
- package/lib/module/skia/types/Picture/PictureFactory.d.ts +8 -0
- package/lib/module/skia/types/Picture/PictureRecorder.d.ts +15 -0
- package/lib/module/skia/types/Picture/index.d.ts +3 -0
- package/lib/module/skia/types/Point.d.ts +10 -0
- package/lib/module/skia/types/RRect.d.ts +7 -0
- package/lib/module/skia/types/RSXform.d.ts +2 -0
- package/lib/module/skia/types/Rect.d.ts +6 -0
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.d.ts +52 -0
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.d.ts +10 -0
- package/lib/module/skia/types/RuntimeEffect/index.d.ts +2 -0
- package/lib/module/skia/types/SVG/SVG.d.ts +2 -0
- package/lib/module/skia/types/SVG/SVGFactory.d.ts +6 -0
- package/lib/module/skia/types/SVG/index.d.ts +2 -0
- package/lib/module/skia/types/Shader/Shader.d.ts +10 -0
- package/lib/module/skia/types/Shader/ShaderFactory.d.ts +104 -0
- package/lib/module/skia/types/Shader/index.d.ts +2 -0
- package/lib/module/skia/types/Size.d.ts +4 -0
- package/lib/module/skia/types/Skia.d.ts +66 -0
- package/lib/module/skia/types/Surface/Surface.d.ts +29 -0
- package/lib/module/skia/types/Surface/Surface.js.map +1 -1
- package/lib/module/skia/types/Surface/SurfaceFactory.d.ts +17 -0
- package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/module/skia/types/Surface/index.d.ts +2 -0
- package/lib/module/skia/types/TextBlob.d.ts +44 -0
- package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -0
- package/lib/module/skia/types/Typeface/TypefaceFactory.d.ts +5 -0
- package/lib/module/skia/types/Typeface/index.d.ts +2 -0
- package/lib/module/skia/types/Vertices/Vertices.d.ts +17 -0
- package/lib/module/skia/types/Vertices/index.d.ts +1 -0
- package/lib/module/skia/types/index.d.ts +28 -0
- package/lib/module/skia/web/Host.d.ts +19 -0
- package/lib/module/skia/web/JsiSkCanvas.d.ts +44 -0
- package/lib/module/skia/web/JsiSkColor.d.ts +2 -0
- package/lib/module/skia/web/JsiSkColorFilter.d.ts +6 -0
- package/lib/module/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
- package/lib/module/skia/web/JsiSkContourMeasure.d.ts +12 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
- package/lib/module/skia/web/JsiSkData.d.ts +8 -0
- package/lib/module/skia/web/JsiSkDataFactory.d.ts +19 -0
- package/lib/module/skia/web/JsiSkFont.d.ts +33 -0
- package/lib/module/skia/web/JsiSkImage.d.ts +12 -0
- package/lib/module/skia/web/JsiSkImageFactory.d.ts +10 -0
- package/lib/module/skia/web/JsiSkImageFilter.d.ts +6 -0
- package/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +19 -0
- package/lib/module/skia/web/JsiSkMaskFilter.d.ts +6 -0
- package/lib/module/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkMatrix.d.ts +13 -0
- package/lib/module/skia/web/JsiSkPaint.d.ts +28 -0
- package/lib/module/skia/web/JsiSkPath.d.ts +57 -0
- package/lib/module/skia/web/JsiSkPathEffect.d.ts +6 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
- package/lib/module/skia/web/JsiSkPathFactory.d.ts +13 -0
- package/lib/module/skia/web/JsiSkPicture.d.ts +9 -0
- package/lib/module/skia/web/JsiSkPictureFactory.d.ts +8 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +11 -0
- package/lib/module/skia/web/JsiSkPoint.d.ts +9 -0
- package/lib/module/skia/web/JsiSkRRect.d.ts +11 -0
- package/lib/module/skia/web/JsiSkRSXform.d.ts +7 -0
- package/lib/module/skia/web/JsiSkRect.d.ts +11 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +16 -0
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
- package/lib/module/skia/web/JsiSkSVGFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkShader.d.ts +6 -0
- package/lib/module/skia/web/JsiSkShaderFactory.d.ts +16 -0
- package/lib/module/skia/web/JsiSkSurface.d.ts +9 -0
- package/lib/module/skia/web/JsiSkSurface.js +4 -0
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkSurfaceFactory.js +21 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.d.ts +6 -0
- package/lib/module/skia/web/JsiSkTextBlobFactory.d.ts +13 -0
- package/lib/module/skia/web/JsiSkTypeface.d.ts +8 -0
- package/lib/module/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
- package/lib/module/skia/web/JsiSkVertices.d.ts +9 -0
- package/lib/module/skia/web/JsiSkVerticesFactory.d.ts +4 -0
- package/lib/module/skia/web/JsiSkia.d.ts +3 -0
- package/lib/module/skia/web/index.d.ts +1 -0
- package/lib/module/values/api.d.ts +5 -0
- package/lib/module/values/api.web.d.ts +2 -0
- package/lib/module/values/hooks/index.d.ts +4 -0
- package/lib/module/values/hooks/useClockValue.d.ts +6 -0
- package/lib/module/values/hooks/useComputedValue.d.ts +8 -0
- package/lib/module/values/hooks/useValue.d.ts +7 -0
- package/lib/module/values/hooks/useValueEffect.d.ts +7 -0
- package/lib/module/values/index.d.ts +4 -0
- package/lib/module/values/selector.d.ts +14 -0
- package/lib/module/values/types.d.ts +63 -0
- package/lib/module/values/web/RNSkAnimation.d.ts +9 -0
- package/lib/module/values/web/RNSkClockValue.d.ts +13 -0
- package/lib/module/values/web/RNSkComputedValue.d.ts +10 -0
- package/lib/module/values/web/RNSkReadonlyValue.d.ts +12 -0
- package/lib/module/values/web/RNSkValue.d.ts +14 -0
- package/lib/module/values/web/api.d.ts +2 -0
- package/lib/module/values/web/index.d.ts +1 -0
- package/lib/module/views/SkiaBaseWebView.d.ts +62 -0
- package/lib/module/views/SkiaBaseWebView.js +6 -4
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaDomView.d.ts +31 -0
- package/lib/module/views/SkiaDomView.web.d.ts +7 -0
- package/lib/module/views/SkiaDomView.web.js +2 -11
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.d.ts +27 -0
- package/lib/module/views/SkiaPictureView.web.d.ts +7 -0
- package/lib/module/views/SkiaPictureView.web.js +0 -5
- package/lib/module/views/SkiaPictureView.web.js.map +1 -1
- package/lib/module/views/SkiaView.d.ts +30 -0
- package/lib/module/views/SkiaView.web.d.ts +7 -0
- package/lib/module/views/SkiaView.web.js +0 -5
- package/lib/module/views/SkiaView.web.js.map +1 -1
- package/lib/module/views/api.d.ts +5 -0
- package/lib/module/views/index.d.ts +6 -0
- package/lib/module/views/types.d.ts +91 -0
- package/lib/module/views/useDrawCallback.d.ts +8 -0
- package/lib/module/views/useTouchHandler.d.ts +22 -0
- package/lib/module/web/LoadSkiaWeb.d.ts +6 -0
- package/lib/module/web/WithSkiaWeb.d.ts +12 -0
- package/lib/module/web/index.d.ts +2 -0
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +33 -34
- package/lib/typescript/src/dom/nodes/Node.d.ts +6 -11
- package/lib/typescript/src/dom/nodes/PaintNode.d.ts +3 -3
- package/lib/typescript/src/dom/nodes/RenderNode.d.ts +2 -3
- package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +3 -1
- package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +3 -7
- package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +10 -11
- package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +11 -11
- package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +3 -3
- package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +15 -18
- package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +11 -12
- package/lib/typescript/src/dom/types/DeclarationContext.d.ts +29 -0
- package/lib/typescript/src/dom/types/DrawingContext.d.ts +18 -1
- package/lib/typescript/src/dom/types/Node.d.ts +4 -10
- package/lib/typescript/src/dom/types/SkDOM.d.ts +22 -23
- package/lib/typescript/src/dom/types/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/renderer/DrawingContext.d.ts +4 -3
- package/lib/typescript/src/renderer/HostComponents.d.ts +35 -35
- package/lib/typescript/src/renderer/Offscreen.d.ts +2 -0
- package/lib/typescript/src/renderer/index.d.ts +0 -1
- package/lib/typescript/src/skia/types/Surface/Surface.d.ts +4 -0
- package/lib/typescript/src/skia/types/Surface/SurfaceFactory.d.ts +6 -0
- package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
- package/package.json +5 -4
- package/src/dom/nodes/DrawingNode.ts +5 -1
- package/src/dom/nodes/LayerNode.ts +13 -11
- package/src/dom/nodes/Node.ts +18 -41
- package/src/dom/nodes/PaintContext.ts +1 -0
- package/src/dom/nodes/PaintNode.ts +28 -18
- package/src/dom/nodes/RenderNode.ts +25 -183
- package/src/dom/nodes/drawings/BackdropFilterNode.ts +18 -11
- package/src/dom/nodes/drawings/Box.ts +6 -4
- package/src/dom/nodes/paint/BlendNode.ts +16 -63
- package/src/dom/nodes/paint/ColorFilters.ts +32 -55
- package/src/dom/nodes/paint/ImageFilters.ts +58 -53
- package/src/dom/nodes/paint/MaskFilters.ts +5 -7
- package/src/dom/nodes/paint/PathEffects.ts +37 -90
- package/src/dom/nodes/paint/Shaders.ts +31 -29
- package/src/dom/types/DeclarationContext.ts +105 -0
- package/src/dom/types/DrawingContext.ts +304 -1
- package/src/dom/types/Node.ts +4 -20
- package/src/dom/types/SkDOM.ts +22 -43
- package/src/dom/types/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/renderer/Canvas.tsx +3 -3
- package/src/renderer/DrawingContext.ts +4 -5
- package/src/renderer/HostComponents.ts +34 -53
- package/src/renderer/HostConfig.ts +1 -0
- package/src/renderer/Offscreen.tsx +24 -0
- package/src/renderer/Reconciler.tsx +0 -1
- package/src/renderer/index.ts +0 -1
- package/src/skia/types/Surface/Surface.ts +5 -0
- package/src/skia/types/Surface/SurfaceFactory.ts +7 -0
- package/src/skia/web/JsiSkSurface.ts +4 -0
- package/src/skia/web/JsiSkSurfaceFactory.ts +21 -2
- package/src/views/SkiaBaseWebView.tsx +6 -2
- package/src/views/SkiaDomView.web.tsx +2 -13
- package/src/views/SkiaPictureView.web.tsx +0 -7
- package/src/views/SkiaView.web.tsx +0 -7
- package/lib/commonjs/renderer/useContextBridge.js +0 -35
- package/lib/commonjs/renderer/useContextBridge.js.map +0 -1
- package/lib/module/renderer/useContextBridge.js +0 -21
- package/lib/module/renderer/useContextBridge.js.map +0 -1
- package/lib/typescript/src/renderer/useContextBridge.d.ts +0 -5
- package/src/renderer/useContextBridge.tsx +0 -21
package/android/CMakeLists.txt
CHANGED
@@ -56,6 +56,7 @@ add_library(
|
|
56
56
|
"${PROJECT_SOURCE_DIR}/cpp/rnskia/RNSkDispatchQueue.cpp"
|
57
57
|
|
58
58
|
"${PROJECT_SOURCE_DIR}/cpp/rnskia/dom/base/DrawingContext.cpp"
|
59
|
+
"${PROJECT_SOURCE_DIR}/cpp/rnskia/dom/base/ConcatablePaint.cpp"
|
59
60
|
|
60
61
|
"${PROJECT_SOURCE_DIR}/cpp/api/third_party/CSSColorParser.cpp"
|
61
62
|
|
@@ -7,6 +7,7 @@
|
|
7
7
|
|
8
8
|
#include <JniPlatformContext.h>
|
9
9
|
#include <RNSkPlatformContext.h>
|
10
|
+
#include <SkiaOpenGLRenderer.h>
|
10
11
|
|
11
12
|
namespace RNSkia {
|
12
13
|
namespace jsi = facebook::jsi;
|
@@ -36,6 +37,10 @@ public:
|
|
36
37
|
_jniPlatformContext->raiseError(err);
|
37
38
|
}
|
38
39
|
|
40
|
+
sk_sp<SkSurface> makeOffscreenSurface(int width, int height) override {
|
41
|
+
return MakeOffscreenGLSurface(width, height);
|
42
|
+
}
|
43
|
+
|
39
44
|
void startDrawLoop() override { _jniPlatformContext->startDrawLoop(); }
|
40
45
|
|
41
46
|
void stopDrawLoop() override { _jniPlatformContext->stopDrawLoop(); }
|
@@ -6,6 +6,112 @@
|
|
6
6
|
|
7
7
|
namespace RNSkia {
|
8
8
|
/** Static members */
|
9
|
+
sk_sp<SkSurface> MakeOffscreenGLSurface(int width, int height) {
|
10
|
+
EGLDisplay eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
11
|
+
if (eglDisplay == EGL_NO_DISPLAY) {
|
12
|
+
RNSkLogger::logToConsole("eglGetdisplay failed : %i", glGetError());
|
13
|
+
return nullptr;
|
14
|
+
}
|
15
|
+
|
16
|
+
EGLint major;
|
17
|
+
EGLint minor;
|
18
|
+
if (!eglInitialize(eglDisplay, &major, &minor)) {
|
19
|
+
RNSkLogger::logToConsole("eglInitialize failed : %i", glGetError());
|
20
|
+
return nullptr;
|
21
|
+
}
|
22
|
+
|
23
|
+
EGLint att[] = {EGL_RENDERABLE_TYPE,
|
24
|
+
EGL_OPENGL_ES2_BIT,
|
25
|
+
EGL_SURFACE_TYPE,
|
26
|
+
EGL_PBUFFER_BIT,
|
27
|
+
EGL_ALPHA_SIZE,
|
28
|
+
8,
|
29
|
+
EGL_BLUE_SIZE,
|
30
|
+
8,
|
31
|
+
EGL_GREEN_SIZE,
|
32
|
+
8,
|
33
|
+
EGL_RED_SIZE,
|
34
|
+
8,
|
35
|
+
EGL_DEPTH_SIZE,
|
36
|
+
0,
|
37
|
+
EGL_STENCIL_SIZE,
|
38
|
+
0,
|
39
|
+
EGL_NONE};
|
40
|
+
|
41
|
+
EGLint numConfigs;
|
42
|
+
EGLConfig eglConfig;
|
43
|
+
eglConfig = 0;
|
44
|
+
if (!eglChooseConfig(eglDisplay, att, &eglConfig, 1, &numConfigs) ||
|
45
|
+
numConfigs == 0) {
|
46
|
+
RNSkLogger::logToConsole("Failed to choose a config %d\n", eglGetError());
|
47
|
+
return nullptr;
|
48
|
+
}
|
49
|
+
|
50
|
+
EGLint contextAttribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
|
51
|
+
|
52
|
+
EGLContext eglContext =
|
53
|
+
eglCreateContext(eglDisplay, eglConfig, NULL, contextAttribs);
|
54
|
+
|
55
|
+
if (eglContext == EGL_NO_CONTEXT) {
|
56
|
+
RNSkLogger::logToConsole("eglCreateContext failed: %d\n", eglGetError());
|
57
|
+
return nullptr;
|
58
|
+
}
|
59
|
+
|
60
|
+
const EGLint offScreenSurfaceAttribs[] = {EGL_WIDTH, width, EGL_HEIGHT,
|
61
|
+
height, EGL_NONE};
|
62
|
+
EGLSurface eglSurface =
|
63
|
+
eglCreatePbufferSurface(eglDisplay, eglConfig, offScreenSurfaceAttribs);
|
64
|
+
if (!eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
|
65
|
+
RNSkLogger::logToConsole("eglMakeCurrent failed: %d\n", eglGetError());
|
66
|
+
return nullptr;
|
67
|
+
}
|
68
|
+
GLint buffer;
|
69
|
+
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &buffer);
|
70
|
+
|
71
|
+
GLint stencil;
|
72
|
+
glGetIntegerv(GL_STENCIL_BITS, &stencil);
|
73
|
+
|
74
|
+
GLint samples;
|
75
|
+
glGetIntegerv(GL_SAMPLES, &samples);
|
76
|
+
|
77
|
+
// Create the Skia backend context
|
78
|
+
auto backendInterface = GrGLMakeNativeInterface();
|
79
|
+
auto grContext = GrDirectContext::MakeGL(backendInterface);
|
80
|
+
if (grContext == nullptr) {
|
81
|
+
RNSkLogger::logToConsole("GrDirectContext::MakeGL failed");
|
82
|
+
return nullptr;
|
83
|
+
}
|
84
|
+
auto maxSamples =
|
85
|
+
grContext->maxSurfaceSampleCountForColorType(kRGBA_8888_SkColorType);
|
86
|
+
|
87
|
+
if (samples > maxSamples)
|
88
|
+
samples = maxSamples;
|
89
|
+
|
90
|
+
GrGLFramebufferInfo fbInfo;
|
91
|
+
fbInfo.fFBOID = buffer;
|
92
|
+
fbInfo.fFormat = 0x8058;
|
93
|
+
|
94
|
+
auto renderTarget =
|
95
|
+
GrBackendRenderTarget(width, height, samples, stencil, fbInfo);
|
96
|
+
|
97
|
+
struct OffscreenRenderContext {
|
98
|
+
EGLDisplay display;
|
99
|
+
EGLSurface surface;
|
100
|
+
};
|
101
|
+
auto ctx = new OffscreenRenderContext({eglDisplay, eglSurface});
|
102
|
+
|
103
|
+
auto surface = SkSurface::MakeFromBackendRenderTarget(
|
104
|
+
grContext.get(), renderTarget, kBottomLeft_GrSurfaceOrigin,
|
105
|
+
kRGBA_8888_SkColorType, nullptr, nullptr,
|
106
|
+
[](void *addr) {
|
107
|
+
auto ctx = reinterpret_cast<OffscreenRenderContext *>(addr);
|
108
|
+
eglDestroySurface(ctx->display, ctx->surface);
|
109
|
+
delete ctx;
|
110
|
+
},
|
111
|
+
reinterpret_cast<void *>(ctx));
|
112
|
+
return surface;
|
113
|
+
}
|
114
|
+
|
9
115
|
std::shared_ptr<OpenGLDrawingContext>
|
10
116
|
SkiaOpenGLRenderer::getThreadDrawingContext() {
|
11
117
|
auto threadId = std::this_thread::get_id();
|
@@ -57,13 +163,8 @@ void SkiaOpenGLRenderer::run(const std::function<void(SkCanvas *)> &cb,
|
|
57
163
|
// during rendering.
|
58
164
|
getThreadDrawingContext()->skContext->resetContext();
|
59
165
|
|
60
|
-
// Clear with transparent
|
61
|
-
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
62
|
-
glClear(GL_COLOR_BUFFER_BIT);
|
63
|
-
|
64
166
|
// Draw picture into surface
|
65
167
|
cb(_skSurface->getCanvas());
|
66
|
-
|
67
168
|
// Flush
|
68
169
|
_skSurface->flushAndSubmit();
|
69
170
|
|
@@ -26,6 +26,8 @@
|
|
26
26
|
#pragma clang diagnostic pop
|
27
27
|
|
28
28
|
namespace RNSkia {
|
29
|
+
sk_sp<SkSurface> MakeOffscreenGLSurface(int width, int height);
|
30
|
+
|
29
31
|
using OpenGLDrawingContext = struct {
|
30
32
|
EGLContext glContext;
|
31
33
|
EGLDisplay glDisplay;
|
@@ -127,4 +129,4 @@ private:
|
|
127
129
|
|
128
130
|
std::atomic<RenderState> _renderState = {RenderState::Initializing};
|
129
131
|
};
|
130
|
-
} // namespace RNSkia
|
132
|
+
} // namespace RNSkia
|
package/cpp/api/JsiSkSurface.h
CHANGED
@@ -40,6 +40,11 @@ public:
|
|
40
40
|
std::make_shared<JsiSkCanvas>(getContext(), getObject()->getCanvas()));
|
41
41
|
}
|
42
42
|
|
43
|
+
JSI_HOST_FUNCTION(flush) {
|
44
|
+
getObject()->flush();
|
45
|
+
return jsi::Value::undefined();
|
46
|
+
}
|
47
|
+
|
43
48
|
JSI_HOST_FUNCTION(makeImageSnapshot) {
|
44
49
|
sk_sp<SkImage> image;
|
45
50
|
if (count == 1) {
|
@@ -55,7 +60,8 @@ public:
|
|
55
60
|
|
56
61
|
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkSurface, __typename__))
|
57
62
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkSurface, getCanvas),
|
58
|
-
JSI_EXPORT_FUNC(JsiSkSurface, makeImageSnapshot)
|
63
|
+
JSI_EXPORT_FUNC(JsiSkSurface, makeImageSnapshot),
|
64
|
+
JSI_EXPORT_FUNC(JsiSkSurface, flush))
|
59
65
|
|
60
66
|
/**
|
61
67
|
Returns the underlying object from a host object of this type
|
@@ -12,7 +12,6 @@
|
|
12
12
|
#pragma clang diagnostic push
|
13
13
|
#pragma clang diagnostic ignored "-Wdocumentation"
|
14
14
|
|
15
|
-
#include "SkImage.h"
|
16
15
|
#include "SkSurface.h"
|
17
16
|
|
18
17
|
#pragma clang diagnostic pop
|
@@ -35,7 +34,21 @@ public:
|
|
35
34
|
std::make_shared<JsiSkSurface>(getContext(), std::move(surface)));
|
36
35
|
}
|
37
36
|
|
38
|
-
|
37
|
+
JSI_HOST_FUNCTION(MakeOffscreen) {
|
38
|
+
auto width = static_cast<int>(arguments[0].asNumber());
|
39
|
+
auto height = static_cast<int>(arguments[1].asNumber());
|
40
|
+
auto context = getContext();
|
41
|
+
auto surface = context->makeOffscreenSurface(width, height);
|
42
|
+
if (surface == nullptr) {
|
43
|
+
return jsi::Value::null();
|
44
|
+
}
|
45
|
+
return jsi::Object::createFromHostObject(
|
46
|
+
runtime,
|
47
|
+
std::make_shared<JsiSkSurface>(getContext(), std::move(surface)));
|
48
|
+
}
|
49
|
+
|
50
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkSurfaceFactory, Make),
|
51
|
+
JSI_EXPORT_FUNC(JsiSkSurfaceFactory, MakeOffscreen))
|
39
52
|
|
40
53
|
explicit JsiSkSurfaceFactory(std::shared_ptr<RNSkPlatformContext> context)
|
41
54
|
: JsiSkHostObject(std::move(context)) {}
|
@@ -79,14 +79,12 @@ void RNSkDomRenderer::renderCanvas(SkCanvas *canvas, float scaledWidth,
|
|
79
79
|
_renderTimingInfo.beginTiming();
|
80
80
|
|
81
81
|
auto pd = _platformContext->getPixelDensity();
|
82
|
-
|
82
|
+
canvas->clear(SK_ColorTRANSPARENT);
|
83
83
|
canvas->save();
|
84
84
|
canvas->scale(pd, pd);
|
85
85
|
|
86
86
|
if (_drawingContext == nullptr) {
|
87
|
-
|
88
|
-
paint->setAntiAlias(true);
|
89
|
-
_drawingContext = std::make_shared<DrawingContext>(paint);
|
87
|
+
_drawingContext = std::make_shared<DrawingContext>();
|
90
88
|
|
91
89
|
_drawingContext->setRequestRedraw([weakSelf = weak_from_this()]() {
|
92
90
|
auto self = weakSelf.lock();
|
@@ -197,11 +197,14 @@ void RNSkJsRenderer::drawInJsiCanvas(std::shared_ptr<JsiSkCanvas> jsiCanvas,
|
|
197
197
|
if (_drawCallback != nullptr && skCanvas != nullptr) {
|
198
198
|
// Make sure to scale correctly
|
199
199
|
auto pd = _platformContext->getPixelDensity();
|
200
|
+
skCanvas->clear(SK_ColorTRANSPARENT);
|
200
201
|
skCanvas->save();
|
201
202
|
skCanvas->scale(pd, pd);
|
202
203
|
|
203
204
|
// Call draw function.
|
204
205
|
callJsDrawCallback(jsiCanvas, width / pd, height / pd, time);
|
206
|
+
|
207
|
+
skCanvas->restore();
|
205
208
|
}
|
206
209
|
}
|
207
210
|
|
@@ -55,8 +55,8 @@ public:
|
|
55
55
|
auto info = getEnsuredViewInfo(nativeId);
|
56
56
|
|
57
57
|
std::lock_guard<std::mutex> lock(_mutex);
|
58
|
-
info->props.
|
59
|
-
|
58
|
+
info->props.insert_or_assign(arguments[1].asString(runtime).utf8(runtime),
|
59
|
+
RNJsi::JsiValueWrapper(runtime, arguments[2]));
|
60
60
|
|
61
61
|
// Now let's see if we have a view that we can update
|
62
62
|
if (info->view != nullptr) {
|
@@ -72,10 +72,13 @@ private:
|
|
72
72
|
canvasProvider->renderToCanvas([=](SkCanvas *canvas) {
|
73
73
|
// Make sure to scale correctly
|
74
74
|
auto pd = _platformContext->getPixelDensity();
|
75
|
+
canvas->clear(SK_ColorTRANSPARENT);
|
75
76
|
canvas->save();
|
76
77
|
canvas->scale(pd, pd);
|
77
78
|
|
78
79
|
canvas->drawPicture(_picture->getObject());
|
80
|
+
|
81
|
+
canvas->restore();
|
79
82
|
});
|
80
83
|
}
|
81
84
|
|
@@ -15,6 +15,7 @@
|
|
15
15
|
#pragma clang diagnostic ignored "-Wdocumentation"
|
16
16
|
|
17
17
|
#include "SkStream.h"
|
18
|
+
#include "SkSurface.h"
|
18
19
|
|
19
20
|
#pragma clang diagnostic pop
|
20
21
|
|
@@ -109,6 +110,14 @@ public:
|
|
109
110
|
*/
|
110
111
|
virtual void raiseError(const std::exception &err) = 0;
|
111
112
|
|
113
|
+
/**
|
114
|
+
* Creates an offscreen surface
|
115
|
+
* @param width
|
116
|
+
* @param height
|
117
|
+
* @return sk_sp<SkSurface>
|
118
|
+
*/
|
119
|
+
virtual sk_sp<SkSurface> makeOffscreenSurface(int width, int height) = 0;
|
120
|
+
|
112
121
|
/**
|
113
122
|
* Raises an exception on the platform. This function does not necessarily
|
114
123
|
* throw an exception and stop execution, so it is important to stop execution
|
@@ -0,0 +1,117 @@
|
|
1
|
+
#include "ConcatablePaint.h"
|
2
|
+
|
3
|
+
#include "DeclarationContext.h"
|
4
|
+
#include "JsiDomNode.h"
|
5
|
+
#include "PaintProps.h"
|
6
|
+
|
7
|
+
namespace RNSkia {
|
8
|
+
|
9
|
+
ConcatablePaint::ConcatablePaint(
|
10
|
+
DeclarationContext *declarationContext, PaintProps *paintProps,
|
11
|
+
const std::vector<std::shared_ptr<JsiDomNode>> &children)
|
12
|
+
: _declarationContext(declarationContext), _paintProps(paintProps),
|
13
|
+
_children(children) {
|
14
|
+
|
15
|
+
auto hasPropertyValues = _paintProps->getColor()->isSet() ||
|
16
|
+
_paintProps->getStrokeWidth()->isSet() ||
|
17
|
+
_paintProps->getBlendMode()->isSet() ||
|
18
|
+
_paintProps->getStyle()->isSet() ||
|
19
|
+
_paintProps->getStrokeJoin()->isSet() ||
|
20
|
+
_paintProps->getStrokeCap()->isSet() ||
|
21
|
+
_paintProps->getStrokeMiter()->isSet() ||
|
22
|
+
_paintProps->getOpacity()->isSet() ||
|
23
|
+
_paintProps->getAntiAlias()->isSet();
|
24
|
+
|
25
|
+
_declarationContext->save();
|
26
|
+
|
27
|
+
for (auto &child : _children) {
|
28
|
+
child->decorateContext(_declarationContext);
|
29
|
+
}
|
30
|
+
|
31
|
+
_imageFilter = declarationContext->getImageFilters()->popAsOne();
|
32
|
+
_colorFilter = declarationContext->getColorFilters()->popAsOne();
|
33
|
+
_shader = declarationContext->getShaders()->pop();
|
34
|
+
_maskFilter = declarationContext->getMaskFilters()->pop();
|
35
|
+
_pathEffect = declarationContext->getPathEffects()->popAsOne();
|
36
|
+
|
37
|
+
_declarationContext->restore();
|
38
|
+
|
39
|
+
_isEmpty = !hasPropertyValues && _imageFilter == nullptr &&
|
40
|
+
_colorFilter == nullptr && _shader == nullptr &&
|
41
|
+
_maskFilter == nullptr && _pathEffect == nullptr;
|
42
|
+
}
|
43
|
+
|
44
|
+
bool ConcatablePaint::isEmpty() { return _isEmpty; }
|
45
|
+
|
46
|
+
void ConcatablePaint::concatTo(std::shared_ptr<SkPaint> paint) {
|
47
|
+
|
48
|
+
if (_paintProps->getOpacity()->isSet()) {
|
49
|
+
paint->setAlphaf(paint->getAlphaf() *
|
50
|
+
_paintProps->getOpacity()->value().getAsNumber());
|
51
|
+
}
|
52
|
+
|
53
|
+
if (_paintProps->getColor()->isSet()) {
|
54
|
+
auto currentOpacity = paint->getAlphaf();
|
55
|
+
paint->setShader(nullptr);
|
56
|
+
paint->setColor(*_paintProps->getColor()->getDerivedValue());
|
57
|
+
paint->setAlphaf(paint->getAlphaf() * currentOpacity);
|
58
|
+
}
|
59
|
+
|
60
|
+
if (_paintProps->getStrokeWidth()->isSet()) {
|
61
|
+
paint->setStrokeWidth(_paintProps->getStrokeWidth()->value().getAsNumber());
|
62
|
+
}
|
63
|
+
|
64
|
+
if (_paintProps->getBlendMode()->isSet()) {
|
65
|
+
paint->setBlendMode(*_paintProps->getBlendMode()->getDerivedValue());
|
66
|
+
}
|
67
|
+
|
68
|
+
if (_paintProps->getStyle()->isSet()) {
|
69
|
+
auto styleValue = _paintProps->getStyle()->value().getAsString();
|
70
|
+
if (styleValue == "stroke") {
|
71
|
+
paint->setStyle(SkPaint::Style::kStroke_Style);
|
72
|
+
} else if (styleValue == "fill") {
|
73
|
+
paint->setStyle(SkPaint::Style::kFill_Style);
|
74
|
+
} else {
|
75
|
+
throw std::runtime_error(styleValue +
|
76
|
+
" is not a valud value for the style property.");
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
if (_paintProps->getStrokeJoin()->isSet()) {
|
81
|
+
paint->setStrokeJoin(*_paintProps->getStrokeJoin()->getDerivedValue());
|
82
|
+
}
|
83
|
+
|
84
|
+
if (_paintProps->getStrokeCap()->isSet()) {
|
85
|
+
paint->setStrokeCap(*_paintProps->getStrokeCap()->getDerivedValue());
|
86
|
+
}
|
87
|
+
|
88
|
+
if (_paintProps->getStrokeMiter()->isSet()) {
|
89
|
+
paint->setStrokeMiter(_paintProps->getStrokeMiter()->value().getAsNumber());
|
90
|
+
}
|
91
|
+
|
92
|
+
if (_paintProps->getAntiAlias()->isSet()) {
|
93
|
+
paint->setAntiAlias(_paintProps->getAntiAlias()->value().getAsBool());
|
94
|
+
}
|
95
|
+
|
96
|
+
if (_imageFilter) {
|
97
|
+
paint->setImageFilter(_imageFilter);
|
98
|
+
}
|
99
|
+
|
100
|
+
if (_colorFilter) {
|
101
|
+
paint->setColorFilter(_colorFilter);
|
102
|
+
}
|
103
|
+
|
104
|
+
if (_shader) {
|
105
|
+
paint->setShader(_shader);
|
106
|
+
}
|
107
|
+
|
108
|
+
if (_maskFilter) {
|
109
|
+
paint->setMaskFilter(_maskFilter);
|
110
|
+
}
|
111
|
+
|
112
|
+
if (_pathEffect) {
|
113
|
+
paint->setPathEffect(_pathEffect);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
} // namespace RNSkia
|
@@ -0,0 +1,49 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include <memory>
|
4
|
+
#include <vector>
|
5
|
+
|
6
|
+
#pragma clang diagnostic push
|
7
|
+
#pragma clang diagnostic ignored "-Wdocumentation"
|
8
|
+
|
9
|
+
#include <SkColorFilter.h>
|
10
|
+
#include <SkImageFilter.h>
|
11
|
+
#include <SkMaskFilter.h>
|
12
|
+
#include <SkPaint.h>
|
13
|
+
#include <SkPathEffect.h>
|
14
|
+
#include <SkShader.h>
|
15
|
+
|
16
|
+
#pragma clang diagnostic pop
|
17
|
+
|
18
|
+
namespace RNSkia {
|
19
|
+
|
20
|
+
class JsiDomNode;
|
21
|
+
class PaintProps;
|
22
|
+
class DeclarationContext;
|
23
|
+
|
24
|
+
/**
|
25
|
+
Class for concatenating SkPaint objects.
|
26
|
+
*/
|
27
|
+
class ConcatablePaint {
|
28
|
+
public:
|
29
|
+
ConcatablePaint(DeclarationContext *context, PaintProps *paintProps,
|
30
|
+
const std::vector<std::shared_ptr<JsiDomNode>> &children);
|
31
|
+
|
32
|
+
void concatTo(std::shared_ptr<SkPaint> paint);
|
33
|
+
bool isEmpty();
|
34
|
+
|
35
|
+
private:
|
36
|
+
DeclarationContext *_declarationContext;
|
37
|
+
const std::vector<std::shared_ptr<JsiDomNode>> _children;
|
38
|
+
PaintProps *_paintProps;
|
39
|
+
|
40
|
+
bool _isEmpty{true};
|
41
|
+
|
42
|
+
sk_sp<SkImageFilter> _imageFilter;
|
43
|
+
sk_sp<SkColorFilter> _colorFilter;
|
44
|
+
sk_sp<SkPathEffect> _pathEffect;
|
45
|
+
sk_sp<SkMaskFilter> _maskFilter;
|
46
|
+
sk_sp<SkShader> _shader;
|
47
|
+
};
|
48
|
+
|
49
|
+
} // namespace RNSkia
|
@@ -0,0 +1,88 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include <algorithm>
|
4
|
+
#include <numeric>
|
5
|
+
#include <stack>
|
6
|
+
#include <utility>
|
7
|
+
#include <vector>
|
8
|
+
|
9
|
+
#pragma clang diagnostic push
|
10
|
+
#pragma clang diagnostic ignored "-Wdocumentation"
|
11
|
+
|
12
|
+
#include <SkRefCnt.h>
|
13
|
+
|
14
|
+
#pragma clang diagnostic pop
|
15
|
+
|
16
|
+
namespace RNSkia {
|
17
|
+
|
18
|
+
/**
|
19
|
+
Small container for shaders, filters, masks and effects
|
20
|
+
*/
|
21
|
+
template <typename T> class Declaration {
|
22
|
+
public:
|
23
|
+
// Pushes to the stack
|
24
|
+
void push(T el) { _elements.push(el); }
|
25
|
+
|
26
|
+
// Clears and returns all elements
|
27
|
+
std::vector<T> popAll() { return popMultiple(_elements.size()); }
|
28
|
+
|
29
|
+
// Pops the number of items up to limit
|
30
|
+
std::vector<T> popMultiple(size_t limit) {
|
31
|
+
auto size = std::min(limit, _elements.size());
|
32
|
+
std::vector<T> tmp;
|
33
|
+
tmp.reserve(size);
|
34
|
+
for (size_t i = 0; i < size; ++i) {
|
35
|
+
tmp.push_back(_elements.top());
|
36
|
+
_elements.pop();
|
37
|
+
}
|
38
|
+
return tmp;
|
39
|
+
}
|
40
|
+
|
41
|
+
T pop() {
|
42
|
+
if (_elements.size() == 0) {
|
43
|
+
return nullptr;
|
44
|
+
}
|
45
|
+
auto tmp = _elements.top();
|
46
|
+
_elements.pop();
|
47
|
+
return tmp;
|
48
|
+
}
|
49
|
+
|
50
|
+
// Clears and returns through reducer function in reversed order
|
51
|
+
T popAsOne(std::function<T(T inner, T outer)> composer) {
|
52
|
+
auto tmp = popAll();
|
53
|
+
// std::reverse(std::begin(tmp), std::end(tmp));
|
54
|
+
return std::accumulate(std::begin(tmp), std::end(tmp),
|
55
|
+
static_cast<T>(nullptr), [=](T inner, T outer) {
|
56
|
+
if (inner == nullptr) {
|
57
|
+
return outer;
|
58
|
+
}
|
59
|
+
return composer(inner, outer);
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
// Returns the size of the elements
|
64
|
+
size_t size() { return _elements.size(); }
|
65
|
+
|
66
|
+
protected:
|
67
|
+
std::stack<T> _elements;
|
68
|
+
};
|
69
|
+
|
70
|
+
/**
|
71
|
+
Small container for shaders, filters, masks and effects
|
72
|
+
*/
|
73
|
+
template <typename T> class ComposableDeclaration : public Declaration<T> {
|
74
|
+
public:
|
75
|
+
/**
|
76
|
+
Constructor
|
77
|
+
*/
|
78
|
+
explicit ComposableDeclaration(std::function<T(T inner, T outer)> composer)
|
79
|
+
: Declaration<T>(), _composer(composer) {}
|
80
|
+
|
81
|
+
// Clears and returns through reducer function in reversed order
|
82
|
+
T popAsOne() { return Declaration<T>::popAsOne(_composer); }
|
83
|
+
|
84
|
+
private:
|
85
|
+
std::function<T(T inner, T outer)> _composer;
|
86
|
+
};
|
87
|
+
|
88
|
+
} // namespace RNSkia
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include "Declaration.h"
|
4
|
+
|
5
|
+
#include <memory>
|
6
|
+
#include <stack>
|
7
|
+
#include <vector>
|
8
|
+
|
9
|
+
#pragma clang diagnostic push
|
10
|
+
#pragma clang diagnostic ignored "-Wdocumentation"
|
11
|
+
|
12
|
+
#include <SkColorFilter.h>
|
13
|
+
#include <SkImageFilter.h>
|
14
|
+
#include <SkImageFilters.h>
|
15
|
+
#include <SkMaskFilter.h>
|
16
|
+
#include <SkPaint.h>
|
17
|
+
#include <SkPathEffect.h>
|
18
|
+
#include <SkShader.h>
|
19
|
+
|
20
|
+
#pragma clang diagnostic pop
|
21
|
+
|
22
|
+
namespace RNSkia {
|
23
|
+
|
24
|
+
class DeclarationContext {
|
25
|
+
public:
|
26
|
+
DeclarationContext() { save(); }
|
27
|
+
|
28
|
+
Declaration<sk_sp<SkShader>> *getShaders() { return &_shaders.top(); }
|
29
|
+
ComposableDeclaration<sk_sp<SkImageFilter>> *getImageFilters() {
|
30
|
+
return &_imageFilters.top();
|
31
|
+
}
|
32
|
+
ComposableDeclaration<sk_sp<SkColorFilter>> *getColorFilters() {
|
33
|
+
return &_colorFilters.top();
|
34
|
+
}
|
35
|
+
ComposableDeclaration<sk_sp<SkPathEffect>> *getPathEffects() {
|
36
|
+
return &_pathEffects.top();
|
37
|
+
}
|
38
|
+
Declaration<sk_sp<SkMaskFilter>> *getMaskFilters() {
|
39
|
+
return &_maskFilters.top();
|
40
|
+
}
|
41
|
+
Declaration<std::shared_ptr<SkPaint>> *getPaints() { return &_paints.top(); }
|
42
|
+
|
43
|
+
void save() {
|
44
|
+
_paints.emplace();
|
45
|
+
_shaders.emplace();
|
46
|
+
_imageFilters.emplace(
|
47
|
+
[](sk_sp<SkImageFilter> inner, sk_sp<SkImageFilter> outer) {
|
48
|
+
return SkImageFilters::Compose(outer, inner);
|
49
|
+
});
|
50
|
+
_colorFilters.emplace(
|
51
|
+
[](sk_sp<SkColorFilter> inner, sk_sp<SkColorFilter> outer) {
|
52
|
+
return SkColorFilters::Compose(outer, inner);
|
53
|
+
});
|
54
|
+
_pathEffects.emplace(
|
55
|
+
[](sk_sp<SkPathEffect> inner, sk_sp<SkPathEffect> outer) {
|
56
|
+
return SkPathEffect::MakeCompose(outer, inner);
|
57
|
+
});
|
58
|
+
_maskFilters.emplace();
|
59
|
+
}
|
60
|
+
|
61
|
+
void restore() {
|
62
|
+
_shaders.pop();
|
63
|
+
_imageFilters.pop();
|
64
|
+
_colorFilters.pop();
|
65
|
+
_pathEffects.pop();
|
66
|
+
_maskFilters.pop();
|
67
|
+
_paints.pop();
|
68
|
+
}
|
69
|
+
|
70
|
+
private:
|
71
|
+
std::stack<Declaration<sk_sp<SkShader>>> _shaders;
|
72
|
+
std::stack<ComposableDeclaration<sk_sp<SkImageFilter>>> _imageFilters;
|
73
|
+
std::stack<ComposableDeclaration<sk_sp<SkColorFilter>>> _colorFilters;
|
74
|
+
std::stack<ComposableDeclaration<sk_sp<SkPathEffect>>> _pathEffects;
|
75
|
+
std::stack<Declaration<sk_sp<SkMaskFilter>>> _maskFilters;
|
76
|
+
std::stack<Declaration<std::shared_ptr<SkPaint>>> _paints;
|
77
|
+
};
|
78
|
+
|
79
|
+
} // namespace RNSkia
|