@shopify/react-native-skia 0.1.190 → 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/dom/nodes/JsiImageSvgNode.h +24 -3
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +11 -11
- package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -2
- package/cpp/rnskia/values/RNSkValue.h +1 -1
- package/lib/commonjs/Platform/Platform.web.js +1 -1
- package/lib/commonjs/Platform/Platform.web.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +7 -2
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +29 -7
- package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PathNode.js +6 -2
- package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +7 -2
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +17 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/processors/math/Math.d.ts +1 -0
- package/lib/commonjs/renderer/processors/math/Math.js +9 -1
- package/lib/commonjs/renderer/processors/math/Math.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/SkiaBaseWebView.js +9 -4
- package/lib/commonjs/views/SkiaBaseWebView.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/Platform/Platform.web.js +1 -1
- package/lib/module/Platform/Platform.web.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +7 -2
- package/lib/module/dom/nodes/drawings/ImageSVG.js +29 -6
- package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PathNode.js +5 -2
- package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +7 -2
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/renderer/Canvas.js +15 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/processors/math/Math.d.ts +1 -0
- package/lib/module/renderer/processors/math/Math.js +5 -0
- package/lib/module/renderer/processors/math/Math.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/SkiaBaseWebView.js +9 -4
- package/lib/module/views/SkiaBaseWebView.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/dom/nodes/drawings/ImageSVG.d.ts +7 -2
- package/lib/typescript/src/dom/types/Drawings.d.ts +7 -2
- package/lib/typescript/src/renderer/processors/math/Math.d.ts +1 -0
- 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 +4 -1
- package/scripts/install-npm.js +2 -3
- package/src/Platform/Platform.web.tsx +1 -1
- package/src/dom/nodes/drawings/ImageSVG.ts +17 -6
- package/src/dom/nodes/drawings/PathNode.ts +10 -1
- package/src/dom/types/Drawings.ts +7 -2
- package/src/renderer/Canvas.tsx +21 -1
- package/src/renderer/processors/math/Math.ts +5 -0
- 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/SkiaBaseWebView.tsx +9 -4
- package/src/views/SkiaDomView.web.tsx +6 -1
- package/src/views/types.ts +2 -1
@@ -2,6 +2,7 @@ import type { ViewProps } from "react-native";
|
|
2
2
|
import type { GroupProps, RenderNode } from "../dom/types";
|
3
3
|
import type { SkCanvas, SkImage, SkPicture, SkRect, SkSize } from "../skia/types";
|
4
4
|
import type { SkiaMutableValue, SkiaValue } from "../values";
|
5
|
+
import type { SharedValueType } from "../renderer/processors/Animations/Animations";
|
5
6
|
export declare type DrawMode = "continuous" | "default";
|
6
7
|
export declare type NativeSkiaViewProps = ViewProps & {
|
7
8
|
mode?: DrawMode;
|
@@ -70,7 +71,7 @@ export interface SkiaBaseViewProps extends ViewProps {
|
|
70
71
|
* Pass an animated value to the onSize property to get updates when
|
71
72
|
* the Skia view is resized.
|
72
73
|
*/
|
73
|
-
onSize?: SkiaMutableValue<SkSize>;
|
74
|
+
onSize?: SkiaMutableValue<SkSize> | SharedValueType<SkSize>;
|
74
75
|
}
|
75
76
|
export interface SkiaDrawViewProps extends SkiaBaseViewProps {
|
76
77
|
/**
|
package/package.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
"setup-skia-web": "./scripts/setup-canvaskit.js"
|
8
8
|
},
|
9
9
|
"title": "React Native Skia",
|
10
|
-
"version": "0.1.
|
10
|
+
"version": "0.1.192",
|
11
11
|
"description": "High-performance React Native Graphics using Skia",
|
12
12
|
"main": "lib/module/index.js",
|
13
13
|
"files": [
|
@@ -76,6 +76,9 @@
|
|
76
76
|
"peerDependenciesMeta": {
|
77
77
|
"react-native-reanimated": {
|
78
78
|
"optional": true
|
79
|
+
},
|
80
|
+
"react-native": {
|
81
|
+
"optional": true
|
79
82
|
}
|
80
83
|
},
|
81
84
|
"devDependencies": {
|
package/scripts/install-npm.js
CHANGED
@@ -8,10 +8,9 @@ const createSymlink = (p) => {
|
|
8
8
|
const srcDir = path.resolve(`./cpp/${p}`);
|
9
9
|
const dstDir = path.resolve(`./android/cpp/${p}`);
|
10
10
|
|
11
|
-
if (fs.existsSync(dstDir)) {
|
12
|
-
fs.
|
11
|
+
if (!fs.existsSync(dstDir) || !fs.lstatSync(dstDir).isSymbolicLink()) {
|
12
|
+
fs.symlinkSync(srcDir, dstDir, "junction");
|
13
13
|
}
|
14
|
-
fs.symlinkSync(srcDir, dstDir, "junction");
|
15
14
|
};
|
16
15
|
|
17
16
|
// Copy common cpp files from the package root to the android folder
|
@@ -99,7 +99,7 @@ const View = (({ children, onLayout, style: rawStyle }: ViewProps) => {
|
|
99
99
|
return {
|
100
100
|
...style,
|
101
101
|
display: "flex",
|
102
|
-
flexDirection: style.flexDirection || "
|
102
|
+
flexDirection: style.flexDirection || "inherit",
|
103
103
|
flexWrap: style.flexWrap || "nowrap",
|
104
104
|
justifyContent: style.justifyContent || "flex-start",
|
105
105
|
alignItems: style.alignItems || "stretch",
|
@@ -1,26 +1,37 @@
|
|
1
1
|
import type { DrawingContext, ImageSVGProps } from "../../types";
|
2
2
|
import { NodeType } from "../../types";
|
3
|
-
import { processRect } from "../datatypes";
|
4
3
|
import { JsiDrawingNode } from "../DrawingNode";
|
5
4
|
import type { NodeContext } from "../Node";
|
6
5
|
|
7
|
-
export class ImageSVGNode extends JsiDrawingNode<
|
6
|
+
export class ImageSVGNode extends JsiDrawingNode<
|
7
|
+
ImageSVGProps,
|
8
|
+
Pick<ImageSVGProps, "x" | "y" | "width" | "height">
|
9
|
+
> {
|
8
10
|
constructor(ctx: NodeContext, props: ImageSVGProps) {
|
9
11
|
super(ctx, NodeType.ImageSVG, props);
|
10
12
|
}
|
11
13
|
|
12
14
|
deriveProps() {
|
13
|
-
|
15
|
+
if (this.props.rect) {
|
16
|
+
return this.props.rect;
|
17
|
+
}
|
18
|
+
const { x, y, width, height } = this.props;
|
19
|
+
return { x, y, width, height };
|
14
20
|
}
|
15
21
|
|
16
22
|
draw({ canvas }: DrawingContext) {
|
17
23
|
const { svg } = this.props;
|
18
|
-
if (!
|
24
|
+
if (!this.derived) {
|
25
|
+
throw new Error("ImageSVGNode: derived props unresolved");
|
26
|
+
}
|
27
|
+
const { x, y, width, height } = this.derived;
|
28
|
+
if (svg === null) {
|
19
29
|
return;
|
20
30
|
}
|
21
|
-
const { x, y, width, height } = processRect(this.Skia, this.props);
|
22
31
|
canvas.save();
|
23
|
-
|
32
|
+
if (x && y) {
|
33
|
+
canvas.translate(x, y);
|
34
|
+
}
|
24
35
|
canvas.drawSvg(svg, width, height);
|
25
36
|
canvas.restore();
|
26
37
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { saturate } from "../../../renderer/processors/math";
|
1
2
|
import { FillType } from "../../../skia/types";
|
2
3
|
import type { SkPath } from "../../../skia/types";
|
3
4
|
import type { DrawingContext, PathProps } from "../../types";
|
@@ -12,7 +13,15 @@ export class PathNode extends JsiDrawingNode<PathProps, SkPath> {
|
|
12
13
|
}
|
13
14
|
|
14
15
|
protected deriveProps() {
|
15
|
-
const {
|
16
|
+
const {
|
17
|
+
start: trimStart,
|
18
|
+
end: trimEnd,
|
19
|
+
fillType,
|
20
|
+
stroke,
|
21
|
+
...pathProps
|
22
|
+
} = this.props;
|
23
|
+
const start = saturate(trimStart);
|
24
|
+
const end = saturate(trimEnd);
|
16
25
|
const hasStartOffset = start !== 0;
|
17
26
|
const hasEndOffset = end !== 1;
|
18
27
|
const hasStrokeOptions = stroke !== undefined;
|
@@ -90,9 +90,14 @@ export interface VerticesProps extends DrawingNodeProps {
|
|
90
90
|
indices?: number[];
|
91
91
|
}
|
92
92
|
|
93
|
-
export
|
93
|
+
export interface ImageSVGProps extends DrawingNodeProps {
|
94
94
|
svg: SkSVG | null;
|
95
|
-
|
95
|
+
x?: number;
|
96
|
+
y?: number;
|
97
|
+
width?: number;
|
98
|
+
height?: number;
|
99
|
+
rect?: SkRect;
|
100
|
+
}
|
96
101
|
|
97
102
|
export interface PictureProps extends DrawingNodeProps {
|
98
103
|
picture: SkPicture;
|
package/src/renderer/Canvas.tsx
CHANGED
@@ -17,9 +17,11 @@ import { Skia } from "../skia/Skia";
|
|
17
17
|
import type { TouchHandler, SkiaBaseViewProps } from "../views";
|
18
18
|
import type { SkiaValue } from "../values/types";
|
19
19
|
import { JsiDrawingContext } from "../dom/types";
|
20
|
+
import { useValue } from "../values";
|
20
21
|
|
21
22
|
import { SkiaRoot } from "./Reconciler";
|
22
23
|
import { NATIVE_DOM } from "./HostComponents";
|
24
|
+
import { isValue } from "./processors";
|
23
25
|
|
24
26
|
export const useCanvasRef = () => useRef<SkiaDomView>(null);
|
25
27
|
|
@@ -31,9 +33,27 @@ export interface CanvasProps extends SkiaBaseViewProps {
|
|
31
33
|
|
32
34
|
export const Canvas = forwardRef<SkiaDomView, CanvasProps>(
|
33
35
|
(
|
34
|
-
{
|
36
|
+
{
|
37
|
+
children,
|
38
|
+
style,
|
39
|
+
debug,
|
40
|
+
mode,
|
41
|
+
onTouch,
|
42
|
+
onSize: onSizeReanimatedOrSkia,
|
43
|
+
...props
|
44
|
+
},
|
35
45
|
forwardedRef
|
36
46
|
) => {
|
47
|
+
const size = useValue({ width: 0, height: 0 });
|
48
|
+
const onSize = isValue(onSizeReanimatedOrSkia)
|
49
|
+
? onSizeReanimatedOrSkia
|
50
|
+
: size;
|
51
|
+
useEffect(() => {
|
52
|
+
if (!isValue(onSizeReanimatedOrSkia) && onSizeReanimatedOrSkia) {
|
53
|
+
return size.addListener((v) => (onSizeReanimatedOrSkia.value = v));
|
54
|
+
}
|
55
|
+
return undefined;
|
56
|
+
}, [onSizeReanimatedOrSkia, size]);
|
37
57
|
const innerRef = useCanvasRef();
|
38
58
|
const ref = useCombinedRefs(forwardedRef, innerRef);
|
39
59
|
const redraw = useCallback(() => {
|
package/src/skia/core/Data.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
2
2
|
|
3
3
|
import { Skia } from "../Skia";
|
4
|
-
import type { SkData, DataSourceParam,
|
4
|
+
import type { SkData, DataSourceParam, BaseSkJSIInstance } from "../types";
|
5
5
|
import { Platform } from "../../Platform";
|
6
6
|
|
7
7
|
const factoryWrapper = <T>(
|
@@ -37,7 +37,7 @@ const loadData = <T>(
|
|
37
37
|
);
|
38
38
|
}
|
39
39
|
};
|
40
|
-
const useLoading = <T extends
|
40
|
+
const useLoading = <T extends BaseSkJSIInstance>(
|
41
41
|
source: DataSourceParam,
|
42
42
|
loader: () => Promise<T | null>
|
43
43
|
) => {
|
@@ -61,7 +61,7 @@ const useLoading = <T extends JsiDisposable>(
|
|
61
61
|
return data;
|
62
62
|
};
|
63
63
|
|
64
|
-
export const useRawData = <T extends
|
64
|
+
export const useRawData = <T extends BaseSkJSIInstance>(
|
65
65
|
source: DataSourceParam,
|
66
66
|
factory: (data: SkData) => T | null,
|
67
67
|
onError?: (err: Error) => void
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import type {
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
2
|
|
3
|
-
export type SkData = SkJSIInstance<"Data"
|
3
|
+
export type SkData = SkJSIInstance<"Data">;
|
4
4
|
|
5
5
|
type RNModule = number;
|
6
6
|
type ESModule = {
|
@@ -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
|
|
@@ -20,7 +20,7 @@ export enum ImageFormat {
|
|
20
20
|
WEBP = 6,
|
21
21
|
}
|
22
22
|
|
23
|
-
export interface SkImage extends SkJSIInstance<"Image"
|
23
|
+
export interface SkImage extends SkJSIInstance<"Image"> {
|
24
24
|
/**
|
25
25
|
* Returns the possibly scaled height of the image.
|
26
26
|
*/
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export interface
|
2
|
-
|
1
|
+
export interface BaseSkJSIInstance {
|
2
|
+
dispose: () => void;
|
3
3
|
}
|
4
4
|
|
5
|
-
export interface
|
6
|
-
|
5
|
+
export interface SkJSIInstance<T extends string> extends BaseSkJSIInstance {
|
6
|
+
__typename__: T;
|
7
7
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import type {
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
2
|
|
3
|
-
export interface SkSVG extends SkJSIInstance<"SVG"
|
3
|
+
export interface SkSVG extends SkJSIInstance<"SVG"> {
|
4
4
|
width(): number;
|
5
5
|
height(): number;
|
6
6
|
}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
2
|
|
3
|
-
export type SkTypeface = SkJSIInstance<"Typeface"
|
3
|
+
export type SkTypeface = SkJSIInstance<"Typeface">;
|
package/src/skia/web/Host.ts
CHANGED
@@ -11,7 +11,7 @@ export class JsiSkData extends HostObject<Data, "Data"> implements SkData {
|
|
11
11
|
super(CanvasKit, ref, "Data");
|
12
12
|
}
|
13
13
|
|
14
|
-
dispose() {
|
15
|
-
// Not implemented in data
|
16
|
-
}
|
14
|
+
dispose = () => {
|
15
|
+
// Not implemented in data - since data is a raw ArrayBuffer
|
16
|
+
};
|
17
17
|
}
|
@@ -20,6 +20,10 @@ export class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
|
|
20
20
|
super(CanvasKit, ref, "Font");
|
21
21
|
}
|
22
22
|
|
23
|
+
dispose = () => {
|
24
|
+
this.ref.delete();
|
25
|
+
};
|
26
|
+
|
23
27
|
getTextWidth(text: string, paint?: SkPaint | undefined) {
|
24
28
|
const ids = this.getGlyphIDs(text);
|
25
29
|
const widths = this.getGlyphWidths(ids, paint);
|
@@ -110,9 +110,9 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
110
110
|
return toBase64String(bytes);
|
111
111
|
}
|
112
112
|
|
113
|
-
dispose() {
|
113
|
+
dispose = () => {
|
114
114
|
this.ref.delete();
|
115
|
-
}
|
115
|
+
};
|
116
116
|
|
117
117
|
makeNonTextureImage(): SkImage {
|
118
118
|
return new JsiSkImage(
|
@@ -12,6 +12,10 @@ export class JsiSkMatrix
|
|
12
12
|
super(CanvasKit, ref, "Matrix");
|
13
13
|
}
|
14
14
|
|
15
|
+
dispose = () => {
|
16
|
+
// Do nothing - the matrix is represenetd by a Float32Array
|
17
|
+
};
|
18
|
+
|
15
19
|
concat(matrix: SkMatrix) {
|
16
20
|
this.ref.set(
|
17
21
|
this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))
|
@@ -33,6 +33,10 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
|
|
33
33
|
super(CanvasKit, ref, "Path");
|
34
34
|
}
|
35
35
|
|
36
|
+
dispose = () => {
|
37
|
+
this.ref.delete();
|
38
|
+
};
|
39
|
+
|
36
40
|
addPath(src: SkPath, matrix?: SkMatrix, extend = false) {
|
37
41
|
const args = [
|
38
42
|
JsiSkPath.fromValue(src),
|
@@ -12,6 +12,10 @@ export class JsiSkRect extends BaseHostObject<Rect, "Rect"> implements SkRect {
|
|
12
12
|
return CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height);
|
13
13
|
}
|
14
14
|
|
15
|
+
dispose = () => {
|
16
|
+
// Float32Array
|
17
|
+
};
|
18
|
+
|
15
19
|
constructor(CanvasKit: CanvasKit, ref: Rect) {
|
16
20
|
super(CanvasKit, ref, "Rect");
|
17
21
|
}
|
@@ -16,6 +16,6 @@ export const useComputedValue = <R>(cb: () => R, values: unknown[]) => {
|
|
16
16
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
17
17
|
values
|
18
18
|
);
|
19
|
-
useEffect(() => () => value.
|
19
|
+
useEffect(() => () => value.dispose(), [value]);
|
20
20
|
return value;
|
21
21
|
};
|
package/src/values/types.ts
CHANGED
@@ -42,7 +42,7 @@ export class RNSkComputedValue<T> extends RNSkReadonlyValue<T> {
|
|
42
42
|
this._unsubscribers = [];
|
43
43
|
}
|
44
44
|
|
45
|
-
public
|
45
|
+
public dispose(): void {
|
46
46
|
this._unsubscribers.forEach((unsubscribe) => unsubscribe());
|
47
47
|
this._unsubscribers = [];
|
48
48
|
}
|
@@ -77,11 +77,16 @@ export abstract class SkiaBaseWebView<
|
|
77
77
|
componentWillUnmount() {
|
78
78
|
this.unsubscribeAll();
|
79
79
|
cancelAnimationFrame(this.requestId);
|
80
|
+
// eslint-disable-next-line max-len
|
81
|
+
// https://stackoverflow.com/questions/23598471/how-do-i-clean-up-and-unload-a-webgl-canvas-context-from-gpu-after-use
|
80
82
|
// https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
83
|
+
// We delete the context, only if the context has been intialized
|
84
|
+
if (this._surface) {
|
85
|
+
this._canvasRef.current
|
86
|
+
?.getContext("webgl2")
|
87
|
+
?.getExtension("WEBGL_lose_context")
|
88
|
+
?.loseContext();
|
89
|
+
}
|
85
90
|
}
|
86
91
|
|
87
92
|
/**
|