@shopify/react-native-skia 0.1.225 → 0.1.228
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +3 -3
- package/cpp/api/JsiSkCanvas.h +2 -1
- package/cpp/api/JsiSkMatrix.h +35 -13
- package/cpp/api/JsiSkPictureRecorder.h +10 -3
- package/cpp/api/JsiSkTypeface.h +1 -0
- package/cpp/rnskia/dom/props/MatrixProp.h +19 -0
- package/cpp/rnskia/dom/props/TransformProp.h +76 -9
- package/lib/commonjs/animation/spring/runSpring.d.ts +3 -0
- package/lib/commonjs/animation/spring/runSpring.js +3 -0
- package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
- package/lib/commonjs/animation/spring/useSpring.d.ts +3 -0
- package/lib/commonjs/animation/spring/useSpring.js +3 -0
- package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
- package/lib/commonjs/animation/timing/runTiming.d.ts +3 -0
- package/lib/commonjs/animation/timing/runTiming.js +3 -0
- package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/useLoop.d.ts +3 -0
- package/lib/commonjs/animation/timing/useLoop.js +3 -0
- package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
- package/lib/commonjs/animation/timing/useTiming.d.ts +3 -0
- package/lib/commonjs/animation/timing/useTiming.js +3 -0
- package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +2 -0
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/types/Common.d.ts +3 -3
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.d.ts +1 -0
- package/lib/commonjs/external/reanimated/interpolators.js +24 -5
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.js +9 -7
- package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +34 -28
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/components/Drawing.d.ts +5 -0
- package/lib/commonjs/renderer/components/Drawing.js +5 -0
- package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/commonjs/skia/core/Matrix.d.ts +2 -2
- package/lib/commonjs/skia/core/Matrix.js.map +1 -1
- package/lib/commonjs/skia/core/Picture.d.ts +2 -2
- package/lib/commonjs/skia/core/Picture.js +12 -2
- package/lib/commonjs/skia/core/Picture.js.map +1 -1
- package/lib/commonjs/skia/core/Vector.d.ts +0 -5
- package/lib/commonjs/skia/core/Vector.js +1 -17
- package/lib/commonjs/skia/core/Vector.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.d.ts +1 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.d.ts +4 -20
- package/lib/commonjs/skia/types/Matrix.js +4 -70
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +90 -0
- package/lib/commonjs/skia/types/Matrix4.js +312 -0
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -0
- package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.d.ts +1 -0
- package/lib/commonjs/skia/types/Rect.js +18 -0
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/index.d.ts +1 -0
- package/lib/commonjs/skia/types/index.js +13 -0
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +2 -3
- package/lib/commonjs/skia/web/Host.js +4 -12
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +13 -13
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js +2 -2
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +3 -3
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkMatrix.js +6 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js +5 -5
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +3 -3
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/commonjs/values/api.d.ts +23 -2
- package/lib/commonjs/values/api.js +44 -1
- package/lib/commonjs/values/api.js.map +1 -1
- package/lib/commonjs/values/hooks/useClockValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useClockValue.js +3 -0
- package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useComputedValue.js +3 -0
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useValue.js +3 -0
- package/lib/commonjs/values/hooks/useValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/commonjs/values/hooks/useValueEffect.js +3 -0
- package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
- package/lib/commonjs/values/types.d.ts +4 -4
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/views/SkiaView.d.ts +5 -0
- package/lib/commonjs/views/SkiaView.js +9 -0
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/module/animation/spring/runSpring.d.ts +3 -0
- package/lib/module/animation/spring/runSpring.js +3 -0
- package/lib/module/animation/spring/runSpring.js.map +1 -1
- package/lib/module/animation/spring/useSpring.d.ts +3 -0
- package/lib/module/animation/spring/useSpring.js +3 -0
- package/lib/module/animation/spring/useSpring.js.map +1 -1
- package/lib/module/animation/timing/runTiming.d.ts +3 -0
- package/lib/module/animation/timing/runTiming.js +3 -0
- package/lib/module/animation/timing/runTiming.js.map +1 -1
- package/lib/module/animation/timing/useLoop.d.ts +3 -0
- package/lib/module/animation/timing/useLoop.js +3 -0
- package/lib/module/animation/timing/useLoop.js.map +1 -1
- package/lib/module/animation/timing/useTiming.d.ts +3 -0
- package/lib/module/animation/timing/useTiming.js +3 -0
- package/lib/module/animation/timing/useTiming.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +2 -0
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/types/Common.d.ts +3 -3
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.d.ts +1 -0
- package/lib/module/external/reanimated/interpolators.js +22 -6
- package/lib/module/external/reanimated/interpolators.js.map +1 -1
- package/lib/module/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/module/external/reanimated/moduleWrapper.js +7 -6
- package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/module/renderer/Canvas.js +35 -29
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/components/Drawing.d.ts +5 -0
- package/lib/module/renderer/components/Drawing.js +6 -0
- package/lib/module/renderer/components/Drawing.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/module/skia/core/Matrix.d.ts +2 -2
- package/lib/module/skia/core/Matrix.js.map +1 -1
- package/lib/module/skia/core/Picture.d.ts +2 -2
- package/lib/module/skia/core/Picture.js +12 -3
- package/lib/module/skia/core/Picture.js.map +1 -1
- package/lib/module/skia/core/Vector.d.ts +0 -5
- package/lib/module/skia/core/Vector.js +0 -13
- package/lib/module/skia/core/Vector.js.map +1 -1
- package/lib/module/skia/types/Canvas.d.ts +1 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Matrix.d.ts +4 -20
- package/lib/module/skia/types/Matrix.js +3 -71
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +90 -0
- package/lib/module/skia/types/Matrix4.js +274 -0
- package/lib/module/skia/types/Matrix4.js.map +1 -0
- package/lib/module/skia/types/Path/Path.d.ts +1 -1
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/module/skia/types/Rect.d.ts +1 -0
- package/lib/module/skia/types/Rect.js +9 -0
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/index.d.ts +1 -0
- package/lib/module/skia/types/index.js +1 -0
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +2 -3
- package/lib/module/skia/web/Host.js +2 -7
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +14 -14
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +2 -2
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +3 -3
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +7 -7
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +3 -3
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js +4 -4
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js +2 -2
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/module/skia/web/JsiSkMatrix.js +6 -1
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +4 -4
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +6 -6
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +2 -2
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js +2 -2
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js +6 -6
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js +2 -2
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/module/values/api.d.ts +23 -2
- package/lib/module/values/api.js +44 -1
- package/lib/module/values/api.js.map +1 -1
- package/lib/module/values/hooks/useClockValue.d.ts +3 -0
- package/lib/module/values/hooks/useClockValue.js +3 -0
- package/lib/module/values/hooks/useClockValue.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/module/values/hooks/useComputedValue.js +3 -0
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/hooks/useValue.d.ts +3 -0
- package/lib/module/values/hooks/useValue.js +3 -0
- package/lib/module/values/hooks/useValue.js.map +1 -1
- package/lib/module/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/module/values/hooks/useValueEffect.js +3 -0
- package/lib/module/values/hooks/useValueEffect.js.map +1 -1
- package/lib/module/values/types.d.ts +4 -4
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/views/SkiaView.d.ts +5 -0
- package/lib/module/views/SkiaView.js +10 -0
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/typescript/src/animation/spring/runSpring.d.ts +3 -0
- package/lib/typescript/src/animation/spring/useSpring.d.ts +3 -0
- package/lib/typescript/src/animation/timing/runTiming.d.ts +3 -0
- package/lib/typescript/src/animation/timing/useLoop.d.ts +3 -0
- package/lib/typescript/src/animation/timing/useTiming.d.ts +3 -0
- package/lib/typescript/src/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/typescript/src/dom/types/Common.d.ts +3 -3
- package/lib/typescript/src/external/reanimated/interpolators.d.ts +1 -0
- package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/typescript/src/renderer/components/Drawing.d.ts +5 -0
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/typescript/src/skia/core/Matrix.d.ts +2 -2
- package/lib/typescript/src/skia/core/Picture.d.ts +2 -2
- package/lib/typescript/src/skia/core/Vector.d.ts +0 -5
- package/lib/typescript/src/skia/types/Canvas.d.ts +1 -1
- package/lib/typescript/src/skia/types/Matrix.d.ts +4 -20
- package/lib/typescript/src/skia/types/Matrix4.d.ts +90 -0
- package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
- package/lib/typescript/src/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/typescript/src/skia/types/Rect.d.ts +1 -0
- package/lib/typescript/src/skia/types/index.d.ts +1 -0
- package/lib/typescript/src/skia/web/Host.d.ts +2 -3
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/typescript/src/values/api.d.ts +23 -2
- package/lib/typescript/src/values/hooks/useClockValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/typescript/src/values/types.d.ts +4 -4
- package/lib/typescript/src/views/SkiaView.d.ts +5 -0
- package/package.json +2 -1
- package/src/animation/spring/runSpring.ts +3 -0
- package/src/animation/spring/useSpring.ts +3 -0
- package/src/animation/timing/runTiming.ts +3 -0
- package/src/animation/timing/useLoop.ts +3 -0
- package/src/animation/timing/useTiming.ts +3 -0
- package/src/dom/nodes/JsiSkDOM.ts +4 -0
- package/src/dom/nodes/datatypes/Fitting.ts +10 -2
- package/src/dom/nodes/datatypes/Gradient.ts +2 -2
- package/src/dom/types/Common.ts +5 -3
- package/src/external/reanimated/interpolators.ts +30 -7
- package/src/external/reanimated/moduleWrapper.ts +6 -0
- package/src/renderer/Canvas.tsx +41 -30
- package/src/renderer/components/Drawing.tsx +5 -0
- package/src/skia/core/Matrix.ts +2 -2
- package/src/skia/core/Picture.ts +11 -3
- package/src/skia/core/Vector.ts +0 -4
- package/src/skia/types/Canvas.ts +1 -1
- package/src/skia/types/Matrix.ts +7 -85
- package/src/skia/types/Matrix4.ts +344 -0
- package/src/skia/types/Path/Path.ts +1 -1
- package/src/skia/types/Picture/PictureRecorder.ts +1 -1
- package/src/skia/types/Rect.ts +14 -0
- package/src/skia/types/index.ts +1 -0
- package/src/skia/web/Host.ts +4 -3
- package/src/skia/web/JsiSkCanvas.ts +24 -17
- package/src/skia/web/JsiSkColorFilterFactory.ts +5 -2
- package/src/skia/web/JsiSkFont.ts +3 -3
- package/src/skia/web/JsiSkImage.ts +14 -11
- package/src/skia/web/JsiSkImageFactory.ts +3 -3
- package/src/skia/web/JsiSkImageFilterFactory.ts +5 -5
- package/src/skia/web/JsiSkMaskFilterFactory.ts +6 -2
- package/src/skia/web/JsiSkMatrix.ts +14 -3
- package/src/skia/web/JsiSkPaint.ts +4 -4
- package/src/skia/web/JsiSkPath.ts +9 -6
- package/src/skia/web/JsiSkPathEffectFactory.ts +2 -2
- package/src/skia/web/JsiSkPathFactory.ts +2 -2
- package/src/skia/web/JsiSkPicture.ts +4 -4
- package/src/skia/web/JsiSkPictureRecorder.ts +6 -2
- package/src/skia/web/JsiSkShaderFactory.ts +6 -6
- package/src/skia/web/JsiSkVerticesFactory.ts +2 -2
- package/src/values/api.ts +55 -2
- package/src/values/hooks/useClockValue.ts +3 -0
- package/src/values/hooks/useComputedValue.ts +3 -0
- package/src/values/hooks/useValue.ts +3 -0
- package/src/values/hooks/useValueEffect.ts +3 -0
- package/src/values/types.ts +6 -6
- package/src/views/SkiaView.tsx +11 -0
@@ -5,10 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.JsiSkMatrix = void 0;
|
7
7
|
|
8
|
+
var _types = require("../types");
|
9
|
+
|
8
10
|
var _Host = require("./Host");
|
9
11
|
|
10
12
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
13
|
|
14
|
+
const isMatrixHostObject = obj => !Array.isArray(obj);
|
15
|
+
|
12
16
|
class JsiSkMatrix extends _Host.HostObject {
|
13
17
|
constructor(CanvasKit, ref) {
|
14
18
|
super(CanvasKit, ref, "Matrix");
|
@@ -26,7 +30,8 @@ class JsiSkMatrix extends _Host.HostObject {
|
|
26
30
|
}
|
27
31
|
|
28
32
|
concat(matrix) {
|
29
|
-
this.preMultiply(
|
33
|
+
this.preMultiply( // eslint-disable-next-line no-nested-ternary
|
34
|
+
isMatrixHostObject(matrix) ? JsiSkMatrix.fromValue(matrix) : matrix.length === 16 ? (0, _types.toMatrix3)(matrix) : [...matrix]);
|
30
35
|
return this;
|
31
36
|
}
|
32
37
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkMatrix","HostObject","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","fromValue","translate","x","y","translated","postTranslate","scale","scaled","postScale","skew","skewed","postSkew","rotate","value","rotated","postRotate","identity","get","
|
1
|
+
{"version":3,"names":["isMatrixHostObject","obj","Array","isArray","JsiSkMatrix","HostObject","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","fromValue","length","toMatrix3","translate","x","y","translated","postTranslate","scale","scaled","postScale","skew","skewed","postSkew","rotate","value","rotated","postRotate","identity","get","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport { toMatrix3, type Matrix3, type Matrix4, type SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nconst isMatrixHostObject = (\n obj: SkMatrix | number[] | Matrix4 | Matrix3\n): obj is SkMatrix => !Array.isArray(obj);\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n private preMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, matrix));\n }\n\n private postMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(matrix, this.ref));\n }\n\n dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: SkMatrix | number[] | Matrix4 | Matrix3) {\n this.preMultiply(\n // eslint-disable-next-line no-nested-ternary\n isMatrixHostObject(matrix)\n ? JsiSkMatrix.fromValue(matrix)\n : matrix.length === 16\n ? toMatrix3(matrix as Matrix4)\n : [...matrix]\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n postTranslate(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n scale(x: number, y?: number) {\n this.preMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n postScale(x: number, y?: number) {\n this.postMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n skew(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n postSkew(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n rotate(value: number) {\n this.preMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n postRotate(value: number) {\n this.postMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;;;;;;AAEA;;AAEA;;;;AAEA,MAAMA,kBAAkB,GACtBC,GADyB,IAEL,CAACC,KAAK,CAACC,OAAN,CAAcF,GAAd,CAFvB;;AAIO,MAAMG,WAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IADgD,iCAYxC,MAAM,CACd;IACD,CAdiD;EAEjD;;EAEOC,WAAW,CAACC,MAAD,EAAmB;IACpC,KAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCE,MAAzC,CAAb;EACD;;EAEOI,YAAY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AKF,SAAL,CAAeK,MAAf,CAAsBgB,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDQ,QAAQ,CAACT,CAAD,EAAYC,CAAZ,EAAuB;IAC7B,KAAKP,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBgB,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDS,MAAM,CAACC,KAAD,EAAgB;IACpB,KAAKtB,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBoB,OAAtB,CAA8BD,KAA9B,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDE,UAAU,CAACF,KAAD,EAAgB;IACxB,KAAKjB,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBoB,OAAtB,CAA8BD,KAA9B,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDG,QAAQ,GAAG;IACT,KAAK1B,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBsB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAOjC,KAAK,CAACkC,IAAN,CAAW,KAAK5B,GAAhB,CAAP;EACD;;AA5EH"}
|
@@ -73,7 +73,7 @@ class JsiSkPaint extends _Host.HostObject {
|
|
73
73
|
}
|
74
74
|
|
75
75
|
setBlendMode(blendMode) {
|
76
|
-
this.ref.setBlendMode((0, _Host.
|
76
|
+
this.ref.setBlendMode((0, _Host.getEnum)(this.CanvasKit.BlendMode, blendMode));
|
77
77
|
}
|
78
78
|
|
79
79
|
setColor(color) {
|
@@ -101,11 +101,11 @@ class JsiSkPaint extends _Host.HostObject {
|
|
101
101
|
}
|
102
102
|
|
103
103
|
setStrokeCap(cap) {
|
104
|
-
this.ref.setStrokeCap((0, _Host.
|
104
|
+
this.ref.setStrokeCap((0, _Host.getEnum)(this.CanvasKit.StrokeCap, cap));
|
105
105
|
}
|
106
106
|
|
107
107
|
setStrokeJoin(join) {
|
108
|
-
this.ref.setStrokeJoin((0, _Host.
|
108
|
+
this.ref.setStrokeJoin((0, _Host.getEnum)(this.CanvasKit.StrokeJoin, join));
|
109
109
|
}
|
110
110
|
|
111
111
|
setStrokeMiter(limit) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkPaint","HostObject","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","
|
1
|
+
{"version":3,"names":["JsiSkPaint","HostObject","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","getEnum","BlendMode","setColor","color","setColorFilter","filter","JsiSkColorFilter","fromValue","setImageFilter","JsiSkImageFilter","setMaskFilter","JsiSkMaskFilter","setPathEffect","effect","JsiSkPathEffect","setShader","shader","JsiSkShader","setStrokeCap","cap","StrokeCap","setStrokeJoin","join","StrokeJoin","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setDither(dither: boolean) {\n this.ref.setDither(dither);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":";;;;;;;AAgBA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,UAAN,SAAyBC,gBAAzB,CAAuE;EAC5EC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAIpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN6C;EAE7C;;EAMDC,IAAI,GAAG;IACL,OAAO,IAAIN,UAAJ,CAAe,KAAKG,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKH,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeK,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKN,GAAL,CAASM,QAAT,EAAP;EACD;;EAEDC,YAAY,GAAG;IACb,OAAO,KAAKP,GAAL,CAASO,YAAT,GAAwBC,KAA/B;EACD;;EAEDC,aAAa,GAAG;IACd,OAAO,KAAKT,GAAL,CAASS,aAAT,GAAyBD,KAAhC;EACD;;EAEDE,cAAc,GAAG;IACf,OAAO,KAAKV,GAAL,CAASU,cAAT,EAAP;EACD;;EAEDC,cAAc,GAAG;IACf,OAAO,KAAKX,GAAL,CAASW,cAAT,EAAP;EACD;;EAEDC,SAAS,CAACC,KAAD,EAAgB;IACvB,KAAKb,GAAL,CAASY,SAAT,CAAmBC,KAAnB;EACD;;EAEDC,YAAY,CAACC,EAAD,EAAc;IACxB,KAAKf,GAAL,CAASc,YAAT,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yC,SAAvB,EAAkCD,GAAlC,CAAtB;EACD;;EAEDE,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAK1C,GAAL,CAASyC,aAAT,CAAuB,IAAArB,aAAA,EAAQ,KAAKrB,SAAL,CAAe4C,UAAvB,EAAmCD,IAAnC,CAAvB;EACD;;EAEDE,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAK7C,GAAL,CAAS4C,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAK/C,GAAL,CAAS8C,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAKjD,GAAL,CAASgD,QAAT,CAAkB;MAAExC,KAAK,EAAEyC;IAAT,CAAlB;EACD;;AAnG2E"}
|
@@ -116,7 +116,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
116
116
|
}
|
117
117
|
|
118
118
|
setFillType(fill) {
|
119
|
-
this.ref.setFillType((0, _Host.
|
119
|
+
this.ref.setFillType((0, _Host.getEnum)(this.CanvasKit.FillType, fill));
|
120
120
|
return this;
|
121
121
|
}
|
122
122
|
|
@@ -131,8 +131,8 @@ class JsiSkPath extends _Host.HostObject {
|
|
131
131
|
// eslint-disable-next-line camelcase
|
132
132
|
miter_limit: opts.width,
|
133
133
|
precision: opts.width,
|
134
|
-
join: (0, _Host.optEnum)(opts.join),
|
135
|
-
cap: (0, _Host.optEnum)(opts.cap)
|
134
|
+
join: (0, _Host.optEnum)(this.CanvasKit.StrokeJoin, opts.join),
|
135
|
+
cap: (0, _Host.optEnum)(this.CanvasKit.StrokeCap, opts.cap)
|
136
136
|
});
|
137
137
|
return result === null ? result : this;
|
138
138
|
}
|
@@ -242,7 +242,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
242
242
|
}
|
243
243
|
|
244
244
|
op(path, op) {
|
245
|
-
return this.ref.op(JsiSkPath.fromValue(path), (0, _Host.
|
245
|
+
return this.ref.op(JsiSkPath.fromValue(path), (0, _Host.getEnum)(this.CanvasKit.PathOp, op));
|
246
246
|
}
|
247
247
|
|
248
248
|
simplify() {
|
@@ -266,7 +266,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
266
266
|
}
|
267
267
|
|
268
268
|
transform(m3) {
|
269
|
-
this.ref.transform(_JsiSkMatrix.JsiSkMatrix.fromValue(m3));
|
269
|
+
this.ref.transform(Array.isArray(m3) ? m3 : _JsiSkMatrix.JsiSkMatrix.fromValue(m3));
|
270
270
|
return this;
|
271
271
|
}
|
272
272
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["CommandCount","PathVerb","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","HostObject","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","JsiSkMatrix","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","JsiSkRect","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","JsiSkPoint","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","ckEnum","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","optEnum","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","JsiSkRRect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;;;;;;AAEA;;AAaA;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AmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF,CAND,MAMO;QACL,MAAME,MAAM,GAAGxJ,YAAY,CAACuJ,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,GAAiBA,MAArB,EAA6B;UAC3BD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACD;;QACD,IAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAOlG,MAAP;EACD;;AAxWuE"}
|
1
|
+
{"version":3,"names":["CommandCount","PathVerb","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","HostObject","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","JsiSkMatrix","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","JsiSkRect","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","JsiSkPoint","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","getEnum","FillType","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","optEnum","StrokeJoin","cap","StrokeCap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","JsiSkRRect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","PathOp","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","isArray","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { getEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(getEnum(this.CanvasKit.FillType, fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(this.CanvasKit.StrokeJoin, opts.join),\n cap: optEnum(this.CanvasKit.StrokeCap, opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op)\n );\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;;;;;;AAEA;;AAaA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG;EACnB,CAACC,eAAA,CAASC,IAAV,GAAiB,CADE;EAEnB,CAACD,eAAA,CAASE,IAAV,GAAiB,CAFE;EAGnB,CAACF,eAAA,CAASG,IAAV,GAAiB,CAHE;EAInB,CAACH,eAAA,CAASI,KAAV,GAAkB,CAJC;EAKnB,CAACJ,eAAA,CAASK,KAAV,GAAkB,CALC;EAMnB,CAACL,eAAA,CAASM,KAAV,GAAkB;AANC,CAArB;;AASA,MAAMC,IAAI,GAAIC,CAAD,IAAeC,IAAI,CAACC,GAAL,CAASD,IAAI,CAACE,GAAL,CAASH,CAAT,EAAY,CAAZ,CAAT,EAAyB,CAAzB,CAA5B;;AAEO,MAAMI,SAAN,SAAwBC,gBAAxB,CAAmE;EACxEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN4C;EAE5C;;EAMDC,OAAO,CAACC,GAAD,EAAcC,MAAd,EAAiD;IAAA,IAAhBC,MAAgB,uEAAP,KAAO;IACtD,MAAMC,IAAI,GAAG,CACXV,SAAS,CAACW,SAAV,CAAoBJ,GAApB,CADW,EAEX,IAAIC,MAAM,GAAGI,wBAAA,CAAYD,SAAZ,CAAoCH,MAApC,CAAH,GAAiD,EAA3D,CAFW,EAGX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AM,GAAG;IACP,MAAMC,IAAI,GAAG,KAAKrI,GAAL,CAASoI,MAAT,EAAb;IACA,MAAMpG,MAAM,GAAGqG,IAAI,CAACC,MAAL,CAA2B,CAACC,GAAD,EAAMC,GAAN,EAAWC,CAAX,KAAiB;MACzD,IAAIA,CAAC,KAAK,CAAV,EAAa;QACXF,GAAG,CAACG,IAAJ,CAAS,EAAT;MACD;;MACD,MAAMC,OAAO,GAAGJ,GAAG,CAACA,GAAG,CAACK,MAAJ,GAAa,CAAd,CAAnB;;MACA,IAAID,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;QACxBD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACA,MAAMI,MAAM,GAAG7J,YAAY,CAAC4J,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF,CAND,MAMO;QACL,MAAME,MAAM,GAAG7J,YAAY,CAAC4J,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,GAAiBA,MAArB,EAA6B;UAC3BD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACD;;QACD,IAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAOvG,MAAP;EACD;;AA3WuE"}
|
@@ -57,7 +57,7 @@ class JsiSkPathEffectFactory extends _Host.Host {
|
|
57
57
|
}
|
58
58
|
|
59
59
|
MakePath1D(path, advance, phase, style) {
|
60
|
-
const pe = this.CanvasKit.PathEffect.MakePath1D(_JsiSkPath.JsiSkPath.fromValue(path), advance, phase, (0, _Host.
|
60
|
+
const pe = this.CanvasKit.PathEffect.MakePath1D(_JsiSkPath.JsiSkPath.fromValue(path), advance, phase, (0, _Host.getEnum)(this.CanvasKit.Path1DEffect, style));
|
61
61
|
|
62
62
|
if (pe === null) {
|
63
63
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkPathEffectFactory","Host","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","JsiSkPathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","NotImplementedOnRNWeb","MakeSum","MakeLine2D","width","matrix","JsiSkMatrix","fromValue","MakePath1D","path","advance","style","JsiSkPath","
|
1
|
+
{"version":3,"names":["JsiSkPathEffectFactory","Host","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","JsiSkPathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","NotImplementedOnRNWeb","MakeSum","MakeLine2D","width","matrix","JsiSkMatrix","fromValue","MakePath1D","path","advance","style","JsiSkPath","getEnum","Path1DEffect","MakePath2D"],"sources":["JsiSkPathEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n Path1DEffectStyle,\n PathEffectFactory,\n SkMatrix,\n SkPath,\n SkPathEffect,\n} from \"../types\";\n\nimport { getEnum, Host, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\n\nexport class JsiSkPathEffectFactory extends Host implements PathEffectFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeCorner(radius: number) {\n const pe = this.CanvasKit.PathEffect.MakeCorner(radius);\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDash(intervals: number[], phase?: number) {\n const pe = this.CanvasKit.PathEffect.MakeDash(intervals, phase);\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDiscrete(segLength: number, dev: number, seedAssist: number) {\n const pe = this.CanvasKit.PathEffect.MakeDiscrete(\n segLength,\n dev,\n seedAssist\n );\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeSum(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeLine2D(width: number, matrix: SkMatrix) {\n const pe = this.CanvasKit.PathEffect.MakeLine2D(\n width,\n JsiSkMatrix.fromValue(matrix)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath1D(\n path: SkPath,\n advance: number,\n phase: number,\n style: Path1DEffectStyle\n ) {\n const pe = this.CanvasKit.PathEffect.MakePath1D(\n JsiSkPath.fromValue(path),\n advance,\n phase,\n getEnum(this.CanvasKit.Path1DEffect, style)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath2D(matrix: SkMatrix, path: SkPath) {\n const pe = this.CanvasKit.PathEffect.MakePath2D(\n JsiSkMatrix.fromValue(matrix),\n JsiSkPath.fromValue(path)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n}\n"],"mappings":";;;;;;;AAUA;;AACA;;AACA;;AACA;;AAEO,MAAMA,sBAAN,SAAqCC,UAArC,CAAuE;EAC5EC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,MAAD,EAAiB;IACzB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BH,UAA1B,CAAqCC,MAArC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX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I,oBAAA,CAAUL,SAAV,CAAoBE,IAApB,CADS,EAETC,OAFS,EAGTjB,KAHS,EAIT,IAAAoB,aAAA,EAAQ,KAAK5B,SAAL,CAAe6B,YAAvB,EAAqCH,KAArC,CAJS,CAAX;;IAMA,IAAIvB,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIE,gCAAJ,CAAoB,KAAKL,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAED2B,UAAU,CAACV,MAAD,EAAmBI,IAAnB,EAAiC;IACzC,MAAMrB,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0B0B,UAA1B,CACTT,wBAAA,CAAYC,SAAZ,CAAsBF,MAAtB,CADS,EAETO,oBAAA,CAAUL,SAAV,CAAoBE,IAApB,CAFS,CAAX;;IAIA,IAAIrB,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIE,gCAAJ,CAAoB,KAAKL,SAAzB,EAAoCG,EAApC,CAAP;EACD;;AAzE2E"}
|
@@ -29,7 +29,7 @@ class JsiSkPathFactory extends _Host.Host {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
MakeFromOp(one, two, op) {
|
32
|
-
const path = this.CanvasKit.Path.MakeFromOp(_JsiSkPath.JsiSkPath.fromValue(one), _JsiSkPath.JsiSkPath.fromValue(two), (0, _Host.
|
32
|
+
const path = this.CanvasKit.Path.MakeFromOp(_JsiSkPath.JsiSkPath.fromValue(one), _JsiSkPath.JsiSkPath.fromValue(two), (0, _Host.getEnum)(this.CanvasKit.PathOp, op));
|
33
33
|
|
34
34
|
if (path === null) {
|
35
35
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkPathFactory","Host","constructor","CanvasKit","Make","JsiSkPath","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","
|
1
|
+
{"version":3,"names":["JsiSkPathFactory","Host","constructor","CanvasKit","Make","JsiSkPath","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","getEnum","PathOp","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font","NotImplementedOnRNWeb"],"sources":["JsiSkPathFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { PathCommand, PathOp, SkFont, SkPath } from \"../types\";\nimport type { PathFactory } from \"../types/Path/PathFactory\";\n\nimport { Host, getEnum, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkPathFactory extends Host implements PathFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make() {\n return new JsiSkPath(this.CanvasKit, new this.CanvasKit.Path());\n }\n\n MakeFromSVGString(str: string) {\n const path = this.CanvasKit.Path.MakeFromSVGString(str);\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromOp(one: SkPath, two: SkPath, op: PathOp) {\n const path = this.CanvasKit.Path.MakeFromOp(\n JsiSkPath.fromValue(one),\n JsiSkPath.fromValue(two),\n getEnum(this.CanvasKit.PathOp, op)\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromCmds(cmds: PathCommand[]) {\n const path = this.CanvasKit.Path.MakeFromCmds(cmds.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromText(\n _text: string,\n _x: number,\n _y: number,\n _font: SkFont\n ): SkPath | null {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AAEO,MAAMA,gBAAN,SAA+BC,UAA/B,CAA2D;EAChEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,GAAG;IACL,OAAO,IAAIC,oBAAJ,CAAc,KAAKF,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeG,IAAnB,EAA9B,C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|
29
|
-
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShader((0, _Host.
|
29
|
+
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShader((0, _Host.getEnum)(this.CanvasKit.TileMode, tmx), (0, _Host.getEnum)(this.CanvasKit.TileMode, tmy), (0, _Host.getEnum)(this.CanvasKit.FilterMode, mode), localMatrix ? _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix) : undefined, tileRect ? _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined));
|
30
30
|
}
|
31
31
|
|
32
32
|
serialize() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkPicture","HostObject","constructor","CanvasKit","ref","delete","makeShader","tmx","tmy","mode","localMatrix","tileRect","JsiSkShader","
|
1
|
+
{"version":3,"names":["JsiSkPicture","HostObject","constructor","CanvasKit","ref","delete","makeShader","tmx","tmy","mode","localMatrix","tileRect","JsiSkShader","getEnum","TileMode","FilterMode","JsiSkMatrix","fromValue","undefined","JsiSkRect","serialize"],"sources":["JsiSkPicture.ts"],"sourcesContent":["// TODO: suggest to rename SkPicture to Picture for consistency\nimport type { CanvasKit, SkPicture as Picture } from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n SkRect,\n TileMode,\n SkPicture,\n SkMatrix,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPicture\n extends HostObject<Picture, \"Picture\">\n implements SkPicture\n{\n constructor(CanvasKit: CanvasKit, ref: Picture) {\n super(CanvasKit, ref, \"Picture\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeShader(\n tmx: TileMode,\n tmy: TileMode,\n mode: FilterMode,\n localMatrix?: SkMatrix,\n tileRect?: SkRect\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n getEnum(this.CanvasKit.TileMode, tmx),\n getEnum(this.CanvasKit.TileMode, tmy),\n getEnum(this.CanvasKit.FilterMode, mode),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,\n tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined\n )\n );\n }\n\n serialize() {\n return this.ref.serialize();\n }\n}\n"],"mappings":";;;;;;;AAWA;;AACA;;AACA;;AACA;;kNAdA;;;AAgBO,MAAMA,YAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;;IAD8C,iCAItC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN+C;EAE/C;;EAMDC,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;IACA,OAAO,IAAIC,wBAAJ,CACL,KAAKT,SADA,EAEL,KAAKC,GAAL,CAASE,UAAT,CACE,IAAAO,aAAA,EAAQ,KAAKV,SAAL,CAAeW,QAAvB,EAAiCP,GAAjC,CADF,EAEE,IAAAM,aAAA,EAAQ,KAAKV,SAAL,CAAeW,QAAvB,EAAiCN,GAAjC,CAFF,EAGE,IAAAK,aAAA,EAAQ,KAAKV,SAAL,CAAeY,UAAvB,EAAmCN,IAAnC,CAHF,EAIEC,WAAW,GAAGM,wBAAA,CAAYC,SAAZ,CAAsBP,WAAtB,CAAH,GAAwCQ,SAJrD,EAKEP,QAAQ,GAAGQ,oBAAA,CAAUF,SAAV,CAAoB,KAAKd,SAAzB,EAAoCQ,QAApC,CAAH,GAAmDO,SAL7D,CAFK,CAAP;EAUD;;EAEDE,SAAS,GAAG;IACV,OAAO,KAAKhB,GAAL,CAASgB,SAAT,EAAP;EACD;;AA9BH"}
|
@@ -7,6 +7,6 @@ import { JsiSkPicture } from "./JsiSkPicture";
|
|
7
7
|
export declare class JsiSkPictureRecorder extends HostObject<PictureRecorder, "PictureRecorder"> implements SkPictureRecorder {
|
8
8
|
constructor(CanvasKit: CanvasKit, ref: PictureRecorder);
|
9
9
|
dispose: () => void;
|
10
|
-
beginRecording(bounds
|
10
|
+
beginRecording(bounds?: SkRect): JsiSkCanvas;
|
11
11
|
finishRecordingAsPicture(): JsiSkPicture;
|
12
12
|
}
|
@@ -25,7 +25,7 @@ class JsiSkPictureRecorder extends _Host.HostObject {
|
|
25
25
|
}
|
26
26
|
|
27
27
|
beginRecording(bounds) {
|
28
|
-
return new _JsiSkCanvas.JsiSkCanvas(this.CanvasKit, this.ref.beginRecording(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, bounds)));
|
28
|
+
return new _JsiSkCanvas.JsiSkCanvas(this.CanvasKit, this.ref.beginRecording(bounds ? _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, bounds) : Float32Array.of(0, 0, 2_000_000, 2_000_000)));
|
29
29
|
}
|
30
30
|
|
31
31
|
finishRecordingAsPicture() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkPictureRecorder","HostObject","constructor","CanvasKit","ref","delete","beginRecording","bounds","JsiSkCanvas","JsiSkRect","fromValue","finishRecordingAsPicture","JsiSkPicture"],"sources":["JsiSkPictureRecorder.ts"],"sourcesContent":["import type { CanvasKit, PictureRecorder } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\nimport type { SkPictureRecorder } from \"../types/Picture/PictureRecorder\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPictureRecorder\n extends HostObject<PictureRecorder, \"PictureRecorder\">\n implements SkPictureRecorder\n{\n constructor(CanvasKit: CanvasKit, ref: PictureRecorder) {\n super(CanvasKit, ref, \"PictureRecorder\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n beginRecording(bounds
|
1
|
+
{"version":3,"names":["JsiSkPictureRecorder","HostObject","constructor","CanvasKit","ref","delete","beginRecording","bounds","JsiSkCanvas","JsiSkRect","fromValue","Float32Array","of","finishRecordingAsPicture","JsiSkPicture"],"sources":["JsiSkPictureRecorder.ts"],"sourcesContent":["import type { CanvasKit, PictureRecorder } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\nimport type { SkPictureRecorder } from \"../types/Picture/PictureRecorder\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPictureRecorder\n extends HostObject<PictureRecorder, \"PictureRecorder\">\n implements SkPictureRecorder\n{\n constructor(CanvasKit: CanvasKit, ref: PictureRecorder) {\n super(CanvasKit, ref, \"PictureRecorder\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n beginRecording(bounds?: SkRect) {\n return new JsiSkCanvas(\n this.CanvasKit,\n this.ref.beginRecording(\n bounds\n ? JsiSkRect.fromValue(this.CanvasKit, bounds)\n : Float32Array.of(0, 0, 2_000_000, 2_000_000)\n )\n );\n }\n\n finishRecordingAsPicture() {\n return new JsiSkPicture(\n this.CanvasKit,\n this.ref.finishRecordingAsPicture()\n );\n }\n}\n"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,oBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA6C;IACtD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,iBAAtB;;IADsD,iCAI9C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANuD;EAEvD;;EAMDC,cAAc,CAACC,MAAD,EAAkB;IAC9B,OAAO,IAAIC,wBAAJ,CACL,KAAKL,SADA,EAEL,KAAKC,GAAL,CAASE,cAAT,CACEC,MAAM,GACFE,oBAAA,CAAUC,SAAV,CAAoB,KAAKP,SAAzB,EAAoCI,MAApC,CADE,GAEFI,YAAY,CAACC,EAAb,CAAgB,CAAhB,EAAmB,CAAnB,EAAsB,SAAtB,EAAiC,SAAjC,CAHN,CAFK,CAAP;EAQD;;EAEDC,wBAAwB,GAAG;IACzB,OAAO,IAAIC,0BAAJ,CACL,KAAKX,SADA,EAEL,KAAKC,GAAL,CAASS,wBAAT,EAFK,CAAP;EAID;;AAzBH"}
|
@@ -19,19 +19,19 @@ class JsiSkShaderFactory extends _Host.Host {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
MakeLinearGradient(start, end, colors, pos, mode, localMatrix, flags) {
|
22
|
-
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(_JsiSkPoint.JsiSkPoint.fromValue(start), _JsiSkPoint.JsiSkPoint.fromValue(end), colors, pos, (0, _Host.
|
22
|
+
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(_JsiSkPoint.JsiSkPoint.fromValue(start), _JsiSkPoint.JsiSkPoint.fromValue(end), colors, pos, (0, _Host.getEnum)(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix), flags));
|
23
23
|
}
|
24
24
|
|
25
25
|
MakeRadialGradient(center, radius, colors, pos, mode, localMatrix, flags) {
|
26
|
-
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(_JsiSkPoint.JsiSkPoint.fromValue(center), radius, colors, pos, (0, _Host.
|
26
|
+
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(_JsiSkPoint.JsiSkPoint.fromValue(center), radius, colors, pos, (0, _Host.getEnum)(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix), flags));
|
27
27
|
}
|
28
28
|
|
29
29
|
MakeTwoPointConicalGradient(start, startRadius, end, endRadius, colors, pos, mode, localMatrix, flags) {
|
30
|
-
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(_JsiSkPoint.JsiSkPoint.fromValue(start), startRadius, _JsiSkPoint.JsiSkPoint.fromValue(end), endRadius, colors, pos, (0, _Host.
|
30
|
+
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(_JsiSkPoint.JsiSkPoint.fromValue(start), startRadius, _JsiSkPoint.JsiSkPoint.fromValue(end), endRadius, colors, pos, (0, _Host.getEnum)(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix), flags));
|
31
31
|
}
|
32
32
|
|
33
33
|
MakeSweepGradient(cx, cy, colors, pos, mode, localMatrix, flags, startAngleInDegrees, endAngleInDegrees) {
|
34
|
-
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, (0, _Host.
|
34
|
+
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, (0, _Host.getEnum)(this.CanvasKit.TileMode, mode), localMatrix === undefined || localMatrix === null ? undefined : _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
|
35
35
|
}
|
36
36
|
|
37
37
|
MakeTurbulence(baseFreqX, baseFreqY, octaves, seed, tileW, tileH) {
|
@@ -43,7 +43,7 @@ class JsiSkShaderFactory extends _Host.Host {
|
|
43
43
|
}
|
44
44
|
|
45
45
|
MakeBlend(mode, one, two) {
|
46
|
-
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend((0, _Host.
|
46
|
+
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend((0, _Host.getEnum)(this.CanvasKit.BlendMode, mode), _JsiSkShader.JsiSkShader.fromValue(one), _JsiSkShader.JsiSkShader.fromValue(two)));
|
47
47
|
}
|
48
48
|
|
49
49
|
MakeColor(color) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkShaderFactory","Host","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","JsiSkShader","Shader","JsiSkPoint","fromValue","
|
1
|
+
{"version":3,"names":["JsiSkShaderFactory","Host","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","JsiSkShader","Shader","JsiSkPoint","fromValue","getEnum","TileMode","undefined","JsiSkMatrix","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","BlendMode","MakeColor","color","ColorSpace","SRGB"],"sources":["JsiSkShaderFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, getEnum } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n JsiSkPoint.fromValue(start),\n JsiSkPoint.fromValue(end),\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n JsiSkPoint.fromValue(center),\n radius,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n JsiSkPoint.fromValue(start),\n startRadius,\n JsiSkPoint.fromValue(end),\n endRadius,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkShader.fromValue(one),\n JsiSkShader.fromValue(two)\n )\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB)\n );\n }\n}\n"],"mappings":";;;;;;;AAYA;;AACA;;AACA;;AACA;;AAEO,MAAMA,kBAAN,SAAiCC,UAAjC,CAA+D;EACpEC,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,kBAAkB,CAChBC,KADgB,EAEhBC,GAFgB,EAGhBC,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;IACA,OAAO,IAAIC,wBAAJ,CACL,KAAKT,SADA,EAEL,KAAKA,SAAL,CAAeU,MAAf,CAAsBT,kBAAtB,CACEU,sBAAA,CAAWC,SAAX,CAAqBV,KAArB,CADF,EAEES,sBAAA,CAAWC,SAAX,CAAqBT,GAArB,CAFF,EAGEC,MAHF,EAIEC,GAJF,EAKE,IAAAQ,aAAA,EAAQ,KAAKb,SAAL,CAAec,QAAvB,EAAiCR,IAAjC,CALF,EAMEC,WAAW,KAAKQ,SAAhB,GACIA,SADJ,GAEIC,wBAAA,CAAYJ,SAAZ,CAAsBL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AvB,EAAkCjC,IAAlC,CADF,EAEEG,wBAAA,CAAYG,SAAZ,CAAsByB,GAAtB,CAFF,EAGE5B,wBAAA,CAAYG,SAAZ,CAAsB0B,GAAtB,CAHF,CAFK,CAAP;EAQD;;EAEDE,SAAS,CAACC,KAAD,EAAiB;IACxB,OAAO,IAAIhC,wBAAJ,CACL,KAAKT,SADA,EAEL,KAAKA,SAAL,CAAeU,MAAf,CAAsB8B,SAAtB,CAAgCC,KAAhC,EAAuC,KAAKzC,SAAL,CAAe0C,UAAf,CAA0BC,IAAjE,CAFK,CAAP;EAID;;AA3KmE"}
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.MakeVertices = void 0;
|
7
7
|
|
8
|
-
var _Host = require("./Host");
|
9
|
-
|
10
8
|
var _JsiSkVertices = require("./JsiSkVertices");
|
11
9
|
|
10
|
+
var _Host = require("./Host");
|
11
|
+
|
12
12
|
const concat = function () {
|
13
13
|
let totalLength = 0;
|
14
14
|
|
@@ -31,7 +31,7 @@ const concat = function () {
|
|
31
31
|
return result;
|
32
32
|
};
|
33
33
|
|
34
|
-
const MakeVertices = (CanvasKit, mode, positions, textureCoordinates, colors, indices, isVolatile) => new _JsiSkVertices.JsiSkVertices(CanvasKit, CanvasKit.MakeVertices((0, _Host.
|
34
|
+
const MakeVertices = (CanvasKit, mode, positions, textureCoordinates, colors, indices, isVolatile) => new _JsiSkVertices.JsiSkVertices(CanvasKit, CanvasKit.MakeVertices((0, _Host.getEnum)(CanvasKit.VertexMode, mode), positions.map(_ref => {
|
35
35
|
let {
|
36
36
|
x,
|
37
37
|
y
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["concat","totalLength","arrays","arr","length","result","Float32Array","offset","set","MakeVertices","CanvasKit","mode","positions","textureCoordinates","colors","indices","isVolatile","JsiSkVertices","
|
1
|
+
{"version":3,"names":["concat","totalLength","arrays","arr","length","result","Float32Array","offset","set","MakeVertices","CanvasKit","mode","positions","textureCoordinates","colors","indices","isVolatile","JsiSkVertices","getEnum","VertexMode","map","x","y","flat","reduce","a","c"],"sources":["JsiSkVerticesFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkColor, SkPoint, VertexMode } from \"../types\";\n\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { getEnum } from \"./Host\";\n\nconst concat = (...arrays: Float32Array[]) => {\n let totalLength = 0;\n for (const arr of arrays) {\n totalLength += arr.length;\n }\n const result = new Float32Array(totalLength);\n let offset = 0;\n for (const arr of arrays) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n};\n\nexport const MakeVertices = (\n CanvasKit: CanvasKit,\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n) =>\n new JsiSkVertices(\n CanvasKit,\n CanvasKit.MakeVertices(\n getEnum(CanvasKit.VertexMode, mode),\n positions.map(({ x, y }) => [x, y]).flat(),\n (textureCoordinates || []).map(({ x, y }) => [x, y]).flat(),\n !colors ? null : colors.reduce((a, c) => concat(a, c)),\n indices,\n isVolatile\n )\n );\n"],"mappings":";;;;;;;AAIA;;AACA;;AAEA,MAAMA,MAAM,GAAG,YAA+B;EAC5C,IAAIC,WAAW,GAAG,CAAlB;;EAD4C,kCAA3BC,MAA2B;IAA3BA,MAA2B;EAAA;;EAE5C,KAAK,MAAMC,GAAX,IAAkBD,MAAlB,EAA0B;IACxBD,WAAW,IAAIE,GAAG,CAACC,MAAnB;EACD;;EACD,MAAMC,MAAM,GAAG,IAAIC,YAAJ,CAAiBL,WAAjB,CAAf;EACA,IAAIM,MAAM,GAAG,CAAb;;EACA,KAAK,MAAMJ,GAAX,IAAkBD,MAAlB,EAA0B;IACxBG,MAAM,CAACG,GAAP,CAAWL,GAAX,EAAgBI,MAAhB;IACAA,MAAM,IAAIJ,GAAG,CAACC,MAAd;EACD;;EACD,OAAOC,MAAP;AACD,CAZD;;AAcO,MAAMI,YAAY,GAAG,CAC1BC,SAD0B,EAE1BC,IAF0B,EAG1BC,SAH0B,EAI1BC,kBAJ0B,EAK1BC,MAL0B,EAM1BC,OAN0B,EAO1BC,UAP0B,KAS1B,IAAIC,4BAAJ,CACEP,SADF,EAEEA,SAAS,CAACD,YAAV,CACE,IAAAS,aAAA,EAAQR,SAAS,CAACS,UAAlB,EAA8BR,IAA9B,CADF,EAEEC,SAAS,CAACQ,GAAV,CAAc;EAAA,IAAC;IAAEC,CAAF;IAAKC;EAAL,CAAD;EAAA,OAAc,CAACD,CAAD,EAAIC,CAAJ,CAAd;AAAA,CAAd,EAAoCC,IAApC,EAFF,EAGE,CAACV,kBAAkB,IAAI,EAAvB,EAA2BO,GAA3B,CAA+B;EAAA,IAAC;IAAEC,CAAF;IAAKC;EAAL,CAAD;EAAA,OAAc,CAACD,CAAD,EAAIC,CAAJ,CAAd;AAAA,CAA/B,EAAqDC,IAArD,EAHF,EAIE,CAACT,MAAD,GAAU,IAAV,GAAiBA,MAAM,CAACU,MAAP,CAAc,CAACC,CAAD,EAAIC,CAAJ,KAAU1B,MAAM,CAACyB,CAAD,EAAIC,CAAJ,CAA9B,CAJnB,EAKEX,OALF,EAMEC,UANF,CAFF,CATK"}
|
@@ -1,5 +1,26 @@
|
|
1
|
-
import type { ISkiaValueApi } from "./types";
|
1
|
+
import type { AnimationState, ISkiaValueApi, SkiaAnimation, SkiaClockValue, SkiaMutableValue, SkiaValue } from "./types";
|
2
2
|
declare global {
|
3
3
|
var SkiaValueApi: ISkiaValueApi;
|
4
4
|
}
|
5
|
-
export declare const ValueApi:
|
5
|
+
export declare const ValueApi: {
|
6
|
+
/**
|
7
|
+
* @deprecated Use Reanimated 3
|
8
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
9
|
+
*/
|
10
|
+
createValue<T>(initialValue: T): SkiaMutableValue<T>;
|
11
|
+
/**
|
12
|
+
* @deprecated Use Reanimated 3
|
13
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
14
|
+
*/
|
15
|
+
createComputedValue<R>(cb: () => R, values: SkiaValue<unknown>[]): SkiaValue<R>;
|
16
|
+
/**
|
17
|
+
* @deprecated Use Reanimated 3
|
18
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
19
|
+
*/
|
20
|
+
createClockValue(): SkiaClockValue;
|
21
|
+
/**
|
22
|
+
* @deprecated Use Reanimated 3
|
23
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
24
|
+
*/
|
25
|
+
createAnimation<S extends AnimationState = AnimationState>(cb: (t: number, state: S | undefined) => S): SkiaAnimation;
|
26
|
+
};
|
@@ -7,6 +7,49 @@ exports.ValueApi = void 0;
|
|
7
7
|
const {
|
8
8
|
SkiaValueApi
|
9
9
|
} = global;
|
10
|
-
|
10
|
+
|
11
|
+
const deprecatedWarning = () => {
|
12
|
+
console.warn(`Skia values are deprecated and will be removed in the next Skia release.
|
13
|
+
Please use Reanimated instead: https://shopify.github.io/react-native-skia/docs/animations/animations`);
|
14
|
+
};
|
15
|
+
|
16
|
+
const ValueApi = {
|
17
|
+
/**
|
18
|
+
* @deprecated Use Reanimated 3
|
19
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
20
|
+
*/
|
21
|
+
createValue(initialValue) {
|
22
|
+
deprecatedWarning();
|
23
|
+
return SkiaValueApi.createValue(initialValue);
|
24
|
+
},
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @deprecated Use Reanimated 3
|
28
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
29
|
+
*/
|
30
|
+
createComputedValue(cb, values) {
|
31
|
+
deprecatedWarning();
|
32
|
+
return SkiaValueApi.createComputedValue(cb, values);
|
33
|
+
},
|
34
|
+
|
35
|
+
/**
|
36
|
+
* @deprecated Use Reanimated 3
|
37
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
38
|
+
*/
|
39
|
+
createClockValue() {
|
40
|
+
deprecatedWarning();
|
41
|
+
return SkiaValueApi.createClockValue();
|
42
|
+
},
|
43
|
+
|
44
|
+
/**
|
45
|
+
* @deprecated Use Reanimated 3
|
46
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
47
|
+
*/
|
48
|
+
createAnimation(cb) {
|
49
|
+
deprecatedWarning();
|
50
|
+
return SkiaValueApi.createAnimation(cb);
|
51
|
+
}
|
52
|
+
|
53
|
+
};
|
11
54
|
exports.ValueApi = ValueApi;
|
12
55
|
//# sourceMappingURL=api.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["SkiaValueApi","global","ValueApi"],"sources":["api.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"names":["SkiaValueApi","global","deprecatedWarning","console","warn","ValueApi","createValue","initialValue","createComputedValue","cb","values","createClockValue","createAnimation"],"sources":["api.ts"],"sourcesContent":["import type {\n AnimationState,\n ISkiaValueApi,\n SkiaAnimation,\n SkiaClockValue,\n SkiaMutableValue,\n SkiaValue,\n} from \"./types\";\n\ndeclare global {\n var SkiaValueApi: ISkiaValueApi;\n}\n\nconst { SkiaValueApi } = global;\n\nconst deprecatedWarning = () => {\n console.warn(\n `Skia values are deprecated and will be removed in the next Skia release.\nPlease use Reanimated instead: https://shopify.github.io/react-native-skia/docs/animations/animations`\n );\n};\n\nexport const ValueApi = {\n /**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n */\n createValue<T>(initialValue: T): SkiaMutableValue<T> {\n deprecatedWarning();\n return SkiaValueApi.createValue(initialValue);\n },\n /**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n */\n createComputedValue<R>(\n cb: () => R,\n values: SkiaValue<unknown>[]\n ): SkiaValue<R> {\n deprecatedWarning();\n return SkiaValueApi.createComputedValue(cb, values);\n },\n /**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n */\n createClockValue(): SkiaClockValue {\n deprecatedWarning();\n return SkiaValueApi.createClockValue();\n },\n /**\n * @deprecated Use Reanimated 3\n * for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations\n */\n createAnimation<S extends AnimationState = AnimationState>(\n cb: (t: number, state: S | undefined) => S\n ): SkiaAnimation {\n deprecatedWarning();\n return SkiaValueApi.createAnimation(cb);\n },\n};\n"],"mappings":";;;;;;AAaA,MAAM;EAAEA;AAAF,IAAmBC,MAAzB;;AAEA,MAAMC,iBAAiB,GAAG,MAAM;EAC9BC,OAAO,CAACC,IAAR,CACG;AACL,sGAFE;AAID,CALD;;AAOO,MAAMC,QAAQ,GAAG;EACtB;AACF;AACA;AACA;EACEC,WAAW,CAAIC,YAAJ,EAA0C;IACnDL,iBAAiB;IACjB,OAAOF,YAAY,CAACM,WAAb,CAAyBC,YAAzB,CAAP;EACD,CARqB;;EAStB;AACF;AACA;AACA;EACEC,mBAAmB,CACjBC,EADiB,EAEjBC,MAFiB,EAGH;IACdR,iBAAiB;IACjB,OAAOF,YAAY,CAACQ,mBAAb,CAAiCC,EAAjC,EAAqCC,MAArC,CAAP;EACD,CAnBqB;;EAoBtB;AACF;AACA;AACA;EACEC,gBAAgB,GAAmB;IACjCT,iBAAiB;IACjB,OAAOF,YAAY,CAACW,gBAAb,EAAP;EACD,CA3BqB;;EA4BtB;AACF;AACA;AACA;EACEC,eAAe,CACbH,EADa,EAEE;IACfP,iBAAiB;IACjB,OAAOF,YAAY,CAACY,eAAb,CAA6BH,EAA7B,CAAP;EACD;;AArCqB,CAAjB"}
|
@@ -1,4 +1,7 @@
|
|
1
1
|
/**
|
2
|
+
* @deprecated Use Reanimated 3
|
3
|
+
* for animating Skia: https://shopify.github.io/react-native-skia/docs/animations/animations
|
4
|
+
*
|
2
5
|
* @returns A new value that will be updated on every frame redraw with the
|
3
6
|
* number of milliseconds elapsed since the value was started.
|
4
7
|
* The clock is created in the stopped state.
|