@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
@@ -2,7 +2,7 @@ import type { SkColor, SkPoint } from "../../../skia/types";
|
|
2
2
|
import { BlendMode } from "../../../skia/types";
|
3
3
|
import type { DrawingContext, PatchProps } from "../../types";
|
4
4
|
import { NodeType } from "../../types";
|
5
|
-
import {
|
5
|
+
import { enumKey } from "../datatypes";
|
6
6
|
import { JsiDrawingNode } from "../DrawingNode";
|
7
7
|
import type { NodeContext } from "../Node";
|
8
8
|
|
@@ -39,30 +39,16 @@ export class PatchNode extends JsiDrawingNode<
|
|
39
39
|
patch[3].c2,
|
40
40
|
patch[0].c1,
|
41
41
|
],
|
42
|
-
colors: colors
|
43
|
-
? colors.map((c) => processColor(this.Skia, c, 1))
|
44
|
-
: undefined,
|
42
|
+
colors: colors ? colors.map((c) => this.Skia.Color(c)) : undefined,
|
45
43
|
};
|
46
44
|
}
|
47
45
|
|
48
|
-
draw({ canvas, paint
|
46
|
+
draw({ canvas, paint }: DrawingContext) {
|
49
47
|
if (!this.derived) {
|
50
48
|
throw new Error("PatchNode: derived props not set");
|
51
49
|
}
|
52
50
|
const { texture } = this.props;
|
53
51
|
const { colors, points, mode } = this.derived;
|
54
|
-
canvas.drawPatch(
|
55
|
-
points,
|
56
|
-
opacity === 1
|
57
|
-
? colors
|
58
|
-
: colors &&
|
59
|
-
colors.map((c) => {
|
60
|
-
c[ALPHA] = c[ALPHA] * opacity;
|
61
|
-
return c;
|
62
|
-
}),
|
63
|
-
texture,
|
64
|
-
mode,
|
65
|
-
paint
|
66
|
-
);
|
52
|
+
canvas.drawPatch(points, colors, texture, mode, paint);
|
67
53
|
}
|
68
54
|
}
|
@@ -2,7 +2,7 @@ import type { SkVertices } from "../../../skia/types";
|
|
2
2
|
import { VertexMode, BlendMode } from "../../../skia/types";
|
3
3
|
import type { DrawingContext, VerticesProps } from "../../types";
|
4
4
|
import { NodeType } from "../../types";
|
5
|
-
import { enumKey
|
5
|
+
import { enumKey } from "../datatypes";
|
6
6
|
import { JsiDrawingNode } from "../DrawingNode";
|
7
7
|
import type { NodeContext } from "../Node";
|
8
8
|
|
@@ -18,7 +18,7 @@ export class VerticesNode extends JsiDrawingNode<VerticesProps, SkVertices> {
|
|
18
18
|
vertexMode,
|
19
19
|
vertices,
|
20
20
|
textures,
|
21
|
-
colors ? colors.map((c) =>
|
21
|
+
colors ? colors.map((c) => this.Skia.Color(c)) : undefined,
|
22
22
|
indices
|
23
23
|
);
|
24
24
|
}
|
@@ -8,7 +8,6 @@ import type {
|
|
8
8
|
Node,
|
9
9
|
} from "../../types";
|
10
10
|
import { DeclarationType, NodeType } from "../../types";
|
11
|
-
import { processColor } from "../datatypes";
|
12
11
|
import { enumKey } from "../datatypes/Enum";
|
13
12
|
import type { LerpColorFilterProps } from "../../types/ColorFilters";
|
14
13
|
|
@@ -71,7 +70,7 @@ export class BlendColorFilterNode extends ColorFilterDeclaration<BlendColorFilte
|
|
71
70
|
|
72
71
|
materialize() {
|
73
72
|
const { mode } = this.props;
|
74
|
-
const color =
|
73
|
+
const color = this.Skia.Color(this.props.color);
|
75
74
|
const cf = this.Skia.ColorFilter.MakeBlend(color, BlendMode[enumKey(mode)]);
|
76
75
|
return this.compose(cf);
|
77
76
|
}
|
@@ -15,7 +15,7 @@ import type {
|
|
15
15
|
RuntimeShaderImageFilterProps,
|
16
16
|
} from "../../types";
|
17
17
|
import { DeclarationType, NodeType } from "../../types";
|
18
|
-
import { processRadius, enumKey
|
18
|
+
import { processRadius, enumKey } from "../datatypes";
|
19
19
|
import type { NodeContext } from "../Node";
|
20
20
|
import { JsiDeclarationNode } from "../Node";
|
21
21
|
|
@@ -145,7 +145,7 @@ export class DropShadowImageFilterNode extends ImageFilterDeclaration<DropShadow
|
|
145
145
|
|
146
146
|
materialize() {
|
147
147
|
const { dx, dy, blur, shadowOnly, color: cl, inner } = this.props;
|
148
|
-
const color =
|
148
|
+
const color = this.Skia.Color(cl);
|
149
149
|
const input = this.getOptionalChildInstance(0);
|
150
150
|
let factory;
|
151
151
|
if (inner) {
|
@@ -19,7 +19,6 @@ import type {
|
|
19
19
|
TwoPointConicalGradientProps,
|
20
20
|
} from "../../types";
|
21
21
|
import { DeclarationType, NodeType } from "../../types";
|
22
|
-
import { processColor } from "../datatypes/Color";
|
23
22
|
import {
|
24
23
|
enumKey,
|
25
24
|
fitRects,
|
@@ -99,7 +98,7 @@ export class ColorNode extends ShaderDeclaration<ColorProps> {
|
|
99
98
|
|
100
99
|
materialize() {
|
101
100
|
const { color } = this.props;
|
102
|
-
return this.Skia.Shader.MakeColor(
|
101
|
+
return this.Skia.Shader.MakeColor(this.Skia.Color(color));
|
103
102
|
}
|
104
103
|
}
|
105
104
|
|
package/src/dom/types/Common.ts
CHANGED
@@ -37,21 +37,21 @@ export interface ChildrenProps {
|
|
37
37
|
}
|
38
38
|
|
39
39
|
export interface RectCtor {
|
40
|
-
x
|
41
|
-
y
|
40
|
+
x?: number;
|
41
|
+
y?: number;
|
42
42
|
width: number;
|
43
43
|
height: number;
|
44
44
|
}
|
45
45
|
|
46
46
|
export interface RRectCtor extends RectCtor {
|
47
|
-
r
|
47
|
+
r?: Radius;
|
48
48
|
}
|
49
49
|
|
50
50
|
export type RectDef = RectCtor | { rect: SkRect };
|
51
51
|
export type RRectDef = RRectCtor | { rect: SkRRect };
|
52
52
|
|
53
53
|
export interface PointCircleDef {
|
54
|
-
c
|
54
|
+
c?: Vector;
|
55
55
|
r: number;
|
56
56
|
}
|
57
57
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import type { RefObject } from "react";
|
2
2
|
|
3
3
|
import type { DrawingInfo, SkiaView } from "../views";
|
4
|
-
import type {
|
4
|
+
import type { Skia, Vector } from "../skia/types";
|
5
|
+
import type { DrawingContext as DOMDrawingContext } from "../dom/types";
|
5
6
|
|
6
|
-
export interface DrawingContext
|
7
|
-
|
8
|
-
|
9
|
-
opacity: number;
|
7
|
+
export interface DrawingContext
|
8
|
+
extends Omit<DrawingInfo, "touches">,
|
9
|
+
DOMDrawingContext {
|
10
10
|
center: Vector;
|
11
11
|
ref: RefObject<SkiaView>;
|
12
12
|
Skia: Skia;
|
@@ -6,13 +6,18 @@ import { LumaColorFilter } from "./colorFilters/LumaColorFilter";
|
|
6
6
|
import { Paint } from "./Paint";
|
7
7
|
|
8
8
|
interface MaskProps {
|
9
|
-
mode
|
10
|
-
clip
|
9
|
+
mode?: "luminance" | "alpha";
|
10
|
+
clip?: boolean;
|
11
11
|
mask: ReactNode | ReactNode[];
|
12
12
|
children: ReactNode | ReactNode[];
|
13
13
|
}
|
14
14
|
|
15
|
-
export const Mask = ({
|
15
|
+
export const Mask = ({
|
16
|
+
children,
|
17
|
+
mask,
|
18
|
+
mode = "alpha",
|
19
|
+
clip = true,
|
20
|
+
}: MaskProps) => {
|
16
21
|
return (
|
17
22
|
<Group layer>
|
18
23
|
<Group
|
@@ -29,8 +34,3 @@ export const Mask = ({ children, mask, mode, clip }: MaskProps) => {
|
|
29
34
|
</Group>
|
30
35
|
);
|
31
36
|
};
|
32
|
-
|
33
|
-
Mask.defaultProps = {
|
34
|
-
mode: "alpha",
|
35
|
-
clip: true,
|
36
|
-
};
|
@@ -1,17 +1,29 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { ImageShaderProps } from "../../../dom/types";
|
4
|
-
import type {
|
4
|
+
import type { SkiaDefaultProps } from "../../processors";
|
5
5
|
|
6
|
-
export const ImageShader = (
|
7
|
-
|
6
|
+
export const ImageShader = ({
|
7
|
+
tx = "decal",
|
8
|
+
ty = "decal",
|
9
|
+
fm = "nearest",
|
10
|
+
mm = "none",
|
11
|
+
fit = "none",
|
12
|
+
transform = [],
|
13
|
+
...props
|
14
|
+
}: SkiaDefaultProps<
|
15
|
+
ImageShaderProps,
|
16
|
+
"tx" | "ty" | "fm" | "mm" | "fit" | "transform"
|
17
|
+
>) => {
|
18
|
+
return (
|
19
|
+
<skImageShader
|
20
|
+
tx={tx}
|
21
|
+
ty={ty}
|
22
|
+
fm={fm}
|
23
|
+
mm={mm}
|
24
|
+
fit={fit}
|
25
|
+
transform={transform}
|
26
|
+
{...props}
|
27
|
+
/>
|
28
|
+
);
|
8
29
|
};
|
9
|
-
|
10
|
-
ImageShader.defaultProps = {
|
11
|
-
tx: "decal",
|
12
|
-
ty: "decal",
|
13
|
-
fm: "nearest",
|
14
|
-
mm: "none",
|
15
|
-
fit: "none",
|
16
|
-
transform: [],
|
17
|
-
} as const;
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
4
|
import type { BlurImageFilterProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Blur = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
mode: "decal",
|
6
|
+
export const Blur = ({
|
7
|
+
mode = "decal",
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<BlurImageFilterProps, "mode">) => {
|
10
|
+
return <skBlurImageFilter mode={mode} {...props} />;
|
12
11
|
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { MorphologyImageFilterProps } from "../../../dom/types";
|
4
|
-
import type {
|
4
|
+
import type { SkiaDefaultProps } from "../../processors";
|
5
5
|
|
6
|
-
export const Morphology = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
operator: "dilate",
|
6
|
+
export const Morphology = ({
|
7
|
+
operator = "dilate",
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<MorphologyImageFilterProps, "operator">) => {
|
10
|
+
return <skMorphologyImageFilter operator={operator} {...props} />;
|
12
11
|
};
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
4
|
import type { OffsetImageFilterProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Offset = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
x
|
12
|
-
y: 0,
|
6
|
+
export const Offset = ({
|
7
|
+
x = 0,
|
8
|
+
y = 0,
|
9
|
+
...props
|
10
|
+
}: SkiaDefaultProps<OffsetImageFilterProps, "x" | "y">) => {
|
11
|
+
return <skOffsetImageFilter x={x} y={y} {...props} />;
|
13
12
|
};
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { BlurMaskFilterProps } from "../../../dom/types";
|
4
|
-
import type {
|
4
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
5
5
|
|
6
|
-
export const BlurMask = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
style
|
12
|
-
respectCTM: true,
|
6
|
+
export const BlurMask = ({
|
7
|
+
style = "normal",
|
8
|
+
respectCTM = true,
|
9
|
+
...props
|
10
|
+
}: SkiaDefaultProps<BlurMaskFilterProps, "style" | "respectCTM">) => {
|
11
|
+
return <skBlurMaskFilter style={style} respectCTM={respectCTM} {...props} />;
|
13
12
|
};
|
@@ -1,14 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
4
|
import type { DiscretePathEffectProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const DiscretePathEffect = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
}
|
11
|
-
|
12
|
-
DiscretePathEffect.defaultProps = {
|
13
|
-
seed: 0,
|
6
|
+
export const DiscretePathEffect = ({
|
7
|
+
seed = 0,
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<DiscretePathEffectProps, "seed">) => {
|
10
|
+
return <skDiscretePathEffect seed={seed} {...props} />;
|
14
11
|
};
|
@@ -1,14 +1,23 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { FractalNoiseProps } from "../../../dom/types";
|
4
|
-
import type {
|
4
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
5
5
|
|
6
|
-
export const FractalNoise = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
tileHeight
|
6
|
+
export const FractalNoise = ({
|
7
|
+
seed = 0,
|
8
|
+
tileWidth = 0,
|
9
|
+
tileHeight = 0,
|
10
|
+
...props
|
11
|
+
}: SkiaDefaultProps<
|
12
|
+
FractalNoiseProps,
|
13
|
+
"seed" | "tileHeight" | "tileWidth"
|
14
|
+
>) => {
|
15
|
+
return (
|
16
|
+
<skFractalNoise
|
17
|
+
seed={seed}
|
18
|
+
tileWidth={tileWidth}
|
19
|
+
tileHeight={tileHeight}
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
);
|
14
23
|
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
4
|
import type { ShaderProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Shader = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
uniforms: [],
|
6
|
+
export const Shader = ({
|
7
|
+
uniforms = {},
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<ShaderProps, "uniforms">) => {
|
10
|
+
return <skShader uniforms={uniforms} {...props} />;
|
12
11
|
};
|
@@ -1,14 +1,20 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { TurbulenceProps } from "../../../dom/types";
|
4
|
-
import type {
|
4
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
5
5
|
|
6
|
-
export const Turbulence = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
export const Turbulence = ({
|
7
|
+
seed = 0,
|
8
|
+
tileWidth = 0,
|
9
|
+
tileHeight = 0,
|
10
|
+
...props
|
11
|
+
}: SkiaDefaultProps<TurbulenceProps, "seed" | "tileWidth" | "tileHeight">) => {
|
12
|
+
return (
|
13
|
+
<skTurbulence
|
14
|
+
seed={seed}
|
15
|
+
tileWidth={tileWidth}
|
16
|
+
tileHeight={tileHeight}
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
);
|
14
20
|
};
|
@@ -7,7 +7,7 @@ import type { SkRect } from "../../../skia/types";
|
|
7
7
|
import { Group } from "../Group";
|
8
8
|
|
9
9
|
interface FitProps {
|
10
|
-
fit
|
10
|
+
fit?: Fit;
|
11
11
|
src: SkRect;
|
12
12
|
dst: SkRect;
|
13
13
|
children: ReactNode | ReactNode[];
|
@@ -18,11 +18,7 @@ export const fitbox = (fit: Fit, src: SkRect, dst: SkRect) => {
|
|
18
18
|
return rect2rect(rects.src, rects.dst);
|
19
19
|
};
|
20
20
|
|
21
|
-
export const FitBox = ({ fit, src, dst, children }: FitProps) => {
|
21
|
+
export const FitBox = ({ fit = "contain", src, dst, children }: FitProps) => {
|
22
22
|
const transform = useMemo(() => fitbox(fit, src, dst), [dst, fit, src]);
|
23
23
|
return <Group transform={transform}>{children}</Group>;
|
24
24
|
};
|
25
|
-
|
26
|
-
FitBox.defaultProps = {
|
27
|
-
fit: "contain",
|
28
|
-
};
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
4
|
import type { PathProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Path = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
start
|
12
|
-
end: 1,
|
6
|
+
export const Path = ({
|
7
|
+
start = 0,
|
8
|
+
end = 1,
|
9
|
+
...props
|
10
|
+
}: SkiaDefaultProps<PathProps, "start" | "end">) => {
|
11
|
+
return <skPath start={start} end={end} {...props} />;
|
13
12
|
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
4
|
import type { PointsProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Points = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
mode: "points",
|
6
|
+
export const Points = ({
|
7
|
+
mode = "points",
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<PointsProps, "mode">) => {
|
10
|
+
return <skPoints mode={mode} {...props} />;
|
12
11
|
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
4
|
import type { VerticesProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Vertices = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
mode: "triangles",
|
6
|
+
export const Vertices = ({
|
7
|
+
mode = "triangles",
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<VerticesProps, "mode">) => {
|
10
|
+
return <skVertices mode={mode} {...props} />;
|
12
11
|
};
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import type { GlyphsProps } from "../../../dom/types";
|
4
|
-
import type {
|
4
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
5
5
|
|
6
|
-
export const Glyphs = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
x
|
12
|
-
y: 0,
|
6
|
+
export const Glyphs = ({
|
7
|
+
x = 0,
|
8
|
+
y = 0,
|
9
|
+
...props
|
10
|
+
}: SkiaDefaultProps<GlyphsProps, "x" | "y">) => {
|
11
|
+
return <skGlyphs x={x} y={y} {...props} />;
|
13
12
|
};
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
4
|
import type { TextProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const Text = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
x
|
12
|
-
y: 0,
|
6
|
+
export const Text = ({
|
7
|
+
x = 0,
|
8
|
+
y = 0,
|
9
|
+
...props
|
10
|
+
}: SkiaDefaultProps<TextProps, "x" | "y">) => {
|
11
|
+
return <skText x={x} y={y} {...props} />;
|
13
12
|
};
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
4
|
import type { TextBlobProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const TextBlob = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
x
|
12
|
-
y: 0,
|
6
|
+
export const TextBlob = ({
|
7
|
+
x = 0,
|
8
|
+
y = 0,
|
9
|
+
...props
|
10
|
+
}: SkiaDefaultProps<TextBlobProps, "x" | "y">) => {
|
11
|
+
return <skTextBlob x={x} y={y} {...props} />;
|
13
12
|
};
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
4
|
import type { TextPathProps } from "../../../dom/types";
|
5
5
|
|
6
|
-
export const TextPath = (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
initialOffset: 0,
|
6
|
+
export const TextPath = ({
|
7
|
+
initialOffset = 0,
|
8
|
+
...props
|
9
|
+
}: SkiaDefaultProps<TextPathProps, "initialOffset">) => {
|
10
|
+
return <skTextPath initialOffset={initialOffset} {...props} />;
|
12
11
|
};
|