@shopify/react-native-skia 0.1.172 → 0.1.174
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/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/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 +53 -50
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.h +2 -0
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +56 -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/dom/nodes/DrawingNode.js +5 -1
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +33 -34
- 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 +6 -11
- 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.js.map +1 -1
- package/lib/commonjs/dom/nodes/PaintNode.d.ts +3 -3
- 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 +2 -3
- package/lib/commonjs/dom/nodes/RenderNode.js +19 -187
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +1 -1
- 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 +3 -1
- 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/paint/BlendNode.d.ts +3 -7
- 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 +10 -11
- 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 +11 -11
- 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 +3 -3
- 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 +15 -18
- 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 +11 -12
- 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/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 +18 -1
- package/lib/commonjs/dom/types/DrawingContext.js +330 -0
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Node.d.ts +4 -10
- package/lib/commonjs/dom/types/Node.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.d.ts +22 -23
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/dom/types/index.d.ts +1 -0
- package/lib/commonjs/dom/types/index.js +13 -0
- package/lib/commonjs/dom/types/index.js.map +1 -1
- package/lib/commonjs/index.d.ts +1 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +3 -3
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/DrawingContext.d.ts +4 -3
- package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +35 -35
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- 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.js +0 -1
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/Surface.d.ts +4 -0
- package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.d.ts +6 -0
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkDataFactory.js +0 -1
- package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkImage.js +34 -3
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -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 +2 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js +21 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js +14 -8
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.web.js +3 -14
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.web.js +0 -7
- package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaView.web.js +0 -7
- package/lib/commonjs/views/SkiaView.web.js.map +1 -1
- package/lib/module/dom/nodes/DrawingNode.js +5 -1
- package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +33 -34
- 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 +6 -11
- 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.js.map +1 -1
- package/lib/module/dom/nodes/PaintNode.d.ts +3 -3
- 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 +2 -3
- package/lib/module/dom/nodes/RenderNode.js +20 -187
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +1 -1
- 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 +3 -1
- 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/paint/BlendNode.d.ts +3 -7
- 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 +10 -11
- 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 +11 -11
- 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 +3 -3
- 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 +15 -18
- 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 +11 -12
- 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/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 +18 -1
- package/lib/module/dom/types/DrawingContext.js +322 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Node.d.ts +4 -10
- package/lib/module/dom/types/Node.js.map +1 -1
- package/lib/module/dom/types/SkDOM.d.ts +22 -23
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/dom/types/index.d.ts +1 -0
- package/lib/module/dom/types/index.js +1 -0
- package/lib/module/dom/types/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 +3 -3
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/DrawingContext.d.ts +4 -3
- package/lib/module/renderer/DrawingContext.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +35 -35
- package/lib/module/renderer/HostComponents.js.map +1 -1
- 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.js +0 -1
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/skia/types/Surface/Surface.d.ts +4 -0
- package/lib/module/skia/types/Surface/Surface.js.map +1 -1
- package/lib/module/skia/types/Surface/SurfaceFactory.d.ts +6 -0
- package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkDataFactory.js +0 -1
- package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.d.ts +1 -0
- package/lib/module/skia/web/JsiSkImage.js +31 -3
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.d.ts +1 -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 +2 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js +21 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +14 -8
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaDomView.web.js +2 -11
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.web.js +0 -5
- package/lib/module/views/SkiaPictureView.web.js.map +1 -1
- package/lib/module/views/SkiaView.web.js +0 -5
- package/lib/module/views/SkiaView.web.js.map +1 -1
- 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/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/JsiSkImage.d.ts +1 -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 +1 -1
- 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/skia/types/Surface/Surface.ts +5 -0
- package/src/skia/types/Surface/SurfaceFactory.ts +7 -0
- package/src/skia/web/JsiSkDataFactory.ts +0 -1
- package/src/skia/web/JsiSkImage.ts +26 -2
- package/src/skia/web/JsiSkSurface.ts +4 -0
- package/src/skia/web/JsiSkSurfaceFactory.ts +21 -2
- package/src/views/SkiaBaseWebView.tsx +9 -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
@@ -103,9 +103,13 @@ export class SkiaBaseWebView extends React.Component {
|
|
103
103
|
|
104
104
|
|
105
105
|
makeImageSnapshot(rect) {
|
106
|
-
var _this$_surface;
|
106
|
+
var _this$_surface, _this$_surface2;
|
107
107
|
|
108
|
-
|
108
|
+
this._canvas.clear(CanvasKit.TRANSPARENT);
|
109
|
+
|
110
|
+
this.renderInCanvas(this._canvas, []);
|
111
|
+
(_this$_surface = this._surface) === null || _this$_surface === void 0 ? void 0 : _this$_surface.ref.flush();
|
112
|
+
return (_this$_surface2 = this._surface) === null || _this$_surface2 === void 0 ? void 0 : _this$_surface2.makeImageSnapshot(rect);
|
109
113
|
}
|
110
114
|
/**
|
111
115
|
* Override to render
|
@@ -120,15 +124,17 @@ export class SkiaBaseWebView extends React.Component {
|
|
120
124
|
this._redrawRequests = 0;
|
121
125
|
|
122
126
|
if (this._canvas) {
|
123
|
-
var _this$
|
127
|
+
var _this$_surface3;
|
124
128
|
|
125
129
|
const touches = [...this._touches];
|
126
130
|
this._touches = [];
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
131
|
+
const canvas = this._canvas;
|
132
|
+
canvas.clear(Float32Array.of(0, 0, 0, 0));
|
133
|
+
canvas.save();
|
134
|
+
canvas.scale(pd, pd);
|
135
|
+
this.renderInCanvas(canvas, touches);
|
136
|
+
canvas.restore();
|
137
|
+
(_this$_surface3 = this._surface) === null || _this$_surface3 === void 0 ? void 0 : _this$_surface3.ref.flush();
|
132
138
|
}
|
133
139
|
}
|
134
140
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","PixelRatio","View","JsiSkSurface","TouchType","pd","get","SkiaBaseWebView","Component","constructor","props","createRef","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","onLayout","evt","CanvasKit","global","width","height","nativeEvent","layout","_canvasRef","current","canvas","surface","MakeWebGLCanvasSurface","Error","_surface","_canvas","getCanvas","redraw","getSize","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","makeImageSnapshot","rect","_redrawRequests","touches","_touches","clear","TRANSPARENT","renderInCanvas","ref","flush","requestAnimationFrame","bind","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","timestamp","Date","now","createTouchHandler","render","debug","viewProps","display","flex","Start","Active","End","Cancelled"],"sources":["SkiaBaseWebView.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\nimport { PixelRatio, View } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\n\nimport type { DrawMode, SkiaBaseViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = PixelRatio.get();\n\nexport abstract class SkiaBaseWebView<\n TProps extends SkiaBaseViewProps\n> extends React.Component<TProps> {\n constructor(props: TProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private requestId = 0;\n\n protected width = 0;\n protected height = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayout(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n const { width, height } = evt.nativeEvent.layout;\n this.width = width;\n this.height = height;\n // Reset canvas / surface on layout change\n if (this._canvasRef.current) {\n const canvas = this._canvasRef.current;\n canvas.width = width * pd;\n canvas.height = height * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n // Call onLayout callback if it exists\n if (this.props.onLayout) {\n this.props.onLayout(evt);\n }\n }\n\n protected getSize() {\n return { width: this.width, height: this.height };\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Override to render\n */\n protected abstract renderInCanvas(\n canvas: SkCanvas,\n touches: TouchInfo[]\n ): void;\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas) {\n const touches = [...this._touches];\n this._touches = [];\n this._canvas!.clear(CanvasKit.TRANSPARENT);\n this.renderInCanvas(this._canvas!, touches);\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <View {...viewProps} onLayout={this.onLayout.bind(this)}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.createTouchHandler(TouchType.Start)}\n onPointerMove={this.createTouchHandler(TouchType.Active)}\n onPointerUp={this.createTouchHandler(TouchType.End)}\n onPointerCancel={this.createTouchHandler(TouchType.Cancelled)}\n onPointerLeave={this.createTouchHandler(TouchType.End)}\n onPointerOut={this.createTouchHandler(TouchType.End)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,cAAjC;AAIA,SAASC,YAAT,QAA6B,0BAA7B;AAGA,SAASC,SAAT,QAA0B,SAA1B;AAEA,MAAMC,EAAE,GAAGJ,UAAU,CAACK,GAAX,EAAX;AAEA,OAAO,MAAeC,eAAf,SAEGP,KAAK,CAACQ,SAFT,CAE2B;EAChCC,WAAW,CAACC,KAAD,EAAgB;IAAA;;IACzB,MAAMA,KAAN;;IADyB,kCAKa,IALb;;IAAA,0CAMmB,EANnB;;IAAA,kCAOU,EAPV;;IAAA,iCAQQ,IARR;;IAAA,iDASNV,KAAK,CAACW,SAAN,EATM;;IAAA;;IAAA,yCAWD,CAXC;;IAAA,mCAYP,CAZO;;IAAA,+BAcT,CAdS;;IAAA,gCAeR,CAfQ;;IAEzB,KAAKC,KAAL,kBAAaF,KAAK,CAACG,IAAnB,qDAA2B,SAA3B;EACD;;EAcOC,cAAc,GAAG;IACvB,KAAKC,gBAAL,CAAsBC,OAAtB,CAA+BC,CAAD,IAAOA,CAAC,EAAtC;;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KAAKT,kBAAL,CAAwB3E,SAAS,CAACmF,GAAlC,CAPlB;MAQE,YAAY,EAAE,KAAKR,kBAAL,CAAwB3E,SAAS,CAACmF,GAAlC;IARhB,EADF,CADF;EAcD;;AAvK+B"}
|
1
|
+
{"version":3,"names":["React","PixelRatio","View","JsiSkSurface","TouchType","pd","get","SkiaBaseWebView","Component","constructor","props","createRef","_mode","mode","unsubscribeAll","_unsubscriptions","forEach","u","onLayout","evt","CanvasKit","global","width","height","nativeEvent","layout","_canvasRef","current","canvas","surface","MakeWebGLCanvasSurface","Error","_surface","_canvas","getCanvas","redraw","getSize","componentDidMount","tick","componentDidUpdate","componentWillUnmount","cancelAnimationFrame","requestId","makeImageSnapshot","rect","clear","TRANSPARENT","renderInCanvas","ref","flush","_redrawRequests","touches","_touches","Float32Array","of","save","scale","restore","requestAnimationFrame","bind","setDrawMode","registerValues","_values","v","push","addListener","handleTouchEvent","touchType","id","pointerId","x","clientX","currentTarget","getClientRects","left","y","clientY","top","force","pressure","type","timestamp","Date","now","createTouchHandler","render","debug","viewProps","display","flex","Start","Active","End","Cancelled"],"sources":["SkiaBaseWebView.tsx"],"sourcesContent":["/* global HTMLCanvasElement */\nimport React from \"react\";\nimport type { PointerEvent } from \"react\";\nimport type { LayoutChangeEvent } from \"react-native\";\nimport { PixelRatio, View } from \"react-native\";\n\nimport type { SkRect, SkCanvas } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\nimport { JsiSkSurface } from \"../skia/web/JsiSkSurface\";\n\nimport type { DrawMode, SkiaBaseViewProps, TouchInfo } from \"./types\";\nimport { TouchType } from \"./types\";\n\nconst pd = PixelRatio.get();\n\nexport abstract class SkiaBaseWebView<\n TProps extends SkiaBaseViewProps\n> extends React.Component<TProps> {\n constructor(props: TProps) {\n super(props);\n this._mode = props.mode ?? \"default\";\n }\n\n private _surface: JsiSkSurface | null = null;\n private _unsubscriptions: Array<() => void> = [];\n private _touches: Array<TouchInfo> = [];\n private _canvas: SkCanvas | null = null;\n private _canvasRef = React.createRef<HTMLCanvasElement>();\n private _mode: DrawMode;\n private _redrawRequests = 0;\n private requestId = 0;\n\n protected width = 0;\n protected height = 0;\n\n private unsubscribeAll() {\n this._unsubscriptions.forEach((u) => u());\n this._unsubscriptions = [];\n }\n\n private onLayout(evt: LayoutChangeEvent) {\n const { CanvasKit } = global;\n const { width, height } = evt.nativeEvent.layout;\n this.width = width;\n this.height = height;\n // Reset canvas / surface on layout change\n if (this._canvasRef.current) {\n const canvas = this._canvasRef.current;\n canvas.width = width * pd;\n canvas.height = height * pd;\n const surface = CanvasKit.MakeWebGLCanvasSurface(this._canvasRef.current);\n if (!surface) {\n throw new Error(\"Could not create surface\");\n }\n this._surface = new JsiSkSurface(CanvasKit, surface);\n this._canvas = this._surface.getCanvas();\n this.redraw();\n }\n // Call onLayout callback if it exists\n if (this.props.onLayout) {\n this.props.onLayout(evt);\n }\n }\n\n protected getSize() {\n return { width: this.width, height: this.height };\n }\n\n componentDidMount() {\n // Start render loop\n this.tick();\n }\n\n componentDidUpdate() {\n this.redraw();\n }\n\n componentWillUnmount() {\n this.unsubscribeAll();\n cancelAnimationFrame(this.requestId);\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n this._canvas!.clear(CanvasKit.TRANSPARENT);\n this.renderInCanvas(this._canvas!, []);\n this._surface?.ref.flush();\n return this._surface?.makeImageSnapshot(rect);\n }\n\n /**\n * Override to render\n */\n protected abstract renderInCanvas(\n canvas: SkCanvas,\n touches: TouchInfo[]\n ): void;\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n private tick() {\n if (this._mode === \"continuous\" || this._redrawRequests > 0) {\n this._redrawRequests = 0;\n if (this._canvas) {\n const touches = [...this._touches];\n this._touches = [];\n const canvas = this._canvas!;\n canvas.clear(Float32Array.of(0, 0, 0, 0));\n canvas.save();\n canvas.scale(pd, pd);\n this.renderInCanvas(canvas, touches);\n canvas.restore();\n this._surface?.ref.flush();\n }\n }\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n\n public redraw() {\n this._redrawRequests++;\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n this._mode = mode;\n this.tick();\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(_values: SkiaValue<unknown>[]) {\n // Unsubscribe from dependency values\n this.unsubscribeAll();\n // Register redraw dependencies on values\n _values.forEach((v) => {\n this._unsubscriptions.push(\n v.addListener(() => {\n this.redraw();\n })\n );\n });\n }\n\n private handleTouchEvent(evt: PointerEvent, touchType: TouchType) {\n this._touches.push({\n id: evt.pointerId,\n x: evt.clientX - evt.currentTarget.getClientRects()[0].left,\n y: evt.clientY - evt.currentTarget.getClientRects()[0].top,\n force: evt.pressure,\n type: touchType,\n timestamp: Date.now(),\n });\n this.redraw();\n }\n\n createTouchHandler(touchType: TouchType) {\n return (evt: PointerEvent) => this.handleTouchEvent(evt, touchType);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <View {...viewProps} onLayout={this.onLayout.bind(this)}>\n <canvas\n ref={this._canvasRef}\n style={{ display: \"flex\", flex: 1 }}\n onPointerDown={this.createTouchHandler(TouchType.Start)}\n onPointerMove={this.createTouchHandler(TouchType.Active)}\n onPointerUp={this.createTouchHandler(TouchType.End)}\n onPointerCancel={this.createTouchHandler(TouchType.Cancelled)}\n onPointerLeave={this.createTouchHandler(TouchType.End)}\n onPointerOut={this.createTouchHandler(TouchType.End)}\n />\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA;AACA,OAAOA,KAAP,MAAkB,OAAlB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
import { Skia } from "../skia";
|
2
|
+
import { JsiDrawingContext } from "../dom/types/DrawingContext";
|
3
3
|
import { SkiaBaseWebView } from "./SkiaBaseWebView";
|
4
|
-
const pd = PixelRatio.get();
|
5
4
|
export class SkiaDomView extends SkiaBaseWebView {
|
6
5
|
constructor(props) {
|
7
6
|
super(props);
|
@@ -24,16 +23,8 @@ export class SkiaDomView extends SkiaBaseWebView {
|
|
24
23
|
}
|
25
24
|
|
26
25
|
if (this.props.root) {
|
27
|
-
const
|
28
|
-
const ctx = {
|
29
|
-
canvas,
|
30
|
-
paint,
|
31
|
-
opacity: 1
|
32
|
-
};
|
33
|
-
canvas.save();
|
34
|
-
canvas.scale(pd, pd);
|
26
|
+
const ctx = new JsiDrawingContext(Skia, canvas);
|
35
27
|
this.props.root.render(ctx);
|
36
|
-
canvas.restore();
|
37
28
|
}
|
38
29
|
}
|
39
30
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["Skia","JsiDrawingContext","SkiaBaseWebView","SkiaDomView","constructor","props","renderInCanvas","canvas","touches","onTouch","onSize","width","height","getSize","current","root","ctx","render"],"sources":["SkiaDomView.web.tsx"],"sourcesContent":["import { Skia } from \"../skia\";\nimport type { SkCanvas } from \"../skia/types\";\nimport { JsiDrawingContext } from \"../dom/types/DrawingContext\";\n\nimport { SkiaBaseWebView } from \"./SkiaBaseWebView\";\nimport type { SkiaDomViewProps, TouchInfo } from \"./types\";\n\nexport class SkiaDomView extends SkiaBaseWebView<SkiaDomViewProps> {\n constructor(props: SkiaDomViewProps) {\n super(props);\n }\n\n protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void {\n if (this.props.onTouch) {\n this.props.onTouch([touches]);\n }\n if (this.props.onSize) {\n const { width, height } = this.getSize();\n this.props.onSize.current = { width, height };\n }\n if (this.props.root) {\n const ctx = new JsiDrawingContext(Skia, canvas);\n this.props.root.render(ctx);\n }\n }\n}\n"],"mappings":"AAAA,SAASA,IAAT,QAAqB,SAArB;AAEA,SAASC,iBAAT,QAAkC,6BAAlC;AAEA,SAASC,eAAT,QAAgC,mBAAhC;AAGA,OAAO,MAAMC,WAAN,SAA0BD,eAA1B,CAA4D;EACjEE,WAAW,CAACC,KAAD,EAA0B;IACnC,MAAMA,KAAN;EACD;;EAESC,cAAc,CAACC,MAAD,EAAmBC,OAAnB,EAA+C;IACrE,IAAI,KAAKH,KAAL,CAAWI,OAAf,EAAwB;MACtB,KAAKJ,KAAL,CAAWI,OAAX,CAAmB,CAACD,OAAD,CAAnB;IACD;;IACD,IAAI,KAAKH,KAAL,CAAWK,MAAf,EAAuB;MACrB,MAAM;QAAEC,KAAF;QAASC;MAAT,IAAoB,KAAKC,OAAL,EAA1B;MACA,KAAKR,KAAL,CAAWK,MAAX,CAAkBI,OAAlB,GAA4B;QAAEH,KAAF;QAASC;MAAT,CAA5B;IACD;;IACD,IAAI,KAAKP,KAAL,CAAWU,IAAf,EAAqB;MACnB,MAAMC,GAAG,GAAG,IAAIf,iBAAJ,CAAsBD,IAAtB,EAA4BO,MAA5B,CAAZ;MACA,KAAKF,KAAL,CAAWU,IAAX,CAAgBE,MAAhB,CAAuBD,GAAvB;IACD;EACF;;AAjBgE"}
|
@@ -1,6 +1,4 @@
|
|
1
|
-
import { PixelRatio } from "react-native";
|
2
1
|
import { SkiaBaseWebView } from "./SkiaBaseWebView";
|
3
|
-
const pd = PixelRatio.get();
|
4
2
|
export class SkiaPictureView extends SkiaBaseWebView {
|
5
3
|
constructor(props) {
|
6
4
|
super(props);
|
@@ -8,10 +6,7 @@ export class SkiaPictureView extends SkiaBaseWebView {
|
|
8
6
|
|
9
7
|
renderInCanvas(canvas) {
|
10
8
|
if (this.props.picture) {
|
11
|
-
canvas.save();
|
12
|
-
canvas.scale(pd, pd);
|
13
9
|
canvas.drawPicture(this.props.picture);
|
14
|
-
canvas.restore();
|
15
10
|
}
|
16
11
|
}
|
17
12
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["SkiaBaseWebView","SkiaPictureView","constructor","props","renderInCanvas","canvas","picture","drawPicture"],"sources":["SkiaPictureView.web.tsx"],"sourcesContent":["import type { SkCanvas } from \"../skia/types\";\n\nimport type { SkiaPictureViewProps } from \"./types\";\nimport { SkiaBaseWebView } from \"./SkiaBaseWebView\";\n\nexport class SkiaPictureView extends SkiaBaseWebView<SkiaPictureViewProps> {\n constructor(props: SkiaPictureViewProps) {\n super(props);\n }\n\n protected renderInCanvas(canvas: SkCanvas): void {\n if (this.props.picture) {\n canvas.drawPicture(this.props.picture);\n }\n }\n}\n"],"mappings":"AAGA,SAASA,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,eAAN,SAA8BD,eAA9B,CAAoE;EACzEE,WAAW,CAACC,KAAD,EAA8B;IACvC,MAAMA,KAAN;EACD;;EAESC,cAAc,CAACC,MAAD,EAAyB;IAC/C,IAAI,KAAKF,KAAL,CAAWG,OAAf,EAAwB;MACtBD,MAAM,CAACE,WAAP,CAAmB,KAAKJ,KAAL,CAAWG,OAA9B;IACD;EACF;;AATwE"}
|
@@ -1,6 +1,4 @@
|
|
1
|
-
import { PixelRatio } from "react-native";
|
2
1
|
import { SkiaBaseWebView } from "./SkiaBaseWebView";
|
3
|
-
const pd = PixelRatio.get();
|
4
2
|
export class SkiaView extends SkiaBaseWebView {
|
5
3
|
constructor(props) {
|
6
4
|
super(props);
|
@@ -14,10 +12,7 @@ export class SkiaView extends SkiaBaseWebView {
|
|
14
12
|
timestamp: Date.now(),
|
15
13
|
touches: touches.map(t => [t])
|
16
14
|
};
|
17
|
-
canvas.save();
|
18
|
-
canvas.scale(pd, pd);
|
19
15
|
this.props.onDraw(canvas, info);
|
20
|
-
canvas.restore();
|
21
16
|
}
|
22
17
|
}
|
23
18
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["SkiaBaseWebView","SkiaView","constructor","props","renderInCanvas","canvas","touches","onDraw","info","height","width","timestamp","Date","now","map","t"],"sources":["SkiaView.web.tsx"],"sourcesContent":["import type { SkCanvas } from \"../skia/types\";\n\nimport type { DrawingInfo, SkiaDrawViewProps, TouchInfo } from \"./types\";\nimport { SkiaBaseWebView } from \"./SkiaBaseWebView\";\n\nexport class SkiaView extends SkiaBaseWebView<SkiaDrawViewProps> {\n constructor(props: SkiaDrawViewProps) {\n super(props);\n }\n\n protected renderInCanvas(canvas: SkCanvas, touches: TouchInfo[]): void {\n if (this.props.onDraw) {\n const info: DrawingInfo = {\n height: this.height,\n width: this.width,\n timestamp: Date.now(),\n touches: touches.map((t) => [t]),\n };\n this.props.onDraw(canvas, info);\n }\n }\n}\n"],"mappings":"AAGA,SAASA,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,QAAN,SAAuBD,eAAvB,CAA0D;EAC/DE,WAAW,CAACC,KAAD,EAA2B;IACpC,MAAMA,KAAN;EACD;;EAESC,cAAc,CAACC,MAAD,EAAmBC,OAAnB,EAA+C;IACrE,IAAI,KAAKH,KAAL,CAAWI,MAAf,EAAuB;MACrB,MAAMC,IAAiB,GAAG;QACxBC,MAAM,EAAE,KAAKA,MADW;QAExBC,KAAK,EAAE,KAAKA,KAFY;QAGxBC,SAAS,EAAEC,IAAI,CAACC,GAAL,EAHa;QAIxBP,OAAO,EAAEA,OAAO,CAACQ,GAAR,CAAaC,CAAD,IAAO,CAACA,CAAD,CAAnB;MAJe,CAA1B;MAMA,KAAKZ,KAAL,CAAWI,MAAX,CAAkBF,MAAlB,EAA0BG,IAA1B;IACD;EACF;;AAf8D"}
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import type { PathProps, SkDOM, GroupProps, ImageProps, BlurImageFilterProps, MatrixColorFilterProps, CircleProps, BlurMaskFilterProps, LinearGradientProps, PaintProps, ShaderProps, ImageShaderProps, CustomDrawingNodeProps, LineProps, OvalProps, PatchProps, PointsProps, RectProps, RoundedRectProps, VerticesProps, TextProps, DiffRectProps, OffsetImageFilterProps, BlendColorFilterProps, TextPathProps, TextBlobProps, GlyphsProps, TwoPointConicalGradientProps, TurbulenceProps, SweepGradientProps, RadialGradientProps, FractalNoiseProps, ColorProps, PictureProps, ImageSVGProps, LerpColorFilterProps, DrawingNodeProps, BoxProps, BoxShadowProps, ChildrenProps } from "../types";
|
2
2
|
import type { BlendImageFilterProps, BlendProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, RuntimeShaderImageFilterProps } from "../types/ImageFilters";
|
3
3
|
import type { CornerPathEffectProps, DashPathEffectProps, DiscretePathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps } from "../types/PathEffects";
|
4
|
-
import { CornerPathEffectNode, Path1DPathEffectNode, Path2DPathEffectNode, Line2DPathEffectNode, BlendNode } from "./paint";
|
5
4
|
import type { NodeContext } from "./Node";
|
6
5
|
export declare class JsiSkDOM implements SkDOM {
|
7
6
|
private ctx;
|
8
7
|
constructor(ctx: NodeContext);
|
9
8
|
Layer(props?: ChildrenProps): import("../types").RenderNode<ChildrenProps>;
|
10
9
|
Group(props?: GroupProps): import("../types").RenderNode<GroupProps>;
|
11
|
-
Paint(props: PaintProps): import("../types").DeclarationNode<PaintProps
|
10
|
+
Paint(props: PaintProps): import("../types").DeclarationNode<PaintProps>;
|
12
11
|
Fill(props?: DrawingNodeProps): import("../types").RenderNode<PaintProps>;
|
13
12
|
Image(props: ImageProps): import("../types").RenderNode<ImageProps>;
|
14
13
|
Circle(props: CircleProps): import("../types").RenderNode<CircleProps>;
|
@@ -28,38 +27,38 @@ export declare class JsiSkDOM implements SkDOM {
|
|
28
27
|
DiffRect(props: DiffRectProps): import("../types").RenderNode<DiffRectProps>;
|
29
28
|
Picture(props: PictureProps): import("../types").RenderNode<PictureProps>;
|
30
29
|
ImageSVG(props: ImageSVGProps): import("../types").RenderNode<ImageSVGProps>;
|
31
|
-
BlurMaskFilter(props: BlurMaskFilterProps): import("../types").DeclarationNode<BlurMaskFilterProps
|
32
|
-
BlendImageFilter(props: BlendImageFilterProps): import("../types").DeclarationNode<BlendImageFilterProps
|
33
|
-
DropShadowImageFilter(props: DropShadowImageFilterProps): import("../types").DeclarationNode<DropShadowImageFilterProps
|
34
|
-
DisplacementMapImageFilter(props: DisplacementMapImageFilterProps): import("../types").DeclarationNode<DisplacementMapImageFilterProps
|
35
|
-
BlurImageFilter(props: BlurImageFilterProps): import("../types").DeclarationNode<BlurImageFilterProps
|
36
|
-
OffsetImageFilter(props: OffsetImageFilterProps): import("../types").DeclarationNode<OffsetImageFilterProps
|
37
|
-
MorphologyImageFilter(props: MorphologyImageFilterProps): import("../types").DeclarationNode<MorphologyImageFilterProps
|
38
|
-
RuntimeShaderImageFilter(props: RuntimeShaderImageFilterProps): import("../types").DeclarationNode<RuntimeShaderImageFilterProps
|
39
|
-
MatrixColorFilter(props: MatrixColorFilterProps): import("../types").DeclarationNode<MatrixColorFilterProps
|
40
|
-
BlendColorFilter(props: BlendColorFilterProps): import("../types").DeclarationNode<BlendColorFilterProps
|
41
|
-
LumaColorFilter(): import("../types").DeclarationNode<null
|
42
|
-
LinearToSRGBGammaColorFilter(): import("../types").DeclarationNode<null
|
43
|
-
SRGBToLinearGammaColorFilter(): import("../types").DeclarationNode<null
|
44
|
-
LerpColorFilter(props: LerpColorFilterProps): import("../types").DeclarationNode<LerpColorFilterProps
|
45
|
-
Shader(props: ShaderProps): import("../types").DeclarationNode<ShaderProps
|
46
|
-
ImageShader(props: ImageShaderProps): import("../types").DeclarationNode<ImageShaderProps
|
47
|
-
ColorShader(props: ColorProps): import("../types").DeclarationNode<ColorProps
|
48
|
-
SweepGradient(props: SweepGradientProps): import("../types").DeclarationNode<SweepGradientProps
|
49
|
-
Turbulence(props: TurbulenceProps): import("../types").DeclarationNode<TurbulenceProps
|
50
|
-
FractalNoise(props: FractalNoiseProps): import("../types").DeclarationNode<FractalNoiseProps
|
51
|
-
LinearGradient(props: LinearGradientProps): import("../types").DeclarationNode<LinearGradientProps
|
52
|
-
RadialGradient(props: RadialGradientProps): import("../types").DeclarationNode<RadialGradientProps
|
53
|
-
TwoPointConicalGradient(props: TwoPointConicalGradientProps): import("../types").DeclarationNode<TwoPointConicalGradientProps
|
54
|
-
CornerPathEffect(props: CornerPathEffectProps):
|
55
|
-
DiscretePathEffect(props: DiscretePathEffectProps): import("../types").DeclarationNode<DiscretePathEffectProps
|
56
|
-
DashPathEffect(props: DashPathEffectProps): import("../types").DeclarationNode<DashPathEffectProps
|
57
|
-
Path1DPathEffect(props: Path1DPathEffectProps):
|
58
|
-
Path2DPathEffect(props: Path2DPathEffectProps):
|
59
|
-
SumPathEffect(): import("../types").DeclarationNode<null
|
60
|
-
Line2DPathEffect(props: Line2DPathEffectProps):
|
61
|
-
Blend(props: BlendProps):
|
30
|
+
BlurMaskFilter(props: BlurMaskFilterProps): import("../types").DeclarationNode<BlurMaskFilterProps>;
|
31
|
+
BlendImageFilter(props: BlendImageFilterProps): import("../types").DeclarationNode<BlendImageFilterProps>;
|
32
|
+
DropShadowImageFilter(props: DropShadowImageFilterProps): import("../types").DeclarationNode<DropShadowImageFilterProps>;
|
33
|
+
DisplacementMapImageFilter(props: DisplacementMapImageFilterProps): import("../types").DeclarationNode<DisplacementMapImageFilterProps>;
|
34
|
+
BlurImageFilter(props: BlurImageFilterProps): import("../types").DeclarationNode<BlurImageFilterProps>;
|
35
|
+
OffsetImageFilter(props: OffsetImageFilterProps): import("../types").DeclarationNode<OffsetImageFilterProps>;
|
36
|
+
MorphologyImageFilter(props: MorphologyImageFilterProps): import("../types").DeclarationNode<MorphologyImageFilterProps>;
|
37
|
+
RuntimeShaderImageFilter(props: RuntimeShaderImageFilterProps): import("../types").DeclarationNode<RuntimeShaderImageFilterProps>;
|
38
|
+
MatrixColorFilter(props: MatrixColorFilterProps): import("../types").DeclarationNode<MatrixColorFilterProps>;
|
39
|
+
BlendColorFilter(props: BlendColorFilterProps): import("../types").DeclarationNode<BlendColorFilterProps>;
|
40
|
+
LumaColorFilter(): import("../types").DeclarationNode<null>;
|
41
|
+
LinearToSRGBGammaColorFilter(): import("../types").DeclarationNode<null>;
|
42
|
+
SRGBToLinearGammaColorFilter(): import("../types").DeclarationNode<null>;
|
43
|
+
LerpColorFilter(props: LerpColorFilterProps): import("../types").DeclarationNode<LerpColorFilterProps>;
|
44
|
+
Shader(props: ShaderProps): import("../types").DeclarationNode<ShaderProps>;
|
45
|
+
ImageShader(props: ImageShaderProps): import("../types").DeclarationNode<ImageShaderProps>;
|
46
|
+
ColorShader(props: ColorProps): import("../types").DeclarationNode<ColorProps>;
|
47
|
+
SweepGradient(props: SweepGradientProps): import("../types").DeclarationNode<SweepGradientProps>;
|
48
|
+
Turbulence(props: TurbulenceProps): import("../types").DeclarationNode<TurbulenceProps>;
|
49
|
+
FractalNoise(props: FractalNoiseProps): import("../types").DeclarationNode<FractalNoiseProps>;
|
50
|
+
LinearGradient(props: LinearGradientProps): import("../types").DeclarationNode<LinearGradientProps>;
|
51
|
+
RadialGradient(props: RadialGradientProps): import("../types").DeclarationNode<RadialGradientProps>;
|
52
|
+
TwoPointConicalGradient(props: TwoPointConicalGradientProps): import("../types").DeclarationNode<TwoPointConicalGradientProps>;
|
53
|
+
CornerPathEffect(props: CornerPathEffectProps): import("../types").DeclarationNode<CornerPathEffectProps>;
|
54
|
+
DiscretePathEffect(props: DiscretePathEffectProps): import("../types").DeclarationNode<DiscretePathEffectProps>;
|
55
|
+
DashPathEffect(props: DashPathEffectProps): import("../types").DeclarationNode<DashPathEffectProps>;
|
56
|
+
Path1DPathEffect(props: Path1DPathEffectProps): import("../types").DeclarationNode<Path1DPathEffectProps>;
|
57
|
+
Path2DPathEffect(props: Path2DPathEffectProps): import("../types").DeclarationNode<Path2DPathEffectProps>;
|
58
|
+
SumPathEffect(): import("../types").DeclarationNode<null>;
|
59
|
+
Line2DPathEffect(props: Line2DPathEffectProps): import("../types").DeclarationNode<Line2DPathEffectProps>;
|
60
|
+
Blend(props: BlendProps): import("../types").DeclarationNode<BlendProps>;
|
62
61
|
BackdropFilter(props: ChildrenProps): import("../types").RenderNode<ChildrenProps>;
|
63
62
|
Box(props: BoxProps): import("../types").RenderNode<BoxProps>;
|
64
|
-
BoxShadow(props: BoxShadowProps): import("../types").DeclarationNode<BoxShadowProps
|
63
|
+
BoxShadow(props: BoxShadowProps): import("../types").DeclarationNode<BoxShadowProps>;
|
65
64
|
}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import type {
|
2
|
-
import type { Node, DeclarationNode, NodeType } from "../types";
|
3
|
-
import { DeclarationType } from "../types";
|
1
|
+
import type { Skia } from "../../skia/types";
|
2
|
+
import type { Node, DeclarationNode, NodeType, DeclarationType } from "../types";
|
4
3
|
import type { DependencyManager } from "../../renderer/DependencyManager";
|
4
|
+
import type { DeclarationContext } from "../types/DeclarationContext";
|
5
5
|
export interface NodeContext {
|
6
6
|
Skia: Skia;
|
7
7
|
depMgr: DependencyManager;
|
@@ -23,21 +23,16 @@ export declare abstract class JsiNode<P> implements Node<P> {
|
|
23
23
|
insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;
|
24
24
|
}
|
25
25
|
export declare type Invalidate = () => void;
|
26
|
-
export declare abstract class JsiDeclarationNode<P
|
26
|
+
export declare abstract class JsiDeclarationNode<P> extends JsiNode<P> implements DeclarationNode<P> {
|
27
27
|
declarationType: DeclarationType;
|
28
28
|
private invalidate;
|
29
29
|
constructor(ctx: NodeContext, declarationType: DeclarationType, type: NodeType, props: P);
|
30
|
-
abstract
|
30
|
+
abstract decorate(ctx: DeclarationContext): void;
|
31
|
+
protected decorateChildren(ctx: DeclarationContext): void;
|
31
32
|
addChild(child: Node<unknown>): void;
|
32
33
|
insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;
|
33
34
|
dispose(): void;
|
34
35
|
setInvalidate(invalidate: Invalidate): void;
|
35
36
|
setProps(props: P): void;
|
36
37
|
setProp<K extends keyof P>(name: K, v: P[K]): boolean;
|
37
|
-
isPaint(): this is DeclarationNode<unknown, SkPaint>;
|
38
|
-
isImageFilter(): this is DeclarationNode<unknown, SkImageFilter>;
|
39
|
-
isColorFilter(): this is DeclarationNode<unknown, SkColorFilter>;
|
40
|
-
isShader(): this is DeclarationNode<unknown, SkShader>;
|
41
|
-
isMaskFilter(): this is DeclarationNode<unknown, SkMaskFilter>;
|
42
|
-
isPathEffect(): this is DeclarationNode<unknown, SkPathEffect>;
|
43
38
|
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import type { SkPaint } from "../../skia/types";
|
2
1
|
import type { DeclarationNode, PaintProps } from "../types";
|
2
|
+
import type { DeclarationContext } from "../types/DeclarationContext";
|
3
3
|
import type { NodeContext } from "./Node";
|
4
4
|
import { JsiDeclarationNode } from "./Node";
|
5
|
-
export declare class PaintNode extends JsiDeclarationNode<PaintProps
|
5
|
+
export declare class PaintNode extends JsiDeclarationNode<PaintProps> implements DeclarationNode<PaintProps> {
|
6
6
|
constructor(ctx: NodeContext, props?: PaintProps);
|
7
|
-
|
7
|
+
decorate(ctx: DeclarationContext): void;
|
8
8
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { SkMatrix, SkRect, SkRRect, SkPath, SkPaint } from "../../skia/types";
|
2
|
-
import type { RenderNode, GroupProps,
|
2
|
+
import type { RenderNode, GroupProps, NodeType, Node, DrawingContext } from "../types";
|
3
3
|
import type { NodeContext } from "./Node";
|
4
4
|
import { JsiNode } from "./Node";
|
5
5
|
interface PaintCache {
|
@@ -20,8 +20,7 @@ export declare abstract class JsiRenderNode<P extends GroupProps> extends JsiNod
|
|
20
20
|
insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;
|
21
21
|
private computeClip;
|
22
22
|
private computeMatrix;
|
23
|
-
|
24
|
-
render(parentCtx: DrawingContext): void;
|
23
|
+
render(ctx: DrawingContext): void;
|
25
24
|
abstract renderNode(ctx: DrawingContext): void;
|
26
25
|
}
|
27
26
|
export {};
|
@@ -4,5 +4,5 @@ import type { NodeContext } from "../Node";
|
|
4
4
|
export declare class BackdropFilterNode extends JsiDrawingNode<ChildrenProps, null> {
|
5
5
|
constructor(ctx: NodeContext, props: ChildrenProps);
|
6
6
|
protected deriveProps(): null;
|
7
|
-
draw({ canvas }: DrawingContext): void;
|
7
|
+
draw({ canvas, declarationCtx }: DrawingContext): void;
|
8
8
|
}
|
@@ -3,8 +3,10 @@ import type { BoxShadowProps, BoxProps } from "../../types/Drawings";
|
|
3
3
|
import type { NodeContext } from "../Node";
|
4
4
|
import { JsiDeclarationNode } from "../Node";
|
5
5
|
import { JsiRenderNode } from "../RenderNode";
|
6
|
-
|
6
|
+
import type { DeclarationContext } from "../../types/DeclarationContext";
|
7
|
+
export declare class BoxShadowNode extends JsiDeclarationNode<BoxShadowProps> {
|
7
8
|
constructor(ctx: NodeContext, props: BoxShadowProps);
|
9
|
+
decorate(_ctx: DeclarationContext): void;
|
8
10
|
materialize(): BoxShadowProps;
|
9
11
|
}
|
10
12
|
export declare class BoxNode extends JsiRenderNode<BoxProps> {
|
@@ -1,12 +1,8 @@
|
|
1
1
|
import type { BlendProps } from "../../types/ImageFilters";
|
2
|
-
import type { SkShader, SkImageFilter } from "../../../skia/types";
|
3
2
|
import type { NodeContext } from "../Node";
|
4
3
|
import { JsiDeclarationNode } from "../Node";
|
5
|
-
import type {
|
6
|
-
export declare class BlendNode extends JsiDeclarationNode<BlendProps
|
4
|
+
import type { DeclarationContext } from "../../types/DeclarationContext";
|
5
|
+
export declare class BlendNode extends JsiDeclarationNode<BlendProps> {
|
7
6
|
constructor(ctx: NodeContext, props: BlendProps);
|
8
|
-
|
9
|
-
addChild(child: Node<unknown>): void;
|
10
|
-
insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;
|
11
|
-
materialize(): SkImageFilter | SkShader;
|
7
|
+
decorate(ctx: DeclarationContext): void;
|
12
8
|
}
|
@@ -1,36 +1,35 @@
|
|
1
1
|
import type { SkColorFilter } from "../../../skia/types";
|
2
2
|
import type { NodeContext } from "../Node";
|
3
3
|
import { JsiDeclarationNode } from "../Node";
|
4
|
-
import type { BlendColorFilterProps, MatrixColorFilterProps
|
4
|
+
import type { BlendColorFilterProps, MatrixColorFilterProps } from "../../types";
|
5
5
|
import { NodeType } from "../../types";
|
6
6
|
import type { LerpColorFilterProps } from "../../types/ColorFilters";
|
7
|
-
|
7
|
+
import type { DeclarationContext } from "../../types/DeclarationContext";
|
8
|
+
export declare abstract class ColorFilterDeclaration<P> extends JsiDeclarationNode<P> {
|
8
9
|
constructor(ctx: NodeContext, type: NodeType, props: P);
|
9
|
-
|
10
|
-
insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;
|
11
|
-
compose(filter: SkColorFilter): SkColorFilter;
|
10
|
+
protected composeAndPush(ctx: DeclarationContext, cf1: SkColorFilter): void;
|
12
11
|
}
|
13
12
|
export declare class MatrixColorFilterNode extends ColorFilterDeclaration<MatrixColorFilterProps> {
|
14
13
|
constructor(ctx: NodeContext, props: MatrixColorFilterProps);
|
15
|
-
|
14
|
+
decorate(ctx: DeclarationContext): void;
|
16
15
|
}
|
17
16
|
export declare class BlendColorFilterNode extends ColorFilterDeclaration<BlendColorFilterProps> {
|
18
17
|
constructor(ctx: NodeContext, props: BlendColorFilterProps);
|
19
|
-
|
18
|
+
decorate(ctx: DeclarationContext): void;
|
20
19
|
}
|
21
20
|
export declare class LinearToSRGBGammaColorFilterNode extends ColorFilterDeclaration<null> {
|
22
21
|
constructor(ctx: NodeContext);
|
23
|
-
|
22
|
+
decorate(ctx: DeclarationContext): void;
|
24
23
|
}
|
25
24
|
export declare class SRGBToLinearGammaColorFilterNode extends ColorFilterDeclaration<null> {
|
26
25
|
constructor(ctx: NodeContext);
|
27
|
-
|
26
|
+
decorate(ctx: DeclarationContext): void;
|
28
27
|
}
|
29
28
|
export declare class LumaColorFilterNode extends ColorFilterDeclaration<null> {
|
30
29
|
constructor(ctx: NodeContext);
|
31
|
-
|
30
|
+
decorate(ctx: DeclarationContext): void;
|
32
31
|
}
|
33
32
|
export declare class LerpColorFilterNode extends ColorFilterDeclaration<LerpColorFilterProps> {
|
34
33
|
constructor(ctx: NodeContext, props: LerpColorFilterProps);
|
35
|
-
|
34
|
+
decorate(ctx: DeclarationContext): void;
|
36
35
|
}
|
@@ -1,28 +1,28 @@
|
|
1
1
|
import type { SkImageFilter } from "../../../skia/types";
|
2
|
-
import type { BlendImageFilterProps, BlurImageFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps } from "../../types";
|
2
|
+
import type { BlendImageFilterProps, BlurImageFilterProps, DeclarationContext, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps } from "../../types";
|
3
3
|
import { NodeType } from "../../types";
|
4
4
|
import type { NodeContext } from "../Node";
|
5
5
|
import { JsiDeclarationNode } from "../Node";
|
6
|
-
export declare abstract class ImageFilterDeclaration<P
|
6
|
+
export declare abstract class ImageFilterDeclaration<P> extends JsiDeclarationNode<P> {
|
7
7
|
constructor(ctx: NodeContext, type: NodeType, props: P);
|
8
|
-
|
9
|
-
|
8
|
+
protected input(ctx: DeclarationContext): SkImageFilter | null;
|
9
|
+
protected composeAndPush(ctx: DeclarationContext, imgf1: SkImageFilter): void;
|
10
10
|
}
|
11
11
|
export declare class OffsetImageFilterNode extends ImageFilterDeclaration<OffsetImageFilterProps> {
|
12
12
|
constructor(ctx: NodeContext, props: OffsetImageFilterProps);
|
13
|
-
|
13
|
+
decorate(ctx: DeclarationContext): void;
|
14
14
|
}
|
15
15
|
export declare class DisplacementMapImageFilterNode extends ImageFilterDeclaration<DisplacementMapImageFilterProps> {
|
16
16
|
constructor(ctx: NodeContext, props: DisplacementMapImageFilterProps);
|
17
|
-
|
17
|
+
decorate(ctx: DeclarationContext): void;
|
18
18
|
}
|
19
19
|
export declare class BlurImageFilterNode extends ImageFilterDeclaration<BlurImageFilterProps> {
|
20
20
|
constructor(ctx: NodeContext, props: BlurImageFilterProps);
|
21
|
-
|
21
|
+
decorate(ctx: DeclarationContext): void;
|
22
22
|
}
|
23
23
|
export declare class DropShadowImageFilterNode extends ImageFilterDeclaration<DropShadowImageFilterProps> {
|
24
24
|
constructor(ctx: NodeContext, props: DropShadowImageFilterProps);
|
25
|
-
|
25
|
+
decorate(ctx: DeclarationContext): void;
|
26
26
|
}
|
27
27
|
export declare enum MorphologyOperator {
|
28
28
|
Erode = 0,
|
@@ -30,13 +30,13 @@ export declare enum MorphologyOperator {
|
|
30
30
|
}
|
31
31
|
export declare class MorphologyImageFilterNode extends ImageFilterDeclaration<MorphologyImageFilterProps> {
|
32
32
|
constructor(ctx: NodeContext, props: MorphologyImageFilterProps);
|
33
|
-
|
33
|
+
decorate(ctx: DeclarationContext): void;
|
34
34
|
}
|
35
35
|
export declare class BlendImageFilterNode extends ImageFilterDeclaration<BlendImageFilterProps> {
|
36
36
|
constructor(ctx: NodeContext, props: BlendImageFilterProps);
|
37
|
-
|
37
|
+
decorate(ctx: DeclarationContext): void;
|
38
38
|
}
|
39
39
|
export declare class RuntimeShaderImageFilterNode extends ImageFilterDeclaration<RuntimeShaderImageFilterProps> {
|
40
40
|
constructor(ctx: NodeContext, props: RuntimeShaderImageFilterProps);
|
41
|
-
|
41
|
+
decorate(ctx: DeclarationContext): void;
|
42
42
|
}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import type { SkMaskFilter } from "../../../skia/types";
|
2
1
|
import type { NodeContext } from "../Node";
|
3
2
|
import { JsiDeclarationNode } from "../Node";
|
4
3
|
import type { BlurMaskFilterProps } from "../../types";
|
5
|
-
|
4
|
+
import type { DeclarationContext } from "../../types/DeclarationContext";
|
5
|
+
export declare class BlurMaskFilterNode extends JsiDeclarationNode<BlurMaskFilterProps> {
|
6
6
|
constructor(ctx: NodeContext, props: BlurMaskFilterProps);
|
7
|
-
|
7
|
+
decorate(ctx: DeclarationContext): void;
|
8
8
|
}
|
@@ -1,42 +1,39 @@
|
|
1
1
|
import type { SkPathEffect } from "../../../skia/types";
|
2
2
|
import type { NodeContext } from "../Node";
|
3
3
|
import { JsiDeclarationNode } from "../Node";
|
4
|
-
import type { CornerPathEffectProps, DashPathEffectProps, DiscretePathEffectProps, Line2DPathEffectProps,
|
4
|
+
import type { CornerPathEffectProps, DashPathEffectProps, DiscretePathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps } from "../../types";
|
5
5
|
import { NodeType } from "../../types";
|
6
|
-
|
6
|
+
import type { DeclarationContext } from "../../types/DeclarationContext";
|
7
|
+
declare abstract class PathEffectDeclaration<P> extends JsiDeclarationNode<P> {
|
7
8
|
constructor(ctx: NodeContext, type: NodeType, props: P);
|
8
|
-
|
9
|
-
insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;
|
10
|
-
compose(pe: SkPathEffect): SkPathEffect;
|
11
|
-
getOptionalChildInstance(index: number): any;
|
12
|
-
getMandatoryChildInstance(index: number): any;
|
9
|
+
protected composeAndPush(ctx: DeclarationContext, pe1: SkPathEffect): void;
|
13
10
|
}
|
14
11
|
export declare class DiscretePathEffectNode extends PathEffectDeclaration<DiscretePathEffectProps> {
|
15
12
|
constructor(ctx: NodeContext, props: DiscretePathEffectProps);
|
16
|
-
|
13
|
+
decorate(ctx: DeclarationContext): void;
|
17
14
|
}
|
18
|
-
export declare class Path2DPathEffectNode extends PathEffectDeclaration<Path2DPathEffectProps
|
15
|
+
export declare class Path2DPathEffectNode extends PathEffectDeclaration<Path2DPathEffectProps> {
|
19
16
|
constructor(ctx: NodeContext, props: Path2DPathEffectProps);
|
20
|
-
|
17
|
+
decorate(ctx: DeclarationContext): void;
|
21
18
|
}
|
22
19
|
export declare class DashPathEffectNode extends PathEffectDeclaration<DashPathEffectProps> {
|
23
20
|
constructor(ctx: NodeContext, props: DashPathEffectProps);
|
24
|
-
|
21
|
+
decorate(ctx: DeclarationContext): void;
|
25
22
|
}
|
26
|
-
export declare class CornerPathEffectNode extends PathEffectDeclaration<CornerPathEffectProps
|
23
|
+
export declare class CornerPathEffectNode extends PathEffectDeclaration<CornerPathEffectProps> {
|
27
24
|
constructor(ctx: NodeContext, props: CornerPathEffectProps);
|
28
|
-
|
25
|
+
decorate(ctx: DeclarationContext): void;
|
29
26
|
}
|
30
27
|
export declare class SumPathEffectNode extends PathEffectDeclaration<null> {
|
31
28
|
constructor(ctx: NodeContext);
|
32
|
-
|
29
|
+
decorate(ctx: DeclarationContext): void;
|
33
30
|
}
|
34
|
-
export declare class Line2DPathEffectNode extends PathEffectDeclaration<Line2DPathEffectProps
|
31
|
+
export declare class Line2DPathEffectNode extends PathEffectDeclaration<Line2DPathEffectProps> {
|
35
32
|
constructor(ctx: NodeContext, props: Line2DPathEffectProps);
|
36
|
-
|
33
|
+
decorate(ctx: DeclarationContext): void;
|
37
34
|
}
|
38
|
-
export declare class Path1DPathEffectNode extends PathEffectDeclaration<Path1DPathEffectProps
|
35
|
+
export declare class Path1DPathEffectNode extends PathEffectDeclaration<Path1DPathEffectProps> {
|
39
36
|
constructor(ctx: NodeContext, props: Path1DPathEffectProps);
|
40
|
-
|
37
|
+
decorate(ctx: DeclarationContext): void;
|
41
38
|
}
|
42
39
|
export {};
|