@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
@@ -23,84 +23,48 @@
|
|
23
23
|
|
24
24
|
namespace RNSkia {
|
25
25
|
|
26
|
-
class
|
27
|
-
: public JsiDomDeclarationNode<JsiBaseShaderNode, sk_sp<SkShader>> {
|
28
|
-
public:
|
29
|
-
JsiBaseShaderNode(std::shared_ptr<RNSkPlatformContext> context,
|
30
|
-
const char *type)
|
31
|
-
: JsiDomDeclarationNode<JsiBaseShaderNode, sk_sp<SkShader>>(context,
|
32
|
-
type) {}
|
33
|
-
|
34
|
-
protected:
|
35
|
-
sk_sp<SkShader> resolve(std::shared_ptr<JsiDomNode> child) override {
|
36
|
-
auto ptr = std::dynamic_pointer_cast<JsiBaseShaderNode>(child);
|
37
|
-
if (ptr) {
|
38
|
-
return ptr->getCurrent();
|
39
|
-
}
|
40
|
-
return nullptr;
|
41
|
-
}
|
42
|
-
|
43
|
-
void setShader(DrawingContext *context, sk_sp<SkShader> f) {
|
44
|
-
set(context, f);
|
45
|
-
}
|
46
|
-
|
47
|
-
void set(DrawingContext *context, sk_sp<SkShader> shader) override {
|
48
|
-
auto paint = context->getMutablePaint();
|
49
|
-
paint->setShader(shader);
|
50
|
-
setCurrent(shader);
|
51
|
-
}
|
52
|
-
};
|
53
|
-
|
54
|
-
class JsiShaderNode : public JsiBaseShaderNode,
|
26
|
+
class JsiShaderNode : public JsiDomDeclarationNode,
|
55
27
|
public JsiDomNodeCtor<JsiShaderNode> {
|
56
28
|
public:
|
57
29
|
explicit JsiShaderNode(std::shared_ptr<RNSkPlatformContext> context)
|
58
|
-
:
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
if (
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
lm.preConcat(*tm);
|
83
|
-
}
|
30
|
+
: JsiDomDeclarationNode(context, "skShader", DeclarationType::Shader) {}
|
31
|
+
|
32
|
+
void decorate(DeclarationContext *context) override {
|
33
|
+
decorateChildren(context);
|
34
|
+
auto source = _sourceProp->value().getAs<JsiSkRuntimeEffect>();
|
35
|
+
if (source == nullptr) {
|
36
|
+
throw std::runtime_error("Expected runtime effect when reading source "
|
37
|
+
"property of RuntimeEffectImageFilter.");
|
38
|
+
}
|
39
|
+
auto uniforms =
|
40
|
+
_uniformsProp->isSet() ? _uniformsProp->getDerivedValue() : nullptr;
|
41
|
+
|
42
|
+
SkMatrix lm;
|
43
|
+
auto tm =
|
44
|
+
_transformProp->isSet() ? _transformProp->getDerivedValue() : nullptr;
|
45
|
+
|
46
|
+
if (tm != nullptr) {
|
47
|
+
if (_originProp->isSet()) {
|
48
|
+
auto tr = _originProp->getDerivedValue();
|
49
|
+
lm.preTranslate(tr->x(), tr->y());
|
50
|
+
lm.preConcat(*tm);
|
51
|
+
lm.preTranslate(-tr->x(), -tr->y());
|
52
|
+
} else {
|
53
|
+
lm.preConcat(*tm);
|
84
54
|
}
|
55
|
+
}
|
85
56
|
|
86
|
-
|
87
|
-
|
88
|
-
children.reserve(getChildren().size());
|
89
|
-
for (auto &child : getChildren()) {
|
90
|
-
auto ptr = std::dynamic_pointer_cast<JsiBaseShaderNode>(child);
|
91
|
-
if (ptr != nullptr) {
|
92
|
-
children.push_back(ptr->getCurrent());
|
93
|
-
}
|
94
|
-
}
|
57
|
+
// get all children that are shader nodes
|
58
|
+
auto children = context->getShaders()->popAll();
|
95
59
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
}
|
60
|
+
// Update shader
|
61
|
+
context->getShaders()->push(source->getObject()->makeShader(
|
62
|
+
uniforms, children.data(), children.size(), &lm));
|
100
63
|
}
|
101
64
|
|
65
|
+
protected:
|
102
66
|
void defineProperties(NodePropsContainer *container) override {
|
103
|
-
|
67
|
+
JsiDomDeclarationNode::defineProperties(container);
|
104
68
|
_sourceProp = container->defineProperty<NodeProp>("source");
|
105
69
|
_uniformsProp =
|
106
70
|
container->defineProperty<UniformsProp>("uniforms", _sourceProp);
|
@@ -117,55 +81,52 @@ private:
|
|
117
81
|
PointProp *_originProp;
|
118
82
|
};
|
119
83
|
|
120
|
-
class JsiImageShaderNode : public
|
84
|
+
class JsiImageShaderNode : public JsiDomDeclarationNode,
|
121
85
|
public JsiDomNodeCtor<JsiImageShaderNode> {
|
122
86
|
public:
|
123
87
|
explicit JsiImageShaderNode(std::shared_ptr<RNSkPlatformContext> context)
|
124
|
-
:
|
125
|
-
|
126
|
-
|
127
|
-
void decorate(
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
}
|
88
|
+
: JsiDomDeclarationNode(context, "skImageShader",
|
89
|
+
DeclarationType::Shader) {}
|
90
|
+
|
91
|
+
void decorate(DeclarationContext *context) override {
|
92
|
+
|
93
|
+
auto image = _imageProps->getImage();
|
94
|
+
auto rect = _imageProps->getRect();
|
95
|
+
auto lm =
|
96
|
+
_transformProp->isSet() ? _transformProp->getDerivedValue() : nullptr;
|
97
|
+
|
98
|
+
if (rect != nullptr && lm != nullptr) {
|
99
|
+
auto rc = _imageProps->getDerivedValue();
|
100
|
+
auto m3 = _imageProps->rect2rect(rc->src, rc->dst);
|
101
|
+
if (_transformProp->isChanged()) {
|
102
|
+
// To modify the matrix we need to copy it since we're not allowed to
|
103
|
+
// modify values contained in properties - this would have caused the
|
104
|
+
// matrix to be translated and scaled more and more for each render
|
105
|
+
// even thought the matrix prop did not change.
|
106
|
+
_matrix.reset();
|
107
|
+
_matrix.preConcat(m3);
|
108
|
+
if (_originProp->isSet()) {
|
109
|
+
auto tr = _originProp->getDerivedValue();
|
110
|
+
_matrix.preTranslate(tr->x(), tr->y());
|
111
|
+
_matrix.preConcat(*lm);
|
112
|
+
_matrix.preTranslate(-tr->x(), -tr->y());
|
113
|
+
} else {
|
114
|
+
_matrix.preConcat(*lm);
|
152
115
|
}
|
153
116
|
}
|
154
|
-
|
155
|
-
setShader(
|
156
|
-
context,
|
157
|
-
image->makeShader(
|
158
|
-
*_txProp->getDerivedValue(), *_tyProp->getDerivedValue(),
|
159
|
-
SkSamplingOptions(getFilterModeFromString(
|
160
|
-
_filterModeProp->value().getAsString()),
|
161
|
-
getMipmapModeFromString(
|
162
|
-
_mipmapModeProp->value().getAsString())),
|
163
|
-
&_matrix));
|
164
117
|
}
|
118
|
+
|
119
|
+
context->getShaders()->push(image->makeShader(
|
120
|
+
*_txProp->getDerivedValue(), *_tyProp->getDerivedValue(),
|
121
|
+
SkSamplingOptions(
|
122
|
+
getFilterModeFromString(_filterModeProp->value().getAsString()),
|
123
|
+
getMipmapModeFromString(_mipmapModeProp->value().getAsString())),
|
124
|
+
&_matrix));
|
165
125
|
}
|
166
126
|
|
127
|
+
protected:
|
167
128
|
void defineProperties(NodePropsContainer *container) override {
|
168
|
-
|
129
|
+
JsiDomDeclarationNode::defineProperties(container);
|
169
130
|
_txProp = container->defineProperty<TileModeProp>("tx");
|
170
131
|
_tyProp = container->defineProperty<TileModeProp>("ty");
|
171
132
|
_filterModeProp = container->defineProperty<NodeProp>("fm");
|
@@ -224,25 +185,23 @@ private:
|
|
224
185
|
PointProp *_originProp;
|
225
186
|
};
|
226
187
|
|
227
|
-
class JsiColorShaderNode : public
|
188
|
+
class JsiColorShaderNode : public JsiDomDeclarationNode,
|
228
189
|
public JsiDomNodeCtor<JsiColorShaderNode> {
|
229
190
|
public:
|
230
191
|
explicit JsiColorShaderNode(std::shared_ptr<RNSkPlatformContext> context)
|
231
|
-
:
|
192
|
+
: JsiDomDeclarationNode(context, "skColorShader",
|
193
|
+
DeclarationType::Shader) {}
|
232
194
|
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
setShader(context, SkShaders::Color(*_colorProp->getDerivedValue()));
|
238
|
-
} else {
|
239
|
-
setShader(context, nullptr);
|
240
|
-
}
|
195
|
+
void decorate(DeclarationContext *context) override {
|
196
|
+
if (_colorProp->isSet()) {
|
197
|
+
context->getShaders()->push(
|
198
|
+
SkShaders::Color(*_colorProp->getDerivedValue()));
|
241
199
|
}
|
242
200
|
}
|
243
201
|
|
202
|
+
protected:
|
244
203
|
void defineProperties(NodePropsContainer *container) override {
|
245
|
-
|
204
|
+
JsiDomDeclarationNode::defineProperties(container);
|
246
205
|
_colorProp = container->defineProperty<ColorProp>("color");
|
247
206
|
_colorProp->require();
|
248
207
|
}
|
@@ -251,15 +210,14 @@ private:
|
|
251
210
|
ColorProp *_colorProp;
|
252
211
|
};
|
253
212
|
|
254
|
-
class JsiBasePerlinNoiseNode : public
|
213
|
+
class JsiBasePerlinNoiseNode : public JsiDomDeclarationNode {
|
255
214
|
public:
|
256
215
|
JsiBasePerlinNoiseNode(std::shared_ptr<RNSkPlatformContext> context,
|
257
216
|
PropId type)
|
258
|
-
:
|
217
|
+
: JsiDomDeclarationNode(context, type, DeclarationType::Shader) {}
|
259
218
|
|
260
|
-
protected:
|
261
219
|
void defineProperties(NodePropsContainer *container) override {
|
262
|
-
|
220
|
+
JsiDomDeclarationNode::defineProperties(container);
|
263
221
|
_freqXProp = container->defineProperty<NodeProp>("freqX");
|
264
222
|
_freqYProp = container->defineProperty<NodeProp>("freqY");
|
265
223
|
_octavesProp = container->defineProperty<NodeProp>("octaves");
|
@@ -289,18 +247,15 @@ public:
|
|
289
247
|
explicit JsiTurbulenceNode(std::shared_ptr<RNSkPlatformContext> context)
|
290
248
|
: JsiBasePerlinNoiseNode(context, "skTurbulence") {}
|
291
249
|
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
_octavesProp->value().getAsNumber(),
|
302
|
-
_seedProp->value().getAsNumber(), &size));
|
303
|
-
}
|
250
|
+
void decorate(DeclarationContext *context) override {
|
251
|
+
|
252
|
+
SkISize size = SkISize::Make(_tileWidthProp->value().getAsNumber(),
|
253
|
+
_tileHeightProp->value().getAsNumber());
|
254
|
+
|
255
|
+
context->getShaders()->push(SkPerlinNoiseShader::MakeTurbulence(
|
256
|
+
_freqXProp->value().getAsNumber(), _freqYProp->value().getAsNumber(),
|
257
|
+
_octavesProp->value().getAsNumber(), _seedProp->value().getAsNumber(),
|
258
|
+
&size));
|
304
259
|
}
|
305
260
|
};
|
306
261
|
|
@@ -310,28 +265,41 @@ public:
|
|
310
265
|
explicit JsiFractalNoiseNode(std::shared_ptr<RNSkPlatformContext> context)
|
311
266
|
: JsiBasePerlinNoiseNode(context, "skFractalNoise") {}
|
312
267
|
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
_octavesProp->value().getAsNumber(),
|
323
|
-
_seedProp->value().getAsNumber(), &size));
|
324
|
-
}
|
268
|
+
void decorate(DeclarationContext *context) override {
|
269
|
+
|
270
|
+
SkISize size = SkISize::Make(_tileWidthProp->value().getAsNumber(),
|
271
|
+
_tileHeightProp->value().getAsNumber());
|
272
|
+
|
273
|
+
context->getShaders()->push(SkPerlinNoiseShader::MakeFractalNoise(
|
274
|
+
_freqXProp->value().getAsNumber(), _freqYProp->value().getAsNumber(),
|
275
|
+
_octavesProp->value().getAsNumber(), _seedProp->value().getAsNumber(),
|
276
|
+
&size));
|
325
277
|
}
|
326
278
|
};
|
327
279
|
|
328
|
-
class JsiBaseGradientNode : public
|
280
|
+
class JsiBaseGradientNode : public JsiDomDeclarationNode {
|
329
281
|
public:
|
330
282
|
JsiBaseGradientNode(std::shared_ptr<RNSkPlatformContext> context, PropId type)
|
331
|
-
:
|
283
|
+
: JsiDomDeclarationNode(context, type, DeclarationType::Shader) {}
|
284
|
+
|
285
|
+
void decorate(DeclarationContext *context) override {
|
286
|
+
|
287
|
+
_colors = _colorsProp->getDerivedValue()->data();
|
288
|
+
_colorCount = static_cast<int>(_colorsProp->getDerivedValue()->size());
|
289
|
+
_flags = _flagsProp->isSet() ? _flagsProp->value().getAsNumber() : 0;
|
290
|
+
_mode =
|
291
|
+
_modeProp->isSet() ? *_modeProp->getDerivedValue() : SkTileMode::kClamp;
|
292
|
+
_positions = _positionsProp->isSet()
|
293
|
+
? _positionsProp->getDerivedValue()->data()
|
294
|
+
: nullptr;
|
295
|
+
_matrix = _transformsProps->isSet()
|
296
|
+
? _transformsProps->getDerivedValue().get()
|
297
|
+
: nullptr;
|
298
|
+
}
|
332
299
|
|
300
|
+
protected:
|
333
301
|
void defineProperties(NodePropsContainer *container) override {
|
334
|
-
|
302
|
+
JsiDomDeclarationNode::defineProperties(container);
|
335
303
|
_transformsProps = container->defineProperty<TransformsProps>();
|
336
304
|
|
337
305
|
_colorsProp = container->defineProperty<ColorsProp>("colors");
|
@@ -342,23 +310,6 @@ public:
|
|
342
310
|
_colorsProp->require();
|
343
311
|
}
|
344
312
|
|
345
|
-
protected:
|
346
|
-
void decorate(DrawingContext *context) override {
|
347
|
-
if (isChanged(context)) {
|
348
|
-
_colors = _colorsProp->getDerivedValue()->data();
|
349
|
-
_colorCount = static_cast<int>(_colorsProp->getDerivedValue()->size());
|
350
|
-
_flags = _flagsProp->isSet() ? _flagsProp->value().getAsNumber() : 0;
|
351
|
-
_mode = _modeProp->isSet() ? *_modeProp->getDerivedValue()
|
352
|
-
: SkTileMode::kClamp;
|
353
|
-
_positions = _positionsProp->isSet()
|
354
|
-
? _positionsProp->getDerivedValue()->data()
|
355
|
-
: nullptr;
|
356
|
-
_matrix = _transformsProps->isSet()
|
357
|
-
? _transformsProps->getDerivedValue().get()
|
358
|
-
: nullptr;
|
359
|
-
}
|
360
|
-
}
|
361
|
-
|
362
313
|
const SkColor *_colors;
|
363
314
|
double _flags;
|
364
315
|
int _colorCount;
|
@@ -380,19 +331,17 @@ public:
|
|
380
331
|
explicit JsiLinearGradientNode(std::shared_ptr<RNSkPlatformContext> context)
|
381
332
|
: JsiBaseGradientNode(context, "skLinearGradient") {}
|
382
333
|
|
383
|
-
|
384
|
-
void decorate(DrawingContext *context) override {
|
334
|
+
void decorate(DeclarationContext *context) override {
|
385
335
|
JsiBaseGradientNode::decorate(context);
|
386
336
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
_flags, _matrix));
|
393
|
-
}
|
337
|
+
SkPoint pts[] = {*_startProp->getDerivedValue(),
|
338
|
+
*_endProp->getDerivedValue()};
|
339
|
+
auto shader = SkGradientShader::MakeLinear(
|
340
|
+
pts, _colors, _positions, _colorCount, _mode, _flags, _matrix);
|
341
|
+
context->getShaders()->push(shader);
|
394
342
|
}
|
395
343
|
|
344
|
+
protected:
|
396
345
|
void defineProperties(NodePropsContainer *container) override {
|
397
346
|
JsiBaseGradientNode::defineProperties(container);
|
398
347
|
_startProp = container->defineProperty<PointProp>("start");
|
@@ -413,19 +362,17 @@ public:
|
|
413
362
|
explicit JsiRadialGradientNode(std::shared_ptr<RNSkPlatformContext> context)
|
414
363
|
: JsiBaseGradientNode(context, "skRadialGradient") {}
|
415
364
|
|
416
|
-
|
417
|
-
void decorate(DrawingContext *context) override {
|
365
|
+
void decorate(DeclarationContext *context) override {
|
418
366
|
JsiBaseGradientNode::decorate(context);
|
419
367
|
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
_mode, _flags, _matrix));
|
426
|
-
}
|
368
|
+
auto c = _centerProp->getDerivedValue();
|
369
|
+
auto r = _radiusProp->value().getAsNumber();
|
370
|
+
auto shader = SkGradientShader::MakeRadial(
|
371
|
+
*c, r, _colors, _positions, _colorCount, _mode, _flags, _matrix);
|
372
|
+
context->getShaders()->push(shader);
|
427
373
|
}
|
428
374
|
|
375
|
+
protected:
|
429
376
|
void defineProperties(NodePropsContainer *container) override {
|
430
377
|
JsiBaseGradientNode::defineProperties(container);
|
431
378
|
_centerProp = container->defineProperty<PointProp>("c");
|
@@ -446,21 +393,19 @@ public:
|
|
446
393
|
explicit JsiSweepGradientNode(std::shared_ptr<RNSkPlatformContext> context)
|
447
394
|
: JsiBaseGradientNode(context, "skSweepGradient") {}
|
448
395
|
|
449
|
-
|
450
|
-
void decorate(DrawingContext *context) override {
|
396
|
+
void decorate(DeclarationContext *context) override {
|
451
397
|
JsiBaseGradientNode::decorate(context);
|
452
398
|
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
auto c = _centerProp->getDerivedValue();
|
399
|
+
auto start = _startProp->isSet() ? _startProp->value().getAsNumber() : 0;
|
400
|
+
auto end = _endProp->isSet() ? _endProp->value().getAsNumber() : 360;
|
401
|
+
auto c = _centerProp->getDerivedValue();
|
457
402
|
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
}
|
403
|
+
context->getShaders()->push(SkGradientShader::MakeSweep(
|
404
|
+
c->x(), c->y(), _colors, _positions, _colorCount, _mode, start, end,
|
405
|
+
_flags, _matrix));
|
462
406
|
}
|
463
407
|
|
408
|
+
protected:
|
464
409
|
void defineProperties(NodePropsContainer *container) override {
|
465
410
|
JsiBaseGradientNode::defineProperties(container);
|
466
411
|
_startProp = container->defineProperty<NodeProp>("start");
|
@@ -482,22 +427,20 @@ public:
|
|
482
427
|
std::shared_ptr<RNSkPlatformContext> context)
|
483
428
|
: JsiBaseGradientNode(context, "skTwoPointConicalGradient") {}
|
484
429
|
|
485
|
-
|
486
|
-
void decorate(DrawingContext *context) override {
|
430
|
+
void decorate(DeclarationContext *context) override {
|
487
431
|
JsiBaseGradientNode::decorate(context);
|
488
432
|
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
auto endR = _endRProp->value().getAsNumber();
|
433
|
+
auto start = _startProp->getDerivedValue();
|
434
|
+
auto end = _endProp->getDerivedValue();
|
435
|
+
auto startR = _startRProp->value().getAsNumber();
|
436
|
+
auto endR = _endRProp->value().getAsNumber();
|
494
437
|
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
}
|
438
|
+
context->getShaders()->push(SkGradientShader::MakeTwoPointConical(
|
439
|
+
*start, startR, *end, endR, _colors, _positions, _colorCount, _mode,
|
440
|
+
_flags, _matrix));
|
499
441
|
}
|
500
442
|
|
443
|
+
protected:
|
501
444
|
void defineProperties(NodePropsContainer *container) override {
|
502
445
|
JsiBaseGradientNode::defineProperties(container);
|
503
446
|
_startProp = container->defineProperty<PointProp>("start");
|
@@ -12,8 +12,10 @@ namespace RNSkia {
|
|
12
12
|
|
13
13
|
class BezierProp : public DerivedProp<std::vector<SkPoint>> {
|
14
14
|
public:
|
15
|
-
explicit BezierProp(PropId name
|
16
|
-
|
15
|
+
explicit BezierProp(PropId name,
|
16
|
+
const std::function<void(BaseNodeProp *)> &onChange)
|
17
|
+
: DerivedProp<std::vector<SkPoint>>(onChange) {
|
18
|
+
_bezierProp = defineProperty<NodeProp>(name);
|
17
19
|
}
|
18
20
|
|
19
21
|
void updateDerivedValue() override {
|
@@ -18,8 +18,10 @@ namespace RNSkia {
|
|
18
18
|
|
19
19
|
class BlendModeProp : public DerivedProp<SkBlendMode> {
|
20
20
|
public:
|
21
|
-
explicit BlendModeProp(PropId name
|
22
|
-
|
21
|
+
explicit BlendModeProp(PropId name,
|
22
|
+
const std::function<void(BaseNodeProp *)> &onChange)
|
23
|
+
: DerivedProp<SkBlendMode>(onChange) {
|
24
|
+
_blendMode = defineProperty<NodeProp>(name);
|
23
25
|
}
|
24
26
|
|
25
27
|
void updateDerivedValue() override {
|
@@ -9,16 +9,14 @@ namespace RNSkia {
|
|
9
9
|
|
10
10
|
class BoxShadowProps : public DerivedProp<SkPaint> {
|
11
11
|
public:
|
12
|
-
BoxShadowProps(
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
_blurProp =
|
18
|
-
_colorProp =
|
19
|
-
|
20
|
-
_innerProp =
|
21
|
-
addProperty(std::make_shared<NodeProp>(JsiPropId::get("inner")));
|
12
|
+
explicit BoxShadowProps(const std::function<void(BaseNodeProp *)> &onChange)
|
13
|
+
: DerivedProp<SkPaint>(onChange) {
|
14
|
+
_dxProp = defineProperty<NodeProp>("dx");
|
15
|
+
_dyProp = defineProperty<NodeProp>("dy");
|
16
|
+
_spreadProp = defineProperty<NodeProp>("spread");
|
17
|
+
_blurProp = defineProperty<NodeProp>("blur");
|
18
|
+
_colorProp = defineProperty<ColorProp>("color");
|
19
|
+
_innerProp = defineProperty<NodeProp>("inner");
|
22
20
|
|
23
21
|
_blurProp->require();
|
24
22
|
}
|
@@ -20,10 +20,11 @@ static PropId PropNameC = JsiPropId::get("c");
|
|
20
20
|
|
21
21
|
class CircleProp : public DerivedProp<SkPoint> {
|
22
22
|
public:
|
23
|
-
CircleProp(
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
explicit CircleProp(const std::function<void(BaseNodeProp *)> &onChange)
|
24
|
+
: DerivedProp<SkPoint>(onChange) {
|
25
|
+
_c = defineProperty<PointProp>("c");
|
26
|
+
_cx = defineProperty<NodeProp>("cx");
|
27
|
+
_cy = defineProperty<NodeProp>("cy");
|
27
28
|
}
|
28
29
|
|
29
30
|
void updateDerivedValue() override {
|
@@ -33,7 +34,7 @@ public:
|
|
33
34
|
setDerivedValue(SkPoint::Make(_cx->value().getAsNumber(),
|
34
35
|
_cy->value().getAsNumber()));
|
35
36
|
} else if (_c->isSet()) {
|
36
|
-
setDerivedValue(_c->
|
37
|
+
setDerivedValue(_c->getUnsafeDerivedValue());
|
37
38
|
} else {
|
38
39
|
setDerivedValue(SkPoint::Make(0.0, 0.0));
|
39
40
|
}
|
@@ -19,10 +19,12 @@ namespace RNSkia {
|
|
19
19
|
|
20
20
|
class ClipProp : public BaseDerivedProp {
|
21
21
|
public:
|
22
|
-
explicit ClipProp(PropId name
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
explicit ClipProp(PropId name,
|
23
|
+
const std::function<void(BaseNodeProp *)> &onChange)
|
24
|
+
: BaseDerivedProp(onChange) {
|
25
|
+
_pathProp = defineProperty<PathProp>(name);
|
26
|
+
_rectProp = defineProperty<RectProp>(name);
|
27
|
+
_rrectProp = defineProperty<RRectProp>(name);
|
26
28
|
}
|
27
29
|
|
28
30
|
void updateDerivedValue() override {
|
@@ -16,8 +16,10 @@ static PropId PropName3 = JsiPropId::get("3");
|
|
16
16
|
|
17
17
|
class ColorProp : public DerivedProp<SkColor> {
|
18
18
|
public:
|
19
|
-
explicit ColorProp(PropId name
|
20
|
-
|
19
|
+
explicit ColorProp(PropId name,
|
20
|
+
const std::function<void(BaseNodeProp *)> &onChange)
|
21
|
+
: DerivedProp<SkColor>(onChange) {
|
22
|
+
_colorProp = defineProperty<NodeProp>(name);
|
21
23
|
}
|
22
24
|
|
23
25
|
void updateDerivedValue() override {
|
@@ -59,8 +61,10 @@ private:
|
|
59
61
|
|
60
62
|
class ColorsProp : public DerivedProp<std::vector<SkColor>> {
|
61
63
|
public:
|
62
|
-
explicit ColorsProp(PropId name
|
63
|
-
|
64
|
+
explicit ColorsProp(PropId name,
|
65
|
+
const std::function<void(BaseNodeProp *)> &onChange)
|
66
|
+
: DerivedProp<std::vector<SkColor>>(onChange) {
|
67
|
+
_colorsProp = defineProperty<NodeProp>(name);
|
64
68
|
}
|
65
69
|
|
66
70
|
void updateDerivedValue() override {
|
@@ -13,9 +13,11 @@ using NotifyNeedRenderCallback =
|
|
13
13
|
|
14
14
|
class DrawingProp : public DerivedSkProp<SkPicture> {
|
15
15
|
public:
|
16
|
-
DrawingProp(PropId name, NotifyNeedRenderCallback notifyPictureNeeded
|
17
|
-
|
18
|
-
|
16
|
+
DrawingProp(PropId name, NotifyNeedRenderCallback notifyPictureNeeded,
|
17
|
+
const std::function<void(BaseNodeProp *)> &onChange)
|
18
|
+
: _notifyPictureNeeded(notifyPictureNeeded), DerivedSkProp<SkPicture>(
|
19
|
+
onChange) {
|
20
|
+
_drawingProp = defineProperty<NodeProp>(name);
|
19
21
|
}
|
20
22
|
|
21
23
|
void updateDerivedValue() override {
|
@@ -10,8 +10,10 @@ namespace RNSkia {
|
|
10
10
|
|
11
11
|
class FontProp : public DerivedProp<SkFont> {
|
12
12
|
public:
|
13
|
-
explicit FontProp(PropId name
|
14
|
-
|
13
|
+
explicit FontProp(PropId name,
|
14
|
+
const std::function<void(BaseNodeProp *)> &onChange)
|
15
|
+
: DerivedProp<SkFont>(onChange) {
|
16
|
+
_fontProp = defineProperty<NodeProp>(name);
|
15
17
|
}
|
16
18
|
|
17
19
|
void updateDerivedValue() override {
|
@@ -19,8 +19,10 @@ struct GlyphInfo {
|
|
19
19
|
|
20
20
|
class GlyphsProp : public DerivedProp<GlyphInfo> {
|
21
21
|
public:
|
22
|
-
explicit GlyphsProp(PropId name
|
23
|
-
|
22
|
+
explicit GlyphsProp(PropId name,
|
23
|
+
const std::function<void(BaseNodeProp *)> &onChange)
|
24
|
+
: DerivedProp<GlyphInfo>(onChange) {
|
25
|
+
_glyphsProp = defineProperty<NodeProp>(name);
|
24
26
|
}
|
25
27
|
|
26
28
|
void updateDerivedValue() override {
|