@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
@@ -32,12 +32,6 @@ struct RuntimeEffectUniform {
|
|
32
32
|
class JsiSkRuntimeEffect
|
33
33
|
: public JsiSkWrappingSkPtrHostObject<SkRuntimeEffect> {
|
34
34
|
public:
|
35
|
-
static sk_sp<SkRuntimeEffect> fromValue(jsi::Runtime &runtime,
|
36
|
-
const jsi::Value &obj) {
|
37
|
-
const auto &object = obj.asObject(runtime);
|
38
|
-
return object.asHostObject<JsiSkRuntimeEffect>(runtime)->getObject();
|
39
|
-
}
|
40
|
-
|
41
35
|
JSI_HOST_FUNCTION(makeShader) {
|
42
36
|
auto uniforms = castUniforms(runtime, arguments[0]);
|
43
37
|
|
@@ -121,6 +115,8 @@ public:
|
|
121
115
|
return jsi::String::createFromAscii(runtime, getObject()->source());
|
122
116
|
}
|
123
117
|
|
118
|
+
EXPORT_JSI_API_TYPENAME(JsiSkRuntimeEffect, "RuntimeEffect")
|
119
|
+
|
124
120
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRuntimeEffect, makeShader),
|
125
121
|
JSI_EXPORT_FUNC(JsiSkRuntimeEffect,
|
126
122
|
makeShaderWithChildren),
|
@@ -129,7 +125,8 @@ public:
|
|
129
125
|
getUniformFloatCount),
|
130
126
|
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, getUniformName),
|
131
127
|
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, getUniform),
|
132
|
-
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, source)
|
128
|
+
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, source),
|
129
|
+
JSI_EXPORT_FUNC(JsiSkRuntimeEffect, dispose))
|
133
130
|
|
134
131
|
JsiSkRuntimeEffect(std::shared_ptr<RNSkPlatformContext> context,
|
135
132
|
sk_sp<SkRuntimeEffect> rt)
|
@@ -47,16 +47,8 @@ public:
|
|
47
47
|
return jsi::Value::undefined();
|
48
48
|
}
|
49
49
|
|
50
|
-
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, setUniform)
|
51
|
-
|
52
|
-
/**
|
53
|
-
Returns the underlying object from a host object of this type
|
54
|
-
*/
|
55
|
-
static std::shared_ptr<SkRuntimeShaderBuilder>
|
56
|
-
fromValue(jsi::Runtime &runtime, const jsi::Value &obj) {
|
57
|
-
const auto &object = obj.asObject(runtime);
|
58
|
-
return object.asHostObject<JsiSkRuntimeShaderBuilder>(runtime)->getObject();
|
59
|
-
}
|
50
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, setUniform),
|
51
|
+
JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, dispose))
|
60
52
|
|
61
53
|
/**
|
62
54
|
Returns the jsi object from a host object of this type
|
package/cpp/api/JsiSkSVG.h
CHANGED
@@ -24,9 +24,7 @@ public:
|
|
24
24
|
: JsiSkWrappingSkPtrHostObject<SkSVGDOM>(std::move(context),
|
25
25
|
std::move(svgdom)) {}
|
26
26
|
|
27
|
-
|
28
|
-
return jsi::String::createFromUtf8(runtime, "SVG");
|
29
|
-
}
|
27
|
+
EXPORT_JSI_API_TYPENAME(JsiSkSVG, "SVG")
|
30
28
|
|
31
29
|
JSI_HOST_FUNCTION(width) {
|
32
30
|
return static_cast<double>(getObject()->containerSize().width());
|
@@ -36,13 +34,6 @@ public:
|
|
36
34
|
return static_cast<double>(getObject()->containerSize().height());
|
37
35
|
}
|
38
36
|
|
39
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkSVG, __typename__))
|
40
|
-
|
41
|
-
JSI_HOST_FUNCTION(dispose) {
|
42
|
-
setObject(nullptr);
|
43
|
-
return jsi::Value::undefined();
|
44
|
-
}
|
45
|
-
|
46
37
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkSVG, width),
|
47
38
|
JSI_EXPORT_FUNC(JsiSkSVG, height),
|
48
39
|
JSI_EXPORT_FUNC(JsiSkSVG, dispose))
|
package/cpp/api/JsiSkShader.h
CHANGED
@@ -26,21 +26,7 @@ public:
|
|
26
26
|
: JsiSkWrappingSkPtrHostObject<SkShader>(std::move(context),
|
27
27
|
std::move(shader)) {}
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
return jsi::String::createFromUtf8(runtime, "Shader");
|
32
|
-
}
|
33
|
-
|
34
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkShader, __typename__))
|
35
|
-
|
36
|
-
/**
|
37
|
-
Returns the underlying object from a host object of this type
|
38
|
-
*/
|
39
|
-
static sk_sp<SkShader> fromValue(jsi::Runtime &runtime,
|
40
|
-
const jsi::Value &obj) {
|
41
|
-
return obj.asObject(runtime)
|
42
|
-
.asHostObject<JsiSkShader>(runtime)
|
43
|
-
->getObject();
|
44
|
-
}
|
29
|
+
EXPORT_JSI_API_TYPENAME(JsiSkShader, "Shader")
|
30
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkShader, dispose))
|
45
31
|
};
|
46
32
|
} // namespace RNSkia
|
package/cpp/api/JsiSkSurface.h
CHANGED
@@ -29,10 +29,7 @@ public:
|
|
29
29
|
: JsiSkWrappingSkPtrHostObject<SkSurface>(std::move(context),
|
30
30
|
std::move(surface)) {}
|
31
31
|
|
32
|
-
|
33
|
-
JSI_PROPERTY_GET(__typename__) {
|
34
|
-
return jsi::String::createFromUtf8(runtime, "Surface");
|
35
|
-
}
|
32
|
+
EXPORT_JSI_API_TYPENAME(JsiSkSurface, "Surface")
|
36
33
|
|
37
34
|
JSI_HOST_FUNCTION(getCanvas) {
|
38
35
|
return jsi::Object::createFromHostObject(
|
@@ -58,20 +55,10 @@ public:
|
|
58
55
|
runtime, std::make_shared<JsiSkImage>(getContext(), std::move(image)));
|
59
56
|
}
|
60
57
|
|
61
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkSurface, __typename__))
|
62
58
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkSurface, getCanvas),
|
63
59
|
JSI_EXPORT_FUNC(JsiSkSurface, makeImageSnapshot),
|
64
|
-
JSI_EXPORT_FUNC(JsiSkSurface, flush)
|
65
|
-
|
66
|
-
/**
|
67
|
-
Returns the underlying object from a host object of this type
|
68
|
-
*/
|
69
|
-
static sk_sp<SkSurface> fromValue(jsi::Runtime &runtime,
|
70
|
-
const jsi::Value &obj) {
|
71
|
-
return obj.asObject(runtime)
|
72
|
-
.asHostObject<JsiSkSurface>(runtime)
|
73
|
-
->getObject();
|
74
|
-
}
|
60
|
+
JSI_EXPORT_FUNC(JsiSkSurface, flush),
|
61
|
+
JSI_EXPORT_FUNC(JsiSkSurface, dispose))
|
75
62
|
};
|
76
63
|
|
77
64
|
} // namespace RNSkia
|
package/cpp/api/JsiSkTextBlob.h
CHANGED
@@ -25,23 +25,7 @@ public:
|
|
25
25
|
: JsiSkWrappingSkPtrHostObject<SkTextBlob>(std::move(context),
|
26
26
|
std::move(shader)) {}
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
JSI_PROPERTY_GET(__typename__) {
|
31
|
-
return jsi::String::createFromUtf8(runtime, "TextBlob");
|
32
|
-
}
|
33
|
-
|
34
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkTextBlob,
|
35
|
-
__typename__), )
|
36
|
-
|
37
|
-
/**
|
38
|
-
Returns the underlying object from a host object of this type
|
39
|
-
*/
|
40
|
-
static sk_sp<SkTextBlob> fromValue(jsi::Runtime &runtime,
|
41
|
-
const jsi::Value &obj) {
|
42
|
-
return obj.asObject(runtime)
|
43
|
-
.asHostObject<JsiSkTextBlob>(runtime)
|
44
|
-
->getObject();
|
45
|
-
}
|
28
|
+
EXPORT_JSI_API_TYPENAME(JsiSkTextBlob, "TextBlob")
|
29
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkTextBlob, dispose))
|
46
30
|
};
|
47
31
|
} // namespace RNSkia
|
package/cpp/api/JsiSkTypeface.h
CHANGED
@@ -22,34 +22,13 @@ namespace jsi = facebook::jsi;
|
|
22
22
|
|
23
23
|
class JsiSkTypeface : public JsiSkWrappingSkPtrHostObject<SkTypeface> {
|
24
24
|
public:
|
25
|
-
|
26
|
-
JSI_PROPERTY_GET(__typename__) {
|
27
|
-
return jsi::String::createFromUtf8(runtime, "Typeface");
|
28
|
-
}
|
29
|
-
|
30
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkTypeface, __typename__))
|
31
|
-
|
32
|
-
JSI_HOST_FUNCTION(dispose) {
|
33
|
-
setObject(nullptr);
|
34
|
-
return jsi::Value::undefined();
|
35
|
-
}
|
36
|
-
|
25
|
+
EXPORT_JSI_API_TYPENAME(JsiSkTypeface, "Typeface")
|
37
26
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkTypeface, dispose))
|
38
27
|
|
39
28
|
JsiSkTypeface(std::shared_ptr<RNSkPlatformContext> context,
|
40
29
|
sk_sp<SkTypeface> typeface)
|
41
30
|
: JsiSkWrappingSkPtrHostObject(std::move(context), std::move(typeface)) {}
|
42
31
|
|
43
|
-
/**
|
44
|
-
Returns the underlying object from a host object of this type
|
45
|
-
*/
|
46
|
-
static sk_sp<SkTypeface> fromValue(jsi::Runtime &runtime,
|
47
|
-
const jsi::Value &obj) {
|
48
|
-
return obj.asObject(runtime)
|
49
|
-
.asHostObject<JsiSkTypeface>(runtime)
|
50
|
-
->getObject();
|
51
|
-
}
|
52
|
-
|
53
32
|
/**
|
54
33
|
Returns the jsi object from a host object of this type
|
55
34
|
*/
|
package/cpp/api/JsiSkVertices.h
CHANGED
@@ -25,12 +25,7 @@ public:
|
|
25
25
|
: JsiSkWrappingSkPtrHostObject<SkVertices>(std::move(context),
|
26
26
|
std::move(vertices)) {}
|
27
27
|
|
28
|
-
|
29
|
-
JSI_PROPERTY_GET(__typename__) {
|
30
|
-
return jsi::String::createFromUtf8(runtime, "Vertices");
|
31
|
-
}
|
32
|
-
|
33
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkVertices, __typename__))
|
28
|
+
EXPORT_JSI_API_TYPENAME(JsiSkVertices, "Vertices")
|
34
29
|
|
35
30
|
JSI_HOST_FUNCTION(bounds) {
|
36
31
|
const auto &result = getObject()->bounds();
|
@@ -43,17 +38,8 @@ public:
|
|
43
38
|
}
|
44
39
|
|
45
40
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkVertices, bounds),
|
46
|
-
JSI_EXPORT_FUNC(JsiSkVertices, uniqueID),
|
47
|
-
|
48
|
-
/**
|
49
|
-
Returns the underlying object from a host object of this type
|
50
|
-
*/
|
51
|
-
static sk_sp<SkVertices> fromValue(jsi::Runtime &runtime,
|
52
|
-
const jsi::Value &obj) {
|
53
|
-
return obj.asObject(runtime)
|
54
|
-
.asHostObject<JsiSkVertices>(runtime)
|
55
|
-
->getObject();
|
56
|
-
}
|
41
|
+
JSI_EXPORT_FUNC(JsiSkVertices, uniqueID),
|
42
|
+
JSI_EXPORT_FUNC(JsiSkVertices, dispose))
|
57
43
|
|
58
44
|
/**
|
59
45
|
* Creates the function for construction a new instance of the SkVertices
|
@@ -72,13 +72,13 @@ public:
|
|
72
72
|
});
|
73
73
|
}
|
74
74
|
|
75
|
-
JSI_HOST_FUNCTION(
|
75
|
+
JSI_HOST_FUNCTION(dispose) {
|
76
76
|
invalidate();
|
77
77
|
return jsi::Value::undefined();
|
78
78
|
}
|
79
79
|
|
80
80
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(RNSkReadonlyValue, addListener),
|
81
|
-
JSI_EXPORT_FUNC(RNSkReadonlyValue,
|
81
|
+
JSI_EXPORT_FUNC(RNSkReadonlyValue, dispose))
|
82
82
|
|
83
83
|
/**
|
84
84
|
* Adds a callback that will be called whenever the value changes
|
@@ -70,7 +70,7 @@ public:
|
|
70
70
|
JSI_EXPORT_PROP_GET(RNSkValue, animation))
|
71
71
|
|
72
72
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(RNSkValue, addListener),
|
73
|
-
JSI_EXPORT_FUNC(RNSkReadonlyValue,
|
73
|
+
JSI_EXPORT_FUNC(RNSkReadonlyValue, dispose))
|
74
74
|
|
75
75
|
private:
|
76
76
|
void subscribe(std::shared_ptr<RNSkAnimation> animation) {
|
@@ -13,10 +13,14 @@ var _Skia = require("../skia/Skia");
|
|
13
13
|
|
14
14
|
var _types = require("../dom/types");
|
15
15
|
|
16
|
+
var _values = require("../values");
|
17
|
+
|
16
18
|
var _Reconciler = require("./Reconciler");
|
17
19
|
|
18
20
|
var _HostComponents = require("./HostComponents");
|
19
21
|
|
22
|
+
var _processors = require("./processors");
|
23
|
+
|
20
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
25
|
|
22
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -33,9 +37,21 @@ const Canvas = /*#__PURE__*/(0, _react.forwardRef)((_ref, forwardedRef) => {
|
|
33
37
|
debug,
|
34
38
|
mode,
|
35
39
|
onTouch,
|
36
|
-
onSize,
|
40
|
+
onSize: onSizeReanimatedOrSkia,
|
37
41
|
...props
|
38
42
|
} = _ref;
|
43
|
+
const size = (0, _values.useValue)({
|
44
|
+
width: 0,
|
45
|
+
height: 0
|
46
|
+
});
|
47
|
+
const onSize = (0, _processors.isValue)(onSizeReanimatedOrSkia) ? onSizeReanimatedOrSkia : size;
|
48
|
+
(0, _react.useEffect)(() => {
|
49
|
+
if (!(0, _processors.isValue)(onSizeReanimatedOrSkia) && onSizeReanimatedOrSkia) {
|
50
|
+
return size.addListener(v => onSizeReanimatedOrSkia.value = v);
|
51
|
+
}
|
52
|
+
|
53
|
+
return undefined;
|
54
|
+
}, [onSizeReanimatedOrSkia, size]);
|
39
55
|
const innerRef = useCanvasRef();
|
40
56
|
const ref = useCombinedRefs(forwardedRef, innerRef);
|
41
57
|
const redraw = (0, _react.useCallback)(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useCanvasRef","useRef","Canvas","forwardRef","forwardedRef","children","style","debug","mode","onTouch","onSize","props","innerRef","ref","useCombinedRefs","redraw","useCallback","current","getNativeId","id","nativeId","registerValues","values","root","useMemo","SkiaRoot","Skia","
|
1
|
+
{"version":3,"names":["useCanvasRef","useRef","Canvas","forwardRef","forwardedRef","children","style","debug","mode","onTouch","onSize","onSizeReanimatedOrSkia","props","size","useValue","width","height","isValue","useEffect","addListener","v","value","undefined","innerRef","ref","useCombinedRefs","redraw","useCallback","current","getNativeId","id","nativeId","registerValues","values","root","useMemo","SkiaRoot","Skia","render","unmount","NATIVE_DOM","dom","canvas","info","touches","ctx","JsiDrawingContext","refs","targetRef","React","forEach"],"sources":["Canvas.tsx"],"sourcesContent":["import React, {\n useEffect,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n MutableRefObject,\n ForwardedRef,\n} from \"react\";\n\nimport { SkiaDomView, SkiaView } from \"../views\";\nimport { Skia } from \"../skia/Skia\";\nimport type { TouchHandler, SkiaBaseViewProps } from \"../views\";\nimport type { SkiaValue } from \"../values/types\";\nimport { JsiDrawingContext } from \"../dom/types\";\nimport { useValue } from \"../values\";\n\nimport { SkiaRoot } from \"./Reconciler\";\nimport { NATIVE_DOM } from \"./HostComponents\";\nimport { isValue } from \"./processors\";\n\nexport const useCanvasRef = () => useRef<SkiaDomView>(null);\n\nexport interface CanvasProps extends SkiaBaseViewProps {\n ref?: RefObject<SkiaDomView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nexport const Canvas = forwardRef<SkiaDomView, CanvasProps>(\n (\n {\n children,\n style,\n debug,\n mode,\n onTouch,\n onSize: onSizeReanimatedOrSkia,\n ...props\n },\n forwardedRef\n ) => {\n const size = useValue({ width: 0, height: 0 });\n const onSize = isValue(onSizeReanimatedOrSkia)\n ? onSizeReanimatedOrSkia\n : size;\n useEffect(() => {\n if (!isValue(onSizeReanimatedOrSkia) && onSizeReanimatedOrSkia) {\n return size.addListener((v) => (onSizeReanimatedOrSkia.value = v));\n }\n return undefined;\n }, [onSizeReanimatedOrSkia, size]);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const redraw = useCallback(() => {\n innerRef.current?.redraw();\n }, [innerRef]);\n const getNativeId = useCallback(() => {\n const id = innerRef.current?.nativeId ?? -1;\n return id;\n }, [innerRef]);\n\n const registerValues = useCallback(\n (values: Array<SkiaValue<unknown>>) => {\n if (ref.current !== null) {\n return ref.current.registerValues(values);\n }\n return () => {};\n },\n [ref]\n );\n const root = useMemo(\n () => new SkiaRoot(Skia, registerValues, redraw, getNativeId),\n [redraw, registerValues, getNativeId]\n );\n\n // Render effect\n useEffect(() => {\n root.render(children);\n }, [children, root, redraw]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n if (NATIVE_DOM) {\n return (\n <SkiaDomView\n ref={ref}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onSize={onSize}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n } else {\n return (\n <SkiaView\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={style}\n mode={mode}\n debug={debug}\n onSize={onSize}\n onDraw={(canvas, info) => {\n onTouch && onTouch(info.touches);\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n }}\n {...props}\n />\n );\n }\n }\n) as React.FC<CanvasProps & React.RefAttributes<SkiaDomView>>;\n\n/**\n * Combines a list of refs into a single ref. This can be used to provide\n * both a forwarded ref and an internal ref keeping the same functionality\n * on both of the refs.\n * @param refs Array of refs to combine\n * @returns A single ref that can be used in a ref prop.\n */\nconst useCombinedRefs = <T,>(\n ...refs: Array<MutableRefObject<T> | ForwardedRef<T>>\n) => {\n const targetRef = React.useRef<T>(null);\n React.useEffect(() => {\n refs.forEach((ref) => {\n if (ref) {\n if (typeof ref === \"function\") {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n }\n });\n }, [refs]);\n return targetRef;\n};\n"],"mappings":"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"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type { SkData, DataSourceParam,
|
2
|
-
export declare const useRawData: <T extends
|
1
|
+
import type { SkData, DataSourceParam, BaseSkJSIInstance } from "../types";
|
2
|
+
export declare const useRawData: <T extends BaseSkJSIInstance>(source: DataSourceParam, factory: (data: SkData) => T | null, onError?: ((err: Error) => void) | undefined) => T | null;
|
3
3
|
export declare const useData: (source: DataSourceParam, onError?: ((err: Error) => void) | undefined) => SkData | null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["factoryWrapper","data2","factory","onError","factoryResult","Error","loadData","source","undefined","Promise","resolve","Uint8Array","Skia","Data","fromBytes","uri","Platform","resolveAsset","fromURI","then","d","useLoading","loader","mounted","useRef","data","setData","useState","dataRef","useEffect","current","value","dispose","useRawData","identity","useData"],"sources":["Data.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { SkData, DataSourceParam,
|
1
|
+
{"version":3,"names":["factoryWrapper","data2","factory","onError","factoryResult","Error","loadData","source","undefined","Promise","resolve","Uint8Array","Skia","Data","fromBytes","uri","Platform","resolveAsset","fromURI","then","d","useLoading","loader","mounted","useRef","data","setData","useState","dataRef","useEffect","current","value","dispose","useRawData","identity","useData"],"sources":["Data.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { SkData, DataSourceParam, BaseSkJSIInstance } from \"../types\";\nimport { Platform } from \"../../Platform\";\n\nconst factoryWrapper = <T>(\n data2: SkData,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n) => {\n const factoryResult = factory(data2);\n if (factoryResult === null) {\n onError && onError(new Error(\"Could not load data\"));\n return null;\n } else {\n return factoryResult;\n }\n};\n\nconst loadData = <T>(\n source: DataSourceParam,\n factory: (data: SkData) => T | null,\n onError?: (err: Error) => void\n): Promise<T | null> => {\n if (source === null || source === undefined) {\n return new Promise((resolve) => resolve(null));\n } else if (source instanceof Uint8Array) {\n return new Promise((resolve) =>\n resolve(factoryWrapper(Skia.Data.fromBytes(source), factory, onError))\n );\n } else {\n const uri =\n typeof source === \"string\" ? source : Platform.resolveAsset(source);\n return Skia.Data.fromURI(uri).then((d) =>\n factoryWrapper(d, factory, onError)\n );\n }\n};\nconst useLoading = <T extends BaseSkJSIInstance>(\n source: DataSourceParam,\n loader: () => Promise<T | null>\n) => {\n const mounted = useRef(false);\n const [data, setData] = useState<T | null>(null);\n const dataRef = useRef<T | null>(null);\n useEffect(() => {\n mounted.current = true;\n loader().then((value) => {\n if (mounted.current) {\n setData(value);\n dataRef.current = value;\n }\n });\n return () => {\n dataRef.current?.dispose();\n mounted.current = false;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source]);\n return data;\n};\n\nexport const useRawData = <T extends BaseSkJSIInstance>(\n source: DataSourceParam,\n factory: (data: SkData) => T | null,\n onError?: (err: Error) => void\n) => useLoading(source, () => loadData<T>(source, factory, onError));\n\nconst identity = (data: SkData) => data;\n\nexport const useData = (\n source: DataSourceParam,\n onError?: (err: Error) => void\n) => useRawData(source, identity, onError);\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AAEA,MAAMA,cAAc,GAAG,CACrBC,KADqB,EAErBC,OAFqB,EAGrBC,OAHqB,KAIlB;EACH,MAAMC,aAAa,GAAGF,OAAO,CAACD,KAAD,CAA7B;;EACA,IAAIG,aAAa,KAAK,IAAtB,EAA4B;IAC1BD,OAAO,IAAIA,OAAO,CAAC,IAAIE,KAAJ,CAAU,qBAAV,CAAD,CAAlB;IACA,OAAO,IAAP;EACD,CAHD,MAGO;IACL,OAAOD,aAAP;EACD;AACF,CAZD;;AAcA,MAAME,QAAQ,GAAG,CACfC,MADe,EAEfL,OAFe,EAGfC,OAHe,KAIO;EACtB,IAAII,MAAM,KAAK,IAAX,IAAmBA,MAAM,KAAKC,SAAlC,EAA6C;IAC3C,OAAO,IAAIC,OAAJ,CAAaC,OAAD,IAAaA,OAAO,CAAC,IAAD,CAAhC,CAAP;EACD,CAFD,MAEO,IAAIH,MAAM,YAAYI,UAAtB,EAAkC;IACvC,OAAO,IAAIF,OAAJ,CAAaC,OAAD,IACjBA,OAAO,CAACV,cAAc,CAACY,UAAA,CAAKC,IAAL,CAAUC,SAAV,CAAoBP,MAApB,CAAD,EAA8BL,OAA9B,EAAuCC,OAAvC,CAAf,CADF,CAAP;EAGD,CAJM,MAIA;IACL,MAAMY,GAAG,GACP,OAAOR,MAAP,KAAkB,QAAlB,GAA6BA,MAA7B,GAAsCS,kBAAA,CAASC,YAAT,CAAsBV,MAAtB,CADxC;IAEA,OAAOK,UAAA,CAAKC,IAAL,CAAUK,OAAV,CAAkBH,GAAlB,EAAuBI,IAAvB,CAA6BC,CAAD,IACjCpB,cAAc,CAACoB,CAAD,EAAIlB,OAAJ,EAAaC,OAAb,CADT,CAAP;EAGD;AACF,CAlBD;;AAmBA,MAAMkB,UAAU,GAAG,CACjBd,MADiB,EAEjBe,MAFiB,KAGd;EACH,MAAMC,OAAO,GAAG,IAAAC,aAAA,EAAO,KAAP,CAAhB;EACA,MAAM,CAACC,IAAD,EAAOC,OAAP,IAAkB,IAAAC,eAAA,EAAmB,IAAnB,CAAxB;EACA,MAAMC,OAAO,GAAG,IAAAJ,aAAA,EAAiB,IAAjB,CAAhB;EACA,IAAAK,gBAAA,EAAU,MAAM;IACdN,OAAO,CAACO,OAAR,GAAkB,IAAlB;IACAR,MAAM,GAAGH,IAAT,CAAeY,KAAD,IAAW;MACvB,IAAIR,OAAO,CAACO,OAAZ,EAAqB;QACnBJ,OAAO,CAACK,KAAD,CAAP;QACAH,OAAO,CAACE,OAAR,GAAkBC,KAAlB;MACD;IACF,CALD;IAMA,OAAO,MAAM;MAAA;;MACX,oBAAAH,OAAO,CAACE,OAAR,sEAAiBE,OAAjB;MACAT,OAAO,CAACO,OAAR,GAAkB,KAAlB;IACD,CAHD,CARc,CAYd;EACD,CAbD,EAaG,CAACvB,MAAD,CAbH;EAcA,OAAOkB,IAAP;AACD,CAtBD;;AAwBO,MAAMQ,UAAU,GAAG,CACxB1B,MADwB,EAExBL,OAFwB,EAGxBC,OAHwB,KAIrBkB,UAAU,CAACd,MAAD,EAAS,MAAMD,QAAQ,CAAIC,MAAJ,EAAYL,OAAZ,EAAqBC,OAArB,CAAvB,CAJR;;;;AAMP,MAAM+B,QAAQ,GAAIT,IAAD,IAAkBA,IAAnC;;AAEO,MAAMU,OAAO,GAAG,CACrB5B,MADqB,EAErBJ,OAFqB,KAGlB8B,UAAU,CAAC1B,MAAD,EAAS2B,QAAT,EAAmB/B,OAAnB,CAHR"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
export declare type SkData = SkJSIInstance<"Data"
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
|
+
export declare type SkData = SkJSIInstance<"Data">;
|
3
3
|
declare type RNModule = number;
|
4
4
|
declare type ESModule = {
|
5
5
|
__esModule: true;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isRNModule","mod"],"sources":["Data.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"names":["isRNModule","mod"],"sources":["Data.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport type SkData = SkJSIInstance<\"Data\">;\n\ntype RNModule = number;\ntype ESModule = {\n __esModule: true;\n default: string;\n};\nexport type DataModule = RNModule | ESModule;\nexport type DataSource = DataModule | string | Uint8Array;\nexport type DataSourceParam = DataSource | null | undefined;\n\nexport const isRNModule = (mod: DataModule): mod is RNModule =>\n typeof mod === \"number\";\n"],"mappings":";;;;;;;AAaO,MAAMA,UAAU,GAAIC,GAAD,IACxB,OAAOA,GAAP,KAAe,QADV"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { SkMatrix } from "../Matrix";
|
2
|
-
import type {
|
2
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
3
3
|
import type { TileMode } from "../ImageFilter";
|
4
4
|
import type { SkShader } from "../Shader";
|
5
5
|
export declare enum FilterMode {
|
@@ -16,7 +16,7 @@ export declare enum ImageFormat {
|
|
16
16
|
PNG = 4,
|
17
17
|
WEBP = 6
|
18
18
|
}
|
19
|
-
export interface SkImage extends SkJSIInstance<"Image"
|
19
|
+
export interface SkImage extends SkJSIInstance<"Image"> {
|
20
20
|
/**
|
21
21
|
* Returns the possibly scaled height of the image.
|
22
22
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["FilterMode","MipmapMode","ImageFormat"],"sources":["Image.ts"],"sourcesContent":["import type { SkMatrix } from \"../Matrix\";\nimport type {
|
1
|
+
{"version":3,"names":["FilterMode","MipmapMode","ImageFormat"],"sources":["Image.ts"],"sourcesContent":["import type { SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { TileMode } from \"../ImageFilter\";\nimport type { SkShader } from \"../Shader\";\n\nexport enum FilterMode {\n Nearest,\n Linear,\n}\n\nexport enum MipmapMode {\n None,\n Nearest,\n Linear,\n}\n\nexport enum ImageFormat {\n JPEG = 3,\n PNG = 4,\n WEBP = 6,\n}\n\nexport interface SkImage extends SkJSIInstance<\"Image\"> {\n /**\n * Returns the possibly scaled height of the image.\n */\n height(): number;\n\n /**\n * Returns the possibly scaled width of the image.\n */\n width(): number;\n\n /**\n * Returns this image as a shader with the specified tiling. It will use cubic sampling.\n * @param tx - tile mode in the x direction.\n * @param ty - tile mode in the y direction.\n * @param fm - The filter mode. (default nearest)\n * @param mm - The mipmap mode. Note: for settings other than None, the image must have mipmaps (default none)\n * calculated with makeCopyWithDefaultMipmaps;\n * @param localMatrix\n */\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader;\n\n /**\n * Returns this image as a shader with the specified tiling. It will use cubic sampling.\n * @param tx - tile mode in the x direction.\n * @param ty - tile mode in the y direction.\n * @param B - See CubicResampler in SkSamplingOptions.h for more information\n * @param C - See CubicResampler in SkSamplingOptions.h for more information\n * @param localMatrix\n */\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader;\n\n /** Encodes Image pixels, returning result as UInt8Array. Returns existing\n encoded data if present; otherwise, SkImage is encoded with\n SkEncodedImageFormat::kPNG. Skia must be built with SK_ENCODE_PNG to encode\n SkImage.\n\n Returns nullptr if existing encoded data is missing or invalid, and\n encoding fails.\n\n @param fmt - PNG is the default value.\n @param quality - a value from 0 to 100; 100 is the least lossy. May be ignored.\n\n @return Uint8Array with data\n */\n encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array;\n\n /** Encodes Image pixels, returning result as a base64 encoded string. Returns existing\n encoded data if present; otherwise, SkImage is encoded with\n SkEncodedImageFormat::kPNG. Skia must be built with SK_ENCODE_PNG to encode\n SkImage.\n\n Returns nullptr if existing encoded data is missing or invalid, and\n encoding fails.\n\n @param fmt - PNG is the default value.\n @param quality - a value from 0 to 100; 100 is the least lossy. May be ignored.\n\n @return base64 encoded string of data\n */\n encodeToBase64(fmt?: ImageFormat, quality?: number): string;\n\n /**\n * Returns raster image or lazy image. Copies SkImage backed by GPU texture\n * into CPU memory if needed. Returns original SkImage if decoded in raster\n * bitmap, or if encoded in a stream.\n */\n makeNonTextureImage(): SkImage;\n}\n"],"mappings":";;;;;;IAKYA,U;;;WAAAA,U;EAAAA,U,CAAAA,U;EAAAA,U,CAAAA,U;GAAAA,U,0BAAAA,U;;IAKAC,U;;;WAAAA,U;EAAAA,U,CAAAA,U;EAAAA,U,CAAAA,U;EAAAA,U,CAAAA,U;GAAAA,U,0BAAAA,U;;IAMAC,W;;;WAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;GAAAA,W,2BAAAA,W"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export interface
|
2
|
-
__typename__: T;
|
3
|
-
}
|
4
|
-
export interface JsiDisposable {
|
1
|
+
export interface BaseSkJSIInstance {
|
5
2
|
dispose: () => void;
|
6
3
|
}
|
4
|
+
export interface SkJSIInstance<T extends string> extends BaseSkJSIInstance {
|
5
|
+
__typename__: T;
|
6
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["JsiInstance.ts"],"sourcesContent":["export interface
|
1
|
+
{"version":3,"names":[],"sources":["JsiInstance.ts"],"sourcesContent":["export interface BaseSkJSIInstance {\n dispose: () => void;\n}\n\nexport interface SkJSIInstance<T extends string> extends BaseSkJSIInstance {\n __typename__: T;\n}\n"],"mappings":""}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
export interface SkSVG extends SkJSIInstance<"SVG"
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
|
+
export interface SkSVG extends SkJSIInstance<"SVG"> {
|
3
3
|
width(): number;
|
4
4
|
height(): number;
|
5
5
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["SVG.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"names":[],"sources":["SVG.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport interface SkSVG extends SkJSIInstance<\"SVG\"> {\n width(): number;\n height(): number;\n}\n"],"mappings":""}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type {
|
2
|
-
export declare type SkTypeface = SkJSIInstance<"Typeface"
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
|
+
export declare type SkTypeface = SkJSIInstance<"Typeface">;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["Typeface.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"names":[],"sources":["Typeface.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport type SkTypeface = SkJSIInstance<\"Typeface\">;\n"],"mappings":""}
|
@@ -11,6 +11,7 @@ export declare abstract class BaseHostObject<T, N extends string> extends Host i
|
|
11
11
|
readonly __typename__: N;
|
12
12
|
ref: T;
|
13
13
|
constructor(CanvasKit: CanvasKit, ref: T, typename: N);
|
14
|
+
abstract dispose: () => void;
|
14
15
|
}
|
15
16
|
export declare abstract class HostObject<T, N extends string> extends BaseHostObject<T, N> {
|
16
17
|
static fromValue<T>(value: SkJSIInstance<string>): T;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","ckEnum","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const ckEnum = (value: number): EmbindEnumEntity => ({ value });\nexport const optEnum = (\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : { value };\n"],"mappings":";;;;;;;;;AAIO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;EAC/CC,WAAW,CAACC,GAAD,EAAe;IACxB,MAAMA,GAAG,IAAI,qCAAb;EACD;;AAH8C;;;;AAM1C,MAAeC,IAAf,CAAoB;EAGzBF,WAAW,CAACG,SAAD,EAAuB;IAAA;;IAChC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;AALwB;;;;AAQpB,MAAeC,cAAf,SACGF,IADH,CAGP;EAIEF,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;IACrD,MAAMH,SAAN;;IADqD;;IAAA;;IAErD,KAAKE,GAAL,GAAWA,GAAX;IACA,KAAKE,YAAL,GAAoBD,QAApB;EACD;;AARH;;;;
|
1
|
+
{"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","ckEnum","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n\n abstract dispose: () => void;\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const ckEnum = (value: number): EmbindEnumEntity => ({ value });\nexport const optEnum = (\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : { value };\n"],"mappings":";;;;;;;;;AAIO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;EAC/CC,WAAW,CAACC,GAAD,EAAe;IACxB,MAAMA,GAAG,IAAI,qCAAb;EACD;;AAH8C;;;;AAM1C,MAAeC,IAAf,CAAoB;EAGzBF,WAAW,CAACG,SAAD,EAAuB;IAAA;;IAChC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;AALwB;;;;AAQpB,MAAeC,cAAf,SACGF,IADH,CAGP;EAIEF,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;IACrD,MAAMH,SAAN;;IADqD;;IAAA;;IAAA;;IAErD,KAAKE,GAAL,GAAWA,GAAX;IACA,KAAKE,YAAL,GAAoBD,QAApB;EACD;;AARH;;;;AAaO,MAAeE,UAAf,SAAuDJ,cAAvD,CAGL;EACgB,OAATK,SAAS,CAAIC,KAAJ,EAAkC;IAChD,OAAQA,KAAD,CAAiCL,GAAxC;EACD;;AAHD;;;;AAMK,MAAMM,MAAM,GAAID,KAAD,KAAsC;EAAEA;AAAF,CAAtC,CAAf;;;;AACA,MAAME,OAAO,GAClBF,KADqB,IAGrBA,KAAK,KAAKG,SAAV,GAAsBA,SAAtB,GAAkC;EAAEH;AAAF,CAH7B"}
|
@@ -3,6 +3,7 @@ import type { BlendMode, ClipOp, FilterMode, MipmapMode, PointMode, SaveLayerFla
|
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements SkCanvas {
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: Canvas);
|
6
|
+
dispose: () => void;
|
6
7
|
drawRect(rect: SkRect, paint: SkPaint): void;
|
7
8
|
drawImage(image: SkImage, x: number, y: number, paint?: SkPaint): void;
|
8
9
|
drawImageRect(img: SkImage, src: SkRect, dest: SkRect, paint: SkPaint, fastSample?: boolean): void;
|
@@ -31,9 +31,15 @@ var _JsiSkImageFilter = require("./JsiSkImageFilter");
|
|
31
31
|
|
32
32
|
var _JsiSkPoint = require("./JsiSkPoint");
|
33
33
|
|
34
|
+
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; }
|
35
|
+
|
34
36
|
class JsiSkCanvas extends _Host.HostObject {
|
35
37
|
constructor(CanvasKit, ref) {
|
36
38
|
super(CanvasKit, ref, "Canvas");
|
39
|
+
|
40
|
+
_defineProperty(this, "dispose", () => {
|
41
|
+
this.ref.delete();
|
42
|
+
});
|
37
43
|
}
|
38
44
|
|
39
45
|
drawRect(rect, paint) {
|