@shopify/react-native-skia 0.1.141 → 0.1.145
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +2 -2
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +1 -1
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -16
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +2 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +69 -27
- package/cpp/api/JsiSkPaint.h +6 -0
- package/cpp/api/JsiSkPathFactory.h +1 -1
- package/cpp/api/JsiSkPicture.h +7 -1
- package/cpp/rnskia/RNSkDrawView.cpp +66 -66
- package/cpp/rnskia/RNSkDrawView.h +22 -6
- package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
- package/cpp/rnskia/values/RNSkComputedValue.h +10 -7
- package/cpp/rnskia/values/RNSkReadonlyValue.h +21 -2
- package/cpp/rnskia/values/RNSkValue.h +1 -0
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +1 -1
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm +2 -2
- package/ios/RNSkia-iOS/SkiaDrawView.mm +4 -0
- package/lib/commonjs/mock/index.js +3 -1
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +17 -7
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/DependencyManager.js +144 -36
- package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +1 -1
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.js +20 -5
- package/lib/commonjs/renderer/components/Blend.js.map +1 -1
- package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Declaration.js +2 -3
- package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Drawing.js +3 -7
- package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/nodes/Node.js +9 -7
- package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js +14 -20
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/core/Data.js +10 -22
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Font.js +2 -3
- package/lib/commonjs/skia/core/Font.js.map +1 -1
- package/lib/commonjs/skia/core/Image.js.map +1 -1
- package/lib/commonjs/skia/core/SVG.js.map +1 -1
- package/lib/commonjs/skia/core/Typeface.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.js +5 -0
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
- package/lib/commonjs/skia/web/Host.js +12 -21
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +50 -28
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +4 -4
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js +7 -3
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +4 -2
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +4 -2
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +61 -19
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js +19 -6
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js +16 -60
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +7 -3
- 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 +5 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +3 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.js +9 -1
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.js +9 -1
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.js +3 -3
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +4 -2
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +10 -6
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.js +3 -1
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +8 -4
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +12 -6
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js +6 -2
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/index.js +13 -0
- package/lib/commonjs/values/index.js.map +1 -1
- package/lib/commonjs/values/selector.js +24 -0
- package/lib/commonjs/values/selector.js.map +1 -0
- package/lib/commonjs/values/web/RNSkComputedValue.js +8 -0
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +4 -0
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/mock/index.js +2 -1
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +17 -6
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/DependencyManager.js +141 -34
- package/lib/module/renderer/DependencyManager.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +1 -1
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/components/Blend.js +21 -5
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/nodes/Declaration.js +3 -4
- package/lib/module/renderer/nodes/Declaration.js.map +1 -1
- package/lib/module/renderer/nodes/Drawing.js +3 -6
- package/lib/module/renderer/nodes/Drawing.js.map +1 -1
- package/lib/module/renderer/nodes/Node.js +9 -7
- package/lib/module/renderer/nodes/Node.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js +9 -15
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/core/Data.js +10 -20
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Font.js +2 -3
- package/lib/module/skia/core/Font.js.map +1 -1
- package/lib/module/skia/core/Image.js.map +1 -1
- package/lib/module/skia/core/SVG.js.map +1 -1
- package/lib/module/skia/core/Typeface.js.map +1 -1
- package/lib/module/skia/types/Data/Data.js +1 -1
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/types/Paint/Paint.js.map +1 -1
- package/lib/module/skia/web/Host.js +9 -9
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +40 -29
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +5 -5
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +6 -4
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +4 -3
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +4 -3
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js +61 -20
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js +2 -2
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +15 -7
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +15 -62
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +6 -4
- 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 +4 -2
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js +3 -2
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.js +10 -2
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.js +10 -2
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.js +4 -4
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +4 -3
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js +9 -7
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.js +3 -2
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js +7 -5
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypefaceFactory.js +2 -2
- package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +10 -5
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.js +7 -3
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/index.js +1 -0
- package/lib/module/values/index.js.map +1 -1
- package/lib/module/values/selector.js +15 -0
- package/lib/module/values/selector.js.map +1 -0
- package/lib/module/values/web/RNSkComputedValue.js +8 -0
- package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js +4 -0
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
- package/lib/typescript/src/renderer/DependencyManager.d.ts +40 -14
- package/lib/typescript/src/renderer/nodes/Declaration.d.ts +2 -2
- package/lib/typescript/src/renderer/nodes/Drawing.d.ts +2 -2
- package/lib/typescript/src/renderer/nodes/Node.d.ts +3 -2
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +7 -3
- package/lib/typescript/src/skia/core/Data.d.ts +3 -5
- package/lib/typescript/src/skia/core/Font.d.ts +2 -2
- package/lib/typescript/src/skia/core/Image.d.ts +2 -2
- package/lib/typescript/src/skia/core/SVG.d.ts +2 -2
- package/lib/typescript/src/skia/core/Typeface.d.ts +2 -2
- package/lib/typescript/src/skia/types/Data/Data.d.ts +10 -3
- package/lib/typescript/src/skia/types/Paint/Paint.d.ts +5 -0
- package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -1
- package/lib/typescript/src/skia/web/Host.d.ts +6 -8
- package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +8 -8
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +3 -2
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +3 -2
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -2
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -3
- package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +2 -1
- package/lib/typescript/src/values/index.d.ts +1 -0
- package/lib/typescript/src/values/selector.d.ts +14 -0
- package/lib/typescript/src/values/types.d.ts +4 -0
- package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -0
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -0
- package/libs/ios/libskia.xcframework/Info.plist +5 -5
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +3 -3
- package/src/mock/index.ts +2 -1
- package/src/renderer/Canvas.tsx +19 -7
- package/src/renderer/DependencyManager.tsx +171 -37
- package/src/renderer/HostConfig.ts +1 -1
- package/src/renderer/components/Blend.tsx +25 -5
- package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
- package/src/renderer/components/imageFilters/Morphology.tsx +2 -2
- package/src/renderer/components/imageFilters/Shadow.tsx +2 -2
- package/src/renderer/nodes/Declaration.tsx +6 -8
- package/src/renderer/nodes/Drawing.tsx +5 -7
- package/src/renderer/nodes/Node.ts +11 -9
- package/src/renderer/processors/Animations/Animations.ts +23 -14
- package/src/skia/core/Data.ts +20 -51
- package/src/skia/core/Font.ts +4 -5
- package/src/skia/core/Image.ts +2 -2
- package/src/skia/core/SVG.ts +2 -2
- package/src/skia/core/Typeface.ts +2 -2
- package/src/skia/types/Data/Data.ts +11 -1
- package/src/skia/types/Paint/Paint.ts +6 -0
- package/src/skia/types/Picture/Picture.ts +2 -1
- package/src/skia/web/Host.ts +12 -22
- package/src/skia/web/JsiSkCanvas.ts +99 -56
- package/src/skia/web/JsiSkColorFilterFactory.ts +15 -5
- package/src/skia/web/JsiSkFont.ts +11 -4
- package/src/skia/web/JsiSkImage.ts +4 -3
- package/src/skia/web/JsiSkImageFactory.ts +6 -3
- package/src/skia/web/JsiSkImageFilterFactory.ts +124 -52
- package/src/skia/web/JsiSkMatrix.ts +4 -2
- package/src/skia/web/JsiSkPaint.ts +15 -7
- package/src/skia/web/JsiSkPath.ts +30 -56
- package/src/skia/web/JsiSkPathEffectFactory.ts +10 -5
- package/src/skia/web/JsiSkPathFactory.ts +3 -3
- package/src/skia/web/JsiSkPicture.ts +5 -3
- package/src/skia/web/JsiSkPictureRecorder.ts +3 -2
- package/src/skia/web/JsiSkPoint.ts +12 -2
- package/src/skia/web/JsiSkRRect.ts +16 -2
- package/src/skia/web/JsiSkRSXform.ts +1 -1
- package/src/skia/web/JsiSkRect.ts +4 -7
- package/src/skia/web/JsiSkRuntimeEffect.ts +9 -4
- package/src/skia/web/JsiSkShaderFactory.ts +24 -15
- package/src/skia/web/JsiSkSurface.ts +7 -2
- package/src/skia/web/JsiSkTextBlobFactory.ts +14 -8
- package/src/skia/web/JsiSkTypefaceFactory.tsx +4 -2
- package/src/skia/web/JsiSkia.ts +17 -5
- package/src/values/hooks/useComputedValue.ts +6 -3
- package/src/values/index.ts +1 -0
- package/src/values/selector.ts +24 -0
- package/src/values/types.ts +4 -0
- package/src/values/web/RNSkComputedValue.ts +6 -0
- package/src/values/web/RNSkReadonlyValue.ts +4 -0
@@ -1,6 +1,14 @@
|
|
1
|
-
import {
|
1
|
+
import { BaseHostObject } from "./Host";
|
2
2
|
import { JsiSkRect } from "./JsiSkRect";
|
3
|
-
export class JsiSkRRect extends
|
3
|
+
export class JsiSkRRect extends BaseHostObject {
|
4
|
+
static fromValue(CanvasKit, rect) {
|
5
|
+
if (rect instanceof JsiSkRect) {
|
6
|
+
return rect.ref;
|
7
|
+
}
|
8
|
+
|
9
|
+
return CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect.rect), rect.rx, rect.ry);
|
10
|
+
}
|
11
|
+
|
4
12
|
constructor(CanvasKit, ref) {
|
5
13
|
super(CanvasKit, ref, "RRect");
|
6
14
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkRRect.ts"],"names":["
|
1
|
+
{"version":3,"sources":["JsiSkRRect.ts"],"names":["BaseHostObject","JsiSkRect","JsiSkRRect","fromValue","CanvasKit","rect","ref","RRectXY","rx","ry","constructor","Float32Array","of"],"mappings":"AAIA,SAASA,cAAT,QAA+B,QAA/B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,UAAN,SACGF,cADH,CAGP;AACkB,SAATG,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAsC;AACpD,QAAIA,IAAI,YAAYJ,SAApB,EAA+B;AAC7B,aAAOI,IAAI,CAACC,GAAZ;AACD;;AACD,WAAOF,SAAS,CAACG,OAAV,CACLN,SAAS,CAACE,SAAV,CAAoBC,SAApB,EAA+BC,IAAI,CAACA,IAApC,CADK,EAELA,IAAI,CAACG,EAFA,EAGLH,IAAI,CAACI,EAHA,CAAP;AAKD;;AAEDC,EAAAA,WAAW,CAACN,SAAD,EAAuBE,GAAvB,EAAmC;AAC5C,UAAMF,SAAN,EAAiBE,GAAjB,EAAsB,OAAtB;AACD;;AAEK,MAAFE,EAAE,GAAG;AACP,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAEK,MAAFG,EAAE,GAAG;AACP,WAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;AACD;;AAEO,MAAJD,IAAI,GAAG;AACT,WAAO,IAAIJ,SAAJ,CACL,KAAKG,SADA,EAELO,YAAY,CAACC,EAAb,CAAgB,KAAKN,GAAL,CAAS,CAAT,CAAhB,EAA6B,KAAKA,GAAL,CAAS,CAAT,CAA7B,EAA0C,KAAKA,GAAL,CAAS,CAAT,CAA1C,EAAuD,KAAKA,GAAL,CAAS,CAAT,CAAvD,CAFK,CAAP;AAID;;AA7BH","sourcesContent":["import type { CanvasKit, RRect } from \"canvaskit-wasm\";\n\nimport type { SkRRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkRRect\n extends BaseHostObject<RRect, \"RRect\">\n implements SkRRect\n{\n static fromValue(CanvasKit: CanvasKit, rect: SkRRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.RRectXY(\n JsiSkRect.fromValue(CanvasKit, rect.rect),\n rect.rx,\n rect.ry\n );\n }\n\n constructor(CanvasKit: CanvasKit, ref: RRect) {\n super(CanvasKit, ref, \"RRect\");\n }\n\n get rx() {\n return this.ref[4];\n }\n\n get ry() {\n return this.ref[5];\n }\n\n get rect() {\n return new JsiSkRect(\n this.CanvasKit,\n Float32Array.of(this.ref[0], this.ref[1], this.ref[2], this.ref[3])\n );\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkRSXform.ts"],"names":["HostObject","JsiSkRSXform","constructor","CanvasKit","ref"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAIA,OAAO,MAAMC,YAAN,SACGD,UADH,CAGP;AACEE,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAHH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkRSXform } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\
|
1
|
+
{"version":3,"sources":["JsiSkRSXform.ts"],"names":["HostObject","JsiSkRSXform","constructor","CanvasKit","ref"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAIA,OAAO,MAAMC,YAAN,SACGD,UADH,CAGP;AACEE,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAHH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkRSXform } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport type RSXform = Float32Array;\n\nexport class JsiSkRSXform\n extends HostObject<RSXform, \"RSXform\">\n implements SkRSXform\n{\n constructor(CanvasKit: CanvasKit, ref: RSXform) {\n super(CanvasKit, ref, \"RSXform\");\n }\n}\n"]}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
export class JsiSkRect extends
|
1
|
+
import { BaseHostObject } from "./Host";
|
2
|
+
export class JsiSkRect extends BaseHostObject {
|
3
3
|
static fromValue(CanvasKit, rect) {
|
4
4
|
if (rect instanceof JsiSkRect) {
|
5
|
-
return rect;
|
5
|
+
return rect.ref;
|
6
6
|
}
|
7
7
|
|
8
|
-
return
|
8
|
+
return CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height);
|
9
9
|
}
|
10
10
|
|
11
11
|
constructor(CanvasKit, ref) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkRect.ts"],"names":["
|
1
|
+
{"version":3,"sources":["JsiSkRect.ts"],"names":["BaseHostObject","JsiSkRect","fromValue","CanvasKit","rect","ref","XYWHRect","x","y","width","height","constructor"],"mappings":"AAIA,SAASA,cAAT,QAA+B,QAA/B;AAEA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAAuE;AAC5D,SAATE,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAqC;AACnD,QAAIA,IAAI,YAAYH,SAApB,EAA+B;AAC7B,aAAOG,IAAI,CAACC,GAAZ;AACD;;AACD,WAAOF,SAAS,CAACG,QAAV,CAAmBF,IAAI,CAACG,CAAxB,EAA2BH,IAAI,CAACI,CAAhC,EAAmCJ,IAAI,CAACK,KAAxC,EAA+CL,IAAI,CAACM,MAApD,CAAP;AACD;;AAEDC,EAAAA,WAAW,CAACR,SAAD,EAAuBE,GAAvB,EAAkC;AAC3C,UAAMF,SAAN,EAAiBE,GAAjB,EAAsB,MAAtB;AACD;;AAEI,MAADE,CAAC,GAAG;AACN,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAEI,MAADG,CAAC,GAAG;AACN,WAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;AACD;;AAEQ,MAALI,KAAK,GAAG;AACV,WAAO,KAAKJ,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AAES,MAANK,MAAM,GAAG;AACX,WAAO,KAAKL,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AA1B2E","sourcesContent":["import type { CanvasKit, Rect } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\n\nexport class JsiSkRect extends BaseHostObject<Rect, \"Rect\"> implements SkRect {\n static fromValue(CanvasKit: CanvasKit, rect: SkRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height);\n }\n\n constructor(CanvasKit: CanvasKit, ref: Rect) {\n super(CanvasKit, ref, \"Rect\");\n }\n\n get x() {\n return this.ref[0];\n }\n\n get y() {\n return this.ref[1];\n }\n\n get width() {\n return this.ref[2] - this.ref[0];\n }\n\n get height() {\n return this.ref[3] - this.ref[1];\n }\n}\n"]}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { HostObject
|
1
|
+
import { HostObject } from "./Host";
|
2
|
+
import { JsiSkMatrix } from "./JsiSkMatrix";
|
2
3
|
import { JsiSkShader } from "./JsiSkShader";
|
3
4
|
export class JsiSkRuntimeEffect extends HostObject {
|
4
5
|
constructor(CanvasKit, ref) {
|
@@ -6,11 +7,11 @@ export class JsiSkRuntimeEffect extends HostObject {
|
|
6
7
|
}
|
7
8
|
|
8
9
|
makeShader(uniforms, localMatrix) {
|
9
|
-
return new JsiSkShader(this.CanvasKit, this.ref.makeShader(uniforms, localMatrix !== undefined ?
|
10
|
+
return new JsiSkShader(this.CanvasKit, this.ref.makeShader(uniforms, localMatrix !== undefined ? JsiSkMatrix.fromValue(localMatrix) : localMatrix));
|
10
11
|
}
|
11
12
|
|
12
13
|
makeShaderWithChildren(uniforms, children, localMatrix) {
|
13
|
-
return new JsiSkShader(this.CanvasKit, this.ref.makeShaderWithChildren(uniforms, children === null || children === void 0 ? void 0 : children.map(child =>
|
14
|
+
return new JsiSkShader(this.CanvasKit, this.ref.makeShaderWithChildren(uniforms, children === null || children === void 0 ? void 0 : children.map(child => JsiSkShader.fromValue(child)), localMatrix !== undefined ? JsiSkMatrix.fromValue(localMatrix) : localMatrix));
|
14
15
|
}
|
15
16
|
|
16
17
|
getUniform(index) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkRuntimeEffect.ts"],"names":["HostObject","
|
1
|
+
{"version":3,"sources":["JsiSkRuntimeEffect.ts"],"names":["HostObject","JsiSkMatrix","JsiSkShader","JsiSkRuntimeEffect","constructor","CanvasKit","ref","makeShader","uniforms","localMatrix","undefined","fromValue","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"mappings":"AAKA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SACGH,UADH,CAGP;AACEI,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA2C;AACpD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,eAAtB;AACD;;AAEDC,EAAAA,UAAU,CAACC,QAAD,EAAqBC,WAArB,EAA6C;AACrD,WAAO,IAAIP,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASC,UAAT,CACEC,QADF,EAEEC,WAAW,KAAKC,SAAhB,GACIT,WAAW,CAACU,SAAZ,CAAsBF,WAAtB,CADJ,GAEIA,WAJN,CAFK,CAAP;AASD;;AAEDG,EAAAA,sBAAsB,CACpBJ,QADoB,EAEpBK,QAFoB,EAGpBJ,WAHoB,EAIpB;AACA,WAAO,IAAIP,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASM,sBAAT,CACEJ,QADF,EAEEK,QAFF,aAEEA,QAFF,uBAEEA,QAAQ,CAAEC,GAAV,CAAeC,KAAD,IAAWb,WAAW,CAACS,SAAZ,CAAsBI,KAAtB,CAAzB,CAFF,EAGEN,WAAW,KAAKC,SAAhB,GACIT,WAAW,CAACU,SAAZ,CAAsBF,WAAtB,CADJ,GAEIA,WALN,CAFK,CAAP;AAUD;;AAEDO,EAAAA,UAAU,CAACC,KAAD,EAAgB;AACxB,WAAO,KAAKX,GAAL,CAASU,UAAT,CAAoBC,KAApB,CAAP;AACD;;AAEDC,EAAAA,eAAe,GAAG;AAChB,WAAO,KAAKZ,GAAL,CAASY,eAAT,EAAP;AACD;;AAEDC,EAAAA,oBAAoB,GAAG;AACrB,WAAO,KAAKb,GAAL,CAASa,oBAAT,EAAP;AACD;;AAEDC,EAAAA,cAAc,CAACH,KAAD,EAAgB;AAC5B,WAAO,KAAKX,GAAL,CAASc,cAAT,CAAwBH,KAAxB,CAAP;AACD;;AAhDH","sourcesContent":["import type { CanvasKit, RuntimeEffect } from \"canvaskit-wasm\";\n\nimport type { SkMatrix, SkShader } from \"../types\";\nimport type { SkRuntimeEffect } from \"../types/RuntimeEffect/RuntimeEffect\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkRuntimeEffect\n extends HostObject<RuntimeEffect, \"RuntimeEffect\">\n implements SkRuntimeEffect\n{\n constructor(CanvasKit: CanvasKit, ref: RuntimeEffect) {\n super(CanvasKit, ref, \"RuntimeEffect\");\n }\n\n makeShader(uniforms: number[], localMatrix?: SkMatrix) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n uniforms,\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderWithChildren(\n uniforms,\n children?.map((child) => JsiSkShader.fromValue(child)),\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n getUniform(index: number) {\n return this.ref.getUniform(index);\n }\n\n getUniformCount() {\n return this.ref.getUniformCount();\n }\n\n getUniformFloatCount() {\n return this.ref.getUniformFloatCount();\n }\n\n getUniformName(index: number) {\n return this.ref.getUniformName(index);\n }\n}\n"]}
|
@@ -1,4 +1,6 @@
|
|
1
|
-
import { Host,
|
1
|
+
import { Host, ckEnum } from "./Host";
|
2
|
+
import { JsiSkMatrix } from "./JsiSkMatrix";
|
3
|
+
import { JsiSkPoint } from "./JsiSkPoint";
|
2
4
|
import { JsiSkShader } from "./JsiSkShader";
|
3
5
|
export class JsiSkShaderFactory extends Host {
|
4
6
|
constructor(CanvasKit) {
|
@@ -6,19 +8,19 @@ export class JsiSkShaderFactory extends Host {
|
|
6
8
|
}
|
7
9
|
|
8
10
|
MakeLinearGradient(start, end, colors, pos, mode, localMatrix, flags) {
|
9
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(
|
11
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(JsiSkPoint.fromValue(start), JsiSkPoint.fromValue(end), colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
|
10
12
|
}
|
11
13
|
|
12
14
|
MakeRadialGradient(center, radius, colors, pos, mode, localMatrix, flags) {
|
13
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(
|
15
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(JsiSkPoint.fromValue(center), radius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
|
14
16
|
}
|
15
17
|
|
16
18
|
MakeTwoPointConicalGradient(start, startRadius, end, endRadius, colors, pos, mode, localMatrix, flags) {
|
17
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(
|
19
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(JsiSkPoint.fromValue(start), startRadius, JsiSkPoint.fromValue(end), endRadius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
|
18
20
|
}
|
19
21
|
|
20
22
|
MakeSweepGradient(cx, cy, colors, pos, mode, localMatrix, flags, startAngleInDegrees, endAngleInDegrees) {
|
21
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, ckEnum(mode), localMatrix === undefined || localMatrix === null ? undefined :
|
23
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, ckEnum(mode), localMatrix === undefined || localMatrix === null ? undefined : JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
|
22
24
|
}
|
23
25
|
|
24
26
|
MakeTurbulence(baseFreqX, baseFreqY, octaves, seed, tileW, tileH) {
|
@@ -30,11 +32,11 @@ export class JsiSkShaderFactory extends Host {
|
|
30
32
|
}
|
31
33
|
|
32
34
|
MakeBlend(mode, one, two) {
|
33
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(ckEnum(mode),
|
35
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(ckEnum(mode), JsiSkShader.fromValue(one), JsiSkShader.fromValue(two)));
|
34
36
|
}
|
35
37
|
|
36
38
|
MakeColor(color) {
|
37
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeColor(
|
39
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB));
|
38
40
|
}
|
39
41
|
|
40
42
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkShaderFactory.ts"],"names":["Host","
|
1
|
+
{"version":3,"sources":["JsiSkShaderFactory.ts"],"names":["Host","ckEnum","JsiSkMatrix","JsiSkPoint","JsiSkShader","JsiSkShaderFactory","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","Shader","fromValue","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","MakeColor","color","ColorSpace","SRGB"],"mappings":"AAYA,SAASA,IAAT,EAAeC,MAAf,QAA6B,QAA7B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SAAiCL,IAAjC,CAA+D;AACpEM,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,kBAAkB,CAChBC,KADgB,EAEhBC,GAFgB,EAGhBC,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;AACA,WAAO,IAAIX,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsBR,kBAAtB,CACEL,UAAU,CAACc,SAAX,CAAqBR,KAArB,CADF,EAEEN,UAAU,CAACc,SAAX,CAAqBP,GAArB,CAFF,EAGEC,MAHF,EAIEC,GAJF,EAKEX,MAAM,CAACY,IAAD,CALR,EAMEC,WAAW,KAAKI,SAAhB,GACIA,SADJ,GAEIhB,WAAW,CAACe,SAAZ,CAAsBH,WAAtB,CARN,EASEC,KATF,CAFK,CAAP;AAcD;;AAEDI,EAAAA,kBAAkB,CAChBC,MADgB,EAEhBC,MAFgB,EAGhBV,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;AACA,WAAO,IAAIX,WAAJ,CACL,KAA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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, ckEnum } 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 ckEnum(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 ckEnum(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 ckEnum(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 ckEnum(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 ckEnum(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"]}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { HostObject
|
1
|
+
import { HostObject } from "./Host";
|
2
2
|
import { JsiSkCanvas } from "./JsiSkCanvas";
|
3
3
|
import { JsiSkImage } from "./JsiSkImage";
|
4
|
+
import { JsiSkRect } from "./JsiSkRect";
|
4
5
|
export class JsiSkSurface extends HostObject {
|
5
6
|
constructor(CanvasKit, ref) {
|
6
7
|
super(CanvasKit, ref, "Surface");
|
@@ -11,7 +12,7 @@ export class JsiSkSurface extends HostObject {
|
|
11
12
|
}
|
12
13
|
|
13
14
|
makeImageSnapshot(bounds) {
|
14
|
-
const image = this.ref.makeImageSnapshot(
|
15
|
+
const image = this.ref.makeImageSnapshot(bounds ? Array.from(JsiSkRect.fromValue(this.CanvasKit, bounds)) : undefined);
|
15
16
|
return new JsiSkImage(this.CanvasKit, image);
|
16
17
|
}
|
17
18
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkSurface.ts"],"names":["HostObject","
|
1
|
+
{"version":3,"sources":["JsiSkSurface.ts"],"names":["HostObject","JsiSkCanvas","JsiSkImage","JsiSkRect","JsiSkSurface","constructor","CanvasKit","ref","getCanvas","makeImageSnapshot","bounds","image","Array","from","fromValue","undefined"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,YAAN,SACGJ,UADH,CAGP;AACEK,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAEDC,EAAAA,SAAS,GAAa;AACpB,WAAO,IAAIP,WAAJ,CAAgB,KAAKK,SAArB,EAAgC,KAAKC,GAAL,CAASC,SAAT,EAAhC,CAAP;AACD;;AAEDC,EAAAA,iBAAiB,CAACC,MAAD,EAA2B;AAC1C,UAAMC,KAAK,GAAG,KAAKJ,GAAL,CAASE,iBAAT,CACZC,MAAM,GACFE,KAAK,CAACC,IAAN,CAAWV,SAAS,CAACW,SAAV,CAAoB,KAAKR,SAAzB,EAAoCI,MAApC,CAAX,CADE,GAEFK,SAHQ,CAAd;AAKA,WAAO,IAAIb,UAAJ,CAAe,KAAKI,SAApB,EAA+BK,KAA/B,CAAP;AACD;;AAhBH","sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { SkCanvas, SkImage, SkRect, SkSurface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkSurface\n extends HostObject<Surface, \"Surface\">\n implements SkSurface\n{\n constructor(CanvasKit: CanvasKit, ref: Surface) {\n super(CanvasKit, ref, \"Surface\");\n }\n\n getCanvas(): SkCanvas {\n return new JsiSkCanvas(this.CanvasKit, this.ref.getCanvas());\n }\n\n makeImageSnapshot(bounds?: SkRect): SkImage {\n const image = this.ref.makeImageSnapshot(\n bounds\n ? Array.from(JsiSkRect.fromValue(this.CanvasKit, bounds))\n : undefined\n );\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"]}
|
@@ -1,24 +1,26 @@
|
|
1
|
-
import { Host
|
1
|
+
import { Host } from "./Host";
|
2
|
+
import { JsiSkFont } from "./JsiSkFont";
|
2
3
|
import { JsiSkTextBlob } from "./JsiSkTextBlob";
|
4
|
+
import { JsiSkRSXform } from "./JsiSkRSXform";
|
3
5
|
export class JsiSkTextBlobFactory extends Host {
|
4
6
|
constructor(CanvasKit) {
|
5
7
|
super(CanvasKit);
|
6
8
|
}
|
7
9
|
|
8
10
|
MakeFromText(str, font) {
|
9
|
-
return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromText(str,
|
11
|
+
return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromText(str, JsiSkFont.fromValue(font)));
|
10
12
|
}
|
11
13
|
|
12
14
|
MakeFromGlyphs(glyphs, font) {
|
13
|
-
return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs,
|
15
|
+
return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, JsiSkFont.fromValue(font)));
|
14
16
|
}
|
15
17
|
|
16
18
|
MakeFromRSXform(str, rsxforms, font) {
|
17
|
-
return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXform(str, rsxforms.map(f => Array.from(
|
19
|
+
return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXform(str, rsxforms.map(f => Array.from(JsiSkRSXform.fromValue(f))).flat(), JsiSkFont.fromValue(font)));
|
18
20
|
}
|
19
21
|
|
20
22
|
MakeFromRSXformGlyphs(glyphs, rsxforms, font) {
|
21
|
-
return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(glyphs, rsxforms.map(f =>
|
23
|
+
return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(glyphs, rsxforms.map(f => JsiSkRSXform.fromValue(f)), JsiSkFont.fromValue(font)));
|
22
24
|
}
|
23
25
|
|
24
26
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkTextBlobFactory.ts"],"names":["Host","
|
1
|
+
{"version":3,"sources":["JsiSkTextBlobFactory.ts"],"names":["Host","JsiSkFont","JsiSkTextBlob","JsiSkRSXform","JsiSkTextBlobFactory","constructor","CanvasKit","MakeFromText","str","font","TextBlob","fromValue","MakeFromGlyphs","glyphs","MakeFromRSXform","rsxforms","map","f","Array","from","flat","MakeFromRSXformGlyphs"],"mappings":"AAMA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,SAASC,YAAT,QAA6B,gBAA7B;AAEA,OAAO,MAAMC,oBAAN,SAAmCJ,IAAnC,CAAmE;AACxEK,EAAAA,WAAW,C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vasKit } from \"canvaskit-wasm\";\n\nimport type { SkFont } from \"../types\";\nimport type { TextBlobFactory } from \"../types/TextBlob\";\nimport type { SkRSXform } from \"../types/RSXform\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport type { RSXform } from \"./JsiSkRSXform\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\n\nexport class JsiSkTextBlobFactory extends Host implements TextBlobFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFromText(str: string, font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromText(str, JsiSkFont.fromValue(font))\n );\n }\n\n MakeFromGlyphs(glyphs: number[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, JsiSkFont.fromValue(font))\n );\n }\n\n MakeFromRSXform(str: string, rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXform(\n str,\n rsxforms\n .map((f) => Array.from(JsiSkRSXform.fromValue<RSXform>(f)))\n .flat(),\n JsiSkFont.fromValue(font)\n )\n );\n }\n\n MakeFromRSXformGlyphs(glyphs: number[], rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(\n glyphs,\n rsxforms.map((f) => JsiSkRSXform.fromValue(f)),\n JsiSkFont.fromValue(font)\n )\n );\n }\n}\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Host
|
1
|
+
import { Host } from "./Host";
|
2
2
|
import { JsiSkTypeface } from "./JsiSkTypeface";
|
3
3
|
export class JsiSkTypefaceFactory extends Host {
|
4
4
|
constructor(CanvasKit) {
|
@@ -6,7 +6,7 @@ export class JsiSkTypefaceFactory extends Host {
|
|
6
6
|
}
|
7
7
|
|
8
8
|
MakeFreeTypeFaceFromData(data) {
|
9
|
-
const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(
|
9
|
+
const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(JsiSkTypeface.fromValue(data));
|
10
10
|
|
11
11
|
if (tf === null) {
|
12
12
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkTypefaceFactory.tsx"],"names":["Host","
|
1
|
+
{"version":3,"sources":["JsiSkTypefaceFactory.tsx"],"names":["Host","JsiSkTypeface","JsiSkTypefaceFactory","constructor","CanvasKit","MakeFreeTypeFaceFromData","data","tf","Typeface","fromValue"],"mappings":"AAIA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,oBAAN,SAAmCF,IAAnC,CAAmE;AACxEG,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,wBAAwB,CAACC,IAAD,EAAe;AACrC,UAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,QAAf,CAAwBH,wBAAxB,CACTJ,aAAa,CAACQ,SAAd,CAAwBH,IAAxB,CADS,CAAX;;AAGA,QAAIC,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIN,aAAJ,CAAkB,KAAKG,SAAvB,EAAkCG,EAAlC,CAAP;AACD;;AAbuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData, TypefaceFactory } from \"../types\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkTypefaceFactory extends Host implements TypefaceFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFreeTypeFaceFromData(data: SkData) {\n const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(\n JsiSkTypeface.fromValue(data)\n );\n if (tf === null) {\n return null;\n }\n return new JsiSkTypeface(this.CanvasKit, tf);\n }\n}\n"]}
|
@@ -5,7 +5,6 @@ import { Color } from "./JsiSkColor";
|
|
5
5
|
import { JsiSkSurfaceFactory } from "./JsiSkSurfaceFactory";
|
6
6
|
import { JsiSkRRect } from "./JsiSkRRect";
|
7
7
|
import { JsiSkRSXform } from "./JsiSkRSXform";
|
8
|
-
import { toValue } from "./Host";
|
9
8
|
import { JsiSkContourMeasureIter } from "./JsiSkContourMeasureIter";
|
10
9
|
import { JsiSkPictureRecorder } from "./JsiSkPictureRecorder";
|
11
10
|
import { JsiSkPictureFactory } from "./JsiSkPictureFactory";
|
@@ -24,22 +23,28 @@ import { JsiSkSVGFactory } from "./JsiSkSVGFactory";
|
|
24
23
|
import { JsiSkTextBlobFactory } from "./JsiSkTextBlobFactory";
|
25
24
|
import { JsiSkFont } from "./JsiSkFont";
|
26
25
|
import { MakeVertices } from "./JsiSkVerticesFactory";
|
26
|
+
import { JsiSkPath } from "./JsiSkPath";
|
27
|
+
import { JsiSkTypeface } from "./JsiSkTypeface";
|
27
28
|
export const JsiSkApi = CanvasKit => ({
|
28
29
|
Point: (x, y) => new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),
|
29
30
|
RuntimeShaderBuilder: _ => {
|
30
31
|
throw new Error("Not implemented on React Native Web");
|
31
32
|
},
|
32
|
-
RRectXY: (rect, rx, ry) => new JsiSkRRect(CanvasKit, CanvasKit.RRectXY(
|
33
|
+
RRectXY: (rect, rx, ry) => new JsiSkRRect(CanvasKit, CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect), rx, ry)),
|
33
34
|
RSXform: (scos, ssin, tx, ty) => new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),
|
34
35
|
Color,
|
35
|
-
ContourMeasureIter: (path, forceClosed, resScale) => new JsiSkContourMeasureIter(CanvasKit, new CanvasKit.ContourMeasureIter(
|
36
|
-
Paint: () =>
|
36
|
+
ContourMeasureIter: (path, forceClosed, resScale) => new JsiSkContourMeasureIter(CanvasKit, new CanvasKit.ContourMeasureIter(JsiSkPath.fromValue(path), forceClosed, resScale)),
|
37
|
+
Paint: () => {
|
38
|
+
const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());
|
39
|
+
paint.setAntiAlias(true);
|
40
|
+
return paint;
|
41
|
+
},
|
37
42
|
PictureRecorder: () => new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),
|
38
43
|
Picture: new JsiSkPictureFactory(CanvasKit),
|
39
44
|
Path: new JsiSkPathFactory(CanvasKit),
|
40
45
|
Matrix: matrix => new JsiSkMatrix(CanvasKit, matrix ? Float32Array.of(...matrix) : Float32Array.of(...CanvasKit.Matrix.identity())),
|
41
46
|
ColorFilter: new JsiSkColorFilterFactory(CanvasKit),
|
42
|
-
Font: (typeface, size) => new JsiSkFont(CanvasKit, new CanvasKit.Font(typeface === undefined ? null :
|
47
|
+
Font: (typeface, size) => new JsiSkFont(CanvasKit, new CanvasKit.Font(typeface === undefined ? null : JsiSkTypeface.fromValue(typeface), size)),
|
43
48
|
Typeface: new JsiSkTypefaceFactory(CanvasKit),
|
44
49
|
MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),
|
45
50
|
RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkia.ts"],"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","
|
1
|
+
{"version":3,"sources":["JsiSkia.ts"],"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","JsiSkContourMeasureIter","JsiSkPictureRecorder","JsiSkPictureFactory","JsiSkPathFactory","JsiSkMatrix","JsiSkColorFilterFactory","JsiSkTypefaceFactory","JsiSkMaskFilterFactory","JsiSkRuntimeEffectFactory","JsiSkImageFilterFactory","JsiSkShaderFactory","JsiSkPathEffectFactory","JsiSkDataFactory","JsiSkImageFactory","JsiSkSVGFactory","JsiSkTextBlobFactory","JsiSkFont","MakeVertices","JsiSkPath","JsiSkTypeface","JsiSkApi","CanvasKit","Point","x","y","Float32Array","of","RuntimeShaderBuilder","_","Error","RRectXY","rect","rx","ry","fromValue","RSXform","scos","ssin","tx","ty","ContourMeasureIter","path","forceClosed","resScale","Paint","paint","setAntiAlias","PictureRecorder","Picture","Path","Matrix","matrix","identity","ColorFilter","Font","typeface","size","undefined","Typeface","MaskFilter","RuntimeEffect","ImageFilter","Shader","PathEffect","bind","Data","Image","SVG","TextBlob","XYWHRect","width","height","Surface"],"mappings":"AAYA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,KAAT,QAAsB,cAAtB;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,yBAAT,QAA0C,6BAA1C;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,SAAT,QAA0B,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D,kBAAJ,CAAuBW,SAAvB,CAxD+C;AAyDvD0C,EAAAA,UAAU,EAAE,IAAIpD,sBAAJ,CAA2BU,SAA3B,CAzD2C;AA0DvDJ,EAAAA,YAAY,EAAEA,YAAY,CAAC+C,IAAb,CAAkB,IAAlB,EAAwB3C,SAAxB,CA1DyC;AA2DvD4C,EAAAA,IAAI,EAAE,IAAIrD,gBAAJ,CAAqBS,SAArB,CA3DiD;AA4DvD6C,EAAAA,KAAK,EAAE,IAAIrD,iBAAJ,CAAsBQ,SAAtB,CA5DgD;AA6DvD8C,EAAAA,GAAG,EAAE,IAAIrD,eAAJ,CAAoBO,SAApB,CA7DkD;AA8DvD+C,EAAAA,QAAQ,EAAE,IAAIrD,oBAAJ,CAAyBM,SAAzB,CA9D6C;AA+DvDgD,EAAAA,QAAQ,EAAE,CAAC9C,CAAD,EAAYC,CAAZ,EAAuB8C,KAAvB,EAAsCC,MAAtC,KAAyD;AACjE,WAAO,IAAI5E,SAAJ,CAAc0B,SAAd,EAAyBA,SAAS,CAACgD,QAAV,CAAmB9C,CAAnB,EAAsBC,CAAtB,EAAyB8C,KAAzB,EAAgCC,MAAhC,CAAzB,CAAP;AACD,GAjEsD;AAkEvDC,EAAAA,OAAO,EAAE,IAAI3E,mBAAJ,CAAwBwB,SAAxB;AAlE8C,CAAjC,CAAjB","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect): SkRuntimeShaderBuilder => {\n throw new Error(\"Not implemented on React Native Web\");\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(\n CanvasKit,\n CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect), rx, ry)\n ),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(\n JsiSkPath.fromValue(path),\n forceClosed,\n resScale\n )\n ),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n});\n"]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { useMemo } from "react";
|
1
|
+
import { useEffect, useMemo } from "react";
|
2
2
|
import { ValueApi } from "../api";
|
3
3
|
import { isValue } from "../../renderer/processors/Animations";
|
4
4
|
/**
|
@@ -9,6 +9,10 @@ import { isValue } from "../../renderer/processors/Animations";
|
|
9
9
|
* @returns A readonly value
|
10
10
|
*/
|
11
11
|
|
12
|
-
export const useComputedValue = (cb, values) =>
|
13
|
-
values)
|
12
|
+
export const useComputedValue = (cb, values) => {
|
13
|
+
const value = useMemo(() => ValueApi.createComputedValue(cb, values.filter(isValue)), // eslint-disable-next-line react-hooks/exhaustive-deps
|
14
|
+
values);
|
15
|
+
useEffect(() => () => value.__invalidate(), [value]);
|
16
|
+
return value;
|
17
|
+
};
|
14
18
|
//# sourceMappingURL=useComputedValue.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useComputedValue.ts"],"names":["useMemo","ValueApi","isValue","useComputedValue","cb","values","createComputedValue","filter"],"mappings":"AAAA,SAASA,
|
1
|
+
{"version":3,"sources":["useComputedValue.ts"],"names":["useEffect","useMemo","ValueApi","isValue","useComputedValue","cb","values","value","createComputedValue","filter","__invalidate"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,OAApB,QAAmC,OAAnC;AAEA,SAASC,QAAT,QAAyB,QAAzB;AACA,SAASC,OAAT,QAAwB,sCAAxB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,gBAAgB,GAAG,CAAIC,EAAJ,EAAiBC,MAAjB,KAAuC;AACrE,QAAMC,KAAK,GAAGN,OAAO,CACnB,MAAMC,QAAQ,CAACM,mBAAT,CAAgCH,EAAhC,EAAoCC,MAAM,CAACG,MAAP,CAAcN,OAAd,CAApC,CADa,EAEnB;AACAG,EAAAA,MAHmB,CAArB;AAKAN,EAAAA,SAAS,CAAC,MAAM,MAAMO,KAAK,CAACG,YAAN,EAAb,EAAmC,CAACH,KAAD,CAAnC,CAAT;AACA,SAAOA,KAAP;AACD,CARM","sourcesContent":["import { useEffect, useMemo } from \"react\";\n\nimport { ValueApi } from \"../api\";\nimport { isValue } from \"../../renderer/processors/Animations\";\n\n/**\n * Creates a new computed value - a value that will calculate its value depending\n * on other values.\n * @param cb Callback to calculate new value\n * @param values Dependant values\n * @returns A readonly value\n */\nexport const useComputedValue = <R>(cb: () => R, values: unknown[]) => {\n const value = useMemo(\n () => ValueApi.createComputedValue<R>(cb, values.filter(isValue)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n values\n );\n useEffect(() => () => value.__invalidate(), [value]);\n return value;\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAd;AACA,cAAc,SAAd;AACA,cAAc,OAAd","sourcesContent":["export * from \"./types\";\nexport * from \"./hooks\";\nexport * from \"./api\";\n"]}
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAd;AACA,cAAc,SAAd;AACA,cAAc,OAAd;AACA,cAAc,YAAd","sourcesContent":["export * from \"./types\";\nexport * from \"./hooks\";\nexport * from \"./api\";\nexport * from \"./selector\";\n"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* Wraps a Skia Value with a selector function. The selector function can access the
|
3
|
+
* inner values of the Skia Value so that we can dynamically ready array values and
|
4
|
+
* object values when doing animations in Skia.
|
5
|
+
* @param value Dependant value
|
6
|
+
* @param selector Selector function to calculate new value from the Skia Value's value
|
7
|
+
* @returns A descriptor that will be used by the reconciler to calculate the value
|
8
|
+
*/
|
9
|
+
export const Selector = (value, selector) => {
|
10
|
+
return {
|
11
|
+
selector,
|
12
|
+
value
|
13
|
+
};
|
14
|
+
};
|
15
|
+
//# sourceMappingURL=selector.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["selector.ts"],"names":["Selector","value","selector"],"mappings":"AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,QAAQ,GAAG,CACtBC,KADsB,EAEtBC,QAFsB,KAGY;AAClC,SAAO;AACLA,IAAAA,QADK;AAELD,IAAAA;AAFK,GAAP;AAID,CARM","sourcesContent":["import type { SkiaValue } from \"./types\";\n\nexport type SkiaSelector<TReturn, TInput = unknown> = {\n value: SkiaValue<TInput>;\n selector: (v: TInput) => TReturn;\n};\n\n/**\n * Wraps a Skia Value with a selector function. The selector function can access the\n * inner values of the Skia Value so that we can dynamically ready array values and\n * object values when doing animations in Skia.\n * @param value Dependant value\n * @param selector Selector function to calculate new value from the Skia Value's value\n * @returns A descriptor that will be used by the reconciler to calculate the value\n */\nexport const Selector = <TInput, TReturn>(\n value: SkiaValue<TInput>,\n selector: (v: TInput) => TReturn\n): SkiaSelector<TReturn, TInput> => {\n return {\n selector,\n value,\n };\n};\n"]}
|
@@ -35,6 +35,14 @@ export class RNSkComputedValue extends RNSkReadonlyValue {
|
|
35
35
|
|
36
36
|
unsubscribe() {
|
37
37
|
this._unsubscribers.forEach(unsubscribe => unsubscribe());
|
38
|
+
|
39
|
+
this._unsubscribers = [];
|
40
|
+
}
|
41
|
+
|
42
|
+
__invalidate() {
|
43
|
+
this._unsubscribers.forEach(unsubscribe => unsubscribe());
|
44
|
+
|
45
|
+
this._unsubscribers = [];
|
38
46
|
}
|
39
47
|
|
40
48
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["RNSkComputedValue.ts"],"names":["RNSkReadonlyValue","RNSkComputedValue","constructor","callback","dependencies","unsubscribers","notifyUpdateRef","current","undefined","forEach","dep","push","addListener","_unsubscribers","dependecyUpdated","bind","_callback","update","unsubscribe"],"mappings":";;AAEA,SAASA,iBAAT,QAAkC,qBAAlC;AAEA,OAAO,MAAMC,iBAAN,SAAmCD,iBAAnC,CAAwD;AAC7DE,EAAAA,WAAW,CAACC,QAAD,EAAoBC,YAApB,EAAkD;AAC3D;AACA;AACA,UAAMC,aAAgC,GAAG,EAAzC;AACA,UAAMC,eAAsD,GAAG;AAC7DC,MAAAA,OAAO,EAAEC;AADoD,KAA/D;AAGAJ,IAAAA,YAAY,CAACK,OAAb,CAAsBC,GAAD,IAAS;AAC5B,UAAI,kBAAkBA,GAAlB,IAAyB,iBAAiBA,GAA9C,EAAmD;AACjDL,QAAAA,aAAa,CAACM,IAAd,CACGD,GAAD,CAAoCE,WAApC,CAAgD;AAAA;;AAAA,0CAC9CN,eAAe,CAACC,OAD8B,0DAC9C,2BAAAD,eAAe,CAD+B;AAAA,SAAhD,CADF;AAKD;AACF,KARD;AASA,UAAMH,QAAQ,EAAd;;AAhB2D;;AAAA;;AAiB3D,SAAKU,cAAL,GAAsBR,aAAtB;AACAC,IAAAA,eAAe,CAACC,OAAhB,GAA0B,KAAKO,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAA1B;AACA,SAAKC,SAAL,GAAiBb,QAAjB;AACD;;AAEOW,EAAAA,gBAAgB,GAAG;AACzB,SAAKG,MAAL,CAAY,KAAKD,SAAL,EAAZ;AACD;;AAKME,EAAAA,WAAW,GAAG;AACnB,SAAKL,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;AACD;;
|
1
|
+
{"version":3,"sources":["RNSkComputedValue.ts"],"names":["RNSkReadonlyValue","RNSkComputedValue","constructor","callback","dependencies","unsubscribers","notifyUpdateRef","current","undefined","forEach","dep","push","addListener","_unsubscribers","dependecyUpdated","bind","_callback","update","unsubscribe","__invalidate"],"mappings":";;AAEA,SAASA,iBAAT,QAAkC,qBAAlC;AAEA,OAAO,MAAMC,iBAAN,SAAmCD,iBAAnC,CAAwD;AAC7DE,EAAAA,WAAW,CAACC,QAAD,EAAoBC,YAApB,EAAkD;AAC3D;AACA;AACA,UAAMC,aAAgC,GAAG,EAAzC;AACA,UAAMC,eAAsD,GAAG;AAC7DC,MAAAA,OAAO,EAAEC;AADoD,KAA/D;AAGAJ,IAAAA,YAAY,CAACK,OAAb,CAAsBC,GAAD,IAAS;AAC5B,UAAI,kBAAkBA,GAAlB,IAAyB,iBAAiBA,GAA9C,EAAmD;AACjDL,QAAAA,aAAa,CAACM,IAAd,CACGD,GAAD,CAAoCE,WAApC,CAAgD;AAAA;;AAAA,0CAC9CN,eAAe,CAACC,OAD8B,0DAC9C,2BAAAD,eAAe,CAD+B;AAAA,SAAhD,CADF;AAKD;AACF,KARD;AASA,UAAMH,QAAQ,EAAd;;AAhB2D;;AAAA;;AAiB3D,SAAKU,cAAL,GAAsBR,aAAtB;AACAC,IAAAA,eAAe,CAACC,OAAhB,GAA0B,KAAKO,gBAAL,CAAsBC,IAAtB,CAA2B,IAA3B,CAA1B;AACA,SAAKC,SAAL,GAAiBb,QAAjB;AACD;;AAEOW,EAAAA,gBAAgB,GAAG;AACzB,SAAKG,MAAL,CAAY,KAAKD,SAAL,EAAZ;AACD;;AAKME,EAAAA,WAAW,GAAG;AACnB,SAAKL,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;;AACA,SAAKL,cAAL,GAAsB,EAAtB;AACD;;AAEMM,EAAAA,YAAY,GAAS;AAC1B,SAAKN,cAAL,CAAoBJ,OAApB,CAA6BS,WAAD,IAAiBA,WAAW,EAAxD;;AACA,SAAKL,cAAL,GAAsB,EAAtB;AACD;;AAtC4D","sourcesContent":["import type { DependencyList } from \"react\";\n\nimport { RNSkReadonlyValue } from \"./RNSkReadonlyValue\";\n\nexport class RNSkComputedValue<T> extends RNSkReadonlyValue<T> {\n constructor(callback: () => T, dependencies: DependencyList) {\n // Initialize dependencies - we can't call this yet, since\n // super if not called and it requires a start value to be set.\n const unsubscribers: Array<() => void> = [];\n const notifyUpdateRef: { current: (() => void) | undefined } = {\n current: undefined,\n };\n dependencies.forEach((dep) => {\n if (\"__typename__\" in dep && \"addListener\" in dep) {\n unsubscribers.push(\n (dep as RNSkReadonlyValue<unknown>).addListener(() =>\n notifyUpdateRef.current?.()\n )\n );\n }\n });\n super(callback());\n this._unsubscribers = unsubscribers;\n notifyUpdateRef.current = this.dependecyUpdated.bind(this);\n this._callback = callback;\n }\n\n private dependecyUpdated() {\n this.update(this._callback());\n }\n\n private _callback: () => T;\n private _unsubscribers: Array<() => void>;\n\n public unsubscribe() {\n this._unsubscribers.forEach((unsubscribe) => unsubscribe());\n this._unsubscribers = [];\n }\n\n public __invalidate(): void {\n this._unsubscribers.forEach((unsubscribe) => unsubscribe());\n this._unsubscribers = [];\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["RNSkReadonlyValue.ts"],"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf"],"mappings":";;AAEA,OAAO,MAAMA,iBAAN,CAAmD;AACxDC,EAAAA,WAAW,CAACC,KAAD,EAAW;AAAA;;AAAA,wCAK0B,EAL1B;;AAAA,0CAgBS,WAhBT;;AACpB,SAAKC,QAAL,GAAgBD,KAAhB;AACD;;AAKOE,EAAAA,eAAe,GAAS;AAC9B,SAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;AACD;;AAESK,EAAAA,MAAM,CAACC,SAAD,EAAqB;AACnC,SAAKN,QAAL,GAAgBM,SAAhB;AACA,SAAKL,eAAL;AACD;;AAIiB,MAAPM,OAAO,GAAM;AACtB,WAAO,KAAKP,QAAZ;AACD;;AAEMQ,EAAAA,WAAW,CAACJ,EAAD,EAAyB;AACzC,SAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;AACA,WAAO,MAAM;AACX,WAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;AACD,KAFD;AAGD;;
|
1
|
+
{"version":3,"sources":["RNSkReadonlyValue.ts"],"names":["RNSkReadonlyValue","constructor","value","_current","notifyListeners","_listeners","forEach","cb","update","nextValue","current","addListener","push","splice","indexOf","__invalidate"],"mappings":";;AAEA,OAAO,MAAMA,iBAAN,CAAmD;AACxDC,EAAAA,WAAW,CAACC,KAAD,EAAW;AAAA;;AAAA,wCAK0B,EAL1B;;AAAA,0CAgBS,WAhBT;;AACpB,SAAKC,QAAL,GAAgBD,KAAhB;AACD;;AAKOE,EAAAA,eAAe,GAAS;AAC9B,SAAKC,UAAL,CAAgBC,OAAhB,CAAyBC,EAAD,IAAQA,EAAE,CAAC,KAAKJ,QAAN,CAAlC;AACD;;AAESK,EAAAA,MAAM,CAACC,SAAD,EAAqB;AACnC,SAAKN,QAAL,GAAgBM,SAAhB;AACA,SAAKL,eAAL;AACD;;AAIiB,MAAPM,OAAO,GAAM;AACtB,WAAO,KAAKP,QAAZ;AACD;;AAEMQ,EAAAA,WAAW,CAACJ,EAAD,EAAyB;AACzC,SAAKF,UAAL,CAAgBO,IAAhB,CAAqBL,EAArB;;AACA,WAAO,MAAM;AACX,WAAKF,UAAL,CAAgBQ,MAAhB,CAAuB,KAAKR,UAAL,CAAgBS,OAAhB,CAAwBP,EAAxB,CAAvB,EAAoD,CAApD;AACD,KAFD;AAGD;;AAEMQ,EAAAA,YAAY,GAAS;AAC1B,SAAKV,UAAL,GAAkB,EAAlB;AACD;;AAhCuD","sourcesContent":["import type { SkiaValue } from \"../types\";\n\nexport class RNSkReadonlyValue<T> implements SkiaValue<T> {\n constructor(value: T) {\n this._current = value;\n }\n\n private _current: T;\n private _listeners: Array<(value: T) => void> = [];\n\n private notifyListeners(): void {\n this._listeners.forEach((cb) => cb(this._current));\n }\n\n protected update(nextValue: T): void {\n this._current = nextValue;\n this.notifyListeners();\n }\n\n public readonly __typename__ = \"RNSkValue\";\n\n public get current(): T {\n return this._current;\n }\n\n public addListener(cb: (value: T) => void) {\n this._listeners.push(cb);\n return () => {\n this._listeners.splice(this._listeners.indexOf(cb), 1);\n };\n }\n\n public __invalidate(): void {\n this._listeners = [];\n }\n}\n"]}
|
@@ -11,4 +11,4 @@ export interface CanvasProps extends ComponentProps<typeof SkiaView> {
|
|
11
11
|
children: ReactNode;
|
12
12
|
onTouch?: TouchHandler;
|
13
13
|
}
|
14
|
-
export declare const Canvas: React.ForwardRefExoticComponent<Pick<CanvasProps, "
|
14
|
+
export declare const Canvas: React.ForwardRefExoticComponent<Pick<CanvasProps, "mode" | "debug" | "onDraw" | "children" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "onTouch"> & React.RefAttributes<SkiaView>>;
|