@shopify/react-native-skia 2.0.0-next.1 → 2.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +25 -11
- package/android/cpp/jni/JniPlatformContext.cpp +1 -0
- package/{ios/RNSkia-iOS → apple}/MetalContext.h +0 -5
- package/{ios/RNSkia-iOS → apple}/MetalWindowContext.mm +4 -0
- package/{ios/RNSkia-iOS/RNSkiOSPlatformContext.h → apple/RNSkApplePlatformContext.h} +7 -3
- package/{ios/RNSkia-iOS/RNSkiOSPlatformContext.mm → apple/RNSkApplePlatformContext.mm} +19 -19
- package/{ios/RNSkia-iOS/RNSkiOSVideo.h → apple/RNSkAppleVideo.h} +3 -3
- package/{ios/RNSkia-iOS/RNSkiOSVideo.mm → apple/RNSkAppleVideo.mm} +14 -14
- package/{ios/RNSkia-iOS/RNSkiOSView.h → apple/RNSkAppleView.h} +4 -4
- package/{ios/RNSkia-iOS/RNSkiOSView.mm → apple/RNSkAppleView.mm} +4 -4
- package/{ios/RNSkia-iOS → apple}/RNSkMetalCanvasProvider.mm +6 -1
- package/{ios/RNSkia-iOS → apple}/SkiaManager.mm +2 -2
- package/{ios/RNSkia-iOS → apple}/SkiaPictureView.mm +2 -2
- package/{ios/RNSkia-iOS → apple}/SkiaPictureViewManager.mm +6 -2
- package/{ios/RNSkia-iOS → apple}/SkiaUIView.h +12 -4
- package/{ios/RNSkia-iOS → apple}/SkiaUIView.mm +11 -7
- package/{ios/RNSkia-iOS → apple}/ViewScreenshotService.h +4 -0
- package/{ios/RNSkia-iOS → apple}/ViewScreenshotService.mm +4 -0
- package/cpp/api/JsiSkCanvas.h +45 -2
- package/cpp/api/JsiSkContourMeasure.h +1 -1
- package/cpp/api/JsiSkHostObjects.h +21 -10
- package/cpp/api/JsiSkParagraph.h +17 -27
- package/cpp/api/JsiSkPathEffect.h +1 -1
- package/cpp/api/JsiSkPictureFactory.h +1 -1
- package/cpp/api/JsiSkShaderFactory.h +43 -8
- package/cpp/api/JsiSkVertices.h +14 -3
- package/cpp/api/recorder/Drawings.h +35 -5
- package/cpp/api/recorder/Shaders.h +40 -0
- package/cpp/rnskia/DawnContext.h +1 -1
- package/cpp/skia/include/codec/SkCodec.h +7 -2
- package/cpp/skia/include/config/SkUserConfig.h +11 -0
- package/cpp/skia/include/core/SkCanvas.h +11 -7
- package/cpp/skia/include/core/SkColor.h +10 -0
- package/cpp/skia/include/core/SkColorSpace.h +184 -2
- package/cpp/skia/include/core/SkColorType.h +114 -32
- package/cpp/skia/include/core/SkFontScanner.h +5 -8
- package/cpp/skia/include/core/SkFontStyle.h +1 -1
- package/cpp/skia/include/core/SkMaskFilter.h +0 -8
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPath.h +1 -1
- package/cpp/skia/include/core/SkRRect.h +3 -1
- package/cpp/skia/include/core/SkShader.h +3 -3
- package/cpp/skia/include/core/SkString.h +8 -8
- package/cpp/skia/include/core/SkSurface.h +14 -0
- package/cpp/skia/include/core/SkTypeface.h +24 -7
- package/cpp/skia/include/effects/SkGradientShader.h +6 -1
- package/cpp/skia/include/effects/SkRuntimeEffect.h +1 -0
- package/cpp/skia/include/encode/SkPngEncoder.h +14 -0
- package/cpp/skia/include/gpu/GpuTypes.h +9 -0
- package/cpp/skia/include/gpu/ganesh/GrContextOptions.h +135 -133
- package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +5 -0
- package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkarounds.h +3 -3
- package/cpp/skia/include/gpu/ganesh/GrTypes.h +14 -9
- package/cpp/skia/include/gpu/graphite/Context.h +25 -2
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +23 -5
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +20 -1
- package/cpp/skia/include/gpu/graphite/Image.h +1 -0
- package/cpp/skia/include/gpu/graphite/LogPriority.h +36 -0
- package/cpp/skia/include/gpu/graphite/PrecompileContext.h +52 -0
- package/cpp/skia/include/gpu/graphite/Recorder.h +6 -0
- package/cpp/skia/include/gpu/graphite/Recording.h +3 -1
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +4 -36
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypesUtils.h +48 -0
- package/cpp/skia/include/gpu/graphite/precompile/Precompile.h +3 -2
- package/cpp/skia/include/pathops/SkPathOps.h +9 -1
- package/cpp/skia/include/ports/SkFontMgr_FontConfigInterface.h +3 -0
- package/cpp/skia/include/private/SkPathRef.h +15 -21
- package/cpp/skia/include/private/base/SkAttributes.h +16 -10
- package/cpp/skia/include/private/base/SkMutex.h +8 -0
- package/cpp/skia/include/private/base/SkTArray.h +1 -1
- package/cpp/skia/include/private/base/SkTDArray.h +1 -1
- package/cpp/skia/include/private/base/SkTemplates.h +24 -11
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +1 -1
- package/cpp/skia/include/sksl/SkSLDebugTrace.h +0 -3
- package/cpp/skia/modules/skcms/src/Transform_inl.h +20 -20
- package/cpp/skia/modules/skcms/src/skcms_Transform.h +4 -3
- package/cpp/skia/modules/skcms/src/skcms_public.h +19 -15
- package/cpp/skia/modules/skresources/include/SkResources.h +3 -1
- package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGContainer.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGImage.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +2 -0
- package/cpp/skia/modules/svg/include/SkSVGShape.h +1 -0
- package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +4 -0
- package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
- package/cpp/skia/src/core/SkLRUCache.h +19 -13
- package/cpp/skia/src/core/SkTHash.h +50 -4
- package/cpp/skia/src/gpu/ganesh/gl/GrGLDefines.h +1 -0
- package/lib/commonjs/__tests__/setup.d.ts +18 -0
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +4 -3
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/commonjs/headless/index.d.ts +1 -0
- package/lib/commonjs/headless/index.js +12 -0
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +1 -2
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +1 -2
- package/lib/commonjs/renderer/Canvas.js +3 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +4 -6
- package/lib/commonjs/skia/web/Host.js +23 -10
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +15 -15
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js +3 -3
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFontMgr.js +1 -1
- package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +3 -3
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +9 -9
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js +4 -4
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +3 -3
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +2 -2
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.js +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +4 -3
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/skia/web/JsiVideo.js +2 -1
- package/lib/commonjs/skia/web/JsiVideo.js.map +1 -1
- package/lib/commonjs/sksg/HostConfig.js +3 -1
- package/lib/commonjs/sksg/HostConfig.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Core.d.ts +1 -5
- package/lib/commonjs/sksg/Recorder/Core.js +12 -4
- package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Player.d.ts +1 -1
- package/lib/commonjs/sksg/Recorder/Player.js +4 -5
- package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Box.js +4 -6
- package/lib/commonjs/sksg/Recorder/commands/Box.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +1 -3
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js +1 -58
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +2 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js +10 -1
- package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/module/__tests__/setup.d.ts +18 -0
- package/lib/module/external/reanimated/useAnimatedImageValue.js +4 -3
- package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/module/headless/index.d.ts +1 -0
- package/lib/module/headless/index.js +1 -0
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/mock/index.js +1 -2
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +1 -2
- package/lib/module/renderer/Canvas.js +3 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +4 -6
- package/lib/module/skia/web/Host.js +21 -8
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +15 -15
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +4 -4
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkFontMgr.js +2 -2
- package/lib/module/skia/web/JsiSkFontMgr.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +6 -6
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +4 -4
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js +10 -10
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +3 -3
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +4 -4
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +4 -4
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js +3 -3
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js +1 -1
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js +5 -5
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.js +2 -2
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.js.map +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +4 -3
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/skia/web/JsiVideo.js +2 -1
- package/lib/module/skia/web/JsiVideo.js.map +1 -1
- package/lib/module/sksg/HostConfig.js +3 -1
- package/lib/module/sksg/HostConfig.js.map +1 -1
- package/lib/module/sksg/Recorder/Core.d.ts +1 -5
- package/lib/module/sksg/Recorder/Core.js +10 -2
- package/lib/module/sksg/Recorder/Core.js.map +1 -1
- package/lib/module/sksg/Recorder/Player.d.ts +1 -1
- package/lib/module/sksg/Recorder/Player.js +5 -6
- package/lib/module/sksg/Recorder/Player.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Box.js +5 -7
- package/lib/module/sksg/Recorder/commands/Box.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Drawing.d.ts +1 -3
- package/lib/module/sksg/Recorder/commands/Drawing.js +2 -58
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/module/specs/NativeSkiaModule.web.d.ts +2 -0
- package/lib/module/specs/NativeSkiaModule.web.js +10 -1
- package/lib/module/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/typescript/lib/commonjs/mock/index.d.ts +2 -2
- package/lib/typescript/lib/commonjs/skia/index.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/Host.d.ts +3 -5
- package/lib/typescript/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkFontMgr.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathEffectFactory.d.ts +2 -2
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +3 -3
- package/lib/typescript/lib/commonjs/skia/web/JsiVideo.d.ts +1 -1
- package/lib/typescript/lib/commonjs/sksg/Recorder/Core.d.ts +1 -1
- package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +0 -1
- package/lib/typescript/lib/module/headless/index.d.ts +1 -0
- package/lib/typescript/lib/module/mock/index.d.ts +5 -5
- package/lib/typescript/lib/module/skia/Skia.d.ts +1 -1
- package/lib/typescript/lib/module/skia/Skia.web.d.ts +3 -3
- package/lib/typescript/lib/module/skia/web/Host.d.ts +3 -5
- package/lib/typescript/lib/module/skia/web/JsiSkFont.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkFontMgr.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkImageFactory.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkPathEffectFactory.d.ts +2 -2
- package/lib/typescript/lib/module/skia/web/JsiSkPathFactory.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkTypefaceFontProvider.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +3 -3
- package/lib/typescript/lib/module/skia/web/JsiVideo.d.ts +1 -1
- package/lib/typescript/lib/module/sksg/Recorder/Core.d.ts +1 -1
- package/lib/typescript/lib/module/sksg/Recorder/commands/Drawing.d.ts +0 -1
- package/lib/typescript/src/__tests__/setup.d.ts +18 -0
- package/lib/typescript/src/headless/index.d.ts +1 -0
- package/lib/typescript/src/renderer/Canvas.d.ts +1 -2
- package/lib/typescript/src/skia/web/Host.d.ts +4 -6
- package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +1 -1
- package/lib/typescript/src/sksg/Recorder/Core.d.ts +1 -5
- package/lib/typescript/src/sksg/Recorder/Player.d.ts +1 -1
- package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +1 -3
- package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +2 -0
- package/package.json +8 -7
- package/react-native-skia.podspec +3 -3
- package/src/__tests__/setup.ts +67 -1
- package/src/__tests__/snapshots/box/box-shadow-opacity.png +0 -0
- package/src/__tests__/snapshots/platform-buffer.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot2-android-ci.png +0 -0
- package/src/external/reanimated/useAnimatedImageValue.ts +4 -3
- package/src/headless/index.ts +2 -1
- package/src/mock/index.ts +1 -2
- package/src/renderer/Canvas.tsx +3 -2
- package/src/renderer/__tests__/e2e/Box.spec.tsx +22 -0
- package/src/renderer/__tests__/e2e/Matrix4.spec.tsx +1 -2
- package/src/renderer/__tests__/e2e/NativeBuffer.spec.tsx +2 -0
- package/src/renderer/__tests__/e2e/Paths.spec.tsx +13 -11
- package/src/skia/__tests__/Enums.spec.ts +24 -2
- package/src/skia/__tests__/Path.spec.ts +2 -2
- package/src/skia/web/Host.ts +29 -11
- package/src/skia/web/JsiSkCanvas.ts +17 -17
- package/src/skia/web/JsiSkColorFilterFactory.ts +1 -1
- package/src/skia/web/JsiSkFont.ts +5 -5
- package/src/skia/web/JsiSkFontMgr.ts +3 -3
- package/src/skia/web/JsiSkImage.ts +14 -10
- package/src/skia/web/JsiSkImageFactory.ts +5 -5
- package/src/skia/web/JsiSkImageFilterFactory.ts +12 -22
- package/src/skia/web/JsiSkMaskFilterFactory.ts +1 -1
- package/src/skia/web/JsiSkPaint.ts +3 -3
- package/src/skia/web/JsiSkPath.ts +4 -4
- package/src/skia/web/JsiSkPathEffectFactory.ts +6 -6
- package/src/skia/web/JsiSkPathFactory.ts +4 -9
- package/src/skia/web/JsiSkPicture.ts +3 -3
- package/src/skia/web/JsiSkShaderFactory.ts +5 -5
- package/src/skia/web/JsiSkTypefaceFontProvider.ts +3 -3
- package/src/skia/web/JsiSkVerticesFactory.ts +1 -1
- package/src/skia/web/JsiSkia.ts +7 -4
- package/src/skia/web/JsiVideo.ts +2 -1
- package/src/sksg/HostConfig.ts +1 -1
- package/src/sksg/Recorder/Core.ts +5 -7
- package/src/sksg/Recorder/Player.ts +6 -7
- package/src/sksg/Recorder/commands/Box.ts +5 -7
- package/src/sksg/Recorder/commands/Drawing.ts +0 -65
- package/src/specs/NativeSkiaModule.web.ts +12 -2
- package/ios/Rnskia.xcodeproj/project.pbxproj +0 -281
- package/ios/Rnskia.xcworkspace/contents.xcworkspacedata +0 -7
- package/lib/commonjs/skia/types/Image/ColorType.web.d.ts +0 -19
- package/lib/commonjs/skia/types/Image/ColorType.web.js +0 -43
- package/lib/commonjs/skia/types/Image/ColorType.web.js.map +0 -1
- package/lib/module/skia/types/Image/ColorType.web.d.ts +0 -19
- package/lib/module/skia/types/Image/ColorType.web.js +0 -37
- package/lib/module/skia/types/Image/ColorType.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/skia/types/Image/ColorType.web.d.ts +0 -2
- package/lib/typescript/lib/module/skia/types/Image/ColorType.web.d.ts +0 -1
- package/lib/typescript/src/skia/types/Image/ColorType.web.d.ts +0 -19
- package/src/skia/types/Image/ColorType.web.ts +0 -19
- /package/{ios/RNSkia-iOS → apple}/MetalContext.mm +0 -0
- /package/{ios/RNSkia-iOS → apple}/MetalWindowContext.h +0 -0
- /package/{ios/RNSkia-iOS → apple}/RNSkMetalCanvasProvider.h +0 -0
- /package/{ios → apple}/RNSkiaModule.h +0 -0
- /package/{ios → apple}/RNSkiaModule.mm +0 -0
- /package/{ios/RNSkia-iOS → apple}/SkiaCVPixelBufferUtils.h +0 -0
- /package/{ios/RNSkia-iOS → apple}/SkiaCVPixelBufferUtils.mm +0 -0
- /package/{ios/RNSkia-iOS → apple}/SkiaManager.h +0 -0
- /package/{ios/RNSkia-iOS → apple}/SkiaPictureView.h +0 -0
- /package/{ios/RNSkia-iOS → apple}/SkiaPictureViewManager.h +0 -0
@@ -124,8 +124,8 @@ export class JsiSkCanvas
|
|
124
124
|
JsiSkImage.fromValue(img),
|
125
125
|
left,
|
126
126
|
top,
|
127
|
-
getEnum(this.CanvasKit
|
128
|
-
getEnum(this.CanvasKit
|
127
|
+
getEnum(this.CanvasKit, "FilterMode", fm),
|
128
|
+
getEnum(this.CanvasKit, "MipmapMode", mm),
|
129
129
|
paint ? JsiSkPaint.fromValue(paint) : paint
|
130
130
|
);
|
131
131
|
}
|
@@ -141,7 +141,7 @@ export class JsiSkCanvas
|
|
141
141
|
JsiSkImage.fromValue(img),
|
142
142
|
Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),
|
143
143
|
JsiSkRect.fromValue(this.CanvasKit, dest),
|
144
|
-
getEnum(this.CanvasKit
|
144
|
+
getEnum(this.CanvasKit, "FilterMode", filter),
|
145
145
|
paint ? JsiSkPaint.fromValue(paint) : paint
|
146
146
|
);
|
147
147
|
}
|
@@ -176,8 +176,8 @@ export class JsiSkCanvas
|
|
176
176
|
JsiSkImage.fromValue(img),
|
177
177
|
JsiSkRect.fromValue(this.CanvasKit, src),
|
178
178
|
JsiSkRect.fromValue(this.CanvasKit, dest),
|
179
|
-
getEnum(this.CanvasKit
|
180
|
-
getEnum(this.CanvasKit
|
179
|
+
getEnum(this.CanvasKit, "FilterMode", fm),
|
180
|
+
getEnum(this.CanvasKit, "MipmapMode", mm),
|
181
181
|
paint ? JsiSkPaint.fromValue(paint) : paint
|
182
182
|
);
|
183
183
|
}
|
@@ -197,7 +197,7 @@ export class JsiSkCanvas
|
|
197
197
|
drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {
|
198
198
|
this.ref.drawVertices(
|
199
199
|
JsiSkVertices.fromValue(verts),
|
200
|
-
getEnum(this.CanvasKit
|
200
|
+
getEnum(this.CanvasKit, "BlendMode", mode),
|
201
201
|
JsiSkPaint.fromValue(paint)
|
202
202
|
);
|
203
203
|
}
|
@@ -213,7 +213,7 @@ export class JsiSkCanvas
|
|
213
213
|
cubics.map(({ x, y }) => [x, y]).flat(),
|
214
214
|
colors,
|
215
215
|
texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,
|
216
|
-
mode ? getEnum(this.CanvasKit
|
216
|
+
mode ? getEnum(this.CanvasKit, "BlendMode", mode) : null,
|
217
217
|
paint ? JsiSkPaint.fromValue(paint) : undefined
|
218
218
|
);
|
219
219
|
}
|
@@ -224,7 +224,7 @@ export class JsiSkCanvas
|
|
224
224
|
|
225
225
|
drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {
|
226
226
|
this.ref.drawPoints(
|
227
|
-
getEnum(this.CanvasKit
|
227
|
+
getEnum(this.CanvasKit, "PointMode", mode),
|
228
228
|
points.map(({ x, y }) => [x, y]).flat(),
|
229
229
|
JsiSkPaint.fromValue(paint)
|
230
230
|
);
|
@@ -357,7 +357,7 @@ export class JsiSkCanvas
|
|
357
357
|
drawColor(color: SkColor, blendMode?: BlendMode) {
|
358
358
|
this.ref.drawColor(
|
359
359
|
color,
|
360
|
-
blendMode ? getEnum(this.CanvasKit
|
360
|
+
blendMode ? getEnum(this.CanvasKit, "BlendMode", blendMode) : undefined
|
361
361
|
);
|
362
362
|
}
|
363
363
|
|
@@ -368,7 +368,7 @@ export class JsiSkCanvas
|
|
368
368
|
clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {
|
369
369
|
this.ref.clipPath(
|
370
370
|
JsiSkPath.fromValue(path),
|
371
|
-
getEnum(this.CanvasKit
|
371
|
+
getEnum(this.CanvasKit, "PathOp", op),
|
372
372
|
doAntiAlias
|
373
373
|
);
|
374
374
|
}
|
@@ -376,7 +376,7 @@ export class JsiSkCanvas
|
|
376
376
|
clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {
|
377
377
|
this.ref.clipRect(
|
378
378
|
JsiSkRect.fromValue(this.CanvasKit, rect),
|
379
|
-
getEnum(this.CanvasKit
|
379
|
+
getEnum(this.CanvasKit, "PathOp", op),
|
380
380
|
doAntiAlias
|
381
381
|
);
|
382
382
|
}
|
@@ -384,7 +384,7 @@ export class JsiSkCanvas
|
|
384
384
|
clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean) {
|
385
385
|
this.ref.clipRRect(
|
386
386
|
JsiSkRRect.fromValue(this.CanvasKit, rrect),
|
387
|
-
getEnum(this.CanvasKit
|
387
|
+
getEnum(this.CanvasKit, "PathOp", op),
|
388
388
|
doAntiAlias
|
389
389
|
);
|
390
390
|
}
|
@@ -426,9 +426,9 @@ export class JsiSkCanvas
|
|
426
426
|
ckSampling = sampling;
|
427
427
|
} else if (sampling) {
|
428
428
|
ckSampling = {
|
429
|
-
filter: getEnum(this.CanvasKit
|
429
|
+
filter: getEnum(this.CanvasKit, "FilterMode", sampling.filter),
|
430
430
|
mipmap: sampling.mipmap
|
431
|
-
? getEnum(this.CanvasKit
|
431
|
+
? getEnum(this.CanvasKit, "MipmapMode", sampling.mipmap)
|
432
432
|
: this.CanvasKit.MipmapMode.None,
|
433
433
|
};
|
434
434
|
}
|
@@ -438,7 +438,7 @@ export class JsiSkCanvas
|
|
438
438
|
dst,
|
439
439
|
JsiSkPaint.fromValue(paint),
|
440
440
|
blendMode
|
441
|
-
? getEnum(this.CanvasKit
|
441
|
+
? getEnum(this.CanvasKit, "BlendMode", blendMode)
|
442
442
|
: this.CanvasKit.BlendMode.DstOver,
|
443
443
|
cls,
|
444
444
|
ckSampling
|
@@ -450,8 +450,8 @@ export class JsiSkCanvas
|
|
450
450
|
width: imageInfo.width,
|
451
451
|
height: imageInfo.height,
|
452
452
|
colorSpace: this.CanvasKit.ColorSpace.SRGB,
|
453
|
-
alphaType: getEnum(this.CanvasKit
|
454
|
-
colorType: getEnum(this.CanvasKit
|
453
|
+
alphaType: getEnum(this.CanvasKit, "AlphaType", imageInfo.alphaType),
|
454
|
+
colorType: getEnum(this.CanvasKit, "ColorType", imageInfo.colorType),
|
455
455
|
};
|
456
456
|
return this.ref.readPixels(srcX, srcY, pxInfo);
|
457
457
|
}
|
@@ -10,7 +10,7 @@ import type {
|
|
10
10
|
SkTypeface,
|
11
11
|
} from "../types";
|
12
12
|
|
13
|
-
import { HostObject,
|
13
|
+
import { HostObject, getEnum, throwNotImplementedOnRNWeb } from "./Host";
|
14
14
|
import { JsiSkPaint } from "./JsiSkPaint";
|
15
15
|
import { JsiSkPoint } from "./JsiSkPoint";
|
16
16
|
import { JsiSkRect } from "./JsiSkRect";
|
@@ -21,8 +21,8 @@ export class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
|
|
21
21
|
super(CanvasKit, ref, "Font");
|
22
22
|
}
|
23
23
|
|
24
|
-
measureText(_text: string, _paint?: SkPaint | undefined)
|
25
|
-
|
24
|
+
measureText(_text: string, _paint?: SkPaint | undefined) {
|
25
|
+
return throwNotImplementedOnRNWeb<SkRect>();
|
26
26
|
}
|
27
27
|
|
28
28
|
dispose = () => {
|
@@ -100,7 +100,7 @@ export class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
|
|
100
100
|
}
|
101
101
|
|
102
102
|
setEdging(edging: FontEdging) {
|
103
|
-
this.ref.setEdging(getEnum(this.CanvasKit
|
103
|
+
this.ref.setEdging(getEnum(this.CanvasKit, "FontEdging", edging));
|
104
104
|
}
|
105
105
|
|
106
106
|
setEmbeddedBitmaps(embeddedBitmaps: boolean) {
|
@@ -108,7 +108,7 @@ export class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
|
|
108
108
|
}
|
109
109
|
|
110
110
|
setHinting(hinting: FontHinting) {
|
111
|
-
this.ref.setHinting(getEnum(this.CanvasKit
|
111
|
+
this.ref.setHinting(getEnum(this.CanvasKit, "FontHinting", hinting));
|
112
112
|
}
|
113
113
|
|
114
114
|
setLinearMetrics(linearMetrics: boolean) {
|
@@ -2,7 +2,7 @@ import type { CanvasKit, FontMgr } from "canvaskit-wasm";
|
|
2
2
|
|
3
3
|
import type { FontStyle, SkFontMgr, SkTypeface } from "../types";
|
4
4
|
|
5
|
-
import { HostObject,
|
5
|
+
import { HostObject, throwNotImplementedOnRNWeb } from "./Host";
|
6
6
|
|
7
7
|
export class JsiSkFontMgr
|
8
8
|
extends HostObject<FontMgr, "FontMgr">
|
@@ -20,7 +20,7 @@ export class JsiSkFontMgr
|
|
20
20
|
getFamilyName(index: number) {
|
21
21
|
return this.ref.getFamilyName(index);
|
22
22
|
}
|
23
|
-
matchFamilyStyle(_familyName: string, _fontStyle: FontStyle)
|
24
|
-
|
23
|
+
matchFamilyStyle(_familyName: string, _fontStyle: FontStyle) {
|
24
|
+
return throwNotImplementedOnRNWeb<SkTypeface>();
|
25
25
|
}
|
26
26
|
}
|
@@ -77,10 +77,10 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
77
77
|
return new JsiSkShader(
|
78
78
|
this.CanvasKit,
|
79
79
|
this.ref.makeShaderOptions(
|
80
|
-
getEnum(this.CanvasKit
|
81
|
-
getEnum(this.CanvasKit
|
82
|
-
getEnum(this.CanvasKit
|
83
|
-
getEnum(this.CanvasKit
|
80
|
+
getEnum(this.CanvasKit, "TileMode", tx),
|
81
|
+
getEnum(this.CanvasKit, "TileMode", ty),
|
82
|
+
getEnum(this.CanvasKit, "FilterMode", fm),
|
83
|
+
getEnum(this.CanvasKit, "MipmapMode", mm),
|
84
84
|
localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined
|
85
85
|
)
|
86
86
|
);
|
@@ -96,8 +96,8 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
96
96
|
return new JsiSkShader(
|
97
97
|
this.CanvasKit,
|
98
98
|
this.ref.makeShaderCubic(
|
99
|
-
getEnum(this.CanvasKit
|
100
|
-
getEnum(this.CanvasKit
|
99
|
+
getEnum(this.CanvasKit, "TileMode", tx),
|
100
|
+
getEnum(this.CanvasKit, "TileMode", ty),
|
101
101
|
B,
|
102
102
|
C,
|
103
103
|
localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined
|
@@ -109,11 +109,13 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
109
109
|
let result: Uint8Array | null;
|
110
110
|
if (fmt && quality) {
|
111
111
|
result = this.ref.encodeToBytes(
|
112
|
-
getEnum(this.CanvasKit
|
112
|
+
getEnum(this.CanvasKit, "ImageFormat", fmt),
|
113
113
|
quality
|
114
114
|
);
|
115
115
|
} else if (fmt) {
|
116
|
-
result = this.ref.encodeToBytes(
|
116
|
+
result = this.ref.encodeToBytes(
|
117
|
+
getEnum(this.CanvasKit, "ImageFormat", fmt)
|
118
|
+
);
|
117
119
|
} else {
|
118
120
|
result = this.ref.encodeToBytes();
|
119
121
|
}
|
@@ -137,11 +139,13 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
137
139
|
width: imageInfo?.width ?? info.width,
|
138
140
|
height: imageInfo?.height ?? info.height,
|
139
141
|
alphaType: getEnum(
|
140
|
-
this.CanvasKit
|
142
|
+
this.CanvasKit,
|
143
|
+
"AlphaType",
|
141
144
|
(imageInfo ?? info).alphaType
|
142
145
|
),
|
143
146
|
colorType: getEnum(
|
144
|
-
this.CanvasKit
|
147
|
+
this.CanvasKit,
|
148
|
+
"ColorType",
|
145
149
|
(imageInfo ?? info).colorType
|
146
150
|
),
|
147
151
|
};
|
@@ -9,7 +9,7 @@ import type {
|
|
9
9
|
ImageFactory,
|
10
10
|
} from "../types";
|
11
11
|
|
12
|
-
import { Host, getEnum } from "./Host";
|
12
|
+
import { Host, getEnum, throwNotImplementedOnRNWeb } from "./Host";
|
13
13
|
import { JsiSkImage } from "./JsiSkImage";
|
14
14
|
import { JsiSkData } from "./JsiSkData";
|
15
15
|
import type { JsiSkSurface } from "./JsiSkSurface";
|
@@ -75,17 +75,17 @@ export class JsiSkImageFactory extends Host implements ImageFactory {
|
|
75
75
|
return new JsiSkImage(this.CanvasKit, image);
|
76
76
|
}
|
77
77
|
|
78
|
-
MakeImageFromNativeTextureUnstable()
|
79
|
-
|
78
|
+
MakeImageFromNativeTextureUnstable() {
|
79
|
+
return throwNotImplementedOnRNWeb<SkImage>();
|
80
80
|
}
|
81
81
|
|
82
82
|
MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number) {
|
83
83
|
// see toSkImageInfo() from canvaskit
|
84
84
|
const image = this.CanvasKit.MakeImage(
|
85
85
|
{
|
86
|
-
alphaType: getEnum(this.CanvasKit
|
86
|
+
alphaType: getEnum(this.CanvasKit, "AlphaType", info.alphaType),
|
87
87
|
colorSpace: this.CanvasKit.ColorSpace.SRGB,
|
88
|
-
colorType: getEnum(this.CanvasKit
|
88
|
+
colorType: getEnum(this.CanvasKit, "ColorType", info.colorType),
|
89
89
|
height: info.height,
|
90
90
|
width: info.width,
|
91
91
|
},
|
@@ -13,7 +13,7 @@ import type {
|
|
13
13
|
TileMode,
|
14
14
|
} from "../types";
|
15
15
|
|
16
|
-
import { Host,
|
16
|
+
import { Host, throwNotImplementedOnRNWeb, getEnum } from "./Host";
|
17
17
|
import { JsiSkImageFilter } from "./JsiSkImageFilter";
|
18
18
|
import { JsiSkColorFilter } from "./JsiSkColorFilter";
|
19
19
|
|
@@ -42,8 +42,8 @@ export class JsiSkImageFilterFactory
|
|
42
42
|
const inputFilter =
|
43
43
|
input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);
|
44
44
|
const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(
|
45
|
-
getEnum(this.CanvasKit
|
46
|
-
getEnum(this.CanvasKit
|
45
|
+
getEnum(this.CanvasKit, "ColorChannel", channelX),
|
46
|
+
getEnum(this.CanvasKit, "ColorChannel", channelY),
|
47
47
|
scale,
|
48
48
|
JsiSkImageFilter.fromValue(in1),
|
49
49
|
inputFilter
|
@@ -69,7 +69,7 @@ export class JsiSkImageFilterFactory
|
|
69
69
|
this.CanvasKit.ImageFilter.MakeBlur(
|
70
70
|
sigmaX,
|
71
71
|
sigmaY,
|
72
|
-
getEnum(this.CanvasKit
|
72
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
73
73
|
input === null ? null : JsiSkImageFilter.fromValue(input)
|
74
74
|
)
|
75
75
|
);
|
@@ -107,9 +107,7 @@ export class JsiSkImageFilterFactory
|
|
107
107
|
const inputFilter =
|
108
108
|
input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);
|
109
109
|
if (cropRect) {
|
110
|
-
|
111
|
-
"The cropRect argument is not yet supported on React Native Web."
|
112
|
-
);
|
110
|
+
throwNotImplementedOnRNWeb<SkImageFilter>();
|
113
111
|
}
|
114
112
|
const filter = this.CanvasKit.ImageFilter.MakeDropShadow(
|
115
113
|
dx,
|
@@ -134,9 +132,7 @@ export class JsiSkImageFilterFactory
|
|
134
132
|
const inputFilter =
|
135
133
|
input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);
|
136
134
|
if (cropRect) {
|
137
|
-
|
138
|
-
"The cropRect argument is not yet supported on React Native Web."
|
139
|
-
);
|
135
|
+
throwNotImplementedOnRNWeb<SkImageFilter>();
|
140
136
|
}
|
141
137
|
const filter = this.CanvasKit.ImageFilter.MakeDropShadowOnly(
|
142
138
|
dx,
|
@@ -158,9 +154,7 @@ export class JsiSkImageFilterFactory
|
|
158
154
|
const inputFilter =
|
159
155
|
input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);
|
160
156
|
if (cropRect) {
|
161
|
-
|
162
|
-
"The cropRect argument is not yet supported on React Native Web."
|
163
|
-
);
|
157
|
+
throwNotImplementedOnRNWeb<SkImageFilter>();
|
164
158
|
}
|
165
159
|
const filter = this.CanvasKit.ImageFilter.MakeErode(rx, ry, inputFilter);
|
166
160
|
return new JsiSkImageFilter(this.CanvasKit, filter);
|
@@ -175,9 +169,7 @@ export class JsiSkImageFilterFactory
|
|
175
169
|
const inputFilter =
|
176
170
|
input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);
|
177
171
|
if (cropRect) {
|
178
|
-
|
179
|
-
"The cropRect argument is not yet supported on React Native Web."
|
180
|
-
);
|
172
|
+
throwNotImplementedOnRNWeb<SkImageFilter>();
|
181
173
|
}
|
182
174
|
const filter = this.CanvasKit.ImageFilter.MakeDilate(rx, ry, inputFilter);
|
183
175
|
return new JsiSkImageFilter(this.CanvasKit, filter);
|
@@ -194,12 +186,10 @@ export class JsiSkImageFilterFactory
|
|
194
186
|
? null
|
195
187
|
: JsiSkImageFilter.fromValue<ImageFilter>(foreground);
|
196
188
|
if (cropRect) {
|
197
|
-
|
198
|
-
"The cropRect argument is not yet supported on React Native Web."
|
199
|
-
);
|
189
|
+
throwNotImplementedOnRNWeb<SkImageFilter>();
|
200
190
|
}
|
201
191
|
const filter = this.CanvasKit.ImageFilter.MakeBlend(
|
202
|
-
getEnum(this.CanvasKit
|
192
|
+
getEnum(this.CanvasKit, "BlendMode", mode),
|
203
193
|
JsiSkImageFilter.fromValue(background),
|
204
194
|
inputFilter
|
205
195
|
);
|
@@ -210,7 +200,7 @@ export class JsiSkImageFilterFactory
|
|
210
200
|
_builder: SkRuntimeShaderBuilder,
|
211
201
|
_childShaderName: string | null,
|
212
202
|
_input: SkImageFilter | null
|
213
|
-
)
|
214
|
-
|
203
|
+
) {
|
204
|
+
return throwNotImplementedOnRNWeb<SkImageFilter>();
|
215
205
|
}
|
216
206
|
}
|
@@ -15,7 +15,7 @@ export class JsiSkMaskFilterFactory extends Host implements MaskFilterFactory {
|
|
15
15
|
return new JsiSkMaskFilter(
|
16
16
|
this.CanvasKit,
|
17
17
|
this.CanvasKit.MaskFilter.MakeBlur(
|
18
|
-
getEnum(this.CanvasKit
|
18
|
+
getEnum(this.CanvasKit, "BlurStyle", style),
|
19
19
|
sigma,
|
20
20
|
respectCTM
|
21
21
|
)
|
@@ -79,7 +79,7 @@ export class JsiSkPaint extends HostObject<Paint, "Paint"> implements SkPaint {
|
|
79
79
|
}
|
80
80
|
|
81
81
|
setBlendMode(blendMode: BlendMode) {
|
82
|
-
this.ref.setBlendMode(getEnum(this.CanvasKit
|
82
|
+
this.ref.setBlendMode(getEnum(this.CanvasKit, "BlendMode", blendMode));
|
83
83
|
}
|
84
84
|
|
85
85
|
setColor(color: SkColor) {
|
@@ -107,11 +107,11 @@ export class JsiSkPaint extends HostObject<Paint, "Paint"> implements SkPaint {
|
|
107
107
|
}
|
108
108
|
|
109
109
|
setStrokeCap(cap: StrokeCap) {
|
110
|
-
this.ref.setStrokeCap(getEnum(this.CanvasKit
|
110
|
+
this.ref.setStrokeCap(getEnum(this.CanvasKit, "StrokeCap", cap));
|
111
111
|
}
|
112
112
|
|
113
113
|
setStrokeJoin(join: StrokeJoin) {
|
114
|
-
this.ref.setStrokeJoin(getEnum(this.CanvasKit
|
114
|
+
this.ref.setStrokeJoin(getEnum(this.CanvasKit, "StrokeJoin", join));
|
115
115
|
}
|
116
116
|
|
117
117
|
setStrokeMiter(limit: number) {
|
@@ -150,7 +150,7 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
|
|
150
150
|
}
|
151
151
|
|
152
152
|
setFillType(fill: FillType) {
|
153
|
-
this.ref.setFillType(getEnum(this.CanvasKit
|
153
|
+
this.ref.setFillType(getEnum(this.CanvasKit, "FillType", fill));
|
154
154
|
return this;
|
155
155
|
}
|
156
156
|
|
@@ -168,8 +168,8 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
|
|
168
168
|
// eslint-disable-next-line camelcase
|
169
169
|
miter_limit: opts.width,
|
170
170
|
precision: opts.width,
|
171
|
-
join: optEnum(this.CanvasKit
|
172
|
-
cap: optEnum(this.CanvasKit
|
171
|
+
join: optEnum(this.CanvasKit, "StrokeJoin", opts.join),
|
172
|
+
cap: optEnum(this.CanvasKit, "StrokeCap", opts.cap),
|
173
173
|
}
|
174
174
|
);
|
175
175
|
return result === null ? result : this;
|
@@ -318,7 +318,7 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
|
|
318
318
|
op(path: SkPath, op: PathOp) {
|
319
319
|
return this.ref.op(
|
320
320
|
JsiSkPath.fromValue(path),
|
321
|
-
getEnum(this.CanvasKit
|
321
|
+
getEnum(this.CanvasKit, "PathOp", op)
|
322
322
|
);
|
323
323
|
}
|
324
324
|
|
@@ -8,7 +8,7 @@ import type {
|
|
8
8
|
SkPathEffect,
|
9
9
|
} from "../types";
|
10
10
|
|
11
|
-
import { getEnum, Host,
|
11
|
+
import { getEnum, Host, throwNotImplementedOnRNWeb } from "./Host";
|
12
12
|
import { JsiSkMatrix } from "./JsiSkMatrix";
|
13
13
|
import { JsiSkPath } from "./JsiSkPath";
|
14
14
|
import { JsiSkPathEffect } from "./JsiSkPathEffect";
|
@@ -40,12 +40,12 @@ export class JsiSkPathEffectFactory extends Host implements PathEffectFactory {
|
|
40
40
|
return new JsiSkPathEffect(this.CanvasKit, pe);
|
41
41
|
}
|
42
42
|
|
43
|
-
MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect)
|
44
|
-
|
43
|
+
MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect) {
|
44
|
+
return throwNotImplementedOnRNWeb<SkPathEffect>();
|
45
45
|
}
|
46
46
|
|
47
|
-
MakeSum(_outer: SkPathEffect, _inner: SkPathEffect)
|
48
|
-
|
47
|
+
MakeSum(_outer: SkPathEffect, _inner: SkPathEffect) {
|
48
|
+
return throwNotImplementedOnRNWeb<SkPathEffect>();
|
49
49
|
}
|
50
50
|
|
51
51
|
MakeLine2D(width: number, matrix: SkMatrix) {
|
@@ -69,7 +69,7 @@ export class JsiSkPathEffectFactory extends Host implements PathEffectFactory {
|
|
69
69
|
JsiSkPath.fromValue(path),
|
70
70
|
advance,
|
71
71
|
phase,
|
72
|
-
getEnum(this.CanvasKit
|
72
|
+
getEnum(this.CanvasKit, "Path1DEffect", style)
|
73
73
|
);
|
74
74
|
if (pe === null) {
|
75
75
|
return null;
|
@@ -3,7 +3,7 @@ import type { CanvasKit } from "canvaskit-wasm";
|
|
3
3
|
import type { PathCommand, PathOp, SkFont, SkPath } from "../types";
|
4
4
|
import type { PathFactory } from "../types/Path/PathFactory";
|
5
5
|
|
6
|
-
import { Host, getEnum,
|
6
|
+
import { Host, getEnum, throwNotImplementedOnRNWeb } from "./Host";
|
7
7
|
import { JsiSkPath } from "./JsiSkPath";
|
8
8
|
|
9
9
|
export class JsiSkPathFactory extends Host implements PathFactory {
|
@@ -27,7 +27,7 @@ export class JsiSkPathFactory extends Host implements PathFactory {
|
|
27
27
|
const path = this.CanvasKit.Path.MakeFromOp(
|
28
28
|
JsiSkPath.fromValue(one),
|
29
29
|
JsiSkPath.fromValue(two),
|
30
|
-
getEnum(this.CanvasKit
|
30
|
+
getEnum(this.CanvasKit, "PathOp", op)
|
31
31
|
);
|
32
32
|
if (path === null) {
|
33
33
|
return null;
|
@@ -43,12 +43,7 @@ export class JsiSkPathFactory extends Host implements PathFactory {
|
|
43
43
|
return new JsiSkPath(this.CanvasKit, path);
|
44
44
|
}
|
45
45
|
|
46
|
-
MakeFromText(
|
47
|
-
|
48
|
-
_x: number,
|
49
|
-
_y: number,
|
50
|
-
_font: SkFont
|
51
|
-
): SkPath | null {
|
52
|
-
throw new NotImplementedOnRNWeb();
|
46
|
+
MakeFromText(_text: string, _x: number, _y: number, _font: SkFont) {
|
47
|
+
return throwNotImplementedOnRNWeb<SkPath>();
|
53
48
|
}
|
54
49
|
}
|
@@ -36,9 +36,9 @@ export class JsiSkPicture
|
|
36
36
|
return new JsiSkShader(
|
37
37
|
this.CanvasKit,
|
38
38
|
this.ref.makeShader(
|
39
|
-
getEnum(this.CanvasKit
|
40
|
-
getEnum(this.CanvasKit
|
41
|
-
getEnum(this.CanvasKit
|
39
|
+
getEnum(this.CanvasKit, "TileMode", tmx),
|
40
|
+
getEnum(this.CanvasKit, "TileMode", tmy),
|
41
|
+
getEnum(this.CanvasKit, "FilterMode", mode),
|
42
42
|
localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,
|
43
43
|
tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined
|
44
44
|
)
|
@@ -36,7 +36,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
36
36
|
JsiSkPoint.fromValue(end),
|
37
37
|
colors,
|
38
38
|
pos,
|
39
|
-
getEnum(this.CanvasKit
|
39
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
40
40
|
localMatrix === undefined
|
41
41
|
? undefined
|
42
42
|
: JsiSkMatrix.fromValue(localMatrix),
|
@@ -61,7 +61,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
61
61
|
radius,
|
62
62
|
colors,
|
63
63
|
pos,
|
64
|
-
getEnum(this.CanvasKit
|
64
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
65
65
|
localMatrix === undefined
|
66
66
|
? undefined
|
67
67
|
: JsiSkMatrix.fromValue(localMatrix),
|
@@ -90,7 +90,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
90
90
|
endRadius,
|
91
91
|
colors,
|
92
92
|
pos,
|
93
|
-
getEnum(this.CanvasKit
|
93
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
94
94
|
localMatrix === undefined
|
95
95
|
? undefined
|
96
96
|
: JsiSkMatrix.fromValue(localMatrix),
|
@@ -117,7 +117,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
117
117
|
cy,
|
118
118
|
colors,
|
119
119
|
pos,
|
120
|
-
getEnum(this.CanvasKit
|
120
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
121
121
|
localMatrix === undefined || localMatrix === null
|
122
122
|
? undefined
|
123
123
|
: JsiSkMatrix.fromValue(localMatrix),
|
@@ -174,7 +174,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
174
174
|
return new JsiSkShader(
|
175
175
|
this.CanvasKit,
|
176
176
|
this.CanvasKit.Shader.MakeBlend(
|
177
|
-
getEnum(this.CanvasKit
|
177
|
+
getEnum(this.CanvasKit, "BlendMode", mode),
|
178
178
|
JsiSkShader.fromValue(one),
|
179
179
|
JsiSkShader.fromValue(two)
|
180
180
|
)
|
@@ -3,7 +3,7 @@ import type { CanvasKit, TypefaceFontProvider } from "canvaskit-wasm";
|
|
3
3
|
import type { SkTypefaceFontProvider } from "../types/Paragraph/TypefaceFontProvider";
|
4
4
|
import type { FontStyle, SkTypeface } from "../types";
|
5
5
|
|
6
|
-
import { HostObject,
|
6
|
+
import { HostObject, throwNotImplementedOnRNWeb } from "./Host";
|
7
7
|
|
8
8
|
export class JsiSkTypefaceFontProvider
|
9
9
|
extends HostObject<TypefaceFontProvider, "FontMgr">
|
@@ -15,8 +15,8 @@ export class JsiSkTypefaceFontProvider
|
|
15
15
|
super(CanvasKit, ref, "FontMgr");
|
16
16
|
}
|
17
17
|
|
18
|
-
matchFamilyStyle(_name: string, _style: FontStyle)
|
19
|
-
|
18
|
+
matchFamilyStyle(_name: string, _style: FontStyle) {
|
19
|
+
return throwNotImplementedOnRNWeb<SkTypeface>();
|
20
20
|
}
|
21
21
|
countFamilies() {
|
22
22
|
return this.ref.countFamilies();
|
@@ -31,7 +31,7 @@ export const MakeVertices = (
|
|
31
31
|
new JsiSkVertices(
|
32
32
|
CanvasKit,
|
33
33
|
CanvasKit.MakeVertices(
|
34
|
-
getEnum(CanvasKit
|
34
|
+
getEnum(CanvasKit, "VertexMode", mode),
|
35
35
|
positions.map(({ x, y }) => [x, y]).flat(),
|
36
36
|
(textureCoordinates || []).map(({ x, y }) => [x, y]).flat(),
|
37
37
|
!colors ? null : colors.reduce((a, c) => concat(a, c)),
|
package/src/skia/web/JsiSkia.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
import type { CanvasKit } from "canvaskit-wasm";
|
2
2
|
|
3
3
|
import type {
|
4
|
+
JsiRecorder,
|
4
5
|
SkContourMeasureIter,
|
5
6
|
Skia,
|
7
|
+
SkiaContext,
|
6
8
|
SkPath,
|
7
9
|
SkRect,
|
8
10
|
SkRuntimeEffect,
|
@@ -43,12 +45,13 @@ import { JsiSkAnimatedImageFactory } from "./JsiSkAnimatedImageFactory";
|
|
43
45
|
import { JsiSkParagraphBuilderFactory } from "./JsiSkParagraphBuilderFactory";
|
44
46
|
import { JsiSkNativeBufferFactory } from "./JsiSkNativeBufferFactory";
|
45
47
|
import { createVideo } from "./JsiVideo";
|
48
|
+
import { throwNotImplementedOnRNWeb } from "./Host";
|
46
49
|
|
47
50
|
export const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({
|
48
51
|
Point: (x: number, y: number) =>
|
49
52
|
new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),
|
50
|
-
RuntimeShaderBuilder: (_: SkRuntimeEffect)
|
51
|
-
|
53
|
+
RuntimeShaderBuilder: (_: SkRuntimeEffect) => {
|
54
|
+
return throwNotImplementedOnRNWeb<SkRuntimeShaderBuilder>();
|
52
55
|
},
|
53
56
|
RRectXY: (rect: SkRect, rx: number, ry: number) =>
|
54
57
|
new JsiSkRRect(CanvasKit, rect, rx, ry),
|
@@ -130,9 +133,9 @@ export const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({
|
|
130
133
|
NativeBuffer: new JsiSkNativeBufferFactory(CanvasKit),
|
131
134
|
Video: createVideo.bind(null, CanvasKit),
|
132
135
|
Context: (_surface: bigint, _width: number, _height: number) => {
|
133
|
-
|
136
|
+
return throwNotImplementedOnRNWeb<SkiaContext>();
|
134
137
|
},
|
135
138
|
Recorder: () => {
|
136
|
-
|
139
|
+
return throwNotImplementedOnRNWeb<JsiRecorder>();
|
137
140
|
},
|
138
141
|
});
|
package/src/skia/web/JsiVideo.ts
CHANGED
@@ -4,6 +4,7 @@ import type { CanvasKitWebGLBuffer, Video, ImageFactory } from "../types";
|
|
4
4
|
|
5
5
|
import { CanvasKitWebGLBufferImpl } from "./CanvasKitWebGLBufferImpl";
|
6
6
|
import { JsiSkImageFactory } from "./JsiSkImageFactory";
|
7
|
+
import { throwNotImplementedOnRNWeb } from "./Host";
|
7
8
|
|
8
9
|
export const createVideo = async (
|
9
10
|
CanvasKit: CanvasKit,
|
@@ -42,7 +43,7 @@ export class JsiVideo implements Video {
|
|
42
43
|
}
|
43
44
|
|
44
45
|
framerate(): number {
|
45
|
-
|
46
|
+
return throwNotImplementedOnRNWeb<number>();
|
46
47
|
}
|
47
48
|
|
48
49
|
setSurface(surface: Surface) {
|
package/src/sksg/HostConfig.ts
CHANGED