@shopify/react-native-skia 0.1.191 → 0.1.192
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkColorFilter.h +2 -17
- package/cpp/api/JsiSkContourMeasure.h +3 -17
- package/cpp/api/JsiSkContourMeasureIter.h +3 -18
- package/cpp/api/JsiSkData.h +1 -18
- package/cpp/api/JsiSkFont.h +4 -14
- package/cpp/api/JsiSkHostObjects.h +85 -10
- package/cpp/api/JsiSkImage.h +1 -12
- package/cpp/api/JsiSkImageFilter.h +1 -17
- package/cpp/api/JsiSkMaskFilter.h +1 -17
- package/cpp/api/JsiSkMatrix.h +3 -6
- package/cpp/api/JsiSkPaint.h +3 -15
- package/cpp/api/JsiSkPath.h +2 -15
- package/cpp/api/JsiSkPathEffect.h +2 -17
- package/cpp/api/JsiSkPicture.h +4 -18
- package/cpp/api/JsiSkPictureRecorder.h +4 -1
- package/cpp/api/JsiSkPoint.h +6 -1
- package/cpp/api/JsiSkRRect.h +6 -1
- package/cpp/api/JsiSkRSXform.h +4 -6
- package/cpp/api/JsiSkRect.h +6 -2
- package/cpp/api/JsiSkRuntimeEffect.h +4 -7
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +2 -10
- package/cpp/api/JsiSkSVG.h +1 -10
- package/cpp/api/JsiSkShader.h +2 -16
- package/cpp/api/JsiSkSurface.h +3 -16
- package/cpp/api/JsiSkTextBlob.h +2 -18
- package/cpp/api/JsiSkTypeface.h +1 -22
- package/cpp/api/JsiSkVertices.h +3 -17
- package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -2
- package/cpp/rnskia/values/RNSkValue.h +1 -1
- package/lib/commonjs/renderer/Canvas.js +17 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +2 -2
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.d.ts +2 -2
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.d.ts +2 -2
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.d.ts +4 -4
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +1 -0
- package/lib/commonjs/skia/web/Host.js +2 -0
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkColorFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +6 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkData.js +4 -2
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkFont.js +6 -0
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +6 -4
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js +5 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPath.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js +6 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js +5 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRect.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkShader.js +6 -0
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js +6 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js +6 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.js +6 -4
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js +6 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/types.d.ts +1 -1
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.web.js +14 -4
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -1
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/renderer/Canvas.js +15 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +2 -2
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/types/Data/Data.d.ts +2 -2
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/types/Image/Image.d.ts +2 -2
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.d.ts +4 -4
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/module/skia/types/SVG/SVG.js.map +1 -1
- package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +1 -0
- package/lib/module/skia/web/Host.js +2 -0
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/module/skia/web/JsiSkCanvas.js +6 -0
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkColorFilter.js +6 -0
- package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js +6 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.d.ts +1 -1
- package/lib/module/skia/web/JsiSkData.js +4 -2
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/module/skia/web/JsiSkFont.js +6 -0
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/module/skia/web/JsiSkImage.js +6 -4
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkImageFilter.js +6 -0
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js +6 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/module/skia/web/JsiSkMatrix.js +5 -0
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPaint.js +6 -0
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPath.js +6 -0
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPathEffect.js +6 -0
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPicture.js +6 -0
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPoint.js +5 -0
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRRect.js +5 -0
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRSXform.js +5 -0
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRect.js +5 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/module/skia/web/JsiSkShader.js +6 -0
- package/lib/module/skia/web/JsiSkShader.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/module/skia/web/JsiSkSurface.js +6 -0
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/module/skia/web/JsiSkTextBlob.js +6 -0
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/module/skia/web/JsiSkTypeface.js +6 -4
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/module/skia/web/JsiSkVertices.js +6 -0
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.js +1 -1
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/types.d.ts +1 -1
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/module/values/web/RNSkComputedValue.js +1 -1
- package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/views/SkiaDomView.web.js +13 -4
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -1
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/skia/core/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/Data/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/Image/Image.d.ts +2 -2
- package/lib/typescript/src/skia/types/JsiInstance.d.ts +4 -4
- package/lib/typescript/src/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/typescript/src/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/typescript/src/skia/web/Host.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/typescript/src/values/types.d.ts +1 -1
- package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/typescript/src/views/types.d.ts +2 -1
- package/package.json +1 -1
- package/src/renderer/Canvas.tsx +21 -1
- package/src/skia/core/Data.ts +3 -3
- package/src/skia/types/Data/Data.ts +2 -2
- package/src/skia/types/Image/Image.ts +2 -2
- package/src/skia/types/JsiInstance.ts +4 -4
- package/src/skia/types/SVG/SVG.ts +2 -2
- package/src/skia/types/Typeface/Typeface.ts +2 -2
- package/src/skia/web/Host.ts +2 -0
- package/src/skia/web/JsiSkCanvas.ts +4 -0
- package/src/skia/web/JsiSkColorFilter.ts +4 -0
- package/src/skia/web/JsiSkContourMeasure.ts +4 -0
- package/src/skia/web/JsiSkContourMeasureIter.ts +4 -0
- package/src/skia/web/JsiSkData.ts +3 -3
- package/src/skia/web/JsiSkFont.ts +4 -0
- package/src/skia/web/JsiSkImage.ts +2 -2
- package/src/skia/web/JsiSkImageFilter.ts +4 -0
- package/src/skia/web/JsiSkMaskFilter.ts +4 -0
- package/src/skia/web/JsiSkMatrix.ts +4 -0
- package/src/skia/web/JsiSkPaint.ts +4 -0
- package/src/skia/web/JsiSkPath.ts +4 -0
- package/src/skia/web/JsiSkPathEffect.ts +4 -0
- package/src/skia/web/JsiSkPicture.ts +4 -0
- package/src/skia/web/JsiSkPictureRecorder.ts +4 -0
- package/src/skia/web/JsiSkPoint.ts +4 -0
- package/src/skia/web/JsiSkRRect.ts +4 -0
- package/src/skia/web/JsiSkRSXform.ts +4 -0
- package/src/skia/web/JsiSkRect.ts +4 -0
- package/src/skia/web/JsiSkRuntimeEffect.ts +4 -0
- package/src/skia/web/JsiSkShader.ts +4 -0
- package/src/skia/web/JsiSkSurface.ts +4 -0
- package/src/skia/web/JsiSkTextBlob.ts +4 -0
- package/src/skia/web/JsiSkTypeface.ts +2 -2
- package/src/skia/web/JsiSkVertices.ts +4 -0
- package/src/values/hooks/useComputedValue.ts +1 -1
- package/src/values/types.ts +1 -1
- package/src/values/web/RNSkComputedValue.ts +1 -1
- package/src/values/web/RNSkReadonlyValue.ts +1 -1
- package/src/views/SkiaDomView.web.tsx +6 -1
- package/src/views/types.ts +2 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkCanvas","HostObject","constructor","CanvasKit","ref","drawRect","rect","paint","JsiSkRect","fromValue","JsiSkPaint","drawImage","image","x","y","JsiSkImage","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","ckEnum","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","JsiSkVertices","drawPatch","cubics","colors","texs","map","flat","flatMap","p","JsiSkPoint","undefined","restoreToCount","saveCount","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","JsiSkRRect","drawDRRect","outer","inner","drawOval","drawPath","path","JsiSkPath","drawText","str","font","JsiSkFont","drawTextBlob","blob","JsiSkTextBlob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","JsiSkImageFilter","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","clipRect","clipRRect","concat","m","JsiSkMatrix","drawPicture","skp","JsiSkPicture"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { ckEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n ckEnum(mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? ckEnum(mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n ckEnum(mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(color, blendMode ? ckEnum(blendMode) : undefined);\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(JsiSkPath.fromValue(path), ckEnum(op), doAntiAlias);\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix) {\n this.ref.concat(JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n}\n"],"mappings":";;;;;;;AA0BA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,MAAMA,WAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SAAN,EAAi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QAAT,CACEhH,oBAAA,CAAUC,SAAV,CAAoB,KAAKN,SAAzB,EAAoCG,IAApC,CADF,EAEE,IAAAuB,YAAA,EAAOyF,EAAP,CAFF,EAGEC,WAHF;EAKD;;EAEDE,SAAS,CAAClD,KAAD,EAAiB+C,EAAjB,EAA6BC,WAA7B,EAAmD;IAC1D,KAAKnH,GAAL,CAASqH,SAAT,CACEjD,sBAAA,CAAW/D,SAAX,CAAqB,KAAKN,SAA1B,EAAqCoE,KAArC,CADF,EAEE,IAAA1C,YAAA,EAAOyF,EAAP,CAFF,EAGEC,WAHF;EAKD;;EAEDG,MAAM,CAACC,CAAD,EAAc;IAClB,KAAKvH,GAAL,CAASsH,MAAT,CAAgBE,wBAAA,CAAYnH,SAAZ,CAAsBkH,CAAtB,CAAhB;EACD;;EAEDE,WAAW,CAACC,GAAD,EAAiB;IAC1B,KAAK1H,GAAL,CAASyH,WAAT,CAAqBE,0BAAA,CAAatH,SAAb,CAAuBqH,GAAvB,CAArB;EACD;;AAxUH"}
|
1
|
+
{"version":3,"names":["JsiSkCanvas","HostObject","constructor","CanvasKit","ref","delete","drawRect","rect","paint","JsiSkRect","fromValue","JsiSkPaint","drawImage","image","x","y","JsiSkImage","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","ckEnum","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","JsiSkVertices","drawPatch","cubics","colors","texs","map","flat","flatMap","p","JsiSkPoint","undefined","restoreToCount","saveCount","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","JsiSkRRect","drawDRRect","outer","inner","drawOval","drawPath","path","JsiSkPath","drawText","str","font","JsiSkFont","drawTextBlob","blob","JsiSkTextBlob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","JsiSkImageFilter","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","clipRect","clipRRect","concat","m","JsiSkMatrix","drawPicture","skp","JsiSkPicture"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { ckEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n ckEnum(mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? ckEnum(mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n ckEnum(mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(color, blendMode ? ckEnum(blendMode) : undefined);\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(JsiSkPath.fromValue(path), ckEnum(op), doAntiAlias);\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix) {\n this.ref.concat(JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n}\n"],"mappings":";;;;;;;AA0BA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,WAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IAD6C,iCAIrC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN8C;EAE9C;;EAMDC,QAAQ,CAACC,IAAD,EAAeC,KAAf,EAA+B;IACrC,KAAKJ,GAAL,CAASE,QAAT,CACEG,oBAAA,CAAUC,SAAV,CAAoB,KAAKP,SAAzB,EA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KD;;EAEDE,SAAS,CAAClD,KAAD,EAAiB+C,EAAjB,EAA6BC,WAA7B,EAAmD;IAC1D,KAAKpH,GAAL,CAASsH,SAAT,CACEjD,sBAAA,CAAW/D,SAAX,CAAqB,KAAKP,SAA1B,EAAqCqE,KAArC,CADF,EAEE,IAAA1C,YAAA,EAAOyF,EAAP,CAFF,EAGEC,WAHF;EAKD;;EAEDG,MAAM,CAACC,CAAD,EAAc;IAClB,KAAKxH,GAAL,CAASuH,MAAT,CAAgBE,wBAAA,CAAYnH,SAAZ,CAAsBkH,CAAtB,CAAhB;EACD;;EAEDE,WAAW,CAACC,GAAD,EAAiB;IAC1B,KAAK3H,GAAL,CAAS0H,WAAT,CAAqBE,0BAAA,CAAatH,SAAb,CAAuBqH,GAAvB,CAArB;EACD;;AA5UH"}
|
@@ -3,4 +3,5 @@ import type { SkColorFilter } from "../types";
|
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
export declare class JsiSkColorFilter extends HostObject<ColorFilter, "ColorFilter"> implements SkColorFilter {
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: ColorFilter);
|
6
|
+
dispose: () => void;
|
6
7
|
}
|
@@ -7,9 +7,15 @@ exports.JsiSkColorFilter = void 0;
|
|
7
7
|
|
8
8
|
var _Host = require("./Host");
|
9
9
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
10
12
|
class JsiSkColorFilter extends _Host.HostObject {
|
11
13
|
constructor(CanvasKit, ref) {
|
12
14
|
super(CanvasKit, ref, "ColorFilter");
|
15
|
+
|
16
|
+
_defineProperty(this, "dispose", () => {
|
17
|
+
this.ref.delete();
|
18
|
+
});
|
13
19
|
}
|
14
20
|
|
15
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkColorFilter","HostObject","constructor","CanvasKit","ref"],"sources":["JsiSkColorFilter.ts"],"sourcesContent":["import type { CanvasKit, ColorFilter } from \"canvaskit-wasm\";\n\nimport type { SkColorFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkColorFilter\n extends HostObject<ColorFilter, \"ColorFilter\">\n implements SkColorFilter\n{\n constructor(CanvasKit: CanvasKit, ref: ColorFilter) {\n super(CanvasKit, ref, \"ColorFilter\");\n }\n}\n"],"mappings":";;;;;;;AAIA
|
1
|
+
{"version":3,"names":["JsiSkColorFilter","HostObject","constructor","CanvasKit","ref","delete"],"sources":["JsiSkColorFilter.ts"],"sourcesContent":["import type { CanvasKit, ColorFilter } from \"canvaskit-wasm\";\n\nimport type { SkColorFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkColorFilter\n extends HostObject<ColorFilter, \"ColorFilter\">\n implements SkColorFilter\n{\n constructor(CanvasKit: CanvasKit, ref: ColorFilter) {\n super(CanvasKit, ref, \"ColorFilter\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;;;;;AAIA;;;;AAEO,MAAMA,gBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAyC;IAClD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,aAAtB;;IADkD,iCAI1C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANmD;EAEnD;;AAHH"}
|
@@ -11,9 +11,15 @@ var _JsiSkPath = require("./JsiSkPath");
|
|
11
11
|
|
12
12
|
var _JsiSkPoint = require("./JsiSkPoint");
|
13
13
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
15
|
+
|
14
16
|
class JsiSkContourMeasure extends _Host.HostObject {
|
15
17
|
constructor(CanvasKit, ref) {
|
16
18
|
super(CanvasKit, ref, "ContourMeasure");
|
19
|
+
|
20
|
+
_defineProperty(this, "dispose", () => {
|
21
|
+
this.ref.delete();
|
22
|
+
});
|
17
23
|
}
|
18
24
|
|
19
25
|
getPosTan(distance) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkContourMeasure","HostObject","constructor","CanvasKit","ref","getPosTan","distance","posTan","JsiSkPoint","slice","getSegment","startD","stopD","startWithMoveTo","JsiSkPath","isClosed","length"],"sources":["JsiSkContourMeasure.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasure } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasure } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkContourMeasure\n extends HostObject<ContourMeasure, \"ContourMeasure\">\n implements SkContourMeasure\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasure) {\n super(CanvasKit, ref, \"ContourMeasure\");\n }\n\n getPosTan(distance: number): [position: JsiSkPoint, tangent: JsiSkPoint] {\n const posTan = this.ref.getPosTan(distance);\n return [\n new JsiSkPoint(this.CanvasKit, posTan.slice(0, 2)),\n new JsiSkPoint(this.CanvasKit, posTan.slice(2)),\n ];\n }\n\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean) {\n return new JsiSkPath(\n this.CanvasKit,\n this.ref.getSegment(startD, stopD, startWithMoveTo)\n );\n }\n\n isClosed() {\n return this.ref.isClosed();\n }\n\n length() {\n return this.ref.length();\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;AACA
|
1
|
+
{"version":3,"names":["JsiSkContourMeasure","HostObject","constructor","CanvasKit","ref","delete","getPosTan","distance","posTan","JsiSkPoint","slice","getSegment","startD","stopD","startWithMoveTo","JsiSkPath","isClosed","length"],"sources":["JsiSkContourMeasure.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasure } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasure } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkContourMeasure\n extends HostObject<ContourMeasure, \"ContourMeasure\">\n implements SkContourMeasure\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasure) {\n super(CanvasKit, ref, \"ContourMeasure\");\n }\n\n getPosTan(distance: number): [position: JsiSkPoint, tangent: JsiSkPoint] {\n const posTan = this.ref.getPosTan(distance);\n return [\n new JsiSkPoint(this.CanvasKit, posTan.slice(0, 2)),\n new JsiSkPoint(this.CanvasKit, posTan.slice(2)),\n ];\n }\n\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean) {\n return new JsiSkPath(\n this.CanvasKit,\n this.ref.getSegment(startD, stopD, startWithMoveTo)\n );\n }\n\n isClosed() {\n return this.ref.isClosed();\n }\n\n length() {\n return this.ref.length();\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;AACA;;;;AAEO,MAAMA,mBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA4C;IACrD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,gBAAtB;;IADqD,iCA2B7C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CA7BsD;EAEtD;;EAEDC,SAAS,CAACC,QAAD,EAAgE;IACvE,MAAMC,MAAM,GAAG,KAAKJ,GAAL,CAASE,SAAT,CAAmBC,QAAnB,CAAf;IACA,OAAO,CACL,IAAIE,sBAAJ,CAAe,KAAKN,SAApB,EAA+BK,MAAM,CAACE,KAAP,CAAa,CAAb,EAAgB,CAAhB,CAA/B,CADK,EAEL,IAAID,sBAAJ,CAAe,KAAKN,SAApB,EAA+BK,MAAM,CAACE,KAAP,CAAa,CAAb,CAA/B,CAFK,CAAP;EAID;;EAEDC,UAAU,CAACC,MAAD,EAAiBC,KAAjB,EAAgCC,eAAhC,EAA0D;IAClE,OAAO,IAAIC,oBAAJ,CACL,KAAKZ,SADA,EAEL,KAAKC,GAAL,CAASO,UAAT,CAAoBC,MAApB,EAA4BC,KAA5B,EAAmCC,eAAnC,CAFK,CAAP;EAID;;EAEDE,QAAQ,GAAG;IACT,OAAO,KAAKZ,GAAL,CAASY,QAAT,EAAP;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKb,GAAL,CAASa,MAAT,EAAP;EACD;;AA1BH"}
|
@@ -5,4 +5,5 @@ import { JsiSkContourMeasure } from "./JsiSkContourMeasure";
|
|
5
5
|
export declare class JsiSkContourMeasureIter extends HostObject<ContourMeasureIter, "ContourMeasureIter"> implements SkContourMeasureIter {
|
6
6
|
constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter);
|
7
7
|
next(): JsiSkContourMeasure | null;
|
8
|
+
dispose: () => void;
|
8
9
|
}
|
@@ -9,9 +9,15 @@ var _Host = require("./Host");
|
|
9
9
|
|
10
10
|
var _JsiSkContourMeasure = require("./JsiSkContourMeasure");
|
11
11
|
|
12
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
13
|
+
|
12
14
|
class JsiSkContourMeasureIter extends _Host.HostObject {
|
13
15
|
constructor(CanvasKit, ref) {
|
14
16
|
super(CanvasKit, ref, "ContourMeasureIter");
|
17
|
+
|
18
|
+
_defineProperty(this, "dispose", () => {
|
19
|
+
this.ref.delete();
|
20
|
+
});
|
15
21
|
}
|
16
22
|
|
17
23
|
next() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkContourMeasureIter","HostObject","constructor","CanvasKit","ref","next","result","JsiSkContourMeasure"],"sources":["JsiSkContourMeasureIter.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasureIter } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasureIter } from \"../types/ContourMeasure\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkContourMeasure } from \"./JsiSkContourMeasure\";\n\nexport class JsiSkContourMeasureIter\n extends HostObject<ContourMeasureIter, \"ContourMeasureIter\">\n implements SkContourMeasureIter\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter) {\n super(CanvasKit, ref, \"ContourMeasureIter\");\n }\n\n next() {\n const result = this.ref.next();\n if (result === null) {\n return null;\n }\n return new JsiSkContourMeasure(this.CanvasKit, result);\n }\n}\n"],"mappings":";;;;;;;AAIA;;AACA
|
1
|
+
{"version":3,"names":["JsiSkContourMeasureIter","HostObject","constructor","CanvasKit","ref","delete","next","result","JsiSkContourMeasure"],"sources":["JsiSkContourMeasureIter.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasureIter } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasureIter } from \"../types/ContourMeasure\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkContourMeasure } from \"./JsiSkContourMeasure\";\n\nexport class JsiSkContourMeasureIter\n extends HostObject<ContourMeasureIter, \"ContourMeasureIter\">\n implements SkContourMeasureIter\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter) {\n super(CanvasKit, ref, \"ContourMeasureIter\");\n }\n\n next() {\n const result = this.ref.next();\n if (result === null) {\n return null;\n }\n return new JsiSkContourMeasure(this.CanvasKit, result);\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;;;;;AAIA;;AACA;;;;AAEO,MAAMA,uBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAgD;IACzD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,oBAAtB;;IADyD,iCAYjD,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAd0D;EAE1D;;EAEDC,IAAI,GAAG;IACL,MAAMC,MAAM,GAAG,KAAKH,GAAL,CAASE,IAAT,EAAf;;IACA,IAAIC,MAAM,KAAK,IAAf,EAAqB;MACnB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIC,wCAAJ,CAAwB,KAAKL,SAA7B,EAAwCI,MAAxC,CAAP;EACD;;AAXH"}
|
@@ -7,12 +7,14 @@ exports.JsiSkData = void 0;
|
|
7
7
|
|
8
8
|
var _Host = require("./Host");
|
9
9
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
10
12
|
class JsiSkData extends _Host.HostObject {
|
11
13
|
constructor(CanvasKit, ref) {
|
12
14
|
super(CanvasKit, ref, "Data");
|
13
|
-
}
|
14
15
|
|
15
|
-
|
16
|
+
_defineProperty(this, "dispose", () => {// Not implemented in data - since data is a raw ArrayBuffer
|
17
|
+
});
|
16
18
|
}
|
17
19
|
|
18
20
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkData","HostObject","constructor","CanvasKit","ref"
|
1
|
+
{"version":3,"names":["JsiSkData","HostObject","constructor","CanvasKit","ref"],"sources":["JsiSkData.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\ntype Data = ArrayBuffer;\n\nexport class JsiSkData extends HostObject<Data, \"Data\"> implements SkData {\n constructor(CanvasKit: CanvasKit, ref: Data) {\n super(CanvasKit, ref, \"Data\");\n }\n\n dispose = () => {\n // Not implemented in data - since data is a raw ArrayBuffer\n };\n}\n"],"mappings":";;;;;;;AAIA;;;;AAIO,MAAMA,SAAN,SAAwBC,gBAAxB,CAAmE;EACxEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,MAAM,CACd;IACD,CAN4C;EAE5C;;AAHuE"}
|
@@ -5,6 +5,7 @@ import { JsiSkRect } from "./JsiSkRect";
|
|
5
5
|
import { JsiSkTypeface } from "./JsiSkTypeface";
|
6
6
|
export declare class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
|
7
7
|
constructor(CanvasKit: CanvasKit, ref: Font);
|
8
|
+
dispose: () => void;
|
8
9
|
getTextWidth(text: string, paint?: SkPaint | undefined): number;
|
9
10
|
getMetrics(): {
|
10
11
|
ascent: number;
|
@@ -15,9 +15,15 @@ var _JsiSkRect = require("./JsiSkRect");
|
|
15
15
|
|
16
16
|
var _JsiSkTypeface = require("./JsiSkTypeface");
|
17
17
|
|
18
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
19
|
+
|
18
20
|
class JsiSkFont extends _Host.HostObject {
|
19
21
|
constructor(CanvasKit, ref) {
|
20
22
|
super(CanvasKit, ref, "Font");
|
23
|
+
|
24
|
+
_defineProperty(this, "dispose", () => {
|
25
|
+
this.ref.delete();
|
26
|
+
});
|
21
27
|
}
|
22
28
|
|
23
29
|
getTextWidth(text, paint) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkFont","HostObject","constructor","CanvasKit","ref","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","JsiSkRect","undefined","str","numCodePoints","glyphs","JsiSkPaint","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","JsiSkPoint","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","JsiSkTypeface","setEdging","edging","ckEnum","setEmbeddedBitmaps","embeddedBitmaps","setHinting","hinting","setLinearMetrics","linearMetrics","setScaleX","sx","setSize","points","setSkewX","setEmbolden","embolden","setSubpixel","subpixel","setTypeface","face"],"sources":["JsiSkFont.ts"],"sourcesContent":["import type { CanvasKit, Font } from \"canvaskit-wasm\";\n\nimport type {\n FontEdging,\n FontHinting,\n SkFont,\n SkPaint,\n SkPoint,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkFont extends HostObject<Font, \"Font\"> implements SkFont {\n constructor(CanvasKit: CanvasKit, ref: Font) {\n super(CanvasKit, ref, \"Font\");\n }\n\n getTextWidth(text: string, paint?: SkPaint | undefined) {\n const ids = this.getGlyphIDs(text);\n const widths = this.getGlyphWidths(ids, paint);\n return widths.reduce((a, b) => a + b, 0);\n }\n\n getMetrics() {\n const result = this.ref.getMetrics();\n return {\n ascent: result.ascent,\n descent: result.descent,\n leading: result.leading,\n bounds: result.bounds\n ? new JsiSkRect(this.CanvasKit, result.bounds)\n : undefined,\n };\n }\n\n getGlyphIDs(str: string, numCodePoints?: number) {\n // TODO: Fix return value in the C++ implementation\n return [...this.ref.getGlyphIDs(str, numCodePoints)];\n }\n\n // TODO: Fix return value in the C++ implementation, it return float32\n getGlyphWidths(glyphs: number[], paint?: SkPaint | null) {\n return [\n ...this.ref.getGlyphWidths(\n glyphs,\n paint ? JsiSkPaint.fromValue(paint) : null\n ),\n ];\n }\n\n getGlyphIntercepts(\n glyphs: number[],\n positions: SkPoint[],\n top: number,\n bottom: number\n ) {\n return [\n ...this.ref.getGlyphIntercepts(\n glyphs,\n positions.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n top,\n bottom\n ),\n ];\n }\n\n getScaleX() {\n return this.ref.getScaleX();\n }\n\n getSize() {\n return this.ref.getSize();\n }\n\n getSkewX() {\n return this.ref.getSkewX();\n }\n\n isEmbolden() {\n return this.ref.isEmbolden();\n }\n\n getTypeface() {\n const tf = this.ref.getTypeface();\n return tf ? new JsiSkTypeface(this.CanvasKit, tf) : null;\n }\n\n setEdging(edging: FontEdging) {\n this.ref.setEdging(ckEnum(edging));\n }\n\n setEmbeddedBitmaps(embeddedBitmaps: boolean) {\n this.ref.setEmbeddedBitmaps(embeddedBitmaps);\n }\n\n setHinting(hinting: FontHinting) {\n this.ref.setHinting(ckEnum(hinting));\n }\n\n setLinearMetrics(linearMetrics: boolean) {\n this.ref.setLinearMetrics(linearMetrics);\n }\n\n setScaleX(sx: number) {\n this.ref.setScaleX(sx);\n }\n\n setSize(points: number) {\n this.ref.setSize(points);\n }\n\n setSkewX(sx: number) {\n this.ref.setSkewX(sx);\n }\n\n setEmbolden(embolden: boolean) {\n this.ref.setEmbolden(embolden);\n }\n\n setSubpixel(subpixel: boolean) {\n this.ref.setSubpixel(subpixel);\n }\n\n setTypeface(face: SkTypeface | null) {\n this.ref.setTypeface(face ? JsiSkTypeface.fromValue(face) : null);\n }\n}\n"],"mappings":";;;;;;;AAWA;;AACA;;AACA;;AACA;;AACA
|
1
|
+
{"version":3,"names":["JsiSkFont","HostObject","constructor","CanvasKit","ref","delete","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","JsiSkRect","undefined","str","numCodePoints","glyphs","JsiSkPaint","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","JsiSkPoint","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","JsiSkTypeface","setEdging","edging","ckEnum","setEmbeddedBitmaps","embeddedBitmaps","setHinting","hinting","setLinearMetrics","linearMetrics","setScaleX","sx","setSize","points","setSkewX","setEmbolden","embolden","setSubpixel","subpixel","setTypeface","face"],"sources":["JsiSkFont.ts"],"sourcesContent":["import type { CanvasKit, Font } from \"canvaskit-wasm\";\n\nimport type {\n FontEdging,\n FontHinting,\n SkFont,\n SkPaint,\n SkPoint,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkFont extends HostObject<Font, \"Font\"> implements SkFont {\n constructor(CanvasKit: CanvasKit, ref: Font) {\n super(CanvasKit, ref, \"Font\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n getTextWidth(text: string, paint?: SkPaint | undefined) {\n const ids = this.getGlyphIDs(text);\n const widths = this.getGlyphWidths(ids, paint);\n return widths.reduce((a, b) => a + b, 0);\n }\n\n getMetrics() {\n const result = this.ref.getMetrics();\n return {\n ascent: result.ascent,\n descent: result.descent,\n leading: result.leading,\n bounds: result.bounds\n ? new JsiSkRect(this.CanvasKit, result.bounds)\n : undefined,\n };\n }\n\n getGlyphIDs(str: string, numCodePoints?: number) {\n // TODO: Fix return value in the C++ implementation\n return [...this.ref.getGlyphIDs(str, numCodePoints)];\n }\n\n // TODO: Fix return value in the C++ implementation, it return float32\n getGlyphWidths(glyphs: number[], paint?: SkPaint | null) {\n return [\n ...this.ref.getGlyphWidths(\n glyphs,\n paint ? JsiSkPaint.fromValue(paint) : null\n ),\n ];\n }\n\n getGlyphIntercepts(\n glyphs: number[],\n positions: SkPoint[],\n top: number,\n bottom: number\n ) {\n return [\n ...this.ref.getGlyphIntercepts(\n glyphs,\n positions.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n top,\n bottom\n ),\n ];\n }\n\n getScaleX() {\n return this.ref.getScaleX();\n }\n\n getSize() {\n return this.ref.getSize();\n }\n\n getSkewX() {\n return this.ref.getSkewX();\n }\n\n isEmbolden() {\n return this.ref.isEmbolden();\n }\n\n getTypeface() {\n const tf = this.ref.getTypeface();\n return tf ? new JsiSkTypeface(this.CanvasKit, tf) : null;\n }\n\n setEdging(edging: FontEdging) {\n this.ref.setEdging(ckEnum(edging));\n }\n\n setEmbeddedBitmaps(embeddedBitmaps: boolean) {\n this.ref.setEmbeddedBitmaps(embeddedBitmaps);\n }\n\n setHinting(hinting: FontHinting) {\n this.ref.setHinting(ckEnum(hinting));\n }\n\n setLinearMetrics(linearMetrics: boolean) {\n this.ref.setLinearMetrics(linearMetrics);\n }\n\n setScaleX(sx: number) {\n this.ref.setScaleX(sx);\n }\n\n setSize(points: number) {\n this.ref.setSize(points);\n }\n\n setSkewX(sx: number) {\n this.ref.setSkewX(sx);\n }\n\n setEmbolden(embolden: boolean) {\n this.ref.setEmbolden(embolden);\n }\n\n setSubpixel(subpixel: boolean) {\n this.ref.setSubpixel(subpixel);\n }\n\n setTypeface(face: SkTypeface | null) {\n this.ref.setTypeface(face ? JsiSkTypeface.fromValue(face) : null);\n }\n}\n"],"mappings":";;;;;;;AAWA;;AACA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,SAAN,SAAwBC,gBAAxB,CAAmE;EACxEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN4C;EAE5C;;EAMDC,YAAY,CAACC,IAAD,EAAeC,KAAf,EAA4C;IACtD,MAAMC,GAAG,GAAG,KAAKC,WAAL,CAAiBH,IAAjB,CAAZ;IACA,MAAMI,MAAM,GAAG,KAAKC,cAAL,CAAoBH,GAApB,EAAyBD,KAAzB,CAAf;IACA,OAAOG,MAAM,CAACE,MAAP,CAAc,CAACC,CAAD,EAAIC,CAAJ,KAAUD,CAAC,GAAGC,CAA5B,EAA+B,CAA/B,CAAP;EACD;;EAEDC,UAAU,GAAG;IACX,MAAMC,MAAM,GAAG,KAAKb,GAAL,CAASY,UAAT,EAAf;IACA,OAAO;MACLE,MAAM,EAAED,MAAM,CAACC,MADV;MAELC,OAAO,EAAEF,MAAM,CAACE,OAFX;MAGLC,OAAO,EAAEH,MAAM,CAACG,OAHX;MAILC,MAAM,EAAEJ,MAAM,CAACI,MAAP,GACJ,IAAIC,oBAAJ,CAAc,KAAKnB,SAAnB,EAA8Bc,MAAM,CAACI,MAArC,CADI,GAEJE;IANC,CAAP;EAQD;;EAEDb,WAAW,CAACc,GAAD,EAAcC,aAAd,EAAsC;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;EACD;;EAEDE,kBAAkB,CAACC,eAAD,EAA2B;IAC3C,KAAK9C,GAAL,CAAS6C,kBAAT,CAA4BC,eAA5B;EACD;;EAEDC,UAAU,CAACC,OAAD,EAAuB;IAC/B,KAAKhD,GAAL,CAAS+C,UAAT,CAAoB,IAAAH,YAAA,EAAOI,OAAP,CAApB;EACD;;EAEDC,gBAAgB,CAACC,aAAD,EAAyB;IACvC,KAAKlD,GAAL,CAASiD,gBAAT,CAA0BC,aAA1B;EACD;;EAEDC,SAAS,CAACC,EAAD,EAAa;IACpB,KAAKpD,GAAL,CAASmD,SAAT,CAAmBC,EAAnB;EACD;;EAEDC,OAAO,CAACC,MAAD,EAAiB;IACtB,KAAKtD,GAAL,CAASqD,OAAT,CAAiBC,MAAjB;EACD;;EAEDC,QAAQ,CAACH,EAAD,EAAa;IACnB,KAAKpD,GAAL,CAASuD,QAAT,CAAkBH,EAAlB;EACD;;EAEDI,WAAW,CAACC,QAAD,EAAoB;IAC7B,KAAKzD,GAAL,CAASwD,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,QAAD,EAAoB;IAC7B,KAAK3D,GAAL,CAAS0D,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,IAAD,EAA0B;IACnC,KAAK7D,GAAL,CAAS4D,WAAT,CAAqBC,IAAI,GAAGpB,4BAAA,CAAcjB,SAAd,CAAwBqC,IAAxB,CAAH,GAAmC,IAA5D;EACD;;AArHuE"}
|
@@ -10,6 +10,6 @@ export declare class JsiSkImage extends HostObject<Image, "Image"> implements Sk
|
|
10
10
|
makeShaderCubic(tx: TileMode, ty: TileMode, B: number, C: number, localMatrix?: SkMatrix): SkShader;
|
11
11
|
encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array;
|
12
12
|
encodeToBase64(fmt?: ImageFormat, quality?: number): string;
|
13
|
-
dispose()
|
13
|
+
dispose: () => void;
|
14
14
|
makeNonTextureImage(): SkImage;
|
15
15
|
}
|
@@ -11,6 +11,8 @@ var _JsiSkMatrix = require("./JsiSkMatrix");
|
|
11
11
|
|
12
12
|
var _JsiSkShader = require("./JsiSkShader");
|
13
13
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
15
|
+
|
14
16
|
// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js
|
15
17
|
const toBase64String = bytes => {
|
16
18
|
if (typeof Buffer !== "undefined") {
|
@@ -46,6 +48,10 @@ exports.toBase64String = toBase64String;
|
|
46
48
|
class JsiSkImage extends _Host.HostObject {
|
47
49
|
constructor(CanvasKit, ref) {
|
48
50
|
super(CanvasKit, ref, "Image");
|
51
|
+
|
52
|
+
_defineProperty(this, "dispose", () => {
|
53
|
+
this.ref.delete();
|
54
|
+
});
|
49
55
|
}
|
50
56
|
|
51
57
|
height() {
|
@@ -87,10 +93,6 @@ class JsiSkImage extends _Host.HostObject {
|
|
87
93
|
return toBase64String(bytes);
|
88
94
|
}
|
89
95
|
|
90
|
-
dispose() {
|
91
|
-
this.ref.delete();
|
92
|
-
}
|
93
|
-
|
94
96
|
makeNonTextureImage() {
|
95
97
|
return new JsiSkImage(this.CanvasKit, this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes()));
|
96
98
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","HostObject","constructor","CanvasKit","ref","height","width","makeShaderOptions","tx","ty","fm","mm","localMatrix","JsiSkShader","ckEnum","JsiSkMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","Error","encodeToBase64","
|
1
|
+
{"version":3,"names":["toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","HostObject","constructor","CanvasKit","ref","delete","height","width","makeShaderOptions","tx","ty","fm","mm","localMatrix","JsiSkShader","ckEnum","JsiSkMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","Error","encodeToBase64","makeNonTextureImage","MakeImageFromEncoded"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type { CanvasKit, Image } from \"canvaskit-wasm\";\n\nimport type {\n ImageFormat,\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { ckEnum, HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\n// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js\nexport const toBase64String = (bytes: Uint8Array) => {\n if (typeof Buffer !== \"undefined\") {\n // Are we on node?\n return Buffer.from(bytes).toString(\"base64\");\n } else {\n // From https://stackoverflow.com/a/25644409\n // because the naive solution of\n // btoa(String.fromCharCode.apply(null, bytes));\n // would occasionally throw \"Maximum call stack size exceeded\"\n var CHUNK_SIZE = 0x8000; //arbitrary number\n var index = 0;\n var { length } = bytes;\n var result = \"\";\n var slice;\n while (index < length) {\n slice = bytes.slice(index, Math.min(index + CHUNK_SIZE, length));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result += String.fromCharCode.apply(null, slice as any);\n index += CHUNK_SIZE;\n }\n return btoa(result);\n }\n};\n\nexport class JsiSkImage extends HostObject<Image, \"Image\"> implements SkImage {\n constructor(CanvasKit: CanvasKit, ref: Image) {\n super(CanvasKit, ref, \"Image\");\n }\n\n height() {\n return this.ref.height();\n }\n\n width() {\n return this.ref.width();\n }\n\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderOptions(\n ckEnum(tx),\n ckEnum(ty),\n ckEnum(fm),\n ckEnum(mm),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderCubic(\n ckEnum(tx),\n ckEnum(ty),\n B,\n C,\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n encodeToBytes(fmt?: ImageFormat, quality?: number) {\n let result: Uint8Array | null;\n if (fmt && quality) {\n result = this.ref.encodeToBytes(ckEnum(fmt), quality);\n } else if (fmt) {\n result = this.ref.encodeToBytes(ckEnum(fmt));\n } else {\n result = this.ref.encodeToBytes();\n }\n if (!result) {\n throw new Error(\"encodeToBytes failed\");\n }\n return result;\n }\n\n encodeToBase64(fmt?: ImageFormat, quality?: number) {\n const bytes = this.encodeToBytes(fmt, quality);\n return toBase64String(bytes);\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeNonTextureImage(): SkImage {\n return new JsiSkImage(\n this.CanvasKit,\n this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes())!\n );\n }\n}\n"],"mappings":";;;;;;;AAYA;;AACA;;AACA;;;;AAEA;AACO,MAAMA,cAAc,GAAIC,KAAD,IAAuB;EACnD,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;IACjC;IACA,OAAOA,MAAM,CAACC,IAAP,CAAYF,KAAZ,EAAmBG,QAAnB,CAA4B,QAA5B,CAAP;EACD,CAHD,MAGO;IACL;IACA;IACA;IACA;IACA,IAAIC,UAAU,GAAG,MAAjB,CALK,CAKoB;;IACzB,IAAIC,KAAK,GAAG,CAAZ;IACA,IAAI;MAAEC;IAAF,IAAaN,KAAjB;IACA,IAAIO,MAAM,GAAG,EAAb;IACA,IAAIC,KAAJ;;IACA,OAAOH,KAAK,GAAGC,MAAf,EA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AAL,CAASe,eAAT,CACE,IAAAJ,YAAA,EAAON,EAAP,CADF,EAEE,IAAAM,YAAA,EAAOL,EAAP,CAFF,EAGEU,CAHF,EAIEC,CAJF,EAKER,WAAW,GAAGG,wBAAA,CAAYC,SAAZ,CAAsBJ,WAAtB,CAAH,GAAwCK,SALrD,CAFK,CAAP;EAUD;;EAEDI,aAAa,CAACC,GAAD,EAAoBC,OAApB,EAAsC;IACjD,IAAIhC,MAAJ;;IACA,IAAI+B,GAAG,IAAIC,OAAX,EAAoB;MAClBhC,MAAM,GAAG,KAAKY,GAAL,CAASkB,aAAT,CAAuB,IAAAP,YAAA,EAAOQ,GAAP,CAAvB,EAAoCC,OAApC,CAAT;IACD,CAFD,MAEO,IAAID,GAAJ,EAAS;MACd/B,MAAM,GAAG,KAAKY,GAAL,CAASkB,aAAT,CAAuB,IAAAP,YAAA,EAAOQ,GAAP,CAAvB,CAAT;IACD,CAFM,MAEA;MACL/B,MAAM,GAAG,KAAKY,GAAL,CAASkB,aAAT,EAAT;IACD;;IACD,IAAI,CAAC9B,MAAL,EAAa;MACX,MAAM,IAAIiC,KAAJ,CAAU,sBAAV,CAAN;IACD;;IACD,OAAOjC,MAAP;EACD;;EAEDkC,cAAc,CAACH,GAAD,EAAoBC,OAApB,EAAsC;IAClD,MAAMvC,KAAK,GAAG,KAAKqC,aAAL,CAAmBC,GAAnB,EAAwBC,OAAxB,CAAd;IACA,OAAOxC,cAAc,CAACC,KAAD,CAArB;EACD;;EAMD0C,mBAAmB,GAAY;IAC7B,OAAO,IAAI3B,UAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeyB,oBAAf,CAAoC,KAAKN,aAAL,EAApC,CAFK,CAAP;EAID;;AAhF2E"}
|
@@ -3,4 +3,5 @@ import type { SkImageFilter } from "../types";
|
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
export declare class JsiSkImageFilter extends HostObject<ImageFilter, "ImageFilter"> implements SkImageFilter {
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: ImageFilter);
|
6
|
+
dispose: () => void;
|
6
7
|
}
|
@@ -7,9 +7,15 @@ exports.JsiSkImageFilter = void 0;
|
|
7
7
|
|
8
8
|
var _Host = require("./Host");
|
9
9
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
10
12
|
class JsiSkImageFilter extends _Host.HostObject {
|
11
13
|
constructor(CanvasKit, ref) {
|
12
14
|
super(CanvasKit, ref, "ImageFilter");
|
15
|
+
|
16
|
+
_defineProperty(this, "dispose", () => {
|
17
|
+
this.ref.delete();
|
18
|
+
});
|
13
19
|
}
|
14
20
|
|
15
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkImageFilter","HostObject","constructor","CanvasKit","ref"],"sources":["JsiSkImageFilter.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type { SkImageFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkImageFilter\n extends HostObject<ImageFilter, \"ImageFilter\">\n implements SkImageFilter\n{\n constructor(CanvasKit: CanvasKit, ref: ImageFilter) {\n super(CanvasKit, ref, \"ImageFilter\");\n }\n}\n"],"mappings":";;;;;;;AAIA
|
1
|
+
{"version":3,"names":["JsiSkImageFilter","HostObject","constructor","CanvasKit","ref","delete"],"sources":["JsiSkImageFilter.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type { SkImageFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkImageFilter\n extends HostObject<ImageFilter, \"ImageFilter\">\n implements SkImageFilter\n{\n constructor(CanvasKit: CanvasKit, ref: ImageFilter) {\n super(CanvasKit, ref, \"ImageFilter\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;;;;;AAIA;;;;AAEO,MAAMA,gBAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAyC;IAClD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,aAAtB;;IADkD,iCAI1C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANmD;EAEnD;;AAHH"}
|
@@ -3,4 +3,5 @@ import type { SkMaskFilter } from "../types";
|
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
export declare class JsiSkMaskFilter extends HostObject<MaskFilter, "MaskFilter"> implements SkMaskFilter {
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: MaskFilter);
|
6
|
+
dispose: () => void;
|
6
7
|
}
|
@@ -7,9 +7,15 @@ exports.JsiSkMaskFilter = void 0;
|
|
7
7
|
|
8
8
|
var _Host = require("./Host");
|
9
9
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
10
12
|
class JsiSkMaskFilter extends _Host.HostObject {
|
11
13
|
constructor(CanvasKit, ref) {
|
12
14
|
super(CanvasKit, ref, "MaskFilter");
|
15
|
+
|
16
|
+
_defineProperty(this, "dispose", () => {
|
17
|
+
this.ref.delete();
|
18
|
+
});
|
13
19
|
}
|
14
20
|
|
15
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkMaskFilter","HostObject","constructor","CanvasKit","ref"],"sources":["JsiSkMaskFilter.ts"],"sourcesContent":["import type { CanvasKit, MaskFilter } from \"canvaskit-wasm\";\n\nimport type { SkMaskFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMaskFilter\n extends HostObject<MaskFilter, \"MaskFilter\">\n implements SkMaskFilter\n{\n constructor(CanvasKit: CanvasKit, ref: MaskFilter) {\n super(CanvasKit, ref, \"MaskFilter\");\n }\n}\n"],"mappings":";;;;;;;AAIA
|
1
|
+
{"version":3,"names":["JsiSkMaskFilter","HostObject","constructor","CanvasKit","ref","delete"],"sources":["JsiSkMaskFilter.ts"],"sourcesContent":["import type { CanvasKit, MaskFilter } from \"canvaskit-wasm\";\n\nimport type { SkMaskFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMaskFilter\n extends HostObject<MaskFilter, \"MaskFilter\">\n implements SkMaskFilter\n{\n constructor(CanvasKit: CanvasKit, ref: MaskFilter) {\n super(CanvasKit, ref, \"MaskFilter\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;;;;;;AAIA;;;;AAEO,MAAMA,eAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;;IADiD,iCAIzC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANkD;EAElD;;AAHH"}
|
@@ -3,6 +3,7 @@ import type { SkMatrix } from "../types";
|
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
export declare class JsiSkMatrix extends HostObject<Matrix3x3, "Matrix"> implements SkMatrix {
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: Matrix3x3);
|
6
|
+
dispose: () => void;
|
6
7
|
concat(matrix: SkMatrix): this;
|
7
8
|
translate(x: number, y: number): this;
|
8
9
|
scale(x: number, y?: number): this;
|
@@ -7,9 +7,14 @@ exports.JsiSkMatrix = void 0;
|
|
7
7
|
|
8
8
|
var _Host = require("./Host");
|
9
9
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11
|
+
|
10
12
|
class JsiSkMatrix extends _Host.HostObject {
|
11
13
|
constructor(CanvasKit, ref) {
|
12
14
|
super(CanvasKit, ref, "Matrix");
|
15
|
+
|
16
|
+
_defineProperty(this, "dispose", () => {// Do nothing - the matrix is represenetd by a Float32Array
|
17
|
+
});
|
13
18
|
}
|
14
19
|
|
15
20
|
concat(matrix) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"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","get","Array","from"],"sources":["JsiSkMatrix.ts"],"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 return this;\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 return this;\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 return this;\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 return this;\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 return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;;;;;;AAIA
|
1
|
+
{"version":3,"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","get","Array","from"],"sources":["JsiSkMatrix.ts"],"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 dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n return this;\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 return this;\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 return this;\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 return this;\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 return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;;;;;;AAIA;;;;AAEO,MAAMA,WAAN,SACGC,gBADH,CAGP;EACEC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IADgD,iCAIxC,MAAM,CACd;IACD,CANiD;EAEjD;;EAMDC,MAAM,CAACC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;IACT,KAAKpB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBgB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAOC,KAAK,CAACC,IAAN,CAAW,KAAKvB,GAAhB,CAAP;EACD;;AA/DH"}
|
@@ -3,6 +3,7 @@ import type { StrokeJoin, BlendMode, SkColor, SkColorFilter, SkImageFilter, SkPa
|
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
export declare class JsiSkPaint extends HostObject<Paint, "Paint"> implements SkPaint {
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: Paint);
|
6
|
+
dispose: () => void;
|
6
7
|
copy(): JsiSkPaint;
|
7
8
|
reset(): void;
|
8
9
|
getAlphaf(): number;
|
@@ -17,9 +17,15 @@ var _JsiSkPathEffect = require("./JsiSkPathEffect");
|
|
17
17
|
|
18
18
|
var _JsiSkShader = require("./JsiSkShader");
|
19
19
|
|
20
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
21
|
+
|
20
22
|
class JsiSkPaint extends _Host.HostObject {
|
21
23
|
constructor(CanvasKit, ref) {
|
22
24
|
super(CanvasKit, ref, "Paint");
|
25
|
+
|
26
|
+
_defineProperty(this, "dispose", () => {
|
27
|
+
this.ref.delete();
|
28
|
+
});
|
23
29
|
}
|
24
30
|
|
25
31
|
copy() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["JsiSkPaint","HostObject","constructor","CanvasKit","ref","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setBlendMode","blendMode","ckEnum","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"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, 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 getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n 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"],"mappings":";;;;;;;AAgBA;;AACA;;AACA;;AACA;;AACA;;AACA
|
1
|
+
{"version":3,"names":["JsiSkPaint","HostObject","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setBlendMode","blendMode","ckEnum","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"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, 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 dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n 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"],"mappings":";;;;;;;AAgBA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEO,MAAMA,UAAN,SAAyBC,gBAAzB,CAAuE;EAC5EC,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAIpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN6C;EAE7C;;EAMDC,IAAI,GAAG;IACL,OAAO,IAAIN,UAAJ,CAAe,KAAKG,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKH,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeK,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKN,GAAL,CAASM,QAAT,EAAP;EACD;;EAEDC,YAAY,GAAG;IACb,OAAO,KAAKP,GAAL,CAASO,YAAT,GAAwBC,KAA/B;EACD;;EAEDC,aAAa,GAAG;IACd,OAAO,KAAKT,GAAL,CAASS,aAAT,GAAyBD,KAAhC;EACD;;EAEDE,cAAc,GAAG;IACf,OAAO,KAAKV,GAAL,CAASU,cAAT,EAAP;EACD;;EAEDC,cAAc,GAAG;IACf,OAAO,KAAKX,GAAL,CAASW,cAAT,EAAP;EACD;;EAEDC,SAAS,CAACC,KAAD,EAAgB;IACvB,KAAKb,GAAL,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mB;IAC9B,KAAKtC,GAAL,CAASqC,aAAT,CAAuB,IAAAnB,YAAA,EAAOoB,IAAP,CAAvB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKxC,GAAL,CAASuC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAK1C,GAAL,CAASyC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAK5C,GAAL,CAAS2C,QAAT,CAAkB;MAAEnC,KAAK,EAAEoC;IAAT,CAAlB;EACD;;AA/F2E"}
|
@@ -5,6 +5,7 @@ import { JsiSkPoint } from "./JsiSkPoint";
|
|
5
5
|
import { JsiSkRect } from "./JsiSkRect";
|
6
6
|
export declare class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
|
7
7
|
constructor(CanvasKit: CanvasKit, ref: Path);
|
8
|
+
dispose: () => void;
|
8
9
|
addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): this;
|
9
10
|
addArc(oval: SkRect, startAngleInDegrees: number, sweepAngleInDegrees: number): this;
|
10
11
|
addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): this;
|
@@ -17,6 +17,8 @@ var _JsiSkRRect = require("./JsiSkRRect");
|
|
17
17
|
|
18
18
|
var _JsiSkMatrix = require("./JsiSkMatrix");
|
19
19
|
|
20
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
21
|
+
|
20
22
|
const CommandCount = {
|
21
23
|
[_types.PathVerb.Move]: 3,
|
22
24
|
[_types.PathVerb.Line]: 3,
|
@@ -29,6 +31,10 @@ const CommandCount = {
|
|
29
31
|
class JsiSkPath extends _Host.HostObject {
|
30
32
|
constructor(CanvasKit, ref) {
|
31
33
|
super(CanvasKit, ref, "Path");
|
34
|
+
|
35
|
+
_defineProperty(this, "dispose", () => {
|
36
|
+
this.ref.delete();
|
37
|
+
});
|
32
38
|
}
|
33
39
|
|
34
40
|
addPath(src, matrix) {
|