@shopify/react-native-skia 1.7.7 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +3 -7
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +58 -70
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js +4 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Enum.js +5 -2
- package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js +10 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js +17 -10
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js +4 -1
- package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Radius.js +2 -1
- package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js +16 -2
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.js +4 -1
- package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/commonjs/dom/types/Node.d.ts +2 -5
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/dom/types/index.d.ts +0 -2
- package/lib/commonjs/dom/types/index.js +0 -22
- package/lib/commonjs/dom/types/index.js.map +1 -1
- package/lib/commonjs/headless/index.js +3 -5
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/index.d.ts +1 -0
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +9 -26
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.web.d.ts +10 -0
- package/lib/commonjs/renderer/Canvas.web.js +110 -0
- package/lib/commonjs/renderer/Canvas.web.js.map +1 -0
- package/lib/commonjs/renderer/Canvas2.d.ts +10 -0
- package/lib/commonjs/renderer/Canvas2.js +104 -0
- package/lib/commonjs/renderer/Canvas2.js.map +1 -0
- package/lib/commonjs/renderer/Canvas2.web.d.ts +3 -0
- package/lib/commonjs/renderer/Canvas2.web.js +9 -0
- package/lib/commonjs/renderer/Canvas2.web.js.map +1 -0
- package/lib/commonjs/renderer/Container.d.ts +3 -5
- package/lib/commonjs/renderer/Container.js +2 -7
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +3 -6
- package/lib/commonjs/renderer/HostComponents.js +1 -4
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.js +3 -5
- package/lib/commonjs/renderer/Offscreen.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +2 -3
- package/lib/commonjs/renderer/Reconciler.js +2 -2
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +6 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/sksg/Container.js +2 -2
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/DeclarationContext.d.ts +56 -0
- package/lib/commonjs/sksg/DeclarationContext.js +77 -0
- package/lib/commonjs/sksg/DeclarationContext.js.map +1 -0
- package/lib/commonjs/sksg/DrawingContext.d.ts +9 -12
- package/lib/commonjs/sksg/DrawingContext.js +63 -77
- package/lib/commonjs/sksg/DrawingContext.js.map +1 -1
- package/lib/commonjs/sksg/Reconciler.d.ts +2 -0
- package/lib/commonjs/sksg/Reconciler.js +7 -0
- package/lib/commonjs/sksg/Reconciler.js.map +1 -1
- package/lib/commonjs/sksg/nodes/colorFilters.d.ts +9 -6
- package/lib/commonjs/sksg/nodes/colorFilters.js +26 -2
- package/lib/commonjs/sksg/nodes/colorFilters.js.map +1 -1
- package/lib/commonjs/sksg/nodes/context.js +58 -112
- package/lib/commonjs/sksg/nodes/context.js.map +1 -1
- package/lib/commonjs/sksg/nodes/drawings.d.ts +1 -2
- package/lib/commonjs/sksg/nodes/drawings.js +43 -6
- package/lib/commonjs/sksg/nodes/drawings.js.map +1 -1
- package/lib/commonjs/sksg/nodes/imageFilters.d.ts +4 -1
- package/lib/commonjs/sksg/nodes/imageFilters.js +64 -2
- package/lib/commonjs/sksg/nodes/imageFilters.js.map +1 -1
- package/lib/commonjs/sksg/nodes/paint.d.ts +2 -1
- package/lib/commonjs/sksg/nodes/paint.js +2 -1
- package/lib/commonjs/sksg/nodes/paint.js.map +1 -1
- package/lib/commonjs/sksg/nodes/pathEffects.d.ts +10 -7
- package/lib/commonjs/sksg/nodes/pathEffects.js +30 -3
- package/lib/commonjs/sksg/nodes/pathEffects.js.map +1 -1
- package/lib/commonjs/sksg/nodes/shaders.d.ts +2 -1
- package/lib/commonjs/sksg/nodes/shaders.js +18 -1
- package/lib/commonjs/sksg/nodes/shaders.js.map +1 -1
- package/lib/commonjs/sksg/nodes/utils.js +4 -1
- package/lib/commonjs/sksg/nodes/utils.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.web.d.ts +0 -7
- package/lib/commonjs/views/SkiaDomView.web.js +0 -30
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.web.d.ts +3 -1
- package/lib/commonjs/views/SkiaPictureView.web.js +10 -0
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -7
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +3 -7
- package/lib/module/dom/nodes/JsiSkDOM.js +58 -70
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js +4 -2
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Enum.js +4 -2
- package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Fitting.js +10 -2
- package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +17 -11
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Path.js +4 -2
- package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Radius.js +2 -2
- package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +15 -2
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Transform.js +4 -2
- package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
- package/lib/module/dom/types/Node.d.ts +2 -5
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/dom/types/index.d.ts +0 -2
- package/lib/module/dom/types/index.js +0 -2
- package/lib/module/dom/types/index.js.map +1 -1
- package/lib/module/headless/index.js +3 -5
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/index.d.ts +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +9 -26
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Canvas.web.d.ts +10 -0
- package/lib/module/renderer/Canvas.web.js +105 -0
- package/lib/module/renderer/Canvas.web.js.map +1 -0
- package/lib/module/renderer/Canvas2.d.ts +10 -0
- package/lib/module/renderer/Canvas2.js +97 -0
- package/lib/module/renderer/Canvas2.js.map +1 -0
- package/lib/module/renderer/Canvas2.web.d.ts +3 -0
- package/lib/module/renderer/Canvas2.web.js +3 -0
- package/lib/module/renderer/Canvas2.web.js.map +1 -0
- package/lib/module/renderer/Container.d.ts +3 -5
- package/lib/module/renderer/Container.js +2 -7
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +3 -6
- package/lib/module/renderer/HostComponents.js +0 -3
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/Offscreen.js +3 -5
- package/lib/module/renderer/Offscreen.js.map +1 -1
- package/lib/module/renderer/Reconciler.d.ts +2 -3
- package/lib/module/renderer/Reconciler.js +2 -2
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +6 -2
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/sksg/Container.js +3 -3
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/DeclarationContext.d.ts +56 -0
- package/lib/module/sksg/DeclarationContext.js +69 -0
- package/lib/module/sksg/DeclarationContext.js.map +1 -0
- package/lib/module/sksg/DrawingContext.d.ts +9 -12
- package/lib/module/sksg/DrawingContext.js +54 -69
- package/lib/module/sksg/DrawingContext.js.map +1 -1
- package/lib/module/sksg/Reconciler.d.ts +2 -0
- package/lib/module/sksg/Reconciler.js +7 -0
- package/lib/module/sksg/Reconciler.js.map +1 -1
- package/lib/module/sksg/nodes/colorFilters.d.ts +9 -6
- package/lib/module/sksg/nodes/colorFilters.js +24 -2
- package/lib/module/sksg/nodes/colorFilters.js.map +1 -1
- package/lib/module/sksg/nodes/context.js +45 -101
- package/lib/module/sksg/nodes/context.js.map +1 -1
- package/lib/module/sksg/nodes/drawings.d.ts +1 -2
- package/lib/module/sksg/nodes/drawings.js +42 -5
- package/lib/module/sksg/nodes/drawings.js.map +1 -1
- package/lib/module/sksg/nodes/imageFilters.d.ts +4 -1
- package/lib/module/sksg/nodes/imageFilters.js +61 -2
- package/lib/module/sksg/nodes/imageFilters.js.map +1 -1
- package/lib/module/sksg/nodes/paint.d.ts +2 -1
- package/lib/module/sksg/nodes/paint.js +2 -2
- package/lib/module/sksg/nodes/paint.js.map +1 -1
- package/lib/module/sksg/nodes/pathEffects.d.ts +10 -7
- package/lib/module/sksg/nodes/pathEffects.js +28 -3
- package/lib/module/sksg/nodes/pathEffects.js.map +1 -1
- package/lib/module/sksg/nodes/shaders.d.ts +2 -1
- package/lib/module/sksg/nodes/shaders.js +18 -2
- package/lib/module/sksg/nodes/shaders.js.map +1 -1
- package/lib/module/sksg/nodes/utils.js +4 -2
- package/lib/module/sksg/nodes/utils.js.map +1 -1
- package/lib/module/views/SkiaDomView.web.d.ts +0 -7
- package/lib/module/views/SkiaDomView.web.js +1 -24
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.web.d.ts +3 -1
- package/lib/module/views/SkiaPictureView.web.js +10 -0
- package/lib/module/views/SkiaPictureView.web.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -7
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +57 -67
- package/lib/typescript/lib/commonjs/renderer/Canvas.web.d.ts +3 -0
- package/lib/typescript/lib/commonjs/renderer/Canvas2.d.ts +3 -0
- package/lib/typescript/lib/commonjs/{dom/nodes/drawings/index.d.ts → renderer/Canvas2.web.d.ts} +1 -0
- package/lib/typescript/lib/commonjs/renderer/Container.d.ts +1 -2
- package/lib/typescript/lib/commonjs/renderer/HostComponents.d.ts +0 -1
- package/lib/typescript/lib/commonjs/renderer/Reconciler.d.ts +1 -1
- package/lib/typescript/lib/commonjs/sksg/DeclarationContext.d.ts +53 -0
- package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +8 -12
- package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +1 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/drawings.d.ts +0 -1
- package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +2 -0
- package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +1 -0
- package/lib/typescript/lib/commonjs/views/SkiaDomView.web.d.ts +0 -5
- package/lib/typescript/lib/commonjs/views/SkiaPictureView.web.d.ts +2 -0
- package/lib/typescript/lib/module/dom/nodes/JsiSkDOM.d.ts +57 -117
- package/lib/typescript/lib/module/dom/types/index.d.ts +0 -2
- package/lib/typescript/lib/module/index.d.ts +1 -0
- package/lib/typescript/lib/module/mock/index.d.ts +0 -3
- package/lib/typescript/lib/module/renderer/Canvas.web.d.ts +1 -0
- package/lib/typescript/lib/module/renderer/Canvas2.d.ts +1 -0
- package/lib/typescript/lib/module/renderer/Canvas2.web.d.ts +1 -0
- package/lib/typescript/lib/module/renderer/Container.d.ts +3 -4
- package/lib/typescript/lib/module/renderer/HostComponents.d.ts +0 -1
- package/lib/typescript/lib/module/renderer/Reconciler.d.ts +2 -2
- package/lib/typescript/lib/module/sksg/DeclarationContext.d.ts +52 -0
- package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +8 -13
- package/lib/typescript/lib/module/sksg/Reconciler.d.ts +2 -0
- package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/nodes/drawings.d.ts +0 -1
- package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +2 -0
- package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +1 -0
- package/lib/typescript/lib/module/views/SkiaDomView.web.d.ts +0 -4
- package/lib/typescript/lib/module/views/SkiaPictureView.web.d.ts +2 -0
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +3 -7
- package/lib/typescript/src/dom/types/Node.d.ts +2 -5
- package/lib/typescript/src/dom/types/index.d.ts +0 -2
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/renderer/Canvas.web.d.ts +10 -0
- package/lib/typescript/src/renderer/Canvas2.d.ts +10 -0
- package/lib/typescript/src/renderer/Canvas2.web.d.ts +3 -0
- package/lib/typescript/src/renderer/Container.d.ts +3 -5
- package/lib/typescript/src/renderer/HostComponents.d.ts +3 -6
- package/lib/typescript/src/renderer/Reconciler.d.ts +2 -3
- package/lib/typescript/src/sksg/DeclarationContext.d.ts +56 -0
- package/lib/typescript/src/sksg/DrawingContext.d.ts +9 -12
- package/lib/typescript/src/sksg/Reconciler.d.ts +2 -0
- package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +9 -6
- package/lib/typescript/src/sksg/nodes/drawings.d.ts +1 -2
- package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +4 -1
- package/lib/typescript/src/sksg/nodes/paint.d.ts +2 -1
- package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +10 -7
- package/lib/typescript/src/sksg/nodes/shaders.d.ts +2 -1
- package/lib/typescript/src/views/SkiaDomView.web.d.ts +0 -7
- package/lib/typescript/src/views/SkiaPictureView.web.d.ts +3 -1
- package/lib/typescript/src/views/types.d.ts +2 -7
- package/package.json +1 -1
- package/src/dom/nodes/JsiSkDOM.ts +58 -239
- package/src/dom/nodes/datatypes/Circle.ts +2 -2
- package/src/dom/nodes/datatypes/Enum.ts +4 -4
- package/src/dom/nodes/datatypes/Fitting.ts +5 -2
- package/src/dom/nodes/datatypes/Gradient.ts +12 -9
- package/src/dom/nodes/datatypes/Path.ts +2 -2
- package/src/dom/nodes/datatypes/Radius.ts +1 -2
- package/src/dom/nodes/datatypes/Rect.ts +7 -2
- package/src/dom/nodes/datatypes/Transform.ts +4 -2
- package/src/dom/types/Node.ts +2 -5
- package/src/dom/types/index.ts +0 -2
- package/src/headless/index.ts +3 -5
- package/src/index.ts +1 -0
- package/src/renderer/Canvas.tsx +12 -31
- package/src/renderer/Canvas.web.tsx +134 -0
- package/src/renderer/Canvas2.tsx +128 -0
- package/src/renderer/Canvas2.web.tsx +6 -0
- package/src/renderer/Container.tsx +4 -16
- package/src/renderer/HostComponents.ts +2 -10
- package/src/renderer/Offscreen.tsx +3 -6
- package/src/renderer/Reconciler.tsx +1 -5
- package/src/skia/types/Shader/Shader.ts +3 -2
- package/src/sksg/Container.ts +3 -3
- package/src/sksg/DeclarationContext.ts +85 -0
- package/src/sksg/DrawingContext.ts +81 -76
- package/src/sksg/Reconciler.ts +8 -1
- package/src/sksg/__tests__/MockDeclaration.ts +0 -2
- package/src/sksg/nodes/colorFilters.ts +22 -3
- package/src/sksg/nodes/context.ts +46 -123
- package/src/sksg/nodes/drawings.ts +21 -9
- package/src/sksg/nodes/imageFilters.ts +55 -3
- package/src/sksg/nodes/paint.ts +3 -3
- package/src/sksg/nodes/pathEffects.ts +27 -4
- package/src/sksg/nodes/shaders.ts +10 -3
- package/src/sksg/nodes/utils.ts +2 -2
- package/src/views/SkiaDomView.web.tsx +0 -23
- package/src/views/SkiaPictureView.web.tsx +10 -1
- package/src/views/types.ts +2 -8
- package/lib/commonjs/dom/nodes/DrawingNode.d.ts +0 -14
- package/lib/commonjs/dom/nodes/DrawingNode.js +0 -69
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/GroupNode.d.ts +0 -7
- package/lib/commonjs/dom/nodes/GroupNode.js +0 -22
- package/lib/commonjs/dom/nodes/GroupNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/LayerNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/LayerNode.js +0 -39
- package/lib/commonjs/dom/nodes/LayerNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/Node.d.ts +0 -34
- package/lib/commonjs/dom/nodes/Node.js +0 -102
- package/lib/commonjs/dom/nodes/Node.js.map +0 -1
- package/lib/commonjs/dom/nodes/PaintNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/PaintNode.js +0 -90
- package/lib/commonjs/dom/nodes/PaintNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/RenderNode.d.ts +0 -26
- package/lib/commonjs/dom/nodes/RenderNode.js +0 -132
- package/lib/commonjs/dom/nodes/RenderNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +0 -36
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +0 -42
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/Box.d.ts +0 -15
- package/lib/commonjs/dom/nodes/drawings/Box.js +0 -81
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js +0 -32
- package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/FillNode.js +0 -24
- package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +0 -25
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js +0 -71
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +0 -13
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +0 -57
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/LineNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/ParagraphNode.js +0 -32
- package/lib/commonjs/dom/nodes/drawings/ParagraphNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +0 -18
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js +0 -53
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/PathNode.js +0 -55
- package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js +0 -26
- package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js +0 -30
- package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +0 -10
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js +0 -32
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/RectNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/Text.d.ts +0 -30
- package/lib/commonjs/dom/nodes/drawings/Text.js +0 -159
- package/lib/commonjs/dom/nodes/drawings/Text.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +0 -9
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +0 -43
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +0 -18
- package/lib/commonjs/dom/nodes/drawings/index.js +0 -204
- package/lib/commonjs/dom/nodes/drawings/index.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/paint/BlendNode.js +0 -37
- package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +0 -35
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js +0 -102
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +0 -42
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js +0 -183
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +0 -8
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js +0 -26
- package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +0 -39
- package/lib/commonjs/dom/nodes/paint/PathEffects.js +0 -136
- package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.d.ts +0 -43
- package/lib/commonjs/dom/nodes/paint/Shaders.js +0 -209
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +0 -1
- package/lib/commonjs/dom/nodes/paint/index.d.ts +0 -6
- package/lib/commonjs/dom/nodes/paint/index.js +0 -72
- package/lib/commonjs/dom/nodes/paint/index.js.map +0 -1
- package/lib/commonjs/dom/types/DeclarationContext.d.ts +0 -29
- package/lib/commonjs/dom/types/DeclarationContext.js +0 -97
- package/lib/commonjs/dom/types/DeclarationContext.js.map +0 -1
- package/lib/commonjs/dom/types/DrawingContext.d.ts +0 -22
- package/lib/commonjs/dom/types/DrawingContext.js +0 -263
- package/lib/commonjs/dom/types/DrawingContext.js.map +0 -1
- package/lib/commonjs/renderer/DrawingContext.d.ts +0 -7
- package/lib/commonjs/renderer/DrawingContext.js +0 -6
- package/lib/commonjs/renderer/DrawingContext.js.map +0 -1
- package/lib/commonjs/views/SkiaJSDomView.d.ts +0 -38
- package/lib/commonjs/views/SkiaJSDomView.js +0 -131
- package/lib/commonjs/views/SkiaJSDomView.js.map +0 -1
- package/lib/commonjs/views/SkiaJSDomView.web.d.ts +0 -1
- package/lib/commonjs/views/SkiaJSDomView.web.js +0 -13
- package/lib/commonjs/views/SkiaJSDomView.web.js.map +0 -1
- package/lib/module/dom/nodes/DrawingNode.d.ts +0 -14
- package/lib/module/dom/nodes/DrawingNode.js +0 -62
- package/lib/module/dom/nodes/DrawingNode.js.map +0 -1
- package/lib/module/dom/nodes/GroupNode.d.ts +0 -7
- package/lib/module/dom/nodes/GroupNode.js +0 -15
- package/lib/module/dom/nodes/GroupNode.js.map +0 -1
- package/lib/module/dom/nodes/LayerNode.d.ts +0 -8
- package/lib/module/dom/nodes/LayerNode.js +0 -32
- package/lib/module/dom/nodes/LayerNode.js.map +0 -1
- package/lib/module/dom/nodes/Node.d.ts +0 -34
- package/lib/module/dom/nodes/Node.js +0 -94
- package/lib/module/dom/nodes/Node.js.map +0 -1
- package/lib/module/dom/nodes/PaintNode.d.ts +0 -8
- package/lib/module/dom/nodes/PaintNode.js +0 -83
- package/lib/module/dom/nodes/PaintNode.js.map +0 -1
- package/lib/module/dom/nodes/RenderNode.d.ts +0 -26
- package/lib/module/dom/nodes/RenderNode.js +0 -125
- package/lib/module/dom/nodes/RenderNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/AtlasNode.js +0 -29
- package/lib/module/dom/nodes/drawings/AtlasNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +0 -35
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/Box.d.ts +0 -15
- package/lib/module/dom/nodes/drawings/Box.js +0 -73
- package/lib/module/dom/nodes/drawings/Box.js.map +0 -1
- package/lib/module/dom/nodes/drawings/CircleNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/CircleNode.js +0 -25
- package/lib/module/dom/nodes/drawings/CircleNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/DiffRectNode.js +0 -21
- package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/FillNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/FillNode.js +0 -17
- package/lib/module/dom/nodes/drawings/FillNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/ImageNode.d.ts +0 -25
- package/lib/module/dom/nodes/drawings/ImageNode.js +0 -64
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +0 -13
- package/lib/module/dom/nodes/drawings/ImageSVG.js +0 -50
- package/lib/module/dom/nodes/drawings/ImageSVG.js.map +0 -1
- package/lib/module/dom/nodes/drawings/LineNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/LineNode.js +0 -21
- package/lib/module/dom/nodes/drawings/LineNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/OvalNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/OvalNode.js +0 -21
- package/lib/module/dom/nodes/drawings/OvalNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/ParagraphNode.js +0 -25
- package/lib/module/dom/nodes/drawings/ParagraphNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/PatchNode.d.ts +0 -18
- package/lib/module/dom/nodes/drawings/PatchNode.js +0 -46
- package/lib/module/dom/nodes/drawings/PatchNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/PathNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/PathNode.js +0 -48
- package/lib/module/dom/nodes/drawings/PathNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/PictureNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/PictureNode.js +0 -19
- package/lib/module/dom/nodes/drawings/PictureNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/PointsNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/PointsNode.js +0 -23
- package/lib/module/dom/nodes/drawings/PointsNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/RRectNode.d.ts +0 -10
- package/lib/module/dom/nodes/drawings/RRectNode.js +0 -25
- package/lib/module/dom/nodes/drawings/RRectNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/RectNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/RectNode.js +0 -21
- package/lib/module/dom/nodes/drawings/RectNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/Text.d.ts +0 -30
- package/lib/module/dom/nodes/drawings/Text.js +0 -149
- package/lib/module/dom/nodes/drawings/Text.js.map +0 -1
- package/lib/module/dom/nodes/drawings/VerticesNode.d.ts +0 -9
- package/lib/module/dom/nodes/drawings/VerticesNode.js +0 -36
- package/lib/module/dom/nodes/drawings/VerticesNode.js.map +0 -1
- package/lib/module/dom/nodes/drawings/index.d.ts +0 -18
- package/lib/module/dom/nodes/drawings/index.js +0 -19
- package/lib/module/dom/nodes/drawings/index.js.map +0 -1
- package/lib/module/dom/nodes/paint/BlendNode.d.ts +0 -8
- package/lib/module/dom/nodes/paint/BlendNode.js +0 -30
- package/lib/module/dom/nodes/paint/BlendNode.js.map +0 -1
- package/lib/module/dom/nodes/paint/ColorFilters.d.ts +0 -35
- package/lib/module/dom/nodes/paint/ColorFilters.js +0 -89
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +0 -1
- package/lib/module/dom/nodes/paint/ImageFilters.d.ts +0 -42
- package/lib/module/dom/nodes/paint/ImageFilters.js +0 -169
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +0 -1
- package/lib/module/dom/nodes/paint/MaskFilters.d.ts +0 -8
- package/lib/module/dom/nodes/paint/MaskFilters.js +0 -19
- package/lib/module/dom/nodes/paint/MaskFilters.js.map +0 -1
- package/lib/module/dom/nodes/paint/PathEffects.d.ts +0 -39
- package/lib/module/dom/nodes/paint/PathEffects.js +0 -123
- package/lib/module/dom/nodes/paint/PathEffects.js.map +0 -1
- package/lib/module/dom/nodes/paint/Shaders.d.ts +0 -43
- package/lib/module/dom/nodes/paint/Shaders.js +0 -193
- package/lib/module/dom/nodes/paint/Shaders.js.map +0 -1
- package/lib/module/dom/nodes/paint/index.d.ts +0 -6
- package/lib/module/dom/nodes/paint/index.js +0 -7
- package/lib/module/dom/nodes/paint/index.js.map +0 -1
- package/lib/module/dom/types/DeclarationContext.d.ts +0 -29
- package/lib/module/dom/types/DeclarationContext.js +0 -90
- package/lib/module/dom/types/DeclarationContext.js.map +0 -1
- package/lib/module/dom/types/DrawingContext.d.ts +0 -22
- package/lib/module/dom/types/DrawingContext.js +0 -256
- package/lib/module/dom/types/DrawingContext.js.map +0 -1
- package/lib/module/renderer/DrawingContext.d.ts +0 -7
- package/lib/module/renderer/DrawingContext.js +0 -2
- package/lib/module/renderer/DrawingContext.js.map +0 -1
- package/lib/module/views/SkiaJSDomView.d.ts +0 -38
- package/lib/module/views/SkiaJSDomView.js +0 -123
- package/lib/module/views/SkiaJSDomView.js.map +0 -1
- package/lib/module/views/SkiaJSDomView.web.d.ts +0 -1
- package/lib/module/views/SkiaJSDomView.web.js +0 -2
- package/lib/module/views/SkiaJSDomView.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/dom/nodes/DrawingNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/GroupNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/LayerNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/Node.d.ts +0 -20
- package/lib/typescript/lib/commonjs/dom/nodes/PaintNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/RenderNode.d.ts +0 -16
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/Box.d.ts +0 -15
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +0 -13
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +0 -9
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/ParagraphNode.d.ts +0 -9
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +0 -14
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +0 -9
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/Text.d.ts +0 -34
- package/lib/typescript/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +0 -10
- package/lib/typescript/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +0 -29
- package/lib/typescript/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +0 -35
- package/lib/typescript/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +0 -6
- package/lib/typescript/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +0 -34
- package/lib/typescript/lib/commonjs/dom/nodes/paint/Shaders.d.ts +0 -40
- package/lib/typescript/lib/commonjs/dom/nodes/paint/index.d.ts +0 -1
- package/lib/typescript/lib/commonjs/dom/types/DeclarationContext.d.ts +0 -26
- package/lib/typescript/lib/commonjs/dom/types/DrawingContext.d.ts +0 -13
- package/lib/typescript/lib/commonjs/renderer/DrawingContext.d.ts +0 -1
- package/lib/typescript/lib/commonjs/views/SkiaJSDomView.d.ts +0 -29
- package/lib/typescript/lib/commonjs/views/SkiaJSDomView.web.d.ts +0 -3
- package/lib/typescript/lib/module/dom/nodes/DrawingNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/GroupNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/LayerNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/Node.d.ts +0 -19
- package/lib/typescript/lib/module/dom/nodes/PaintNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/RenderNode.d.ts +0 -15
- package/lib/typescript/lib/module/dom/nodes/drawings/AtlasNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/Box.d.ts +0 -14
- package/lib/typescript/lib/module/dom/nodes/drawings/CircleNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/FillNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/ImageNode.d.ts +0 -22
- package/lib/typescript/lib/module/dom/nodes/drawings/ImageSVG.d.ts +0 -8
- package/lib/typescript/lib/module/dom/nodes/drawings/LineNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/OvalNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
- package/lib/typescript/lib/module/dom/nodes/drawings/PatchNode.d.ts +0 -13
- package/lib/typescript/lib/module/dom/nodes/drawings/PathNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/PictureNode.d.ts +0 -8
- package/lib/typescript/lib/module/dom/nodes/drawings/PointsNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/RRectNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/RectNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/Text.d.ts +0 -33
- package/lib/typescript/lib/module/dom/nodes/drawings/VerticesNode.d.ts +0 -9
- package/lib/typescript/lib/module/dom/nodes/drawings/index.d.ts +0 -18
- package/lib/typescript/lib/module/dom/nodes/paint/BlendNode.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/paint/ColorFilters.d.ts +0 -28
- package/lib/typescript/lib/module/dom/nodes/paint/ImageFilters.d.ts +0 -34
- package/lib/typescript/lib/module/dom/nodes/paint/MaskFilters.d.ts +0 -5
- package/lib/typescript/lib/module/dom/nodes/paint/PathEffects.d.ts +0 -33
- package/lib/typescript/lib/module/dom/nodes/paint/Shaders.d.ts +0 -39
- package/lib/typescript/lib/module/dom/nodes/paint/index.d.ts +0 -6
- package/lib/typescript/lib/module/dom/types/DeclarationContext.d.ts +0 -25
- package/lib/typescript/lib/module/dom/types/DrawingContext.d.ts +0 -12
- package/lib/typescript/lib/module/renderer/DrawingContext.d.ts +0 -1
- package/lib/typescript/lib/module/views/SkiaJSDomView.d.ts +0 -26
- package/lib/typescript/lib/module/views/SkiaJSDomView.web.d.ts +0 -1
- package/lib/typescript/src/dom/nodes/DrawingNode.d.ts +0 -14
- package/lib/typescript/src/dom/nodes/GroupNode.d.ts +0 -7
- package/lib/typescript/src/dom/nodes/LayerNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/Node.d.ts +0 -34
- package/lib/typescript/src/dom/nodes/PaintNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/RenderNode.d.ts +0 -26
- package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +0 -15
- package/lib/typescript/src/dom/nodes/drawings/CircleNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/FillNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/ImageNode.d.ts +0 -25
- package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +0 -13
- package/lib/typescript/src/dom/nodes/drawings/LineNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/OvalNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +0 -18
- package/lib/typescript/src/dom/nodes/drawings/PathNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/PictureNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/PointsNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +0 -10
- package/lib/typescript/src/dom/nodes/drawings/RectNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/Text.d.ts +0 -30
- package/lib/typescript/src/dom/nodes/drawings/VerticesNode.d.ts +0 -9
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +0 -18
- package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +0 -35
- package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +0 -42
- package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +0 -8
- package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +0 -39
- package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +0 -43
- package/lib/typescript/src/dom/nodes/paint/index.d.ts +0 -6
- package/lib/typescript/src/dom/types/DeclarationContext.d.ts +0 -29
- package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -22
- package/lib/typescript/src/renderer/DrawingContext.d.ts +0 -7
- package/lib/typescript/src/views/SkiaJSDomView.d.ts +0 -38
- package/lib/typescript/src/views/SkiaJSDomView.web.d.ts +0 -1
- package/src/dom/nodes/DrawingNode.ts +0 -74
- package/src/dom/nodes/GroupNode.ts +0 -19
- package/src/dom/nodes/LayerNode.ts +0 -37
- package/src/dom/nodes/Node.ts +0 -121
- package/src/dom/nodes/PaintNode.ts +0 -91
- package/src/dom/nodes/RenderNode.ts +0 -172
- package/src/dom/nodes/drawings/AtlasNode.ts +0 -24
- package/src/dom/nodes/drawings/BackdropFilterNode.ts +0 -37
- package/src/dom/nodes/drawings/Box.ts +0 -82
- package/src/dom/nodes/drawings/CircleNode.ts +0 -24
- package/src/dom/nodes/drawings/DiffRectNode.ts +0 -19
- package/src/dom/nodes/drawings/FillNode.ts +0 -18
- package/src/dom/nodes/drawings/ImageNode.ts +0 -49
- package/src/dom/nodes/drawings/ImageSVG.ts +0 -38
- package/src/dom/nodes/drawings/LineNode.ts +0 -19
- package/src/dom/nodes/drawings/OvalNode.ts +0 -23
- package/src/dom/nodes/drawings/ParagraphNode.ts +0 -22
- package/src/dom/nodes/drawings/PatchNode.ts +0 -54
- package/src/dom/nodes/drawings/PathNode.ts +0 -51
- package/src/dom/nodes/drawings/PictureNode.ts +0 -19
- package/src/dom/nodes/drawings/PointsNode.ts +0 -21
- package/src/dom/nodes/drawings/RRectNode.ts +0 -25
- package/src/dom/nodes/drawings/RectNode.ts +0 -23
- package/src/dom/nodes/drawings/Text.ts +0 -145
- package/src/dom/nodes/drawings/VerticesNode.ts +0 -35
- package/src/dom/nodes/drawings/index.ts +0 -18
- package/src/dom/nodes/paint/BlendNode.ts +0 -32
- package/src/dom/nodes/paint/ColorFilters.ts +0 -106
- package/src/dom/nodes/paint/ImageFilters.ts +0 -221
- package/src/dom/nodes/paint/MaskFilters.ts +0 -23
- package/src/dom/nodes/paint/PathEffects.ts +0 -139
- package/src/dom/nodes/paint/Shaders.ts +0 -233
- package/src/dom/nodes/paint/index.ts +0 -6
- package/src/dom/types/DeclarationContext.ts +0 -115
- package/src/dom/types/DrawingContext.ts +0 -322
- package/src/renderer/DrawingContext.ts +0 -8
- package/src/views/SkiaJSDomView.tsx +0 -143
- package/src/views/SkiaJSDomView.web.tsx +0 -1
@@ -0,0 +1,56 @@
|
|
1
|
+
import type { SkShader, SkPaint, SkImageFilter, SkMaskFilter, SkPathEffect, Skia, SkColorFilter } from "../skia/types";
|
2
|
+
type Composer<T> = (outer: T, inner: T) => T;
|
3
|
+
export declare const composeDeclarations: <T>(filters: T[], composer: Composer<T>) => T;
|
4
|
+
export declare const createDeclarationContext: (Skia: Skia) => {
|
5
|
+
Skia: Skia;
|
6
|
+
paints: {
|
7
|
+
save: () => void;
|
8
|
+
restore: () => void;
|
9
|
+
pop: () => SkPaint | undefined;
|
10
|
+
push: (decl: SkPaint) => void;
|
11
|
+
popAll: () => SkPaint[];
|
12
|
+
popAllAsOne: () => SkPaint | undefined;
|
13
|
+
};
|
14
|
+
maskFilters: {
|
15
|
+
save: () => void;
|
16
|
+
restore: () => void;
|
17
|
+
pop: () => SkMaskFilter | undefined;
|
18
|
+
push: (decl: SkMaskFilter) => void;
|
19
|
+
popAll: () => SkMaskFilter[];
|
20
|
+
popAllAsOne: () => SkMaskFilter | undefined;
|
21
|
+
};
|
22
|
+
shaders: {
|
23
|
+
save: () => void;
|
24
|
+
restore: () => void;
|
25
|
+
pop: () => SkShader | undefined;
|
26
|
+
push: (decl: SkShader) => void;
|
27
|
+
popAll: () => SkShader[];
|
28
|
+
popAllAsOne: () => SkShader | undefined;
|
29
|
+
};
|
30
|
+
pathEffects: {
|
31
|
+
save: () => void;
|
32
|
+
restore: () => void;
|
33
|
+
pop: () => SkPathEffect | undefined;
|
34
|
+
push: (decl: SkPathEffect) => void;
|
35
|
+
popAll: () => SkPathEffect[];
|
36
|
+
popAllAsOne: () => SkPathEffect | undefined;
|
37
|
+
};
|
38
|
+
imageFilters: {
|
39
|
+
save: () => void;
|
40
|
+
restore: () => void;
|
41
|
+
pop: () => SkImageFilter | undefined;
|
42
|
+
push: (decl: SkImageFilter) => void;
|
43
|
+
popAll: () => SkImageFilter[];
|
44
|
+
popAllAsOne: () => SkImageFilter | undefined;
|
45
|
+
};
|
46
|
+
colorFilters: {
|
47
|
+
save: () => void;
|
48
|
+
restore: () => void;
|
49
|
+
pop: () => SkColorFilter | undefined;
|
50
|
+
push: (decl: SkColorFilter) => void;
|
51
|
+
popAll: () => SkColorFilter[];
|
52
|
+
popAllAsOne: () => SkColorFilter | undefined;
|
53
|
+
};
|
54
|
+
};
|
55
|
+
export type DeclarationContext = ReturnType<typeof createDeclarationContext>;
|
56
|
+
export {};
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createDeclarationContext = exports.composeDeclarations = void 0;
|
7
|
+
const composeDeclarations = (filters, composer) => {
|
8
|
+
"worklet";
|
9
|
+
|
10
|
+
const len = filters.length;
|
11
|
+
if (len <= 1) {
|
12
|
+
return filters[0];
|
13
|
+
}
|
14
|
+
return filters.reduceRight((inner, outer) => inner ? composer(outer, inner) : outer);
|
15
|
+
};
|
16
|
+
exports.composeDeclarations = composeDeclarations;
|
17
|
+
const createDeclaration = composer => {
|
18
|
+
"worklet";
|
19
|
+
|
20
|
+
const state = {
|
21
|
+
decls: [],
|
22
|
+
indexes: [0]
|
23
|
+
};
|
24
|
+
return {
|
25
|
+
save: () => {
|
26
|
+
state.indexes.push(state.decls.length);
|
27
|
+
},
|
28
|
+
restore: () => {
|
29
|
+
state.indexes.pop();
|
30
|
+
},
|
31
|
+
pop: () => state.decls.pop(),
|
32
|
+
push: decl => {
|
33
|
+
state.decls.push(decl);
|
34
|
+
},
|
35
|
+
popAll: () => {
|
36
|
+
const idx = state.indexes[state.indexes.length - 1];
|
37
|
+
return state.decls.splice(idx, state.decls.length - idx);
|
38
|
+
},
|
39
|
+
popAllAsOne: () => {
|
40
|
+
if (state.decls.length === 0) {
|
41
|
+
return undefined;
|
42
|
+
}
|
43
|
+
if (!composer) {
|
44
|
+
throw new Error("No composer for this type of declaration");
|
45
|
+
}
|
46
|
+
if (!state.decls.length) {
|
47
|
+
return undefined;
|
48
|
+
}
|
49
|
+
if (!composer) {
|
50
|
+
throw new Error("No composer for this type of declaration");
|
51
|
+
}
|
52
|
+
const idx = state.indexes[state.indexes.length - 1];
|
53
|
+
const decls = state.decls.splice(idx, state.decls.length - idx);
|
54
|
+
return composeDeclarations(decls, composer);
|
55
|
+
}
|
56
|
+
};
|
57
|
+
};
|
58
|
+
const createDeclarationContext = Skia => {
|
59
|
+
"worklet";
|
60
|
+
|
61
|
+
const composers = {
|
62
|
+
pathEffect: Skia.PathEffect.MakeCompose.bind(Skia.PathEffect),
|
63
|
+
imageFilter: Skia.ImageFilter.MakeCompose.bind(Skia.ImageFilter),
|
64
|
+
colorFilter: Skia.ColorFilter.MakeCompose.bind(Skia.ColorFilter)
|
65
|
+
};
|
66
|
+
return {
|
67
|
+
Skia,
|
68
|
+
paints: createDeclaration(),
|
69
|
+
maskFilters: createDeclaration(),
|
70
|
+
shaders: createDeclaration(),
|
71
|
+
pathEffects: createDeclaration(composers.pathEffect),
|
72
|
+
imageFilters: createDeclaration(composers.imageFilter),
|
73
|
+
colorFilters: createDeclaration(composers.colorFilter)
|
74
|
+
};
|
75
|
+
};
|
76
|
+
exports.createDeclarationContext = createDeclarationContext;
|
77
|
+
//# sourceMappingURL=DeclarationContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["composeDeclarations","filters","composer","len","length","reduceRight","inner","outer","exports","createDeclaration","state","decls","indexes","save","push","restore","pop","decl","popAll","idx","splice","popAllAsOne","undefined","Error","createDeclarationContext","Skia","composers","pathEffect","PathEffect","MakeCompose","bind","imageFilter","ImageFilter","colorFilter","ColorFilter","paints","maskFilters","shaders","pathEffects","imageFilters","colorFilters"],"sources":["DeclarationContext.ts"],"sourcesContent":["import type {\n SkShader,\n SkPaint,\n SkImageFilter,\n SkMaskFilter,\n SkPathEffect,\n Skia,\n SkColorFilter,\n} from \"../skia/types\";\n\ntype Composer<T> = (outer: T, inner: T) => T;\n\nexport const composeDeclarations = <T>(filters: T[], composer: Composer<T>) => {\n \"worklet\";\n const len = filters.length;\n if (len <= 1) {\n return filters[0];\n }\n return filters.reduceRight((inner, outer) =>\n inner ? composer(outer, inner) : outer\n );\n};\n\nconst createDeclaration = <T>(composer?: Composer<T>) => {\n \"worklet\";\n const state = {\n decls: [] as T[],\n indexes: [0],\n };\n\n return {\n save: () => {\n state.indexes.push(state.decls.length);\n },\n restore: () => {\n state.indexes.pop();\n },\n pop: () => state.decls.pop(),\n push: (decl: T) => {\n state.decls.push(decl);\n },\n popAll: () => {\n const idx = state.indexes[state.indexes.length - 1];\n return state.decls.splice(idx, state.decls.length - idx);\n },\n popAllAsOne: () => {\n if (state.decls.length === 0) {\n return undefined;\n }\n if (!composer) {\n throw new Error(\"No composer for this type of declaration\");\n }\n if (!state.decls.length) {\n return undefined;\n }\n if (!composer) {\n throw new Error(\"No composer for this type of declaration\");\n }\n\n const idx = state.indexes[state.indexes.length - 1];\n const decls = state.decls.splice(idx, state.decls.length - idx);\n return composeDeclarations(decls, composer);\n },\n };\n};\n\nexport const createDeclarationContext = (Skia: Skia) => {\n \"worklet\";\n const composers = {\n pathEffect: Skia.PathEffect.MakeCompose.bind(Skia.PathEffect),\n imageFilter: Skia.ImageFilter.MakeCompose.bind(Skia.ImageFilter),\n colorFilter: Skia.ColorFilter.MakeCompose.bind(Skia.ColorFilter),\n };\n return {\n Skia,\n paints: createDeclaration<SkPaint>(),\n maskFilters: createDeclaration<SkMaskFilter>(),\n shaders: createDeclaration<SkShader>(),\n pathEffects: createDeclaration<SkPathEffect>(composers.pathEffect),\n imageFilters: createDeclaration<SkImageFilter>(composers.imageFilter),\n colorFilters: createDeclaration<SkColorFilter>(composers.colorFilter),\n };\n};\n\nexport type DeclarationContext = ReturnType<typeof createDeclarationContext>;\n"],"mappings":";;;;;;AAYO,MAAMA,mBAAmB,GAAGA,CAAIC,OAAY,EAAEC,QAAqB,KAAK;EAC7E,SAAS;;EACT,MAAMC,GAAG,GAAGF,OAAO,CAACG,MAAM;EAC1B,IAAID,GAAG,IAAI,CAAC,EAAE;IACZ,OAAOF,OAAO,CAAC,CAAC,CAAC;EACnB;EACA,OAAOA,OAAO,CAACI,WAAW,CAAC,CAACC,KAAK,EAAEC,KAAK,KACtCD,KAAK,GAAGJ,QAAQ,CAACK,KAAK,EAAED,KAAK,CAAC,GAAGC,KACnC,CAAC;AACH,CAAC;AAACC,OAAA,CAAAR,mBAAA,GAAAA,mBAAA;AAEF,MAAMS,iBAAiB,GAAOP,QAAsB,IAAK;EACvD,SAAS;;EACT,MAAMQ,KAAK,GAAG;IACZC,KAAK,EAAE,EAAS;IAChBC,OAAO,EAAE,CAAC,CAAC;EACb,CAAC;EAED,OAAO;IACLC,IAAI,EAAEA,CAAA,KAAM;MACVH,KAAK,CAACE,OAAO,CAACE,IAAI,CAACJ,KAAK,CAACC,KAAK,CAACP,MAAM,CAAC;IACxC,CAAC;IACDW,OAAO,EAAEA,CAAA,KAAM;MACbL,KAAK,CAACE,OAAO,CAACI,GAAG,CAAC,CAAC;IACrB,CAAC;IACDA,GAAG,EAAEA,CAAA,KAAMN,KAAK,CAACC,KAAK,CAACK,GAAG,CAAC,CAAC;IAC5BF,IAAI,EAAGG,IAAO,IAAK;MACjBP,KAAK,CAACC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,WAAW,CAAC;IAChEC,WAAW,EAAER,IAAI,CAACS,WAAW,CAACL,WAAW,CAACC,IAAI,CAACL,IAAI,CAACS,WAAW;EACjE,CAAC;EACD,OAAO;IACLT,IAAI;IACJU,MAAM,EAAE1B,iBAAiB,CAAU,CAAC;IACpC2B,WAAW,EAAE3B,iBAAiB,CAAe,CAAC;IAC9C4B,OAAO,EAAE5B,iBAAiB,CAAW,CAAC;IACtC6B,WAAW,EAAE7B,iBAAiB,CAAeiB,SAAS,CAACC,UAAU,CAAC;IAClEY,YAAY,EAAE9B,iBAAiB,CAAgBiB,SAAS,CAACK,WAAW,CAAC;IACrES,YAAY,EAAE/B,iBAAiB,CAAgBiB,SAAS,CAACO,WAAW;EACtE,CAAC;AACH,CAAC;AAACzB,OAAA,CAAAgB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
@@ -1,16 +1,13 @@
|
|
1
1
|
import type { DrawingNodeProps, GroupProps } from "../dom/types";
|
2
|
-
import { DeclarationContext } from "../dom/types";
|
3
2
|
import type { SkCanvas, Skia, SkPaint } from "../skia/types";
|
4
|
-
|
5
|
-
|
6
|
-
declCtx: DeclarationContext;
|
3
|
+
import type { DeclarationContext } from "./DeclarationContext";
|
4
|
+
export declare const createDrawingContext: (Skia: Skia, canvas: SkCanvas) => {
|
7
5
|
Skia: Skia;
|
8
6
|
canvas: SkCanvas;
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
}
|
7
|
+
save: () => number;
|
8
|
+
restore: () => SkPaint | undefined;
|
9
|
+
getPaint: () => SkPaint;
|
10
|
+
processPaint: ({ opacity, color, strokeWidth, blendMode, style, strokeJoin, strokeCap, strokeMiter, antiAlias, dither, paint: paintProp, }: DrawingNodeProps, declCtx: DeclarationContext) => boolean;
|
11
|
+
processMatrixAndClipping: (props: GroupProps, layer?: boolean | SkPaint) => boolean;
|
12
|
+
};
|
13
|
+
export type DrawingContext = ReturnType<typeof createDrawingContext>;
|
@@ -1,23 +1,20 @@
|
|
1
1
|
"use strict";
|
2
|
-
"worklet";
|
3
2
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
|
-
exports.
|
6
|
+
exports.createDrawingContext = void 0;
|
8
7
|
var _nodes = require("../dom/nodes");
|
9
|
-
var _types = require("../
|
10
|
-
var _types2 = require("../skia/types");
|
11
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
13
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
8
|
+
var _types = require("../skia/types");
|
14
9
|
const computeClip = (Skia, clip) => {
|
10
|
+
"worklet";
|
11
|
+
|
15
12
|
if (clip) {
|
16
13
|
if ((0, _nodes.isPathDef)(clip)) {
|
17
14
|
return {
|
18
15
|
clipPath: (0, _nodes.processPath)(Skia, clip)
|
19
16
|
};
|
20
|
-
} else if ((0,
|
17
|
+
} else if ((0, _types.isRRect)(clip)) {
|
21
18
|
return {
|
22
19
|
clipRRect: clip
|
23
20
|
};
|
@@ -29,37 +26,27 @@ const computeClip = (Skia, clip) => {
|
|
29
26
|
}
|
30
27
|
return undefined;
|
31
28
|
};
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
this.declCtx = new _types.DeclarationContext(this.Skia);
|
42
|
-
}
|
43
|
-
save() {
|
44
|
-
this.paints.push(this.paint.copy());
|
45
|
-
}
|
46
|
-
restore() {
|
47
|
-
this.paints.pop();
|
48
|
-
}
|
49
|
-
get paint() {
|
50
|
-
const paint = this.paints[this.paints.length - 1];
|
51
|
-
if (!paint) {
|
52
|
-
throw new Error("Paint is undefined");
|
53
|
-
}
|
54
|
-
return paint;
|
55
|
-
}
|
56
|
-
getLocalPaints() {
|
57
|
-
const {
|
58
|
-
paint
|
59
|
-
} = this;
|
60
|
-
return [paint, ...this.declCtx.paints.popAll()];
|
29
|
+
const processColor = (Skia, color) => {
|
30
|
+
"worklet";
|
31
|
+
|
32
|
+
if (typeof color === "string" || typeof color === "number") {
|
33
|
+
return Skia.Color(color);
|
34
|
+
} else if (Array.isArray(color) || color instanceof Float32Array) {
|
35
|
+
return color instanceof Float32Array ? color : new Float32Array(color);
|
36
|
+
} else {
|
37
|
+
throw new Error(`Invalid color type: ${typeof color}. Expected number, string, or array.`);
|
61
38
|
}
|
62
|
-
|
39
|
+
};
|
40
|
+
const createDrawingContext = (Skia, canvas) => {
|
41
|
+
"worklet";
|
42
|
+
|
43
|
+
const state = {
|
44
|
+
paints: [Skia.Paint()]
|
45
|
+
};
|
46
|
+
const getPaint = () => {
|
47
|
+
return state.paints[state.paints.length - 1];
|
48
|
+
};
|
49
|
+
const processPaint = ({
|
63
50
|
opacity,
|
64
51
|
color,
|
65
52
|
strokeWidth,
|
@@ -71,57 +58,47 @@ class DrawingContext {
|
|
71
58
|
antiAlias,
|
72
59
|
dither,
|
73
60
|
paint: paintProp
|
74
|
-
}) {
|
61
|
+
}, declCtx) => {
|
75
62
|
if (paintProp) {
|
76
|
-
|
63
|
+
declCtx.paints.push(paintProp);
|
77
64
|
return true;
|
78
65
|
}
|
79
66
|
let shouldRestore = false;
|
80
|
-
const colorFilter =
|
81
|
-
const imageFilter =
|
82
|
-
const shader =
|
83
|
-
const maskFilter =
|
84
|
-
const pathEffect =
|
67
|
+
const colorFilter = declCtx.colorFilters.popAllAsOne();
|
68
|
+
const imageFilter = declCtx.imageFilters.popAllAsOne();
|
69
|
+
const shader = declCtx.shaders.pop();
|
70
|
+
const maskFilter = declCtx.maskFilters.pop();
|
71
|
+
const pathEffect = declCtx.pathEffects.popAllAsOne();
|
85
72
|
if (opacity !== undefined || color !== undefined || strokeWidth !== undefined || blendMode !== undefined || style !== undefined || strokeJoin !== undefined || strokeCap !== undefined || strokeMiter !== undefined || antiAlias !== undefined || dither !== undefined || colorFilter !== undefined || imageFilter !== undefined || shader !== undefined || maskFilter !== undefined || pathEffect !== undefined) {
|
86
73
|
if (!shouldRestore) {
|
87
|
-
|
74
|
+
state.paints.push(getPaint().copy());
|
88
75
|
shouldRestore = true;
|
89
76
|
}
|
90
77
|
}
|
91
|
-
const
|
92
|
-
paint
|
93
|
-
} = this;
|
78
|
+
const paint = getPaint();
|
94
79
|
if (opacity !== undefined) {
|
95
80
|
paint.setAlphaf(paint.getAlphaf() * opacity);
|
96
81
|
}
|
97
82
|
if (color !== undefined) {
|
98
83
|
const currentOpacity = paint.getAlphaf();
|
99
84
|
paint.setShader(null);
|
100
|
-
|
101
|
-
paint.setColor(this.Skia.Color(color));
|
102
|
-
} else if (Array.isArray(color)) {
|
103
|
-
paint.setColor(new Float32Array(color));
|
104
|
-
} else if (color instanceof Float32Array) {
|
105
|
-
paint.setColor(color);
|
106
|
-
} else {
|
107
|
-
throw new Error("Invalid color");
|
108
|
-
}
|
85
|
+
paint.setColor(processColor(Skia, color));
|
109
86
|
paint.setAlphaf(currentOpacity * paint.getAlphaf());
|
110
87
|
}
|
111
88
|
if (strokeWidth !== undefined) {
|
112
89
|
paint.setStrokeWidth(strokeWidth);
|
113
90
|
}
|
114
91
|
if (blendMode !== undefined) {
|
115
|
-
paint.setBlendMode(
|
92
|
+
paint.setBlendMode(_types.BlendMode[(0, _nodes.enumKey)(blendMode)]);
|
116
93
|
}
|
117
94
|
if (style !== undefined) {
|
118
|
-
paint.setStyle(
|
95
|
+
paint.setStyle(_types.PaintStyle[(0, _nodes.enumKey)(style)]);
|
119
96
|
}
|
120
97
|
if (strokeJoin !== undefined) {
|
121
|
-
paint.setStrokeJoin(
|
98
|
+
paint.setStrokeJoin(_types.StrokeJoin[(0, _nodes.enumKey)(strokeJoin)]);
|
122
99
|
}
|
123
100
|
if (strokeCap !== undefined) {
|
124
|
-
paint.setStrokeCap(
|
101
|
+
paint.setStrokeCap(_types.StrokeCap[(0, _nodes.enumKey)(strokeCap)]);
|
125
102
|
}
|
126
103
|
if (strokeMiter !== undefined) {
|
127
104
|
paint.setStrokeMiter(strokeMiter);
|
@@ -148,39 +125,48 @@ class DrawingContext {
|
|
148
125
|
paint.setPathEffect(pathEffect);
|
149
126
|
}
|
150
127
|
return shouldRestore;
|
151
|
-
}
|
152
|
-
processMatrixAndClipping(props, layer) {
|
128
|
+
};
|
129
|
+
const processMatrixAndClipping = (props, layer) => {
|
153
130
|
const hasTransform = props.matrix !== undefined || props.transform !== undefined;
|
154
|
-
const clip = computeClip(
|
131
|
+
const clip = computeClip(Skia, props.clip);
|
155
132
|
const hasClip = clip !== undefined;
|
156
|
-
const op = props.invertClip ?
|
157
|
-
const m3 = (0, _nodes.processTransformProps2)(
|
133
|
+
const op = props.invertClip ? _types.ClipOp.Difference : _types.ClipOp.Intersect;
|
134
|
+
const m3 = (0, _nodes.processTransformProps2)(Skia, props);
|
158
135
|
const shouldSave = hasTransform || hasClip || !!layer;
|
159
136
|
if (shouldSave) {
|
160
137
|
if (layer) {
|
161
138
|
if (typeof layer === "boolean") {
|
162
|
-
|
139
|
+
canvas.saveLayer();
|
163
140
|
} else {
|
164
|
-
|
141
|
+
canvas.saveLayer(layer);
|
165
142
|
}
|
166
143
|
} else {
|
167
|
-
|
144
|
+
canvas.save();
|
168
145
|
}
|
169
146
|
}
|
170
147
|
if (m3) {
|
171
|
-
|
148
|
+
canvas.concat(m3);
|
172
149
|
}
|
173
150
|
if (clip) {
|
174
151
|
if ("clipRect" in clip) {
|
175
|
-
|
152
|
+
canvas.clipRect(clip.clipRect, op, true);
|
176
153
|
} else if ("clipRRect" in clip) {
|
177
|
-
|
154
|
+
canvas.clipRRect(clip.clipRRect, op, true);
|
178
155
|
} else {
|
179
|
-
|
156
|
+
canvas.clipPath(clip.clipPath, op, true);
|
180
157
|
}
|
181
158
|
}
|
182
159
|
return shouldSave;
|
183
|
-
}
|
184
|
-
|
185
|
-
|
160
|
+
};
|
161
|
+
return {
|
162
|
+
Skia,
|
163
|
+
canvas,
|
164
|
+
save: () => state.paints.push(getPaint().copy()),
|
165
|
+
restore: () => state.paints.pop(),
|
166
|
+
getPaint,
|
167
|
+
processPaint,
|
168
|
+
processMatrixAndClipping
|
169
|
+
};
|
170
|
+
};
|
171
|
+
exports.createDrawingContext = createDrawingContext;
|
186
172
|
//# sourceMappingURL=DrawingContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Object","defineProperty","exports","value","DrawingContext","_nodes","require","_types","_types2","_defineProperty","e","r","t","_toPropertyKey","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","computeClip","Skia","clip","isPathDef","clipPath","processPath","isRRect","clipRRect","clipRect","undefined","constructor","canvas","paints","Paint","declCtx","DeclarationContext","save","push","paint","copy","restore","pop","length","Error","getLocalPaints","popAll","processPaint","opacity","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paintProp","shouldRestore","colorFilter","colorFilters","popAllAsOne","imageFilter","imageFilters","shader","shaders","maskFilter","maskFilters","pathEffect","pathEffects","setAlphaf","getAlphaf","currentOpacity","setShader","setColor","Color","Array","isArray","Float32Array","setStrokeWidth","setBlendMode","BlendMode","enumKey","setStyle","PaintStyle","setStrokeJoin","StrokeJoin","setStrokeCap","StrokeCap","setStrokeMiter","setAntiAlias","setDither","setColorFilter","setImageFilter","setMaskFilter","setPathEffect","processMatrixAndClipping","props","layer","hasTransform","matrix","transform","hasClip","op","invertClip","ClipOp","Difference","Intersect","m3","processTransformProps2","shouldSave","saveLayer","concat"],"sources":["DrawingContext.ts"],"sourcesContent":["\"worklet\";\n\nimport {\n enumKey,\n isPathDef,\n processPath,\n processTransformProps2,\n} from \"../dom/nodes\";\nimport type { ClipDef, DrawingNodeProps, GroupProps } from \"../dom/types\";\nimport { DeclarationContext } from \"../dom/types\";\nimport {\n BlendMode,\n ClipOp,\n isRRect,\n PaintStyle,\n StrokeCap,\n StrokeJoin,\n} from \"../skia/types\";\nimport type {\n SkPath,\n SkRect,\n SkRRect,\n SkCanvas,\n Skia,\n SkPaint,\n} from \"../skia/types\";\n\nconst computeClip = (\n Skia: Skia,\n clip: ClipDef | undefined\n):\n | undefined\n | { clipPath: SkPath }\n | { clipRect: SkRect }\n | { clipRRect: SkRRect } => {\n if (clip) {\n if (isPathDef(clip)) {\n return { clipPath: processPath(Skia, clip) };\n } else if (isRRect(clip)) {\n return { clipRRect: clip };\n } else {\n return { clipRect: clip };\n }\n }\n return undefined;\n};\n\nexport class DrawingContext {\n private paints: SkPaint[];\n public declCtx: DeclarationContext;\n public Skia: Skia;\n public canvas: SkCanvas;\n\n constructor(Skia: Skia, canvas: SkCanvas) {\n this.Skia = Skia;\n this.canvas = canvas;\n this.paints = [Skia.Paint()];\n this.declCtx = new DeclarationContext(this.Skia);\n }\n\n save() {\n this.paints.push(this.paint.copy());\n }\n\n restore() {\n this.paints.pop();\n }\n\n get paint() {\n const paint = this.paints[this.paints.length - 1];\n if (!paint) {\n throw new Error(\"Paint is undefined\");\n }\n return paint;\n }\n\n getLocalPaints() {\n const { paint } = this;\n return [paint, ...this.declCtx.paints.popAll()];\n }\n\n processPaint({\n opacity,\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n paint: paintProp,\n }: DrawingNodeProps) {\n if (paintProp) {\n this.declCtx.paints.push(paintProp);\n return true;\n }\n let shouldRestore = false;\n const colorFilter = this.declCtx.colorFilters.popAllAsOne();\n const imageFilter = this.declCtx.imageFilters.popAllAsOne();\n const shader = this.declCtx.shaders.pop();\n const maskFilter = this.declCtx.maskFilters.pop();\n const pathEffect = this.declCtx.pathEffects.popAllAsOne();\n if (\n opacity !== undefined ||\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n antiAlias !== undefined ||\n dither !== undefined ||\n colorFilter !== undefined ||\n imageFilter !== undefined ||\n shader !== undefined ||\n maskFilter !== undefined ||\n pathEffect !== undefined\n ) {\n if (!shouldRestore) {\n this.save();\n shouldRestore = true;\n }\n }\n const { paint } = this;\n if (opacity !== undefined) {\n paint.setAlphaf(paint.getAlphaf() * opacity);\n }\n if (color !== undefined) {\n const currentOpacity = paint.getAlphaf();\n paint.setShader(null);\n if (typeof color === \"string\" || typeof color === \"number\") {\n paint.setColor(this.Skia.Color(color));\n } else if (Array.isArray(color)) {\n paint.setColor(new Float32Array(color));\n } else if (color instanceof Float32Array) {\n paint.setColor(color);\n } else {\n throw new Error(\"Invalid color\");\n }\n paint.setAlphaf(currentOpacity * paint.getAlphaf());\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (dither !== undefined) {\n paint.setDither(dither);\n }\n if (colorFilter) {\n paint.setColorFilter(colorFilter);\n }\n if (imageFilter) {\n paint.setImageFilter(imageFilter);\n }\n if (shader) {\n paint.setShader(shader);\n }\n if (maskFilter) {\n paint.setMaskFilter(maskFilter);\n }\n if (pathEffect) {\n paint.setPathEffect(pathEffect);\n }\n return shouldRestore;\n }\n\n processMatrixAndClipping(props: GroupProps, layer?: boolean | SkPaint) {\n const hasTransform =\n props.matrix !== undefined || props.transform !== undefined;\n const clip = computeClip(this.Skia, props.clip);\n const hasClip = clip !== undefined;\n const op = props.invertClip ? ClipOp.Difference : ClipOp.Intersect;\n const m3 = processTransformProps2(this.Skia, props);\n const shouldSave = hasTransform || hasClip || !!layer;\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n this.canvas.saveLayer();\n } else {\n this.canvas.saveLayer(layer);\n }\n } else {\n this.canvas.save();\n }\n }\n\n if (m3) {\n this.canvas.concat(m3);\n }\n if (clip) {\n if (\"clipRect\" in clip) {\n this.canvas.clipRect(clip.clipRect, op, true);\n } else if (\"clipRRect\" in clip) {\n this.canvas.clipRRect(clip.clipRRect, op, true);\n } else {\n this.canvas.clipPath(clip.clipPath, op, true);\n }\n }\n return shouldSave;\n }\n}\n"],"mappings":";AAAA,SAAS;;AAACA,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,KAAA;AAAA;AAAAD,OAAA,CAAAE,cAAA;AAEV,IAAAC,MAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAOuB,SAAAG,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAV,MAAA,CAAAC,cAAA,CAAAS,CAAA,EAAAC,CAAA,IAAAR,KAAA,EAAAS,CAAA,EAAAE,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAN,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAK,CAAA,GAAAC,YAAA,CAAAN,CAAA,uCAAAK,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAN,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,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AAE;QACtB,IAAI,CAACS,MAAM,CAACH,QAAQ,CAACN,IAAI,CAACM,QAAQ,EAAE2E,EAAE,EAAE,IAAI,CAAC;MAC/C,CAAC,MAAM,IAAI,WAAW,IAAIjF,IAAI,EAAE;QAC9B,IAAI,CAACS,MAAM,CAACJ,SAAS,CAACL,IAAI,CAACK,SAAS,EAAE4E,EAAE,EAAE,IAAI,CAAC;MACjD,CAAC,MAAM;QACL,IAAI,CAACxE,MAAM,CAACP,QAAQ,CAACF,IAAI,CAACE,QAAQ,EAAE+E,EAAE,EAAE,IAAI,CAAC;MAC/C;IACF;IACA,OAAOO,UAAU;EACnB;AACF;AAACjH,OAAA,CAAAE,cAAA,GAAAA,cAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_nodes","require","_types","computeClip","Skia","clip","isPathDef","clipPath","processPath","isRRect","clipRRect","clipRect","undefined","processColor","color","Color","Array","isArray","Float32Array","Error","createDrawingContext","canvas","state","paints","Paint","getPaint","length","processPaint","opacity","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paint","paintProp","declCtx","push","shouldRestore","colorFilter","colorFilters","popAllAsOne","imageFilter","imageFilters","shader","shaders","pop","maskFilter","maskFilters","pathEffect","pathEffects","copy","setAlphaf","getAlphaf","currentOpacity","setShader","setColor","setStrokeWidth","setBlendMode","BlendMode","enumKey","setStyle","PaintStyle","setStrokeJoin","StrokeJoin","setStrokeCap","StrokeCap","setStrokeMiter","setAntiAlias","setDither","setColorFilter","setImageFilter","setMaskFilter","setPathEffect","processMatrixAndClipping","props","layer","hasTransform","matrix","transform","hasClip","op","invertClip","ClipOp","Difference","Intersect","m3","processTransformProps2","shouldSave","saveLayer","save","concat","restore","exports"],"sources":["DrawingContext.ts"],"sourcesContent":["import {\n enumKey,\n isPathDef,\n processPath,\n processTransformProps2,\n} from \"../dom/nodes\";\nimport type { ClipDef, DrawingNodeProps, GroupProps } from \"../dom/types\";\nimport {\n BlendMode,\n ClipOp,\n isRRect,\n PaintStyle,\n StrokeCap,\n StrokeJoin,\n} from \"../skia/types\";\nimport type {\n SkPath,\n SkRect,\n SkRRect,\n SkCanvas,\n Skia,\n SkPaint,\n} from \"../skia/types\";\n\nimport type { DeclarationContext } from \"./DeclarationContext\";\n\nconst computeClip = (\n Skia: Skia,\n clip: ClipDef | undefined\n):\n | undefined\n | { clipPath: SkPath }\n | { clipRect: SkRect }\n | { clipRRect: SkRRect } => {\n \"worklet\";\n if (clip) {\n if (isPathDef(clip)) {\n return { clipPath: processPath(Skia, clip) };\n } else if (isRRect(clip)) {\n return { clipRRect: clip };\n } else {\n return { clipRect: clip };\n }\n }\n return undefined;\n};\n\nconst processColor = (\n Skia: Skia,\n color: number | string | Float32Array | number[]\n) => {\n \"worklet\";\n if (typeof color === \"string\" || typeof color === \"number\") {\n return Skia.Color(color);\n } else if (Array.isArray(color) || color instanceof Float32Array) {\n return color instanceof Float32Array ? color : new Float32Array(color);\n } else {\n throw new Error(\n `Invalid color type: ${typeof color}. Expected number, string, or array.`\n );\n }\n};\n\nexport const createDrawingContext = (Skia: Skia, canvas: SkCanvas) => {\n \"worklet\";\n const state = {\n paints: [Skia.Paint()],\n };\n\n const getPaint = () => {\n return state.paints[state.paints.length - 1];\n };\n\n const processPaint = (\n {\n opacity,\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n paint: paintProp,\n }: DrawingNodeProps,\n declCtx: DeclarationContext\n ) => {\n if (paintProp) {\n declCtx.paints.push(paintProp);\n return true;\n }\n let shouldRestore = false;\n const colorFilter = declCtx.colorFilters.popAllAsOne();\n const imageFilter = declCtx.imageFilters.popAllAsOne();\n const shader = declCtx.shaders.pop();\n const maskFilter = declCtx.maskFilters.pop();\n const pathEffect = declCtx.pathEffects.popAllAsOne();\n\n if (\n opacity !== undefined ||\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n antiAlias !== undefined ||\n dither !== undefined ||\n colorFilter !== undefined ||\n imageFilter !== undefined ||\n shader !== undefined ||\n maskFilter !== undefined ||\n pathEffect !== undefined\n ) {\n if (!shouldRestore) {\n state.paints.push(getPaint().copy());\n shouldRestore = true;\n }\n }\n\n const paint = getPaint();\n if (opacity !== undefined) {\n paint.setAlphaf(paint.getAlphaf() * opacity);\n }\n if (color !== undefined) {\n const currentOpacity = paint.getAlphaf();\n paint.setShader(null);\n paint.setColor(processColor(Skia, color));\n paint.setAlphaf(currentOpacity * paint.getAlphaf());\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (dither !== undefined) {\n paint.setDither(dither);\n }\n if (colorFilter) {\n paint.setColorFilter(colorFilter);\n }\n if (imageFilter) {\n paint.setImageFilter(imageFilter);\n }\n if (shader) {\n paint.setShader(shader);\n }\n if (maskFilter) {\n paint.setMaskFilter(maskFilter);\n }\n if (pathEffect) {\n paint.setPathEffect(pathEffect);\n }\n return shouldRestore;\n };\n\n const processMatrixAndClipping = (\n props: GroupProps,\n layer?: boolean | SkPaint\n ) => {\n const hasTransform =\n props.matrix !== undefined || props.transform !== undefined;\n const clip = computeClip(Skia, props.clip);\n const hasClip = clip !== undefined;\n const op = props.invertClip ? ClipOp.Difference : ClipOp.Intersect;\n const m3 = processTransformProps2(Skia, props);\n const shouldSave = hasTransform || hasClip || !!layer;\n\n if (shouldSave) {\n if (layer) {\n if (typeof layer === \"boolean\") {\n canvas.saveLayer();\n } else {\n canvas.saveLayer(layer);\n }\n } else {\n canvas.save();\n }\n }\n\n if (m3) {\n canvas.concat(m3);\n }\n if (clip) {\n if (\"clipRect\" in clip) {\n canvas.clipRect(clip.clipRect, op, true);\n } else if (\"clipRRect\" in clip) {\n canvas.clipRRect(clip.clipRRect, op, true);\n } else {\n canvas.clipPath(clip.clipPath, op, true);\n }\n }\n return shouldSave;\n };\n\n return {\n Skia,\n canvas,\n save: () => state.paints.push(getPaint().copy()),\n restore: () => state.paints.pop(),\n getPaint,\n processPaint,\n processMatrixAndClipping,\n };\n};\n\nexport type DrawingContext = ReturnType<typeof createDrawingContext>;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAD,OAAA;AAmBA,MAAME,WAAW,GAAGA,CAClBC,IAAU,EACVC,IAAyB,KAKG;EAC5B,SAAS;;EACT,IAAIA,IAAI,EAAE;IACR,IAAI,IAAAC,gBAAS,EAACD,IAAI,CAAC,EAAE;MACnB,OAAO;QAAEE,QAAQ,EAAE,IAAAC,kBAAW,EAACJ,IAAI,EAAEC,IAAI;MAAE,CAAC;IAC9C,CAAC,MAAM,IAAI,IAAAI,cAAO,EAACJ,IAAI,CAAC,EAAE;MACxB,OAAO;QAAEK,SAAS,EAAEL;MAAK,CAAC;IAC5B,CAAC,MAAM;MACL,OAAO;QAAEM,QAAQ,EAAEN;MAAK,CAAC;IAC3B;EACF;EACA,OAAOO,SAAS;AAClB,CAAC;AAED,MAAMC,YAAY,GAAGA,CACnBT,IAAU,EACVU,KAAgD,KAC7C;EACH,SAAS;;EACT,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC1D,OAAOV,IAAI,CAACW,KAAK,CAACD,KAAK,CAAC;EAC1B,CAAC,MAAM,IAAIE,KAAK,CAACC,OAAO,CAAC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IACA,OAAOO,UAAU;EACnB,CAAC;EAED,OAAO;IACLvF,IAAI;IACJiB,MAAM;IACNwE,IAAI,EAAEA,CAAA,KAAMvE,KAAK,CAACC,MAAM,CAACiB,IAAI,CAACf,QAAQ,CAAC,CAAC,CAAC6B,IAAI,CAAC,CAAC,CAAC;IAChDyC,OAAO,EAAEA,CAAA,KAAMzE,KAAK,CAACC,MAAM,CAAC0B,GAAG,CAAC,CAAC;IACjCxB,QAAQ;IACRE,YAAY;IACZkD;EACF,CAAC;AACH,CAAC;AAACmB,OAAA,CAAA5E,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
@@ -2,6 +2,7 @@ import type { ReactNode } from "react";
|
|
2
2
|
import type { SkCanvas, Skia } from "../skia/types";
|
3
3
|
import { NodeType } from "../dom/types";
|
4
4
|
export declare class SkiaSGRoot {
|
5
|
+
Skia: Skia;
|
5
6
|
private root;
|
6
7
|
private container;
|
7
8
|
constructor(Skia: Skia, nativeId?: number);
|
@@ -13,5 +14,6 @@ export declare class SkiaSGRoot {
|
|
13
14
|
};
|
14
15
|
render(element: ReactNode): void;
|
15
16
|
drawOnCanvas(canvas: SkCanvas): void;
|
17
|
+
getPicture(): import("../skia/types").SkPicture;
|
16
18
|
unmount(): void;
|
17
19
|
}
|
@@ -20,6 +20,7 @@ skiaReconciler.injectIntoDevTools({
|
|
20
20
|
});
|
21
21
|
class SkiaSGRoot {
|
22
22
|
constructor(Skia, nativeId = -1) {
|
23
|
+
this.Skia = Skia;
|
23
24
|
_defineProperty(this, "root", void 0);
|
24
25
|
_defineProperty(this, "container", void 0);
|
25
26
|
this.container = new _Container.Container(Skia, nativeId);
|
@@ -43,6 +44,12 @@ class SkiaSGRoot {
|
|
43
44
|
drawOnCanvas(canvas) {
|
44
45
|
this.container.drawOnCanvas(canvas);
|
45
46
|
}
|
47
|
+
getPicture() {
|
48
|
+
const recorder = this.Skia.PictureRecorder();
|
49
|
+
const canvas = recorder.beginRecording();
|
50
|
+
this.drawOnCanvas(canvas);
|
51
|
+
return recorder.finishRecordingAsPicture();
|
52
|
+
}
|
46
53
|
unmount() {
|
47
54
|
this.container.unmounted = true;
|
48
55
|
skiaReconciler.updateContainer(null, this.root, null, () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactReconciler","_interopRequireDefault","require","_types","_HostConfig","_Container","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","skiaReconciler","ReactReconciler","sksgHostConfig","injectIntoDevTools","bundleType","version","rendererPackageName","SkiaSGRoot","constructor","Skia","nativeId","container","Container","root","createContainer","console","error","sg","children","type","NodeType","Group","props","isDeclaration","render","element","updateContainer","debug","drawOnCanvas","canvas","unmount","unmounted","exports"],"sources":["Reconciler.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport type { SkCanvas, Skia } from \"../skia/types\";\nimport { NodeType } from \"../dom/types\";\n\nimport { debug, sksgHostConfig } from \"./HostConfig\";\nimport { Container } from \"./Container\";\n\nconst skiaReconciler = ReactReconciler(sksgHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nexport class SkiaSGRoot {\n private root: OpaqueRoot;\n private container: Container;\n\n constructor(Skia: Skia, nativeId = -1) {\n this.container = new Container(Skia, nativeId);\n this.root = skiaReconciler.createContainer(\n this.container,\n 0,\n null,\n true,\n null,\n \"\",\n console.error,\n null\n );\n }\n\n get sg() {\n const children = this.container.root;\n return { type: NodeType.Group, props: {}, children, isDeclaration: false };\n }\n\n render(element: ReactNode) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n skiaReconciler.updateContainer(element as any, this.root, null, () => {\n debug(\"updateContainer\");\n });\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n this.container.drawOnC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AmB,EAAE;AACvB,CAAC,CAAC;AAEK,MAAMC,UAAU,CAAC;EAItBC,WAAWA,
|
1
|
+
{"version":3,"names":["_reactReconciler","_interopRequireDefault","require","_types","_HostConfig","_Container","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","skiaReconciler","ReactReconciler","sksgHostConfig","injectIntoDevTools","bundleType","version","rendererPackageName","SkiaSGRoot","constructor","Skia","nativeId","container","Container","root","createContainer","console","error","sg","children","type","NodeType","Group","props","isDeclaration","render","element","updateContainer","debug","drawOnCanvas","canvas","getPicture","recorder","PictureRecorder","beginRecording","finishRecordingAsPicture","unmount","unmounted","exports"],"sources":["Reconciler.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { OpaqueRoot } from \"react-reconciler\";\nimport ReactReconciler from \"react-reconciler\";\n\nimport type { SkCanvas, Skia } from \"../skia/types\";\nimport { NodeType } from \"../dom/types\";\n\nimport { debug, sksgHostConfig } from \"./HostConfig\";\nimport { Container } from \"./Container\";\n\nconst skiaReconciler = ReactReconciler(sksgHostConfig);\n\nskiaReconciler.injectIntoDevTools({\n bundleType: 1,\n version: \"0.0.1\",\n rendererPackageName: \"react-native-skia\",\n});\n\nexport class SkiaSGRoot {\n private root: OpaqueRoot;\n private container: Container;\n\n constructor(public Skia: Skia, nativeId = -1) {\n this.container = new Container(Skia, nativeId);\n this.root = skiaReconciler.createContainer(\n this.container,\n 0,\n null,\n true,\n null,\n \"\",\n console.error,\n null\n );\n }\n\n get sg() {\n const children = this.container.root;\n return { type: NodeType.Group, props: {}, children, isDeclaration: false };\n }\n\n render(element: ReactNode) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n skiaReconciler.updateContainer(element as any, this.root, null, () => {\n debug(\"updateContainer\");\n });\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n this.container.drawOnCanvas(canvas);\n }\n\n getPicture() {\n const recorder = this.Skia.PictureRecorder();\n const canvas = recorder.beginRecording();\n this.drawOnCanvas(canvas);\n return recorder.finishRecordingAsPicture();\n }\n\n unmount() {\n this.container.unmounted = true;\n skiaReconciler.updateContainer(null, this.root, null, () => {\n debug(\"unmountContainer\");\n });\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAAwC,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAExC,MAAMgB,cAAc,GAAG,IAAAC,wBAAe,EAACC,0BAAc,CAAC;AAEtDF,cAAc,CAACG,kBAAkB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E,QAAQ,CAACG,wBAAwB,CAAC,CAAC;EAC5C;EAEAC,OAAOA,CAAA,EAAG;IACR,IAAI,CAACxB,SAAS,CAACyB,SAAS,GAAG,IAAI;IAC/BpC,cAAc,CAAC0B,eAAe,CAAC,IAAI,EAAE,IAAI,CAACb,IAAI,EAAE,IAAI,EAAE,MAAM;MAC1D,IAAAc,iBAAK,EAAC,kBAAkB,CAAC;IAC3B,CAAC,CAAC;EACJ;AACF;AAACU,OAAA,CAAA9B,UAAA,GAAAA,UAAA","ignoreList":[]}
|
@@ -1,7 +1,10 @@
|
|
1
|
-
import type { BlendColorFilterProps,
|
2
|
-
|
3
|
-
|
4
|
-
export declare const
|
1
|
+
import type { BlendColorFilterProps, LerpColorFilterProps, MatrixColorFilterProps } from "../../dom/types";
|
2
|
+
import type { SkColorFilter } from "../../skia/types";
|
3
|
+
import type { DeclarationContext } from "../DeclarationContext";
|
4
|
+
export declare const composeColorFilters: (ctx: DeclarationContext, cf: SkColorFilter, processChildren: () => void) => void;
|
5
|
+
export declare const makeBlendColorFilter: (ctx: DeclarationContext, props: BlendColorFilterProps) => SkColorFilter;
|
6
|
+
export declare const makeSRGBToLinearGammaColorFilter: (ctx: DeclarationContext) => SkColorFilter;
|
7
|
+
export declare const makeLinearToSRGBGammaColorFilter: (ctx: DeclarationContext) => SkColorFilter;
|
5
8
|
export declare const declareLerpColorFilter: (ctx: DeclarationContext, props: LerpColorFilterProps) => void;
|
6
|
-
export declare const makeMatrixColorFilter: (ctx: DeclarationContext, props: MatrixColorFilterProps) =>
|
7
|
-
export declare const makeLumaColorFilter: (ctx: DeclarationContext) =>
|
9
|
+
export declare const makeMatrixColorFilter: (ctx: DeclarationContext, props: MatrixColorFilterProps) => SkColorFilter;
|
10
|
+
export declare const makeLumaColorFilter: (ctx: DeclarationContext) => SkColorFilter;
|
@@ -1,13 +1,27 @@
|
|
1
1
|
"use strict";
|
2
|
-
"worklet";
|
3
2
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
|
-
exports.makeSRGBToLinearGammaColorFilter = exports.makeMatrixColorFilter = exports.makeLumaColorFilter = exports.makeLinearToSRGBGammaColorFilter = exports.makeBlendColorFilter = exports.declareLerpColorFilter = void 0;
|
6
|
+
exports.makeSRGBToLinearGammaColorFilter = exports.makeMatrixColorFilter = exports.makeLumaColorFilter = exports.makeLinearToSRGBGammaColorFilter = exports.makeBlendColorFilter = exports.declareLerpColorFilter = exports.composeColorFilters = void 0;
|
8
7
|
var _nodes = require("../../dom/nodes");
|
9
8
|
var _types = require("../../skia/types");
|
9
|
+
const composeColorFilters = (ctx, cf, processChildren) => {
|
10
|
+
"worklet";
|
11
|
+
|
12
|
+
const {
|
13
|
+
Skia
|
14
|
+
} = ctx;
|
15
|
+
ctx.colorFilters.save();
|
16
|
+
processChildren();
|
17
|
+
const cf1 = ctx.colorFilters.popAllAsOne();
|
18
|
+
ctx.colorFilters.restore();
|
19
|
+
ctx.colorFilters.push(cf1 ? Skia.ColorFilter.MakeCompose(cf, cf1) : cf);
|
20
|
+
};
|
21
|
+
exports.composeColorFilters = composeColorFilters;
|
10
22
|
const makeBlendColorFilter = (ctx, props) => {
|
23
|
+
"worklet";
|
24
|
+
|
11
25
|
const {
|
12
26
|
mode
|
13
27
|
} = props;
|
@@ -17,16 +31,22 @@ const makeBlendColorFilter = (ctx, props) => {
|
|
17
31
|
};
|
18
32
|
exports.makeBlendColorFilter = makeBlendColorFilter;
|
19
33
|
const makeSRGBToLinearGammaColorFilter = ctx => {
|
34
|
+
"worklet";
|
35
|
+
|
20
36
|
const cf = ctx.Skia.ColorFilter.MakeSRGBToLinearGamma();
|
21
37
|
return cf;
|
22
38
|
};
|
23
39
|
exports.makeSRGBToLinearGammaColorFilter = makeSRGBToLinearGammaColorFilter;
|
24
40
|
const makeLinearToSRGBGammaColorFilter = ctx => {
|
41
|
+
"worklet";
|
42
|
+
|
25
43
|
const cf = ctx.Skia.ColorFilter.MakeLinearToSRGBGamma();
|
26
44
|
return cf;
|
27
45
|
};
|
28
46
|
exports.makeLinearToSRGBGammaColorFilter = makeLinearToSRGBGammaColorFilter;
|
29
47
|
const declareLerpColorFilter = (ctx, props) => {
|
48
|
+
"worklet";
|
49
|
+
|
30
50
|
const {
|
31
51
|
t
|
32
52
|
} = props;
|
@@ -40,6 +60,8 @@ const declareLerpColorFilter = (ctx, props) => {
|
|
40
60
|
};
|
41
61
|
exports.declareLerpColorFilter = declareLerpColorFilter;
|
42
62
|
const makeMatrixColorFilter = (ctx, props) => {
|
63
|
+
"worklet";
|
64
|
+
|
43
65
|
const {
|
44
66
|
matrix
|
45
67
|
} = props;
|
@@ -48,6 +70,8 @@ const makeMatrixColorFilter = (ctx, props) => {
|
|
48
70
|
};
|
49
71
|
exports.makeMatrixColorFilter = makeMatrixColorFilter;
|
50
72
|
const makeLumaColorFilter = ctx => {
|
73
|
+
"worklet";
|
74
|
+
|
51
75
|
const cf = ctx.Skia.ColorFilter.MakeLumaColorFilter();
|
52
76
|
return cf;
|
53
77
|
};
|