@shopify/react-native-skia 0.1.163 → 0.1.165
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkPaint.h +6 -0
- package/cpp/api/JsiSkRuntimeEffect.h +7 -2
- package/cpp/jsi/JsiHostObject.h +25 -25
- package/cpp/rnskia/RNSkDomView.cpp +1 -1
- package/cpp/rnskia/RNSkPlatformContext.h +2 -6
- package/cpp/rnskia/dom/base/DrawingContext.cpp +23 -41
- package/cpp/rnskia/dom/base/DrawingContext.h +6 -19
- package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +12 -2
- package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +4 -4
- package/cpp/rnskia/dom/base/JsiDomNode.h +68 -10
- package/cpp/rnskia/dom/base/JsiDomRenderNode.h +26 -61
- package/cpp/rnskia/dom/base/NodeProp.h +2 -1
- package/cpp/rnskia/dom/base/NodePropsContainer.h +10 -0
- package/cpp/rnskia/dom/nodes/JsiBlendNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +3 -6
- package/cpp/rnskia/dom/nodes/JsiBoxNode.h +2 -4
- package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiCircleNode.h +2 -5
- package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +4 -8
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +2 -5
- package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +2 -7
- package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +4 -8
- package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +20 -38
- package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -1
- package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +2 -4
- package/cpp/rnskia/dom/nodes/JsiLineNode.h +2 -7
- package/cpp/rnskia/dom/nodes/JsiOvalNode.h +1 -3
- package/cpp/rnskia/dom/nodes/JsiPaintNode.h +2 -3
- package/cpp/rnskia/dom/nodes/JsiPatchNode.h +4 -8
- package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +14 -28
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +6 -16
- package/cpp/rnskia/dom/nodes/JsiPictureNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiPointsNode.h +2 -5
- package/cpp/rnskia/dom/nodes/JsiRRectNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiRectNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +37 -69
- package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +3 -6
- package/cpp/rnskia/dom/nodes/JsiTextNode.h +4 -8
- package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +2 -4
- package/cpp/rnskia/dom/props/CircleProp.h +2 -0
- package/cpp/rnskia/dom/props/ColorProp.h +9 -4
- package/cpp/rnskia/dom/props/ImageProps.h +3 -2
- package/cpp/rnskia/dom/props/PaintProps.h +15 -7
- package/cpp/rnskia/dom/props/RectProp.h +11 -4
- package/cpp/rnskia/dom/props/TransformProp.h +0 -2
- package/cpp/rnskia/dom/props/UniformsProp.h +86 -123
- package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -6
- package/cpp/utils/RNSkLog.h +1 -1
- package/lib/commonjs/dom/nodes/RenderNode.js +12 -16
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js +6 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js +3 -3
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/index.js +0 -13
- package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.js +6 -6
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js +2 -2
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js +3 -7
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +1 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js +1 -3
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.js +1 -3
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js +2 -6
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js +0 -5
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js +20 -10
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js +10 -5
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +10 -5
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js +12 -6
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js +12 -6
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js +10 -5
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js +14 -7
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js +10 -5
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js +14 -7
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js +0 -6
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js +1 -4
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js +0 -4
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js +12 -6
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js +10 -5
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js +0 -3
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js +10 -5
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js +12 -6
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js +12 -6
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js +12 -6
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js +10 -5
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +3 -2
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js +4 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/dom/nodes/RenderNode.js +12 -16
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js +8 -1
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +7 -3
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/index.js +0 -1
- package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.js +6 -5
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageNode.js +4 -2
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PatchNode.js +4 -8
- package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/VerticesNode.js +2 -2
- package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/module/dom/nodes/paint/ColorFilters.js +1 -2
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.js +2 -2
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/Shaders.js +1 -2
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/renderer/DrawingContext.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +2 -6
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js +0 -5
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js +20 -10
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js +10 -5
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +10 -5
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js +12 -6
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +12 -6
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js +10 -5
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js +14 -7
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +10 -5
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js +14 -7
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js +0 -6
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js +1 -4
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js +0 -4
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js +12 -6
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js +10 -5
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js +0 -3
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js +10 -5
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js +12 -6
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js +12 -6
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js +12 -6
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js +10 -5
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/types/Paint/Paint.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +3 -2
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +4 -0
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/module/web/LoadSkiaWeb.js +1 -1
- package/lib/module/web/LoadSkiaWeb.js.map +1 -1
- package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -1
- package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +0 -1
- package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +1 -1
- package/lib/typescript/src/dom/types/Common.d.ts +4 -4
- package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -1
- package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
- package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -5
- package/lib/typescript/src/renderer/components/Mask.d.ts +3 -9
- package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -8
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -12
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -7
- package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -7
- package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -8
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -8
- package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -9
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -9
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -9
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +1 -7
- package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -8
- package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +1 -6
- package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -7
- package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -7
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +5 -0
- package/lib/typescript/src/skia/types/Paint/Paint.d.ts +4 -0
- package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +4 -0
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +3 -1
- package/package.json +1 -1
- package/src/dom/nodes/RenderNode.ts +11 -21
- package/src/dom/nodes/datatypes/Circle.ts +1 -1
- package/src/dom/nodes/datatypes/Rect.ts +3 -3
- package/src/dom/nodes/datatypes/index.ts +0 -1
- package/src/dom/nodes/drawings/Box.ts +7 -4
- package/src/dom/nodes/drawings/ImageNode.ts +2 -1
- package/src/dom/nodes/drawings/PatchNode.ts +4 -18
- package/src/dom/nodes/drawings/VerticesNode.ts +2 -2
- package/src/dom/nodes/paint/ColorFilters.ts +1 -2
- package/src/dom/nodes/paint/ImageFilters.ts +2 -2
- package/src/dom/nodes/paint/Shaders.ts +1 -2
- package/src/dom/types/Common.ts +4 -4
- package/src/dom/types/DrawingContext.ts +0 -1
- package/src/dom/types/Drawings.ts +1 -1
- package/src/renderer/DrawingContext.ts +5 -5
- package/src/renderer/components/Mask.tsx +8 -8
- package/src/renderer/components/image/Image.tsx +0 -6
- package/src/renderer/components/image/ImageShader.tsx +24 -12
- package/src/renderer/components/imageFilters/Blur.tsx +6 -7
- package/src/renderer/components/imageFilters/Morphology.tsx +6 -7
- package/src/renderer/components/imageFilters/Offset.tsx +7 -8
- package/src/renderer/components/maskFilters/Blur.tsx +7 -8
- package/src/renderer/components/pathEffects/Discrete.tsx +6 -9
- package/src/renderer/components/shaders/FractalNoise.tsx +18 -9
- package/src/renderer/components/shaders/Shader.tsx +6 -7
- package/src/renderer/components/shaders/Turbulence.tsx +15 -9
- package/src/renderer/components/shapes/Circle.tsx +0 -4
- package/src/renderer/components/shapes/FitBox.tsx +2 -6
- package/src/renderer/components/shapes/Oval.tsx +0 -5
- package/src/renderer/components/shapes/Path.tsx +7 -8
- package/src/renderer/components/shapes/Points.tsx +6 -7
- package/src/renderer/components/shapes/RoundedRect.tsx +0 -4
- package/src/renderer/components/shapes/Vertices.tsx +6 -7
- package/src/renderer/components/text/Glyphs.tsx +7 -8
- package/src/renderer/components/text/Text.tsx +7 -8
- package/src/renderer/components/text/TextBlob.tsx +7 -8
- package/src/renderer/components/text/TextPath.tsx +6 -7
- package/src/renderer/processors/Animations/Animations.ts +9 -3
- package/src/skia/types/Paint/Paint.ts +5 -0
- package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +5 -0
- package/src/skia/types/Shader/Shader.ts +5 -3
- package/src/skia/web/JsiSkPaint.ts +4 -0
- package/src/skia/web/JsiSkRuntimeEffect.ts +5 -1
- package/src/skia/web/JsiSkRuntimeEffectFactory.ts +1 -1
- package/src/web/LoadSkiaWeb.tsx +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Color.js +0 -27
- package/lib/commonjs/dom/nodes/datatypes/Color.js.map +0 -1
- package/lib/module/dom/nodes/datatypes/Color.js +0 -11
- package/lib/module/dom/nodes/datatypes/Color.js.map +0 -1
- package/lib/typescript/src/dom/nodes/datatypes/Color.d.ts +0 -7
- package/src/dom/nodes/datatypes/Color.ts +0 -15
@@ -18,12 +18,6 @@
|
|
18
18
|
|
19
19
|
namespace RNSkia {
|
20
20
|
|
21
|
-
static PropId PropNameOrigin = JsiPropId::get("origin");
|
22
|
-
static PropId PropNameOpacity = JsiPropId::get("opacity");
|
23
|
-
static PropId PropNameClip = JsiPropId::get("clip");
|
24
|
-
static PropId PropNameInvertClip = JsiPropId::get("invertClip");
|
25
|
-
static PropId PropNameLayer = JsiPropId::get("layer");
|
26
|
-
|
27
21
|
class JsiDomRenderNode : public JsiDomNode {
|
28
22
|
public:
|
29
23
|
JsiDomRenderNode(std::shared_ptr<RNSkPlatformContext> context,
|
@@ -32,7 +26,7 @@ public:
|
|
32
26
|
|
33
27
|
void render(DrawingContext *context) {
|
34
28
|
#if SKIA_DOM_DEBUG
|
35
|
-
printDebugInfo(
|
29
|
+
printDebugInfo("Begin Render");
|
36
30
|
#endif
|
37
31
|
|
38
32
|
// Ensure we have a local drawing context inheriting from the parent context
|
@@ -50,27 +44,27 @@ public:
|
|
50
44
|
if (_layerProp->isSet()) {
|
51
45
|
if (_layerProp->isBool()) {
|
52
46
|
#if SKIA_DOM_DEBUG
|
53
|
-
printDebugInfo(
|
47
|
+
printDebugInfo("canvas->saveLayer()");
|
54
48
|
#endif
|
55
49
|
_localContext->getCanvas()->saveLayer(
|
56
50
|
SkCanvas::SaveLayerRec(nullptr, nullptr, nullptr, 0));
|
57
51
|
} else {
|
58
52
|
#if SKIA_DOM_DEBUG
|
59
|
-
printDebugInfo(
|
53
|
+
printDebugInfo("canvas->saveLayer(paint)");
|
60
54
|
#endif
|
61
55
|
_localContext->getCanvas()->saveLayer(SkCanvas::SaveLayerRec(
|
62
56
|
nullptr, _layerProp->getDerivedValue().get(), nullptr, 0));
|
63
57
|
}
|
64
58
|
} else {
|
65
59
|
#if SKIA_DOM_DEBUG
|
66
|
-
printDebugInfo(
|
60
|
+
printDebugInfo("canvas->save()");
|
67
61
|
#endif
|
68
62
|
_localContext->getCanvas()->save();
|
69
63
|
}
|
70
64
|
|
71
65
|
if (_originProp->isSet()) {
|
72
66
|
#if SKIA_DOM_DEBUG
|
73
|
-
printDebugInfo(
|
67
|
+
printDebugInfo("canvas->translate(origin)");
|
74
68
|
#endif
|
75
69
|
// Handle origin
|
76
70
|
_localContext->getCanvas()->translate(
|
@@ -81,10 +75,9 @@ public:
|
|
81
75
|
if (shouldTransform) {
|
82
76
|
#if SKIA_DOM_DEBUG
|
83
77
|
printDebugInfo(
|
84
|
-
context,
|
85
78
|
"canvas->concat(" +
|
86
|
-
|
87
|
-
|
79
|
+
std::string(_matrixProp->isSet() ? "matrix" : "transform") +
|
80
|
+
std::string(")"));
|
88
81
|
#endif
|
89
82
|
auto matrix = _matrixProp->isSet() ? _matrixProp->getDerivedValue()
|
90
83
|
: _transformProp->getDerivedValue();
|
@@ -101,7 +94,7 @@ public:
|
|
101
94
|
|
102
95
|
if (_originProp->isSet()) {
|
103
96
|
#if SKIA_DOM_DEBUG
|
104
|
-
printDebugInfo(
|
97
|
+
printDebugInfo("canvas->translate(-origin)");
|
105
98
|
#endif
|
106
99
|
// Handle origin
|
107
100
|
_localContext->getCanvas()->translate(
|
@@ -124,13 +117,13 @@ public:
|
|
124
117
|
// Restore if needed
|
125
118
|
if (shouldSave) {
|
126
119
|
#if SKIA_DOM_DEBUG
|
127
|
-
printDebugInfo(
|
120
|
+
printDebugInfo("canvas->restore()");
|
128
121
|
#endif
|
129
122
|
_localContext->getCanvas()->restore();
|
130
123
|
}
|
131
124
|
|
132
125
|
#if SKIA_DOM_DEBUG
|
133
|
-
printDebugInfo(
|
126
|
+
printDebugInfo("End Render");
|
134
127
|
#endif
|
135
128
|
}
|
136
129
|
|
@@ -158,41 +151,19 @@ public:
|
|
158
151
|
|
159
152
|
protected:
|
160
153
|
/**
|
161
|
-
|
162
|
-
context is correctly set.
|
163
|
-
*/
|
164
|
-
virtual void renderNode(DrawingContext *context) = 0;
|
165
|
-
|
166
|
-
/**
|
167
|
-
Removes a child
|
168
|
-
*/
|
169
|
-
void removeChild(std::shared_ptr<JsiDomNode> child) override {
|
170
|
-
JsiDomNode::removeChild(child);
|
171
|
-
if (_localContext != nullptr) {
|
172
|
-
_localContext->markAsChanged();
|
173
|
-
}
|
174
|
-
}
|
175
|
-
|
176
|
-
/**
|
177
|
-
Validates that only declaration nodes can be children
|
154
|
+
Invalidates and marks then context as changed.
|
178
155
|
*/
|
179
|
-
void
|
180
|
-
JsiDomNode::addChild(child);
|
156
|
+
void invalidateContext() override {
|
181
157
|
if (_localContext != nullptr) {
|
182
158
|
_localContext->markAsChanged();
|
183
159
|
}
|
184
160
|
}
|
185
161
|
|
186
162
|
/**
|
187
|
-
|
163
|
+
Override to implement rendering where the current state of the drawing
|
164
|
+
context is correctly set.
|
188
165
|
*/
|
189
|
-
void
|
190
|
-
std::shared_ptr<JsiDomNode> before) override {
|
191
|
-
JsiDomNode::insertChildBefore(child, before);
|
192
|
-
if (_localContext != nullptr) {
|
193
|
-
_localContext->markAsChanged();
|
194
|
-
}
|
195
|
-
}
|
166
|
+
virtual void renderNode(DrawingContext *context) = 0;
|
196
167
|
|
197
168
|
/**
|
198
169
|
Define common properties for all render nodes
|
@@ -200,20 +171,14 @@ protected:
|
|
200
171
|
void defineProperties(NodePropsContainer *container) override {
|
201
172
|
JsiDomNode::defineProperties(container);
|
202
173
|
|
203
|
-
_paintProps = container->defineProperty
|
204
|
-
|
205
|
-
_matrixProp =
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
_clipProp =
|
212
|
-
container->defineProperty(std::make_shared<ClipProp>(PropNameClip));
|
213
|
-
_invertClip = container->defineProperty(
|
214
|
-
std::make_shared<NodeProp>(PropNameInvertClip));
|
215
|
-
_layerProp =
|
216
|
-
container->defineProperty(std::make_shared<LayerProp>(PropNameLayer));
|
174
|
+
_paintProps = container->defineProperty<PaintProps>();
|
175
|
+
|
176
|
+
_matrixProp = container->defineProperty<MatrixProp>("matrix");
|
177
|
+
_transformProp = container->defineProperty<TransformProp>("transform");
|
178
|
+
_originProp = container->defineProperty<PointProp>("origin");
|
179
|
+
_clipProp = container->defineProperty<ClipProp>("clip");
|
180
|
+
_invertClip = container->defineProperty<NodeProp>("invertClip");
|
181
|
+
_layerProp = container->defineProperty<LayerProp>("layer");
|
217
182
|
}
|
218
183
|
|
219
184
|
private:
|
@@ -224,17 +189,17 @@ private:
|
|
224
189
|
auto op = invert ? SkClipOp::kDifference : SkClipOp::kIntersect;
|
225
190
|
if (_clipProp->getRect() != nullptr) {
|
226
191
|
#if SKIA_DOM_DEBUG
|
227
|
-
printDebugInfo(
|
192
|
+
printDebugInfo("canvas->clipRect()");
|
228
193
|
#endif
|
229
194
|
canvas->clipRect(*_clipProp->getRect(), op, true);
|
230
195
|
} else if (_clipProp->getRRect() != nullptr) {
|
231
196
|
#if SKIA_DOM_DEBUG
|
232
|
-
printDebugInfo(
|
197
|
+
printDebugInfo("canvas->clipRRect()");
|
233
198
|
#endif
|
234
199
|
canvas->clipRRect(*_clipProp->getRRect(), op, true);
|
235
200
|
} else if (_clipProp->getPath() != nullptr) {
|
236
201
|
#if SKIA_DOM_DEBUG
|
237
|
-
printDebugInfo(
|
202
|
+
printDebugInfo("canvas->clipPath()");
|
238
203
|
#endif
|
239
204
|
canvas->clipPath(*_clipProp->getPath(), op, true);
|
240
205
|
}
|
@@ -19,7 +19,8 @@ public:
|
|
19
19
|
/**
|
20
20
|
Constructs a new optional dom node properrty
|
21
21
|
*/
|
22
|
-
explicit NodeProp(
|
22
|
+
explicit NodeProp(const std::string &name)
|
23
|
+
: _name(JsiPropId::get(name)), BaseNodeProp() {}
|
23
24
|
|
24
25
|
/**
|
25
26
|
Reads JS value and swaps out with a new value
|
@@ -110,6 +110,16 @@ public:
|
|
110
110
|
return prop.get();
|
111
111
|
}
|
112
112
|
|
113
|
+
/**
|
114
|
+
Defines a property that will be updated with the container changes.
|
115
|
+
*/
|
116
|
+
template <class _Tp, class... _Args,
|
117
|
+
class = std::_EnableIf<!std::is_array<_Tp>::value>>
|
118
|
+
_Tp *defineProperty(_Args &&...__args) {
|
119
|
+
return defineProperty(
|
120
|
+
std::make_shared<_Tp>(std::forward<_Args>(__args)...));
|
121
|
+
}
|
122
|
+
|
113
123
|
private:
|
114
124
|
std::vector<std::shared_ptr<BaseNodeProp>> _properties;
|
115
125
|
std::map<PropId, std::vector<NodeProp *>> _mappedProperties;
|
@@ -70,8 +70,7 @@ protected:
|
|
70
70
|
|
71
71
|
void defineProperties(NodePropsContainer *container) override {
|
72
72
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
73
|
-
_blendProp = container->defineProperty(
|
74
|
-
std::make_shared<BlendModeProp>(JsiPropId::get("mode")));
|
73
|
+
_blendProp = container->defineProperty<BlendModeProp>("mode");
|
75
74
|
_blendProp->require();
|
76
75
|
}
|
77
76
|
|
@@ -44,12 +44,9 @@ protected:
|
|
44
44
|
void defineProperties(NodePropsContainer *container) override {
|
45
45
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
46
46
|
|
47
|
-
_style = container->defineProperty(
|
48
|
-
|
49
|
-
|
50
|
-
std::make_shared<NodeProp>(JsiPropId::get("respectCTM")));
|
51
|
-
_blur = container->defineProperty(
|
52
|
-
std::make_shared<NodeProp>(JsiPropId::get("blur")));
|
47
|
+
_style = container->defineProperty<NodeProp>("style");
|
48
|
+
_respectCTM = container->defineProperty<NodeProp>("respectCTM");
|
49
|
+
_blur = container->defineProperty<NodeProp>("blur");
|
53
50
|
|
54
51
|
_blur->require();
|
55
52
|
}
|
@@ -76,10 +76,8 @@ protected:
|
|
76
76
|
|
77
77
|
void defineProperties(NodePropsContainer *container) override {
|
78
78
|
JsiDomRenderNode::defineProperties(container);
|
79
|
-
_rrectProp = container->defineProperty(
|
80
|
-
|
81
|
-
_rectProp = container->defineProperty(
|
82
|
-
std::make_shared<RectProp>(JsiPropId::get("box")));
|
79
|
+
_rrectProp = container->defineProperty<RRectProp>("box");
|
80
|
+
_rectProp = container->defineProperty<RectProp>("box");
|
83
81
|
}
|
84
82
|
|
85
83
|
private:
|
@@ -22,8 +22,7 @@ protected:
|
|
22
22
|
|
23
23
|
void defineProperties(NodePropsContainer *container) override {
|
24
24
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
25
|
-
_boxShadowProps =
|
26
|
-
container->defineProperty(std::make_shared<BoxShadowProps>());
|
25
|
+
_boxShadowProps = container->defineProperty<BoxShadowProps>();
|
27
26
|
}
|
28
27
|
|
29
28
|
private:
|
@@ -22,11 +22,8 @@ protected:
|
|
22
22
|
|
23
23
|
void defineProperties(NodePropsContainer *container) override {
|
24
24
|
JsiDomDrawingNode::defineProperties(container);
|
25
|
-
_circleProp = container->defineProperty
|
26
|
-
_radiusProp =
|
27
|
-
container->defineProperty(std::make_shared<NodeProp>(PropNameR));
|
28
|
-
|
29
|
-
_circleProp->require();
|
25
|
+
_circleProp = container->defineProperty<CircleProp>();
|
26
|
+
_radiusProp = container->defineProperty<NodeProp>("r");
|
30
27
|
_radiusProp->require();
|
31
28
|
}
|
32
29
|
|
@@ -77,8 +77,7 @@ protected:
|
|
77
77
|
|
78
78
|
void defineProperties(NodePropsContainer *container) override {
|
79
79
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
80
|
-
_matrixProp = container->defineProperty(
|
81
|
-
std::make_shared<NodeProp>(JsiPropId::get("matrix")));
|
80
|
+
_matrixProp = container->defineProperty<NodeProp>("matrix");
|
82
81
|
_matrixProp->require();
|
83
82
|
}
|
84
83
|
|
@@ -103,10 +102,8 @@ protected:
|
|
103
102
|
|
104
103
|
void defineProperties(NodePropsContainer *container) override {
|
105
104
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
106
|
-
_blendModeProp = container->defineProperty(
|
107
|
-
|
108
|
-
_colorProp = container->defineProperty(
|
109
|
-
std::make_shared<ColorProp>(JsiPropId::get("color")));
|
105
|
+
_blendModeProp = container->defineProperty<BlendModeProp>("mode");
|
106
|
+
_colorProp = container->defineProperty<ColorProp>("color");
|
110
107
|
|
111
108
|
_blendModeProp->require();
|
112
109
|
_colorProp->require();
|
@@ -180,8 +177,7 @@ protected:
|
|
180
177
|
|
181
178
|
void defineProperties(NodePropsContainer *container) override {
|
182
179
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
183
|
-
_tProp = container->defineProperty(
|
184
|
-
std::make_shared<NodeProp>(JsiPropId::get("t")));
|
180
|
+
_tProp = container->defineProperty<NodeProp>("t");
|
185
181
|
_tProp->require();
|
186
182
|
}
|
187
183
|
|
@@ -28,7 +28,6 @@ protected:
|
|
28
28
|
float scaledWidth = context->getScaledWidth();
|
29
29
|
float scaledHeight = context->getScaledHeight();
|
30
30
|
auto paint = context->getPaint();
|
31
|
-
auto opacity = context->getOpacity();
|
32
31
|
auto platformContext = getContext();
|
33
32
|
auto requestRedraw = context->getRequestRedraw();
|
34
33
|
|
@@ -44,7 +43,7 @@ protected:
|
|
44
43
|
}
|
45
44
|
|
46
45
|
// Run rendering on the javascript thread
|
47
|
-
getContext()->runOnJavascriptThread([this, platformContext,
|
46
|
+
getContext()->runOnJavascriptThread([this, platformContext,
|
48
47
|
requestRedraw, scaledWidth,
|
49
48
|
scaledHeight]() {
|
50
49
|
// Get the runtime
|
@@ -65,7 +64,6 @@ protected:
|
|
65
64
|
*runtime, "paint",
|
66
65
|
jsi::Object::createFromHostObject(*runtime, this->_jsiPaint));
|
67
66
|
|
68
|
-
jsiCtx.setProperty(*runtime, "opacity", opacity);
|
69
67
|
jsiCtx.setProperty(
|
70
68
|
*runtime, "canvas",
|
71
69
|
jsi::Object::createFromHostObject(*runtime, jsiCanvas));
|
@@ -100,8 +98,7 @@ protected:
|
|
100
98
|
std::bind(&JsiCustomDrawingNode::notifyPictureNeeded, this,
|
101
99
|
std::placeholders::_1);
|
102
100
|
|
103
|
-
_drawingProp = container->defineProperty(
|
104
|
-
std::make_shared<DrawingProp>(JsiPropId::get("drawing"), cb));
|
101
|
+
_drawingProp = container->defineProperty<DrawingProp>("drawing", cb);
|
105
102
|
}
|
106
103
|
|
107
104
|
private:
|
@@ -7,9 +7,6 @@
|
|
7
7
|
|
8
8
|
namespace RNSkia {
|
9
9
|
|
10
|
-
static PropId PropNameInner = JsiPropId::get("inner");
|
11
|
-
static PropId PropNameOuter = JsiPropId::get("outer");
|
12
|
-
|
13
10
|
class JsiDiffRectNode : public JsiDomDrawingNode,
|
14
11
|
public JsiDomNodeCtor<JsiDiffRectNode> {
|
15
12
|
public:
|
@@ -25,10 +22,8 @@ protected:
|
|
25
22
|
|
26
23
|
void defineProperties(NodePropsContainer *container) override {
|
27
24
|
JsiDomDrawingNode::defineProperties(container);
|
28
|
-
_innerRectProp =
|
29
|
-
|
30
|
-
_outerRectProp =
|
31
|
-
container->defineProperty(std::make_shared<RRectProp>(PropNameOuter));
|
25
|
+
_innerRectProp = container->defineProperty<RRectProp>("inner");
|
26
|
+
_outerRectProp = container->defineProperty<RRectProp>("outer");
|
32
27
|
|
33
28
|
_innerRectProp->require();
|
34
29
|
_outerRectProp->require();
|
@@ -31,14 +31,10 @@ protected:
|
|
31
31
|
void defineProperties(NodePropsContainer *container) override {
|
32
32
|
JsiDomDrawingNode::defineProperties(container);
|
33
33
|
|
34
|
-
_fontProp = container->defineProperty(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
_xProp = container->defineProperty(
|
39
|
-
std::make_shared<NodeProp>(JsiPropId::get("x")));
|
40
|
-
_yProp = container->defineProperty(
|
41
|
-
std::make_shared<NodeProp>(JsiPropId::get("y")));
|
34
|
+
_fontProp = container->defineProperty<FontProp>("font");
|
35
|
+
_glyphsProp = container->defineProperty<GlyphsProp>("glyphs");
|
36
|
+
_xProp = container->defineProperty<NodeProp>("x");
|
37
|
+
_yProp = container->defineProperty<NodeProp>("y");
|
42
38
|
|
43
39
|
_fontProp->require();
|
44
40
|
_glyphsProp->require();
|
@@ -94,8 +94,7 @@ protected:
|
|
94
94
|
|
95
95
|
void defineProperties(NodePropsContainer *container) override {
|
96
96
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
97
|
-
_blendModeProp = container->defineProperty(
|
98
|
-
std::make_shared<BlendModeProp>(JsiPropId::get("mode")));
|
97
|
+
_blendModeProp = container->defineProperty<BlendModeProp>("mode");
|
99
98
|
_blendModeProp->require();
|
100
99
|
}
|
101
100
|
|
@@ -154,19 +153,13 @@ protected:
|
|
154
153
|
|
155
154
|
void defineProperties(NodePropsContainer *container) override {
|
156
155
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
157
|
-
_dxProp = container->defineProperty(
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
std::make_shared<ColorProp>(JsiPropId::get("color")));
|
165
|
-
|
166
|
-
_innerProp = container->defineProperty(
|
167
|
-
std::make_shared<NodeProp>(JsiPropId::get("inner")));
|
168
|
-
_shadowOnlyProp = container->defineProperty(
|
169
|
-
std::make_shared<NodeProp>(JsiPropId::get("shadowOnly")));
|
156
|
+
_dxProp = container->defineProperty<NodeProp>("dx");
|
157
|
+
_dyProp = container->defineProperty<NodeProp>("dy");
|
158
|
+
_blurProp = container->defineProperty<NodeProp>("blur");
|
159
|
+
_colorProp = container->defineProperty<ColorProp>("color");
|
160
|
+
|
161
|
+
_innerProp = container->defineProperty<NodeProp>("inner");
|
162
|
+
_shadowOnlyProp = container->defineProperty<NodeProp>("shadowOnly");
|
170
163
|
|
171
164
|
_dxProp->require();
|
172
165
|
_dyProp->require();
|
@@ -212,12 +205,9 @@ protected:
|
|
212
205
|
|
213
206
|
void defineProperties(NodePropsContainer *container) override {
|
214
207
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
215
|
-
_channelXProp = container->defineProperty(
|
216
|
-
|
217
|
-
|
218
|
-
std::make_shared<NodeProp>(JsiPropId::get("channelY")));
|
219
|
-
_scaleProp = container->defineProperty(
|
220
|
-
std::make_shared<NodeProp>(JsiPropId::get("scale")));
|
208
|
+
_channelXProp = container->defineProperty<NodeProp>("channelX");
|
209
|
+
_channelYProp = container->defineProperty<NodeProp>("channelY");
|
210
|
+
_scaleProp = container->defineProperty<NodeProp>("scale");
|
221
211
|
|
222
212
|
_channelXProp->require();
|
223
213
|
_channelYProp->require();
|
@@ -266,10 +256,8 @@ protected:
|
|
266
256
|
|
267
257
|
void defineProperties(NodePropsContainer *container) override {
|
268
258
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
269
|
-
_blurProp = container->defineProperty(
|
270
|
-
|
271
|
-
_tileModeProp = container->defineProperty(
|
272
|
-
std::make_shared<TileModeProp>(JsiPropId::get("mode")));
|
259
|
+
_blurProp = container->defineProperty<RadiusProp>("blur");
|
260
|
+
_tileModeProp = container->defineProperty<TileModeProp>("mode");
|
273
261
|
|
274
262
|
_blurProp->require();
|
275
263
|
}
|
@@ -302,10 +290,8 @@ protected:
|
|
302
290
|
|
303
291
|
void defineProperties(NodePropsContainer *container) override {
|
304
292
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
305
|
-
_xProp = container->defineProperty(
|
306
|
-
|
307
|
-
_yProp = container->defineProperty(
|
308
|
-
std::make_shared<NodeProp>(JsiPropId::get("y")));
|
293
|
+
_xProp = container->defineProperty<NodeProp>("x");
|
294
|
+
_yProp = container->defineProperty<NodeProp>("y");
|
309
295
|
|
310
296
|
_xProp->require();
|
311
297
|
_yProp->require();
|
@@ -346,10 +332,8 @@ protected:
|
|
346
332
|
|
347
333
|
void defineProperties(NodePropsContainer *container) override {
|
348
334
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
349
|
-
_operatorProp = container->defineProperty(
|
350
|
-
|
351
|
-
_radiusProp = container->defineProperty(
|
352
|
-
std::make_shared<RadiusProp>(JsiPropId::get("radius")));
|
335
|
+
_operatorProp = container->defineProperty<NodeProp>("operator");
|
336
|
+
_radiusProp = container->defineProperty<RadiusProp>("radius");
|
353
337
|
|
354
338
|
_operatorProp->require();
|
355
339
|
_radiusProp->require();
|
@@ -398,18 +382,16 @@ protected:
|
|
398
382
|
|
399
383
|
void defineProperties(NodePropsContainer *container) override {
|
400
384
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
401
|
-
_sourceProp = container->defineProperty(
|
402
|
-
std::make_shared<NodeProp>(JsiPropId::get("source")));
|
385
|
+
_sourceProp = container->defineProperty<NodeProp>("source");
|
403
386
|
_uniformsProp =
|
404
|
-
container->defineProperty
|
405
|
-
JsiPropId::get("uniforms"), _sourceProp));
|
387
|
+
container->defineProperty<UniformsProp>("uniforms", _sourceProp);
|
406
388
|
|
407
389
|
_sourceProp->require();
|
408
390
|
}
|
409
391
|
|
410
392
|
private:
|
411
393
|
NodeProp *_sourceProp;
|
412
|
-
|
394
|
+
UniformsProp *_uniformsProp;
|
413
395
|
};
|
414
396
|
|
415
397
|
} // namespace RNSkia
|
@@ -23,7 +23,7 @@ protected:
|
|
23
23
|
|
24
24
|
void defineProperties(NodePropsContainer *container) override {
|
25
25
|
JsiDomDrawingNode::defineProperties(container);
|
26
|
-
_imageProps = container->defineProperty
|
26
|
+
_imageProps = container->defineProperty<ImageProps>();
|
27
27
|
_imageProps->require();
|
28
28
|
}
|
29
29
|
|
@@ -28,10 +28,8 @@ protected:
|
|
28
28
|
|
29
29
|
void defineProperties(NodePropsContainer *container) override {
|
30
30
|
JsiDomDrawingNode::defineProperties(container);
|
31
|
-
_svgDomProp = container->defineProperty(
|
32
|
-
|
33
|
-
_rectProp = container->defineProperty(
|
34
|
-
std::make_shared<RectProps>(JsiPropId::get("rect")));
|
31
|
+
_svgDomProp = container->defineProperty<SvgProp>("svg");
|
32
|
+
_rectProp = container->defineProperty<RectProps>("rect");
|
35
33
|
|
36
34
|
_svgDomProp->require();
|
37
35
|
}
|
@@ -7,9 +7,6 @@
|
|
7
7
|
|
8
8
|
namespace RNSkia {
|
9
9
|
|
10
|
-
static PropId PropNamePoint1 = JsiPropId::get("p1");
|
11
|
-
static PropId PropNamePoint2 = JsiPropId::get("p2");
|
12
|
-
|
13
10
|
class JsiLineNode : public JsiDomDrawingNode,
|
14
11
|
public JsiDomNodeCtor<JsiLineNode> {
|
15
12
|
public:
|
@@ -26,10 +23,8 @@ protected:
|
|
26
23
|
|
27
24
|
void defineProperties(NodePropsContainer *container) override {
|
28
25
|
JsiDomDrawingNode::defineProperties(container);
|
29
|
-
_p1Prop =
|
30
|
-
|
31
|
-
_p2Prop =
|
32
|
-
container->defineProperty(std::make_shared<PointProp>(PropNamePoint2));
|
26
|
+
_p1Prop = container->defineProperty<PointProp>("p1");
|
27
|
+
_p2Prop = container->defineProperty<PointProp>("p2");
|
33
28
|
|
34
29
|
_p1Prop->require();
|
35
30
|
_p2Prop->require();
|
@@ -15,15 +15,13 @@ public:
|
|
15
15
|
|
16
16
|
protected:
|
17
17
|
void draw(DrawingContext *context) override {
|
18
|
-
RNSkLogger::logToConsole(context->getDebugDescription());
|
19
18
|
context->getCanvas()->drawOval(*_rectProp->getDerivedValue(),
|
20
19
|
*context->getPaint());
|
21
20
|
}
|
22
21
|
|
23
22
|
void defineProperties(NodePropsContainer *container) override {
|
24
23
|
JsiDomDrawingNode::defineProperties(container);
|
25
|
-
_rectProp =
|
26
|
-
container->defineProperty(std::make_shared<RectProps>(PropNameRect));
|
24
|
+
_rectProp = container->defineProperty<RectProps>("rect");
|
27
25
|
_rectProp->require();
|
28
26
|
}
|
29
27
|
|
@@ -64,9 +64,8 @@ protected:
|
|
64
64
|
void defineProperties(NodePropsContainer *container) override {
|
65
65
|
JsiBaseDomDeclarationNode::defineProperties(container);
|
66
66
|
|
67
|
-
_paintProps = container->defineProperty
|
68
|
-
_opacityProp =
|
69
|
-
container->defineProperty(std::make_shared<NodeProp>(PropNameOpacity));
|
67
|
+
_paintProps = container->defineProperty<PaintProps>();
|
68
|
+
_opacityProp = container->defineProperty<NodeProp>("opacity");
|
70
69
|
}
|
71
70
|
|
72
71
|
private:
|
@@ -32,14 +32,10 @@ protected:
|
|
32
32
|
|
33
33
|
void defineProperties(NodePropsContainer *container) override {
|
34
34
|
JsiDomDrawingNode::defineProperties(container);
|
35
|
-
_colorsProp = container->defineProperty(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
_blendModeProp = container->defineProperty(
|
40
|
-
std::make_shared<BlendModeProp>(JsiPropId::get("blendMode")));
|
41
|
-
_patchProp = container->defineProperty(
|
42
|
-
std::make_shared<BezierProp>(JsiPropId::get("patch")));
|
35
|
+
_colorsProp = container->defineProperty<ColorsProp>("colors");
|
36
|
+
_textureProp = container->defineProperty<PointsProp>("texture");
|
37
|
+
_blendModeProp = container->defineProperty<BlendModeProp>("blendMode");
|
38
|
+
_patchProp = container->defineProperty<BezierProp>("patch");
|
43
39
|
|
44
40
|
_patchProp->require();
|
45
41
|
}
|