@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
@@ -54,10 +54,16 @@ export type AnimatedProps<T, O extends keyof T | never = never> = {
|
|
54
54
|
: AnimatedProp<T[K]>;
|
55
55
|
};
|
56
56
|
|
57
|
-
// TODO: switch to AnimatedProps<GroupProps> and remove duplicate properties.
|
58
|
-
// For instance matrix in color filter becomes colorMatrix
|
59
|
-
|
60
57
|
export type SkiaProps<
|
61
58
|
P = object,
|
62
59
|
O extends keyof P | never = never
|
63
60
|
> = AnimatedProps<P, O>;
|
61
|
+
|
62
|
+
type WithOptional<T extends object, N extends keyof T> = Omit<T, N> & {
|
63
|
+
[K in N]?: T[K];
|
64
|
+
};
|
65
|
+
|
66
|
+
export type SkiaDefaultProps<
|
67
|
+
T extends object,
|
68
|
+
N extends keyof T
|
69
|
+
> = WithOptional<SkiaProps<T>, N>;
|
@@ -29,6 +29,11 @@ export const isPaint = (obj: SkJSIInstance<string> | null): obj is SkPaint =>
|
|
29
29
|
obj !== null && obj.__typename__ === "Paint";
|
30
30
|
|
31
31
|
export interface SkPaint extends SkJSIInstance<"Paint"> {
|
32
|
+
/**
|
33
|
+
* Retrieves alpha from the color used when stroking and filling.
|
34
|
+
*/
|
35
|
+
getAlphaf(): number;
|
36
|
+
|
32
37
|
/**
|
33
38
|
* Returns a copy of this paint.
|
34
39
|
*/
|
@@ -9,7 +9,7 @@ export type SkShader = SkJSIInstance<"Shader">;
|
|
9
9
|
|
10
10
|
export type UniformValue = number | Vector | readonly number[];
|
11
11
|
|
12
|
-
export type Uniform = UniformValue | readonly UniformValue[];
|
12
|
+
export type Uniform = UniformValue | readonly UniformValue[] | Float32Array;
|
13
13
|
|
14
14
|
export interface Uniforms {
|
15
15
|
[name: string]: Uniform;
|
@@ -36,10 +36,12 @@ export const processUniforms = (
|
|
36
36
|
.fill(0)
|
37
37
|
.flatMap((_, i) => {
|
38
38
|
const name = source.getUniformName(i);
|
39
|
-
const
|
40
|
-
if (
|
39
|
+
const rawValue = uniforms[name];
|
40
|
+
if (rawValue === undefined) {
|
41
41
|
throw new Error(`No value specified for uniform ${name}`);
|
42
42
|
}
|
43
|
+
const value =
|
44
|
+
rawValue instanceof Float32Array ? Array.from(rawValue) : rawValue;
|
43
45
|
const result = Array.isArray(value)
|
44
46
|
? value.flatMap(processValue)
|
45
47
|
: processValue(value as UniformValue);
|
@@ -11,10 +11,14 @@ export class JsiSkRuntimeEffect
|
|
11
11
|
extends HostObject<RuntimeEffect, "RuntimeEffect">
|
12
12
|
implements SkRuntimeEffect
|
13
13
|
{
|
14
|
-
constructor(CanvasKit: CanvasKit, ref: RuntimeEffect) {
|
14
|
+
constructor(CanvasKit: CanvasKit, ref: RuntimeEffect, private sksl: string) {
|
15
15
|
super(CanvasKit, ref, "RuntimeEffect");
|
16
16
|
}
|
17
17
|
|
18
|
+
source() {
|
19
|
+
return this.sksl;
|
20
|
+
}
|
21
|
+
|
18
22
|
makeShader(uniforms: number[], localMatrix?: SkMatrix) {
|
19
23
|
return new JsiSkShader(
|
20
24
|
this.CanvasKit,
|
package/src/web/LoadSkiaWeb.tsx
CHANGED
@@ -1,27 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.rgbaColor = exports.processColor = exports.RED = exports.GREEN = exports.BLUE = exports.ALPHA = void 0;
|
7
|
-
const RED = 0;
|
8
|
-
exports.RED = RED;
|
9
|
-
const GREEN = 1;
|
10
|
-
exports.GREEN = GREEN;
|
11
|
-
const BLUE = 2;
|
12
|
-
exports.BLUE = BLUE;
|
13
|
-
const ALPHA = 3;
|
14
|
-
exports.ALPHA = ALPHA;
|
15
|
-
|
16
|
-
const rgbaColor = (r, g, b, a) => new Float32Array([r, g, b, a]);
|
17
|
-
|
18
|
-
exports.rgbaColor = rgbaColor;
|
19
|
-
|
20
|
-
const processColor = (Skia, cl, currentOpacity) => {
|
21
|
-
const color = Skia.Color(cl);
|
22
|
-
color[ALPHA] *= currentOpacity;
|
23
|
-
return color;
|
24
|
-
};
|
25
|
-
|
26
|
-
exports.processColor = processColor;
|
27
|
-
//# sourceMappingURL=Color.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["RED","GREEN","BLUE","ALPHA","rgbaColor","r","g","b","a","Float32Array","processColor","Skia","cl","currentOpacity","color","Color"],"sources":["Color.ts"],"sourcesContent":["import type { Color, Skia } from \"../../../skia/types\";\n\nexport const RED = 0;\nexport const GREEN = 1;\nexport const BLUE = 2;\nexport const ALPHA = 3;\n\nexport const rgbaColor = (r: number, g: number, b: number, a: number) =>\n new Float32Array([r, g, b, a]);\n\nexport const processColor = (Skia: Skia, cl: Color, currentOpacity: number) => {\n const color = Skia.Color(cl);\n color[ALPHA] *= currentOpacity;\n return color;\n};\n"],"mappings":";;;;;;AAEO,MAAMA,GAAG,GAAG,CAAZ;;AACA,MAAMC,KAAK,GAAG,CAAd;;AACA,MAAMC,IAAI,GAAG,CAAb;;AACA,MAAMC,KAAK,GAAG,CAAd;;;AAEA,MAAMC,SAAS,GAAG,CAACC,CAAD,EAAYC,CAAZ,EAAuBC,CAAvB,EAAkCC,CAAlC,KACvB,IAAIC,YAAJ,CAAiB,CAACJ,CAAD,EAAIC,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAjB,CADK;;;;AAGA,MAAME,YAAY,GAAG,CAACC,IAAD,EAAaC,EAAb,EAAwBC,cAAxB,KAAmD;EAC7E,MAAMC,KAAK,GAAGH,IAAI,CAACI,KAAL,CAAWH,EAAX,CAAd;EACAE,KAAK,CAACX,KAAD,CAAL,IAAgBU,cAAhB;EACA,OAAOC,KAAP;AACD,CAJM"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
export const RED = 0;
|
2
|
-
export const GREEN = 1;
|
3
|
-
export const BLUE = 2;
|
4
|
-
export const ALPHA = 3;
|
5
|
-
export const rgbaColor = (r, g, b, a) => new Float32Array([r, g, b, a]);
|
6
|
-
export const processColor = (Skia, cl, currentOpacity) => {
|
7
|
-
const color = Skia.Color(cl);
|
8
|
-
color[ALPHA] *= currentOpacity;
|
9
|
-
return color;
|
10
|
-
};
|
11
|
-
//# sourceMappingURL=Color.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["RED","GREEN","BLUE","ALPHA","rgbaColor","r","g","b","a","Float32Array","processColor","Skia","cl","currentOpacity","color","Color"],"sources":["Color.ts"],"sourcesContent":["import type { Color, Skia } from \"../../../skia/types\";\n\nexport const RED = 0;\nexport const GREEN = 1;\nexport const BLUE = 2;\nexport const ALPHA = 3;\n\nexport const rgbaColor = (r: number, g: number, b: number, a: number) =>\n new Float32Array([r, g, b, a]);\n\nexport const processColor = (Skia: Skia, cl: Color, currentOpacity: number) => {\n const color = Skia.Color(cl);\n color[ALPHA] *= currentOpacity;\n return color;\n};\n"],"mappings":"AAEA,OAAO,MAAMA,GAAG,GAAG,CAAZ;AACP,OAAO,MAAMC,KAAK,GAAG,CAAd;AACP,OAAO,MAAMC,IAAI,GAAG,CAAb;AACP,OAAO,MAAMC,KAAK,GAAG,CAAd;AAEP,OAAO,MAAMC,SAAS,GAAG,CAACC,CAAD,EAAYC,CAAZ,EAAuBC,CAAvB,EAAkCC,CAAlC,KACvB,IAAIC,YAAJ,CAAiB,CAACJ,CAAD,EAAIC,CAAJ,EAAOC,CAAP,EAAUC,CAAV,CAAjB,CADK;AAGP,OAAO,MAAME,YAAY,GAAG,CAACC,IAAD,EAAaC,EAAb,EAAwBC,cAAxB,KAAmD;EAC7E,MAAMC,KAAK,GAAGH,IAAI,CAACI,KAAL,CAAWH,EAAX,CAAd;EACAE,KAAK,CAACX,KAAD,CAAL,IAAgBU,cAAhB;EACA,OAAOC,KAAP;AACD,CAJM"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { Color, Skia } from "../../../skia/types";
|
2
|
-
export declare const RED = 0;
|
3
|
-
export declare const GREEN = 1;
|
4
|
-
export declare const BLUE = 2;
|
5
|
-
export declare const ALPHA = 3;
|
6
|
-
export declare const rgbaColor: (r: number, g: number, b: number, a: number) => Float32Array;
|
7
|
-
export declare const processColor: (Skia: Skia, cl: Color, currentOpacity: number) => Float32Array;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import type { Color, Skia } from "../../../skia/types";
|
2
|
-
|
3
|
-
export const RED = 0;
|
4
|
-
export const GREEN = 1;
|
5
|
-
export const BLUE = 2;
|
6
|
-
export const ALPHA = 3;
|
7
|
-
|
8
|
-
export const rgbaColor = (r: number, g: number, b: number, a: number) =>
|
9
|
-
new Float32Array([r, g, b, a]);
|
10
|
-
|
11
|
-
export const processColor = (Skia: Skia, cl: Color, currentOpacity: number) => {
|
12
|
-
const color = Skia.Color(cl);
|
13
|
-
color[ALPHA] *= currentOpacity;
|
14
|
-
return color;
|
15
|
-
};
|