@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 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkImageFilterFactory.ts"],"names":["JsiSkImageFilterFactory","Host","constructor","CanvasKit","MakeOffset","_dx","_dy","_input","NotImplementedOnRNWeb","MakeDisplacementMap","_channelX","_channelY","_scale","_in1","MakeShader","_shader","MakeBlur","sigmaX","sigmaY","mode","input","JsiSkImageFilter","ImageFilter","MakeColorFilter","cf","MakeCompose","outer","inner","MakeDropShadow","_sigmaX","_sigmaY","_color","_cropRect","MakeDropShadowOnly","MakeErode","_rx","_ry","MakeDilate","MakeBlend","_mode","_background","_foreground","MakeRuntimeShader","_builder","_childShaderName"],"mappings":";;;;;;;AAeA;;AACA;;AAEO,MAAMA,uBAAN,SACGC,UADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,MAHQ,EAIO;AACf,UAAM,IAAIC,2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OZyB,SAPY,EAQG;AACf,UAAM,IAAIxB,2BAAJ,EAAN;AACD;;AAEDyB,EAAAA,kBAAkB,CAChB5B,GADgB,EAEhBC,GAFgB,EAGhBuB,OAHgB,EAIhBC,OAJgB,EAKhBC,MALgB,EAMhBxB,MANgB,EAOhByB,SAPgB,EAQD;AACf,UAAM,IAAIxB,2BAAJ,EAAN;AACD;;AAED0B,EAAAA,SAAS,CACPC,GADO,EAEPC,GAFO,EAGP7B,MAHO,EAIPyB,SAJO,EAKQ;AACf,UAAM,IAAIxB,2BAAJ,EAAN;AACD;;AAED6B,EAAAA,UAAU,CACRF,GADQ,EAERC,GAFQ,EAGR7B,MAHQ,EAIRyB,SAJQ,EAKO;AACf,UAAM,IAAIxB,2BAAJ,EAAN;AACD;;AAED8B,EAAAA,SAAS,CACPC,KADO,EAEPC,WAFO,EAGPC,WAHO,EAIPT,SAJO,EAKQ;AACf,UAAM,IAAIxB,2BAAJ,EAAN;AACD;;AAEDkC,EAAAA,iBAAiB,CACfC,QADe,EAEfC,gBAFe,EAGfrC,MAHe,EAIA;AACf,UAAM,IAAIC,2BAAJ,EAAN;AACD;;AAzHH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n ColorChannel,\n ImageFilterFactory,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n BlendMode,\n SkRect,\n SkRuntimeShaderBuilder,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { Host, NotImplementedOnRNWeb, ckEnum, toValue } from \"./Host\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\n\nexport class JsiSkImageFilterFactory\n extends Host\n implements ImageFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeOffset(\n _dx: number,\n _dy: number,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeDisplacementMap(\n _channelX: ColorChannel,\n _channelY: ColorChannel,\n _scale: number,\n _in1: SkImageFilter,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeShader(_shader: SkShader, _input: SkImageFilter | null): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeBlur(\n sigmaX: number,\n sigmaY: number,\n mode: TileMode,\n input: SkImageFilter | null\n ) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeBlur(\n sigmaX,\n sigmaY,\n ckEnum(mode),\n input === null ? null : toValue(input)\n )\n );\n }\n\n MakeColorFilter(cf: SkColorFilter, input: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeColorFilter(\n toValue(cf),\n input === null ? null : toValue(input)\n )\n );\n }\n\n MakeCompose(outer: SkImageFilter | null, inner: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeCompose(\n outer === null ? null : toValue(outer),\n inner === null ? null : toValue(inner)\n )\n );\n }\n\n MakeDropShadow(\n _dx: number,\n _dy: number,\n _sigmaX: number,\n _sigmaY: number,\n _color: SkColor,\n _input: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeDropShadowOnly(\n _dx: number,\n _dy: number,\n _sigmaX: number,\n _sigmaY: number,\n _color: SkColor,\n _input: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeErode(\n _rx: number,\n _ry: number,\n _input: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeDilate(\n _rx: number,\n _ry: number,\n _input: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeBlend(\n _mode: BlendMode,\n _background: SkImageFilter,\n _foreground: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeRuntimeShader(\n _builder: SkRuntimeShaderBuilder,\n _childShaderName: string | null,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["JsiSkImageFilterFactory.ts"],"names":["JsiSkImageFilterFactory","Host","constructor","CanvasKit","MakeOffset","dx","dy","input","inputFilter","JsiSkImageFilter","fromValue","filter","ImageFilter","MakeDisplacementMap","channelX","channelY","scale","in1","MakeShader","shader","_input","MakeBlur","sigmaX","sigmaY","mode","MakeColorFilter","cf","JsiSkColorFilter","MakeCompose","outer","inner","MakeDropShadow","color","cropRect","NotImplementedOnRNWeb","MakeDropShadowOnly","MakeErode","rx","ry","MakeDilate","MakeBlend","background","foreground","MakeRuntimeShader","_builder","_childShaderName"],"mappings":";;;;;;;AAeA;;AACA;;AACA;;AAEO,MAAMA,uBAAN,SACGC,UADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,UAAU,CAACC,EAAD,EAAaC,EAAb,EAAyBC,KAAzB,EAAsD;AAC9D,UAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBE,mCAAiBC,SAAjB,CAAwCH,KAAxC,CAD1B;AAEA,UAAMI,MAAM,GAAG,KAAKR,SAAL,CAAeS,WAAf,CAA2BR,UAA3B,CAAsCC,EAAtC,EAA0CC,EAA1C,EAA8CE,WAA9C,CAAf;AACA,WAAO,IAAIC,kCAAJ,CAAqB,KAAKN,SAA1B,EAAqCQ,MAArC,CAAP;AACD;;AAEDE,EAAAA,mBAAmB,CACjBC,QADiB,EAEjBC,QAFiB,EAGjBC,KAHiB,EAIjBC,GAJiB,EAKjBV,KALiB,EAMF;AACf,UAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBE,mCAAiBC,SAAjB,CAAw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IjC,mCAAiBC,SAAjB,CAAwCgC,UAAxC,CAHN;;AAIA,QAAIT,QAAJ,EAAc;AACZ,YAAM,IAAIC,2BAAJ,CACJ,iEADI,CAAN;AAGD;;AACD,UAAMvB,MAAM,GAAG,KAAKR,SAAL,CAAeS,WAAf,CAA2B4B,SAA3B,CACb,kBAAOhB,IAAP,CADa,EAEbf,mCAAiBC,SAAjB,CAA2B+B,UAA3B,CAFa,EAGbjC,WAHa,CAAf;AAKA,WAAO,IAAIC,kCAAJ,CAAqB,KAAKN,SAA1B,EAAqCQ,MAArC,CAAP;AACD;;AAEDgC,EAAAA,iBAAiB,CACfC,QADe,EAEfC,gBAFe,EAGfzB,MAHe,EAIA;AACf,UAAM,IAAIc,2BAAJ,EAAN;AACD;;AAhMH","sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type {\n ColorChannel,\n ImageFilterFactory,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n BlendMode,\n SkRect,\n SkRuntimeShaderBuilder,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { Host, NotImplementedOnRNWeb, ckEnum } from \"./Host\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkImageFilterFactory\n extends Host\n implements ImageFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeOffset(dx: number, dy: number, input: SkImageFilter | null) {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeOffset(dx, dy, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDisplacementMap(\n channelX: ColorChannel,\n channelY: ColorChannel,\n scale: number,\n in1: SkImageFilter,\n input: SkImageFilter | null\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(\n ckEnum(channelX),\n ckEnum(channelY),\n scale,\n JsiSkImageFilter.fromValue(in1),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeShader(shader: SkShader, _input: SkImageFilter | null): SkImageFilter {\n const filter = this.CanvasKit.ImageFilter.MakeShader(\n JsiSkImageFilter.fromValue(shader)\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlur(\n sigmaX: number,\n sigmaY: number,\n mode: TileMode,\n input: SkImageFilter | null\n ) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeBlur(\n sigmaX,\n sigmaY,\n ckEnum(mode),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeColorFilter(cf: SkColorFilter, input: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeColorFilter(\n JsiSkColorFilter.fromValue(cf),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeCompose(outer: SkImageFilter | null, inner: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeCompose(\n outer === null ? null : JsiSkImageFilter.fromValue(outer),\n inner === null ? null : JsiSkImageFilter.fromValue(inner)\n )\n );\n }\n\n MakeDropShadow(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadow(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDropShadowOnly(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadowOnly(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeErode(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeErode(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDilate(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDilate(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlend(\n mode: BlendMode,\n background: SkImageFilter,\n foreground: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n foreground === null\n ? null\n : JsiSkImageFilter.fromValue<ImageFilter>(foreground);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeBlend(\n ckEnum(mode),\n JsiSkImageFilter.fromValue(background),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeRuntimeShader(\n _builder: SkRuntimeShaderBuilder,\n _childShaderName: string | null,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n}\n"]}
|
@@ -13,7 +13,7 @@ class JsiSkMatrix extends _Host.HostObject {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
concat(matrix) {
|
16
|
-
this.ref.set(this.CanvasKit.Matrix.multiply(this.ref,
|
16
|
+
this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix)));
|
17
17
|
}
|
18
18
|
|
19
19
|
translate(x, y) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkMatrix.ts"],"names":["JsiSkMatrix","HostObject","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","identity"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,WAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;AAChD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;AACD;;AAEDC,EAAAA,MAAM,CAACC,MAAD,EAAmB;AACvB,SAAKF,GAAL,CAASG,GAAT,
|
1
|
+
{"version":3,"sources":["JsiSkMatrix.ts"],"names":["JsiSkMatrix","HostObject","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","fromValue","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","identity"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,WAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;AAChD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;AACD;;AAEDC,EAAAA,MAAM,CAACC,MAAD,EAAmB;AACvB,SAAKF,GAAL,CAASG,GAAT,CACE,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f,CAAsBgB,QAAtB,EAAb;AACD;;AAjDH","sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\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 concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n }\n}\n"]}
|
@@ -7,9 +7,18 @@ exports.JsiSkPaint = void 0;
|
|
7
7
|
|
8
8
|
var _Host = require("./Host");
|
9
9
|
|
10
|
+
var _JsiSkColorFilter = require("./JsiSkColorFilter");
|
11
|
+
|
12
|
+
var _JsiSkImageFilter = require("./JsiSkImageFilter");
|
13
|
+
|
14
|
+
var _JsiSkMaskFilter = require("./JsiSkMaskFilter");
|
15
|
+
|
16
|
+
var _JsiSkPathEffect = require("./JsiSkPathEffect");
|
17
|
+
|
18
|
+
var _JsiSkShader = require("./JsiSkShader");
|
19
|
+
|
10
20
|
class JsiSkPaint extends _Host.HostObject {
|
11
21
|
constructor(CanvasKit, ref) {
|
12
|
-
ref.setAntiAlias(true);
|
13
22
|
super(CanvasKit, ref, "Paint");
|
14
23
|
}
|
15
24
|
|
@@ -17,6 +26,10 @@ class JsiSkPaint extends _Host.HostObject {
|
|
17
26
|
return new JsiSkPaint(this.CanvasKit, this.ref.copy());
|
18
27
|
}
|
19
28
|
|
29
|
+
reset() {
|
30
|
+
this.ref = new this.CanvasKit.Paint();
|
31
|
+
}
|
32
|
+
|
20
33
|
getColor() {
|
21
34
|
return this.ref.getColor();
|
22
35
|
}
|
@@ -54,23 +67,23 @@ class JsiSkPaint extends _Host.HostObject {
|
|
54
67
|
}
|
55
68
|
|
56
69
|
setColorFilter(filter) {
|
57
|
-
this.ref.setColorFilter(
|
70
|
+
this.ref.setColorFilter(filter ? _JsiSkColorFilter.JsiSkColorFilter.fromValue(filter) : null);
|
58
71
|
}
|
59
72
|
|
60
73
|
setImageFilter(filter) {
|
61
|
-
this.ref.setImageFilter(
|
74
|
+
this.ref.setImageFilter(filter ? _JsiSkImageFilter.JsiSkImageFilter.fromValue(filter) : null);
|
62
75
|
}
|
63
76
|
|
64
77
|
setMaskFilter(filter) {
|
65
|
-
this.ref.setMaskFilter(
|
78
|
+
this.ref.setMaskFilter(filter ? _JsiSkMaskFilter.JsiSkMaskFilter.fromValue(filter) : null);
|
66
79
|
}
|
67
80
|
|
68
81
|
setPathEffect(effect) {
|
69
|
-
this.ref.setPathEffect(
|
82
|
+
this.ref.setPathEffect(effect ? _JsiSkPathEffect.JsiSkPathEffect.fromValue(effect) : null);
|
70
83
|
}
|
71
84
|
|
72
85
|
setShader(shader) {
|
73
|
-
this.ref.setShader(
|
86
|
+
this.ref.setShader(shader ? _JsiSkShader.JsiSkShader.fromValue(shader) : null);
|
74
87
|
}
|
75
88
|
|
76
89
|
setStrokeCap(cap) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkPaint.ts"],"names":["JsiSkPaint","HostObject","constructor","CanvasKit","ref","
|
1
|
+
{"version":3,"sources":["JsiSkPaint.ts"],"names":["JsiSkPaint","HostObject","constructor","CanvasKit","ref","copy","reset","Paint","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setBlendMode","blendMode","setColor","color","setColorFilter","filter","JsiSkColorFilter","fromValue","setImageFilter","JsiSkImageFilter","setMaskFilter","JsiSkMaskFilter","setPathEffect","effect","JsiSkPathEffect","setShader","shader","JsiSkShader","setStrokeCap","cap","setStrokeJoin","join","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"mappings":";;;;;;;AAgBA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,MAAMA,UAAN,SAAyBC,gBAAzB,CAAuE;AAC5EC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;AAC5C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;AACD;;AAEDC,EAAAA,IAAI,GAAG;AACL,WAAO,IAAIL,UAAJ,CAAe,KAAKG,SAApB,EAA+B,KAAKC,GAAL,CAASC,IAAT,EAA/B,CAAP;AACD;;AAEDC,EAAAA,KAAK,GAAG;AACN,SAAKF,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeI,KAAnB,EAAX;AACD;;AAEDC,EAAAA,QAAQ,GAAG;AACT,WAAO,KAAKJ,GAAL,CAASI,QAAT,EAAP;AACD;;AAEDC,EAAAA,YAAY,GAAG;AACb,WAAO,KAAKL,GAAL,CAASK,YAAT,GAAwBC,KAA/B;AACD;;AAEDC,EAAAA,aAAa,GAAG;AACd,WAAO,KAAKP,GAAL,CAASO,aAAT,GAAyBD,KAAhC;AACD;;AAEDE,EAAAA,cAAc,GAAG;AACf,WAAO,KAAKR,GAAL,CAASQ,cAAT,EAAP;AACD;;AAEDC,EAAAA,cAAc,GAAG;AACf,WAAO,KAAKT,GAAL,CAASS,cAAT,EAAP;AACD;;AAEDC,EAAAA,SAAS,CAACC,KAAD,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D;;AAEDC,EAAAA,aAAa,CAACC,IAAD,EAAmB;AAC9B,SAAKnC,GAAL,CAASkC,aAAT,CAAuB,kBAAOC,IAAP,CAAvB;AACD;;AAEDC,EAAAA,cAAc,CAACC,KAAD,EAAgB;AAC5B,SAAKrC,GAAL,CAASoC,cAAT,CAAwBC,KAAxB;AACD;;AAEDC,EAAAA,cAAc,CAACC,KAAD,EAAgB;AAC5B,SAAKvC,GAAL,CAASsC,cAAT,CAAwBC,KAAxB;AACD;;AAEDC,EAAAA,QAAQ,CAACC,KAAD,EAAoB;AAC1B,SAAKzC,GAAL,CAASwC,QAAT,CAAkB;AAAElC,MAAAA,KAAK,EAAEmC;AAAT,KAAlB;AACD;;AAvF2E","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, ckEnum } 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 copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\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 setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(ckEnum(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(ckEnum(cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(ckEnum(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"]}
|
@@ -13,6 +13,10 @@ var _JsiSkPoint = require("./JsiSkPoint");
|
|
13
13
|
|
14
14
|
var _JsiSkRect = require("./JsiSkRect");
|
15
15
|
|
16
|
+
var _JsiSkRRect = require("./JsiSkRRect");
|
17
|
+
|
18
|
+
var _JsiSkMatrix = require("./JsiSkMatrix");
|
19
|
+
|
16
20
|
const CommandCount = {
|
17
21
|
[_types.PathVerb.Move]: 3,
|
18
22
|
[_types.PathVerb.Line]: 3,
|
@@ -22,34 +26,18 @@ const CommandCount = {
|
|
22
26
|
[_types.PathVerb.Close]: 1
|
23
27
|
};
|
24
28
|
|
25
|
-
const areCmdsInterpolatable = (cmd1, cmd2) => {
|
26
|
-
if (cmd1.length !== cmd2.length) {
|
27
|
-
return false;
|
28
|
-
}
|
29
|
-
|
30
|
-
for (let i = 0; i < cmd1.length; i++) {
|
31
|
-
if (cmd1[i][0] !== cmd2[i][0]) {
|
32
|
-
return false;
|
33
|
-
} else if (cmd1[i][0] === _types.PathVerb.Conic && cmd1[i][5] !== cmd2[i][5]) {
|
34
|
-
return false;
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
return true;
|
39
|
-
};
|
40
|
-
|
41
29
|
class JsiSkPath extends _Host.HostObject {
|
42
30
|
constructor(CanvasKit, ref) {
|
43
31
|
super(CanvasKit, ref, "Path");
|
44
32
|
}
|
45
33
|
|
46
34
|
addArc(oval, startAngleInDegrees, sweepAngleInDegrees) {
|
47
|
-
this.ref.addArc((
|
35
|
+
this.ref.addArc(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, oval), startAngleInDegrees, sweepAngleInDegrees);
|
48
36
|
return this;
|
49
37
|
}
|
50
38
|
|
51
39
|
addOval(oval, isCCW, startIndex) {
|
52
|
-
this.ref.addOval((
|
40
|
+
this.ref.addOval(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, oval), isCCW, startIndex);
|
53
41
|
return this;
|
54
42
|
}
|
55
43
|
|
@@ -58,7 +46,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
58
46
|
}
|
59
47
|
|
60
48
|
addPoly(points, close) {
|
61
|
-
this.ref.addPoly(points.map(p => (
|
49
|
+
this.ref.addPoly(points.map(p => Array.from(_JsiSkPoint.JsiSkPoint.fromValue(p))).flat(), close);
|
62
50
|
return this;
|
63
51
|
}
|
64
52
|
|
@@ -149,7 +137,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
149
137
|
}
|
150
138
|
|
151
139
|
arcToOval(oval, startAngleInDegrees, sweepAngleInDegrees, forceMoveTo) {
|
152
|
-
this.ref.arcToOval((
|
140
|
+
this.ref.arcToOval(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, oval), startAngleInDegrees, sweepAngleInDegrees, forceMoveTo);
|
153
141
|
return this;
|
154
142
|
}
|
155
143
|
|
@@ -186,7 +174,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
186
174
|
}
|
187
175
|
|
188
176
|
equals(other) {
|
189
|
-
return this.ref.equals(
|
177
|
+
return this.ref.equals(JsiSkPath.fromValue(other));
|
190
178
|
}
|
191
179
|
|
192
180
|
getBounds() {
|
@@ -202,11 +190,11 @@ class JsiSkPath extends _Host.HostObject {
|
|
202
190
|
}
|
203
191
|
|
204
192
|
addRect(rect, isCCW) {
|
205
|
-
this.ref.addRect((
|
193
|
+
this.ref.addRect(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);
|
206
194
|
}
|
207
195
|
|
208
196
|
addRRect(rrect, isCCW) {
|
209
|
-
this.ref.addRRect((
|
197
|
+
this.ref.addRRect(_JsiSkRRect.JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);
|
210
198
|
return this;
|
211
199
|
}
|
212
200
|
|
@@ -223,9 +211,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
223
211
|
}
|
224
212
|
|
225
213
|
addCircle(x, y, r) {
|
226
|
-
|
227
|
-
// throw new NotImplementedOnRNWeb();
|
228
|
-
this.ref.addOval(this.CanvasKit.LTRBRect(x - r, y - r, x + r, y + r));
|
214
|
+
this.ref.addCircle(x, y, r);
|
229
215
|
return this;
|
230
216
|
}
|
231
217
|
|
@@ -234,7 +220,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
234
220
|
}
|
235
221
|
|
236
222
|
op(path, op) {
|
237
|
-
return this.ref.op(
|
223
|
+
return this.ref.op(JsiSkPath.fromValue(path), (0, _Host.ckEnum)(op));
|
238
224
|
}
|
239
225
|
|
240
226
|
simplify() {
|
@@ -251,37 +237,11 @@ class JsiSkPath extends _Host.HostObject {
|
|
251
237
|
}
|
252
238
|
|
253
239
|
transform(m3) {
|
254
|
-
this.ref.transform(
|
240
|
+
this.ref.transform(_JsiSkMatrix.JsiSkMatrix.fromValue(m3));
|
255
241
|
}
|
256
242
|
|
257
243
|
interpolate(end, t) {
|
258
|
-
|
259
|
-
// throw new NotImplementedOnRNWeb();
|
260
|
-
const cmd1 = this.toCmds();
|
261
|
-
const cmd2 = end.toCmds();
|
262
|
-
|
263
|
-
if (!areCmdsInterpolatable(cmd1, cmd2)) {
|
264
|
-
return null;
|
265
|
-
}
|
266
|
-
|
267
|
-
const interpolated = [];
|
268
|
-
cmd1.forEach((cmd, i) => {
|
269
|
-
const interpolatedCmd = [cmd[0]];
|
270
|
-
interpolated.push(interpolatedCmd);
|
271
|
-
cmd.forEach((c, j) => {
|
272
|
-
if (j === 0) {
|
273
|
-
return;
|
274
|
-
}
|
275
|
-
|
276
|
-
if (interpolatedCmd[0] === _types.PathVerb.Conic && j === 5) {
|
277
|
-
interpolatedCmd.push(c);
|
278
|
-
} else {
|
279
|
-
const c2 = cmd2[i][j];
|
280
|
-
interpolatedCmd.push(c2 + (c - c2) * t);
|
281
|
-
}
|
282
|
-
});
|
283
|
-
});
|
284
|
-
const path = this.CanvasKit.Path.MakeFromCmds(interpolated.flat());
|
244
|
+
const path = this.CanvasKit.Path.MakeFromPathInterpolation(this.ref, JsiSkPath.fromValue(end), t);
|
285
245
|
|
286
246
|
if (path === null) {
|
287
247
|
return null;
|
@@ -291,11 +251,7 @@ class JsiSkPath extends _Host.HostObject {
|
|
291
251
|
}
|
292
252
|
|
293
253
|
isInterpolatable(path2) {
|
294
|
-
|
295
|
-
// throw new NotImplementedOnRNWeb();
|
296
|
-
const cmd1 = this.toCmds();
|
297
|
-
const cmd2 = path2.toCmds();
|
298
|
-
return areCmdsInterpolatable(cmd1, cmd2);
|
254
|
+
return this.CanvasKit.Path.CanInterpolate(this.ref, JsiSkPath.fromValue(path2));
|
299
255
|
}
|
300
256
|
|
301
257
|
toCmds() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkPath.ts"],"names":["CommandCount","PathVerb","Move","Line","Quad","Conic","Cubic","Close","areCmdsInterpolatable","cmd1","cmd2","length","i","JsiSkPath","HostObject","constructor","CanvasKit","ref","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","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","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","JsiSkRect","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","JsiSkPoint","isEmpty","isVolatile","addCircle","r","LTRBRect","getLastPt","op","path","simplify","toSVGString","trim","startT","stopT","isComplement","transform","m3","interpolate","end","t","toCmds","interpolated","forEach","cmd","interpolatedCmd","push","c","j","c2","Path","MakeFromCmds","flat","isInterpolatable","path2","cmds","reduce","acc","current"],"mappings":";;;;;;;AAEA;;AAaA;;AACA;;AACA;;AAEA,MAAMA,YAAY,GAAG;AACnB,GAACC,gBAASC,IAAV,GAAiB,CADE;AAEnB,GAACD,gBAASE,IAAV,GAAiB,CAFE;AAGnB,GAACF,gBAASG,IAAV,GAAiB,CAHE;AAInB,GAACH,gBAASI,KAAV,GAAkB,CAJC;AAKnB,GAACJ,gBAASK,KAAV,GAAkB,CALC;AAMnB,GAACL,gBAASM,KAAV,GAAkB;AANC,CAArB;;AASA,MAAMC,qBAAqB,GAAG,CAACC,IAAD,EAAsBC,IAAtB,KAA8C;AAC1E,MAAID,IAAI,CAACE,MAAL,KAAgBD,IAAI,C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IkI,OAAO,CAAClI,MAAR,KAAmB,CAAvB,EAA0B;AACxBkI,QAAAA,OAAO,CAACZ,IAAR,CAAaF,GAAb;AACA,cAAMpH,MAAM,GAAGX,YAAY,CAAC6I,OAAO,CAAC,CAAD,CAAR,CAA3B;;AACA,YAAIA,OAAO,CAAClI,MAAR,KAAmBA,MAAnB,IAA6BC,CAAC,KAAK8H,IAAI,CAAC/H,MAAL,GAAc,CAArD,EAAwD;AACtDiI,UAAAA,GAAG,CAACX,IAAJ,CAAS,EAAT;AACD;AACF,OAND,MAMO;AACL,cAAMtH,MAAM,GAAGX,YAAY,CAAC6I,OAAO,CAAC,CAAD,CAAR,CAA3B;;AACA,YAAIA,OAAO,CAAClI,MAAR,GAAiBA,MAArB,EAA6B;AAC3BkI,UAAAA,OAAO,CAACZ,IAAR,CAAaF,GAAb;AACD;;AACD,YAAIc,OAAO,CAAClI,MAAR,KAAmBA,MAAnB,IAA6BC,CAAC,KAAK8H,IAAI,CAAC/H,MAAL,GAAc,CAArD,EAAwD;AACtDiI,UAAAA,GAAG,CAACX,IAAJ,CAAS,EAAT;AACD;AACF;;AACD,aAAOW,GAAP;AACD,KArBc,EAqBZ,EArBY,CAAf;AAsBA,WAAOxG,MAAP;AACD;;AAtVuE","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, toValue } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\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 areCmdsInterpolatable = (cmd1: PathCommand[], cmd2: PathCommand[]) => {\n if (cmd1.length !== cmd2.length) {\n return false;\n }\n for (let i = 0; i < cmd1.length; i++) {\n if (cmd1[i][0] !== cmd2[i][0]) {\n return false;\n } else if (cmd1[i][0] === PathVerb.Conic && cmd1[i][5] !== cmd2[i][5]) {\n return false;\n }\n }\n return true;\n};\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(toValue(oval), startAngleInDegrees, sweepAngleInDegrees);\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(toValue(oval), isCCW, startIndex);\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) => toValue(p)),\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 }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\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 }\n\n reset() {\n this.ref.reset();\n }\n\n rewind() {\n this.ref.rewind();\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 toValue(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(toValue(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 }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(toValue(rect), isCCW);\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(toValue(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 // We leave the comment below to remind us that this is not implemented in CanvasKit\n // throw new NotImplementedOnRNWeb();\n this.ref.addOval(this.CanvasKit.LTRBRect(x - r, y - r, x + r, 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(toValue(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(startT: number, stopT: number, isComplement: boolean) {\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(toValue(m3));\n }\n\n interpolate(end: SkPath, t: number) {\n // Do not remove the comment below. We use it to track missing APIs in CanvasKit\n // throw new NotImplementedOnRNWeb();\n const cmd1 = this.toCmds();\n const cmd2 = end.toCmds();\n if (!areCmdsInterpolatable(cmd1, cmd2)) {\n return null;\n }\n const interpolated: PathCommand[] = [];\n cmd1.forEach((cmd, i) => {\n const interpolatedCmd = [cmd[0]];\n interpolated.push(interpolatedCmd);\n cmd.forEach((c, j) => {\n if (j === 0) {\n return;\n }\n if (interpolatedCmd[0] === PathVerb.Conic && j === 5) {\n interpolatedCmd.push(c);\n } else {\n const c2 = cmd2[i][j];\n interpolatedCmd.push(c2 + (c - c2) * t);\n }\n });\n });\n const path = this.CanvasKit.Path.MakeFromCmds(interpolated.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n isInterpolatable(path2: SkPath): boolean {\n // Do not remove the comment below. We use it to track missing APIs in CanvasKit\n // throw new NotImplementedOnRNWeb();\n const cmd1 = this.toCmds();\n const cmd2 = path2.toCmds();\n return areCmdsInterpolatable(cmd1, cmd2);\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"]}
|
1
|
+
{"version":3,"sources":["JsiSkPath.ts"],"names":["CommandCount","PathVerb","Move","Line","Quad","Conic","Cubic","Close","JsiSkPath","HostObject","constructor","CanvasKit","ref","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","JsiSkRect","fromValue","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","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","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","startT","stopT","isComplement","transform","m3","JsiSkMatrix","interpolate","end","t","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"mappings":";;;;;;;AAEA;;AAaA;;AACA;;AACA;;AACA;;AACA;;AAEA,MAAMA,YAAY,GAAG;AACnB,GAACC,gBAASC,IAAV,GAAiB,CADE;AAEnB,GAACD,gBAASE,IAAV,GAAiB,CAFE;AAGnB,GAACF,gBAASG,IAAV,GAAiB,CAHE;AAInB,GAACH,gBAASI,KAAV,GAAkB,CAJC;AAKnB,GAACJ,gBAASK,KAAV,GAAkB,CALC;AAMnB,GAACL,gBAASM,KAAV,GAAkB;AANC,CAArB;;AASO,MAAMC,SAAN,SAAwBC,gBAAxB,CAAmE;AACxEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;AAC3C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;AACD;;AAEDC,EAAAA,MAAM,CACJC,IADI,EAEJC,mBAFI,EAGJC,mBAHI,EAIJ;AACA,SAAKJ,GAAL,CAASC,MAAT,CACEI,qBAAUC,SAAV,CAAoB,KAAKP,SAAzB,EAAoCG,IAApC,CADF,EAEEC,mBAFF,EAGEC,mBAHF;AAKA,WAAO,IAAP;AACD;;AAEDG,EAAAA,OAAO,CAACL,IAAD,EAAeM,KAAf,EAAgCC,UAAhC,EAAqD;AAC1D,SAAKT,GAAL,C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ArB,EAA6B;AAC3BD,UAAAA,OAAO,CAACD,IAAR,CAAaF,GAAb;AACD;;AACD,YAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;AACtDL,UAAAA,GAAG,CAACG,IAAJ,CAAS,EAAT;AACD;AACF;;AACD,aAAOH,GAAP;AACD,KArBc,EAqBZ,EArBY,CAAf;AAsBA,WAAO/F,MAAP;AACD;;AAxUuE","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\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\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 }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\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 }\n\n reset() {\n this.ref.reset();\n }\n\n rewind() {\n this.ref.rewind();\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 }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\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(startT: number, stopT: number, isComplement: boolean) {\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 }\n\n interpolate(end: SkPath, t: number) {\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 return new JsiSkPath(this.CanvasKit, path);\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"]}
|
@@ -7,6 +7,10 @@ exports.JsiSkPathEffectFactory = void 0;
|
|
7
7
|
|
8
8
|
var _Host = require("./Host");
|
9
9
|
|
10
|
+
var _JsiSkMatrix = require("./JsiSkMatrix");
|
11
|
+
|
12
|
+
var _JsiSkPath = require("./JsiSkPath");
|
13
|
+
|
10
14
|
var _JsiSkPathEffect = require("./JsiSkPathEffect");
|
11
15
|
|
12
16
|
class JsiSkPathEffectFactory extends _Host.Host {
|
@@ -43,7 +47,7 @@ class JsiSkPathEffectFactory extends _Host.Host {
|
|
43
47
|
}
|
44
48
|
|
45
49
|
MakeLine2D(width, matrix) {
|
46
|
-
const pe = this.CanvasKit.PathEffect.MakeLine2D(width,
|
50
|
+
const pe = this.CanvasKit.PathEffect.MakeLine2D(width, _JsiSkMatrix.JsiSkMatrix.fromValue(matrix));
|
47
51
|
|
48
52
|
if (pe === null) {
|
49
53
|
return null;
|
@@ -53,7 +57,7 @@ class JsiSkPathEffectFactory extends _Host.Host {
|
|
53
57
|
}
|
54
58
|
|
55
59
|
MakePath1D(path, advance, phase, style) {
|
56
|
-
const pe = this.CanvasKit.PathEffect.MakePath1D(
|
60
|
+
const pe = this.CanvasKit.PathEffect.MakePath1D(_JsiSkPath.JsiSkPath.fromValue(path), advance, phase, (0, _Host.ckEnum)(style));
|
57
61
|
|
58
62
|
if (pe === null) {
|
59
63
|
return null;
|
@@ -63,7 +67,7 @@ class JsiSkPathEffectFactory extends _Host.Host {
|
|
63
67
|
}
|
64
68
|
|
65
69
|
MakePath2D(matrix, path) {
|
66
|
-
const pe = this.CanvasKit.PathEffect.MakePath2D(
|
70
|
+
const pe = this.CanvasKit.PathEffect.MakePath2D(_JsiSkMatrix.JsiSkMatrix.fromValue(matrix), _JsiSkPath.JsiSkPath.fromValue(path));
|
67
71
|
|
68
72
|
if (pe === null) {
|
69
73
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkPathEffectFactory.ts"],"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","MakePath1D","path","advance","style","MakePath2D"],"mappings":";;;;;;;AAUA;;AACA;;AAEO,MAAMA,sBAAN,SAAqCC,UAArC,CAAuE;AAC5EC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,UAAU,CAACC,MAAD,EAAiB;AACzB,UAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BH,UAA1B,CAAqCC,MAArC,CAAX;;AACA,QAAIC,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIE,gCAAJ,CAAoB,KAAKL,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDG,EAAAA,QAAQ,CAACC,SAAD,EAAsBC,KAAtB,EAAsC;AAC5C,UAAML,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BE,QAA1B,CAAmCC,SAAnC,EAA8CC,KAA9C,CAAX;AACA,WAAO,IAAIH,gCAAJ,CAAoB,KAAKL,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDM,EAAAA,YAAY,CAACC,SAAD,EAAoBC,GAApB,EAAiCC,UAAjC,EAAqD;AAC/D,UAAMT,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BK,YAA1B,CACTC,SADS,EAETC,GAFS,EAGTC,UAHS,CAAX;AAKA,WAAO,IAAIP,gCAAJ,CAAoB,KAAKL,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDU,EAAAA,WAAW,CAACC,MAAD,EAAuBC,MAAvB,EAA2D;AACpE,UAAM,IAAIC,2BAAJ,EAAN;AACD;;AAEDC,EAAAA,OAAO,CAACH,MAAD,EAAuBC,MAAvB,EAA2D;AAChE,UAAM,IAAIC,2BAAJ,EAAN;AACD;;AAEDE,EAAAA,UAAU,CAACC,KAAD,EAAgBC,MAAhB,EAAkC;AAC1C,UAAMjB,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0Bc,UAA1B,
|
1
|
+
{"version":3,"sources":["JsiSkPathEffectFactory.ts"],"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","MakePath2D"],"mappings":";;;;;;;AAUA;;AACA;;AACA;;AACA;;AAEO,MAAMA,sBAAN,SAAqCC,UAArC,CAAuE;AAC5EC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,UAAU,CAACC,MAAD,EAAiB;AACzB,UAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BH,UAA1B,CAAqCC,MAArC,CAAX;;AACA,QAAIC,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIE,gCAAJ,CAAoB,KAAKL,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDG,EAAAA,QAAQ,CAACC,SAAD,EAAsBC,KAAtB,EAAsC;AAC5C,UAAML,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BE,QAA1B,CAAmCC,SAAnC,EAA8CC,KAA9C,CAAX;AACA,WAAO,IAAIH,gCAAJ,CAAoB,KAAKL,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDM,EAAAA,YAAY,CAACC,SAAD,EAAoBC,GAApB,EAAiCC,UAAjC,EAAqD;AAC/D,UAAMT,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BK,YAA1B,CACTC,SADS,EAETC,GAFS,EAGTC,UAHS,CAAX;AAKA,WAAO,IAAIP,gCAAJ,CAAoB,KAAKL,S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IE,gCAAJ,CAAoB,KAAKL,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAzE2E","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 { ckEnum, 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 ckEnum(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"]}
|
@@ -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(
|
32
|
+
const path = this.CanvasKit.Path.MakeFromOp(_JsiSkPath.JsiSkPath.fromValue(one), _JsiSkPath.JsiSkPath.fromValue(two), (0, _Host.ckEnum)(op));
|
33
33
|
|
34
34
|
if (path === null) {
|
35
35
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkPathFactory.ts"],"names":["JsiSkPathFactory","Host","constructor","CanvasKit","Make","JsiSkPath","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font","NotImplementedOnRNWeb"],"mappings":";;;;;;;AAKA;;AACA;;AAEO,MAAMA,gBAAN,SAA+BC,UAA/B,CAA2D;AAChEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,IAAI,GAAG;AACL,WAAO,IAAIC,oBAAJ,CAAc,KAAKF,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeG,IAAnB,EAA9B,CAAP;AACD;;AAEDC,EAAAA,iBAAiB,CAACC,GAAD,EAAc;AAC7B,UAAMC,IAAI,GAAG,KAAKN,SAAL,CAAeG,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;AACA,QAAIC,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIJ,oBAAJ,CAAc,KAAKF,SAAnB,EAA8BM,IAA9B,CAAP;AACD;;AAEDC,EAAAA,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;AAC/C,UAAMJ,IAAI,GAAG,KAAKN,SAAL,CAAeG,IAAf,CAAoBI,UAApB,
|
1
|
+
{"version":3,"sources":["JsiSkPathFactory.ts"],"names":["JsiSkPathFactory","Host","constructor","CanvasKit","Make","JsiSkPath","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font","NotImplementedOnRNWeb"],"mappings":";;;;;;;AAKA;;AACA;;AAEO,MAAMA,gBAAN,SAA+BC,UAA/B,CAA2D;AAChEC,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,IAAI,GAAG;AACL,WAAO,IAAIC,oBAAJ,CAAc,KAAKF,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeG,IAAnB,EAA9B,CAAP;AACD;;AAEDC,EAAAA,iBAAiB,CAACC,GAAD,EAAc;AAC7B,UAAMC,IAAI,GAAG,KAAKN,SAAL,CAAeG,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;AACA,QAAIC,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIJ,oBAAJ,CAAc,KAAKF,SAAnB,EAA8BM,IAA9B,CAAP;AACD;;AAEDC,EAAAA,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;AAC/C,UAAMJ,IAAI,GAAG,KAAKN,SAAL,CAAeG,IAAf,CAAoBI,UAApB,CACXL,qBAAUS,SAAV,CAAoBH,GAApB,CADW,EAEXN,qBAAUS,SAAV,CAAoBF,GAApB,CAFW,EAGX,kBAAOC,EAAP,CAHW,CAAb;;AAKA,QAAIJ,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIJ,oBAAJ,CAAc,KAAKF,SAAnB,EAA8BM,IAA9B,CAAP;AACD;;AAEDM,EAAAA,YAAY,CAACC,IAAD,EAAsB;AAChC,UAAMP,IAAI,GAAG,KAAKN,SAAL,CAAeG,IAAf,CAAoBS,YAApB,CAAiCC,IAAI,CAACC,IAAL,EAAjC,CAAb;;AACA,QAAIR,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIJ,oBAAJ,CAAc,KAAKF,SAAnB,EAA8BM,IAA9B,CAAP;AACD;;AAEDS,EAAAA,YAAY,CACVC,KADU,EAEVC,EAFU,EAGVC,EAHU,EAIVC,KAJU,EAKK;AACf,UAAM,IAAIC,2BAAJ,EAAN;AACD;;AA5C+D","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, ckEnum, 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 ckEnum(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"]}
|
@@ -9,6 +9,10 @@ var _Host = require("./Host");
|
|
9
9
|
|
10
10
|
var _JsiSkShader = require("./JsiSkShader");
|
11
11
|
|
12
|
+
var _JsiSkMatrix = require("./JsiSkMatrix");
|
13
|
+
|
14
|
+
var _JsiSkRect = require("./JsiSkRect");
|
15
|
+
|
12
16
|
// TODO: suggest to rename SkPicture to Picture for consistency
|
13
17
|
class JsiSkPicture extends _Host.HostObject {
|
14
18
|
constructor(CanvasKit, ref) {
|
@@ -16,7 +20,7 @@ class JsiSkPicture extends _Host.HostObject {
|
|
16
20
|
}
|
17
21
|
|
18
22
|
makeShader(tmx, tmy, mode, localMatrix, tileRect) {
|
19
|
-
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShader((0, _Host.ckEnum)(tmx), (0, _Host.ckEnum)(tmy), (0, _Host.ckEnum)(mode), localMatrix ?
|
23
|
+
return new _JsiSkShader.JsiSkShader(this.CanvasKit, this.ref.makeShader((0, _Host.ckEnum)(tmx), (0, _Host.ckEnum)(tmy), (0, _Host.ckEnum)(mode), localMatrix ? _JsiSkMatrix.JsiSkMatrix.fromValue(localMatrix) : undefined, tileRect ? _JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined));
|
20
24
|
}
|
21
25
|
|
22
26
|
serialize() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkPicture.ts"],"names":["JsiSkPicture","HostObject","constructor","CanvasKit","ref","makeShader","tmx","tmy","mode","localMatrix","tileRect","JsiSkShader","undefined","serialize"],"mappings":";;;;;;;AAWA;;AACA;;
|
1
|
+
{"version":3,"sources":["JsiSkPicture.ts"],"names":["JsiSkPicture","HostObject","constructor","CanvasKit","ref","makeShader","tmx","tmy","mode","localMatrix","tileRect","JsiSkShader","JsiSkMatrix","fromValue","undefined","JsiSkRect","serialize"],"mappings":";;;;;;;AAWA;;AACA;;AACA;;AACA;;AAdA;AAgBO,MAAMA,YAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAEDC,EAAAA,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;AACA,WAAO,IAAIC,wBAAJ,CACL,KAAKR,SADA,EAEL,KAAKC,GAAL,CAASC,UAAT,CACE,kBAAOC,GAAP,CADF,EAEE,kBAAOC,GAAP,CAFF,EAGE,kBAAOC,IAAP,CAHF,EAIEC,WAAW,GAAGG,yBAAYC,SAAZ,CAAsBJ,WAAtB,CAAH,GAAwCK,SAJrD,EAKEJ,QAAQ,GAAGK,qBAAUF,SAAV,CAAoB,KAAKV,SAAzB,EAAoCO,QAApC,CAAH,GAAmDI,SAL7D,CAFK,CAAP;AAUD;;AAEDE,EAAAA,SAAS,GAAG;AACV,WAAO,KAAKZ,GAAL,CAASY,SAAT,EAAP;AACD;;AA1BH","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, ckEnum } 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 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 ckEnum(tmx),\n ckEnum(tmy),\n ckEnum(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"]}
|
@@ -11,13 +11,15 @@ var _JsiSkCanvas = require("./JsiSkCanvas");
|
|
11
11
|
|
12
12
|
var _JsiSkPicture = require("./JsiSkPicture");
|
13
13
|
|
14
|
+
var _JsiSkRect = require("./JsiSkRect");
|
15
|
+
|
14
16
|
class JsiSkPictureRecorder extends _Host.HostObject {
|
15
17
|
constructor(CanvasKit, ref) {
|
16
18
|
super(CanvasKit, ref, "PictureRecorder");
|
17
19
|
}
|
18
20
|
|
19
21
|
beginRecording(bounds) {
|
20
|
-
return new _JsiSkCanvas.JsiSkCanvas(this.CanvasKit, this.ref.beginRecording((
|
22
|
+
return new _JsiSkCanvas.JsiSkCanvas(this.CanvasKit, this.ref.beginRecording(_JsiSkRect.JsiSkRect.fromValue(this.CanvasKit, bounds)));
|
21
23
|
}
|
22
24
|
|
23
25
|
finishRecordingAsPicture() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkPictureRecorder.ts"],"names":["JsiSkPictureRecorder","HostObject","constructor","CanvasKit","ref","beginRecording","bounds","JsiSkCanvas","finishRecordingAsPicture","JsiSkPicture"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AAEO,MAAMA,oBAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA6C;AACtD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,iBAAtB;AACD;;AAEDC,EAAAA,cAAc,CAACC,MAAD,EAAiB;AAC7B,WAAO,IAAIC,wBAAJ,CACL,KAAKJ,SADA,EAEL,KAAKC,GAAL,CAASC,cAAT,
|
1
|
+
{"version":3,"sources":["JsiSkPictureRecorder.ts"],"names":["JsiSkPictureRecorder","HostObject","constructor","CanvasKit","ref","beginRecording","bounds","JsiSkCanvas","JsiSkRect","fromValue","finishRecordingAsPicture","JsiSkPicture"],"mappings":";;;;;;;AAKA;;AACA;;AACA;;AACA;;AAEO,MAAMA,oBAAN,SACGC,gBADH,CAGP;AACEC,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA6C;AACtD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,iBAAtB;AACD;;AAEDC,EAAAA,cAAc,CAACC,MAAD,EAAiB;AAC7B,WAAO,IAAIC,wBAAJ,CACL,KAAKJ,SADA,EAEL,KAAKC,GAAL,CAASC,cAAT,CAAwBG,qBAAUC,SAAV,CAAoB,KAAKN,SAAzB,EAAoCG,MAApC,CAAxB,CAFK,CAAP;AAID;;AAEDI,EAAAA,wBAAwB,GAAG;AACzB,WAAO,IAAIC,0BAAJ,CACL,KAAKR,SADA,EAEL,KAAKC,GAAL,CAASM,wBAAT,EAFK,CAAP;AAID;;AAjBH","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 beginRecording(bounds: SkRect) {\n return new JsiSkCanvas(\n this.CanvasKit,\n this.ref.beginRecording(JsiSkRect.fromValue(this.CanvasKit, bounds))\n );\n }\n\n finishRecordingAsPicture() {\n return new JsiSkPicture(\n this.CanvasKit,\n this.ref.finishRecordingAsPicture()\n );\n }\n}\n"]}
|
@@ -7,7 +7,15 @@ exports.JsiSkPoint = void 0;
|
|
7
7
|
|
8
8
|
var _Host = require("./Host");
|
9
9
|
|
10
|
-
class JsiSkPoint extends _Host.
|
10
|
+
class JsiSkPoint extends _Host.BaseHostObject {
|
11
|
+
static fromValue(point) {
|
12
|
+
if (point instanceof JsiSkPoint) {
|
13
|
+
return point.ref;
|
14
|
+
}
|
15
|
+
|
16
|
+
return new Float32Array([point.x, point.y]);
|
17
|
+
}
|
18
|
+
|
11
19
|
constructor(CanvasKit, ref) {
|
12
20
|
super(CanvasKit, ref, "Point");
|
13
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["JsiSkPoint.ts"],"names":["JsiSkPoint","
|
1
|
+
{"version":3,"sources":["JsiSkPoint.ts"],"names":["JsiSkPoint","BaseHostObject","fromValue","point","ref","Float32Array","x","y","constructor","CanvasKit"],"mappings":";;;;;;;AAIA;;AAEO,MAAMA,UAAN,SACGC,oBADH,CAGP;AACkB,SAATC,SAAS,CAACC,KAAD,EAAiB;AAC/B,QAAIA,KAAK,YAAYH,UAArB,EAAiC;AAC/B,aAAOG,KAAK,CAACC,GAAb;AACD;;AACD,WAAO,IAAIC,YAAJ,CAAiB,CAACF,KAAK,CAACG,CAAP,EAAUH,KAAK,CAACI,CAAhB,CAAjB,CAAP;AACD;;AAEDC,EAAAA,WAAW,CAACC,SAAD,EAAuBL,GAAvB,EAAmC;AAC5C,UAAMK,SAAN,EAAiBL,GAAjB,EAAsB,OAAtB;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;;AAlBH","sourcesContent":["import type { CanvasKit, Point } from \"canvaskit-wasm\";\n\nimport type { SkPoint } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\n\nexport class JsiSkPoint\n extends BaseHostObject<Point, \"Point\">\n implements SkPoint\n{\n static fromValue(point: SkPoint) {\n if (point instanceof JsiSkPoint) {\n return point.ref;\n }\n return new Float32Array([point.x, point.y]);\n }\n\n constructor(CanvasKit: CanvasKit, ref: Point) {\n super(CanvasKit, ref, \"Point\");\n }\n\n get x() {\n return this.ref[0];\n }\n\n get y() {\n return this.ref[1];\n }\n}\n"]}
|
@@ -9,7 +9,15 @@ var _Host = require("./Host");
|
|
9
9
|
|
10
10
|
var _JsiSkRect = require("./JsiSkRect");
|
11
11
|
|
12
|
-
class JsiSkRRect extends _Host.
|
12
|
+
class JsiSkRRect extends _Host.BaseHostObject {
|
13
|
+
static fromValue(CanvasKit, rect) {
|
14
|
+
if (rect instanceof _JsiSkRect.JsiSkRect) {
|
15
|
+
return rect.ref;
|
16
|
+
}
|
17
|
+
|
18
|
+
return CanvasKit.RRectXY(_JsiSkRect.JsiSkRect.fromValue(CanvasKit, rect.rect), rect.rx, rect.ry);
|
19
|
+
}
|
20
|
+
|
13
21
|
constructor(CanvasKit, ref) {
|
14
22
|
super(CanvasKit, ref, "RRect");
|
15
23
|
}
|