@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
@@ -1,7 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { enumKey, fitRects, processCircle, processColor, processPath, processRect, processRRect } from "../../../dom/nodes";
|
2
2
|
import { saturate } from "../../../renderer/processors";
|
3
|
-
import { BlendMode,
|
4
|
-
import { materialize } from "../../utils";
|
3
|
+
import { BlendMode, FillType, FilterMode, isCubicSampling, MipmapMode, PointMode, VertexMode } from "../../../skia/types";
|
5
4
|
export const drawLine = (ctx, props) => {
|
6
5
|
"worklet";
|
7
6
|
|
@@ -17,61 +16,6 @@ export const drawOval = (ctx, props) => {
|
|
17
16
|
const rect = processRect(ctx.Skia, props);
|
18
17
|
ctx.canvas.drawOval(rect, ctx.paint);
|
19
18
|
};
|
20
|
-
export const drawBox = (ctx, props, children) => {
|
21
|
-
"worklet";
|
22
|
-
|
23
|
-
const {
|
24
|
-
paint,
|
25
|
-
Skia,
|
26
|
-
canvas
|
27
|
-
} = ctx;
|
28
|
-
const {
|
29
|
-
box: defaultBox
|
30
|
-
} = props;
|
31
|
-
const opacity = paint.getAlphaf();
|
32
|
-
const box = isRRect(defaultBox) ? defaultBox : Skia.RRectXY(defaultBox, 0, 0);
|
33
|
-
const shadows = children.map(node => {
|
34
|
-
if (node.type === NodeType.BoxShadow) {
|
35
|
-
return materialize(node.props);
|
36
|
-
}
|
37
|
-
return null;
|
38
|
-
}).filter(n => n !== null);
|
39
|
-
shadows.filter(shadow => !shadow.inner).map(shadow => {
|
40
|
-
const {
|
41
|
-
color = "black",
|
42
|
-
blur,
|
43
|
-
spread = 0,
|
44
|
-
dx = 0,
|
45
|
-
dy = 0
|
46
|
-
} = shadow;
|
47
|
-
const lPaint = Skia.Paint();
|
48
|
-
lPaint.setColor(processColor(Skia, color));
|
49
|
-
lPaint.setAlphaf(paint.getAlphaf() * opacity);
|
50
|
-
lPaint.setMaskFilter(Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true));
|
51
|
-
canvas.drawRRect(inflate(Skia, box, spread, spread, dx, dy), lPaint);
|
52
|
-
});
|
53
|
-
canvas.drawRRect(box, paint);
|
54
|
-
shadows.filter(shadow => shadow.inner).map(shadow => {
|
55
|
-
const {
|
56
|
-
color = "black",
|
57
|
-
blur,
|
58
|
-
spread = 0,
|
59
|
-
dx = 0,
|
60
|
-
dy = 0
|
61
|
-
} = shadow;
|
62
|
-
const delta = Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));
|
63
|
-
canvas.save();
|
64
|
-
canvas.clipRRect(box, ClipOp.Intersect, false);
|
65
|
-
const lPaint = Skia.Paint();
|
66
|
-
lPaint.setColor(processColor(Skia, color));
|
67
|
-
lPaint.setAlphaf(paint.getAlphaf() * opacity);
|
68
|
-
lPaint.setMaskFilter(Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true));
|
69
|
-
const inner = deflate(Skia, box, spread, spread, dx, dy);
|
70
|
-
const outer = inflate(Skia, box, delta.x, delta.y);
|
71
|
-
canvas.drawDRRect(outer, inner, lPaint);
|
72
|
-
canvas.restore();
|
73
|
-
});
|
74
|
-
};
|
75
19
|
export const drawImage = (ctx, props) => {
|
76
20
|
"worklet";
|
77
21
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["deflate","enumKey","fitRects","inflate","NodeType","processCircle","processColor","processPath","processRect","processRRect","saturate","BlendMode","BlurStyle","ClipOp","FillType","FilterMode","isCubicSampling","isRRect","MipmapMode","PointMode","VertexMode","materialize","drawLine","ctx","props","p1","p2","canvas","x","y","paint","drawOval","rect","Skia","drawBox","children","box","defaultBox","opacity","getAlphaf","RRectXY","shadows","map","node","type","BoxShadow","filter","n","shadow","inner","color","blur","spread","dx","dy","lPaint","Paint","setColor","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","Intersect","outer","drawDRRect","restore","drawImage","image","sampling","_props$fit","fit","src","dst","width","height","drawImageRectCubic","B","C","_sampling$filter","_sampling$mipmap","drawImageRectOptions","Linear","mipmap","None","drawPoints","points","mode","drawVertices","textures","colors","indices","blendMode","vertexMode","Triangles","vertices","MakeVertices","c","undefined","defaultBlendMode","DstOver","SrcOver","blend","drawDiffRect","drawTextPath","path","font","initialOffset","text","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","substring","p","t","getPosTan","adjustedX","adjustedY","push","RSXform","derived","TextBlob","MakeFromRSXform","drawTextBlob","drawText","drawPatch","texture","patch","pos","c2","c1","drawPath","start","trimStart","end","trimEnd","fillType","stroke","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","hasFillType","willMutatePath","pristinePath","copy","setFillType","trim","drawRect","blob","drawGlyphs","glyphs","reduce","acc","glyph","id","positions","drawImageSVG","svg","translate","drawSvg","drawParagraph","paragraph","layout","drawPicture","picture","drawAtlas","sprites","transforms","drawCircle","r","drawFill","_props","drawPaint"],"sources":["Drawing.ts"],"sourcesContent":["import {\n deflate,\n enumKey,\n fitRects,\n inflate,\n NodeType,\n processCircle,\n processColor,\n processPath,\n processRect,\n processRRect,\n} from \"../../../dom/nodes\";\nimport type {\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n CircleProps,\n DiffRectProps,\n DrawingNodeProps,\n GlyphsProps,\n ImageProps,\n ImageSVGProps,\n LineProps,\n OvalProps,\n ParagraphProps,\n PatchProps,\n PathProps,\n PictureProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextBlobProps,\n TextPathProps,\n TextProps,\n VerticesProps,\n} from \"../../../dom/types\";\nimport { saturate } from \"../../../renderer/processors\";\nimport type { SkPoint, SkRSXform } from \"../../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ClipOp,\n FillType,\n FilterMode,\n isCubicSampling,\n isRRect,\n MipmapMode,\n PointMode,\n VertexMode,\n} from \"../../../skia/types\";\nimport type { Node } from \"../../Node\";\nimport { materialize } from \"../../utils\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nexport const drawLine = (ctx: DrawingContext, props: LineProps) => {\n \"worklet\";\n const { p1, p2 } = props;\n ctx.canvas.drawLine(p1.x, p1.y, p2.x, p2.y, ctx.paint);\n};\n\nexport const drawOval = (ctx: DrawingContext, props: OvalProps) => {\n \"worklet\";\n const rect = processRect(ctx.Skia, props);\n ctx.canvas.drawOval(rect, ctx.paint);\n};\n\nexport const drawBox = (\n ctx: DrawingContext,\n props: BoxProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n children: Node<any>[]\n) => {\n \"worklet\";\n const { paint, Skia, canvas } = ctx;\n const { box: defaultBox } = props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox) ? defaultBox : Skia.RRectXY(defaultBox, 0, 0);\n const shadows = children\n .map((node) => {\n if (node.type === NodeType.BoxShadow) {\n return materialize(node.props);\n }\n return null;\n })\n .filter((n): n is BoxShadowProps => n !== null);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = Skia.Paint();\n lPaint.setColor(processColor(Skia, color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(inflate(Skia, box, spread, spread, dx, dy), lPaint);\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = Skia.Paint();\n lPaint.setColor(processColor(Skia, color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(Skia, box, spread, spread, dx, dy);\n const outer = inflate(Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n};\n\nexport const drawImage = (ctx: DrawingContext, props: ImageProps) => {\n \"worklet\";\n const { image, sampling } = props;\n if (image) {\n const fit = props.fit ?? \"contain\";\n const rect = processRect(ctx.Skia, props);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n if (sampling && isCubicSampling(sampling)) {\n ctx.canvas.drawImageRectCubic(\n image,\n src,\n dst,\n sampling.B,\n sampling.C,\n ctx.paint\n );\n } else {\n ctx.canvas.drawImageRectOptions(\n image,\n src,\n dst,\n sampling?.filter ?? FilterMode.Linear,\n sampling?.mipmap ?? MipmapMode.None,\n ctx.paint\n );\n }\n }\n};\n\nexport const drawPoints = (ctx: DrawingContext, props: PointsProps) => {\n \"worklet\";\n const { points, mode } = props;\n ctx.canvas.drawPoints(PointMode[enumKey(mode)], points, ctx.paint);\n};\n\nexport const drawVertices = (ctx: DrawingContext, props: VerticesProps) => {\n \"worklet\";\n const { mode, textures, colors, indices, blendMode } = props;\n const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;\n const vertices = ctx.Skia.MakeVertices(\n vertexMode,\n props.vertices,\n textures,\n colors ? colors.map((c) => processColor(ctx.Skia, c)) : undefined,\n indices\n );\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n\n ctx.canvas.drawVertices(vertices, blend, ctx.paint);\n};\n\nexport const drawDiffRect = (ctx: DrawingContext, props: DiffRectProps) => {\n \"worklet\";\n const { outer, inner } = props;\n ctx.canvas.drawDRRect(outer, inner, ctx.paint);\n};\n\nexport const drawTextPath = (ctx: DrawingContext, props: TextPathProps) => {\n \"worklet\";\n const path = processPath(ctx.Skia, props.path);\n const { font, initialOffset } = props;\n if (font) {\n let { text } = props;\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids);\n const rsx: SkRSXform[] = [];\n const meas = ctx.Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const [p, t] = cont.getPosTan(dist);\n const adjustedX = p.x - (width / 2) * t.x;\n const adjustedY = p.y - (width / 2) * t.y;\n rsx.push(ctx.Skia.RSXform(t.x, t.y, adjustedX, adjustedY));\n dist += width / 2;\n }\n const derived = ctx.Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n ctx.canvas.drawTextBlob(derived, 0, 0, ctx.paint);\n }\n};\n\nexport const drawText = (ctx: DrawingContext, props: TextProps) => {\n \"worklet\";\n const { text, x, y, font } = props;\n if (font != null) {\n ctx.canvas.drawText(text, x, y, ctx.paint, font);\n }\n};\n\nexport const drawPatch = (ctx: DrawingContext, props: PatchProps) => {\n \"worklet\";\n const { texture, blendMode, patch } = props;\n const defaultBlendMode = props.colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n\n const points = [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ];\n const colors = props.colors\n ? props.colors.map((c) => processColor(ctx.Skia, c))\n : undefined;\n ctx.canvas.drawPatch(points, colors, texture, mode, ctx.paint);\n};\n\nexport const drawPath = (ctx: DrawingContext, props: PathProps) => {\n \"worklet\";\n const {\n start: trimStart,\n end: trimEnd,\n fillType,\n stroke,\n ...pathProps\n } = props;\n const start = saturate(trimStart);\n const end = saturate(trimEnd);\n const hasStartOffset = start !== 0;\n const hasEndOffset = end !== 1;\n const hasStrokeOptions = stroke !== undefined;\n const hasFillType = !!fillType;\n const willMutatePath =\n hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;\n const pristinePath = processPath(ctx.Skia, pathProps.path);\n const path = willMutatePath ? pristinePath.copy() : pristinePath;\n if (hasFillType) {\n path.setFillType(FillType[enumKey(fillType)]);\n }\n if (hasStrokeOptions) {\n path.stroke(stroke);\n }\n if (hasStartOffset || hasEndOffset) {\n path.trim(start, end, false);\n }\n ctx.canvas.drawPath(path, ctx.paint);\n};\n\nexport const drawRect = (ctx: DrawingContext, props: RectProps) => {\n \"worklet\";\n const derived = processRect(ctx.Skia, props);\n ctx.canvas.drawRect(derived, ctx.paint);\n};\n\nexport const drawRRect = (ctx: DrawingContext, props: RoundedRectProps) => {\n \"worklet\";\n const derived = processRRect(ctx.Skia, props);\n ctx.canvas.drawRRect(derived, ctx.paint);\n};\n\nexport const drawTextBlob = (ctx: DrawingContext, props: TextBlobProps) => {\n \"worklet\";\n const { blob, x, y } = props;\n ctx.canvas.drawTextBlob(blob, x, y, ctx.paint);\n};\n\ninterface ProcessedGlyphs {\n glyphs: number[];\n positions: SkPoint[];\n}\n\nexport const drawGlyphs = (ctx: DrawingContext, props: GlyphsProps) => {\n \"worklet\";\n const derived = props.glyphs.reduce<ProcessedGlyphs>(\n (acc, glyph) => {\n const { id, pos } = glyph;\n acc.glyphs.push(id);\n acc.positions.push(pos);\n return acc;\n },\n { glyphs: [], positions: [] }\n );\n const { glyphs, positions } = derived;\n const { x, y, font } = props;\n if (font) {\n ctx.canvas.drawGlyphs(glyphs, positions, x, y, font, ctx.paint);\n }\n};\n\nexport const drawImageSVG = (ctx: DrawingContext, props: ImageSVGProps) => {\n \"worklet\";\n const { canvas } = ctx;\n const { svg } = props;\n const { x, y, width, height } = props.rect\n ? props.rect\n : { x: props.x, y: props.y, width: props.width, height: props.height };\n if (svg === null) {\n return;\n }\n canvas.save();\n if (x && y) {\n canvas.translate(x, y);\n }\n canvas.drawSvg(svg, width, height);\n canvas.restore();\n};\n\nexport const drawParagraph = (ctx: DrawingContext, props: ParagraphProps) => {\n \"worklet\";\n const { paragraph, x, y, width } = props;\n if (paragraph) {\n paragraph.layout(width);\n paragraph.paint(ctx.canvas, x, y);\n }\n};\n\nexport const drawPicture = (ctx: DrawingContext, props: PictureProps) => {\n \"worklet\";\n const { picture } = props;\n ctx.canvas.drawPicture(picture);\n};\n\nexport const drawAtlas = (ctx: DrawingContext, props: AtlasProps) => {\n \"worklet\";\n const { image, sprites, transforms, colors, blendMode, sampling } = props;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;\n if (image) {\n ctx.canvas.drawAtlas(\n image,\n sprites,\n transforms,\n ctx.paint,\n blend,\n colors,\n sampling\n );\n }\n};\n\nexport const drawCircle = (ctx: DrawingContext, props: CircleProps) => {\n \"worklet\";\n const { c } = processCircle(props);\n const { r } = props;\n ctx.canvas.drawCircle(c.x, c.y, r, ctx.paint);\n};\n\nexport const drawFill = (ctx: DrawingContext, _props: DrawingNodeProps) => {\n \"worklet\";\n ctx.canvas.drawPaint(ctx.paint);\n};\n"],"mappings":"AAAA,SACEA,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,YAAY,QACP,oBAAoB;AAyB3B,SAASC,QAAQ,QAAQ,8BAA8B;AAEvD,SACEC,SAAS,EACTC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,UAAU,EACVC,eAAe,EACfC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,UAAU,QACL,qBAAqB;AAE5B,SAASC,WAAW,QAAQ,aAAa;AAGzC,OAAO,MAAMC,QAAQ,GAAGA,CAACC,GAAmB,EAAEC,KAAgB,KAAK;EACjE,SAAS;;EACT,MAAM;IAAEC,EAAE;IAAEC;EAAG,CAAC,GAAGF,KAAK;EACxBD,GAAG,CAACI,MAAM,CAACL,QAAQ,CAACG,EAAE,CAACG,CAAC,EAAEH,EAAE,CAACI,CAAC,EAAEH,EAAE,CAACE,CAAC,EAAEF,EAAE,CAACG,CAAC,EAAEN,GAAG,CAACO,KAAK,CAAC;AACxD,CAAC;AAED,OAAO,MAAMC,QAAQ,GAAGA,CAACR,GAAmB,EAAEC,KAAgB,KAAK;EACjE,SAAS;;EACT,MAAMQ,IAAI,GAAGxB,WAAW,CAACe,GAAG,CAACU,IAAI,EAAET,KAAK,CAAC;EACzCD,GAAG,CAACI,MAAM,CAACI,QAAQ,CAACC,IAAI,EAAET,GAAG,CAACO,KAAK,CAAC;AACtC,CA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ACF,CAAC;EACH;AACF,CAAC;AAED,OAAO,MAAM6G,UAAU,GAAGA,CAAClK,GAAmB,EAAEC,KAAkB,KAAK;EACrE,SAAS;;EACT,MAAM;IAAEgF;EAAE,CAAC,GAAGnG,aAAa,CAACmB,KAAK,CAAC;EAClC,MAAM;IAAEkK;EAAE,CAAC,GAAGlK,KAAK;EACnBD,GAAG,CAACI,MAAM,CAAC8J,UAAU,CAACjF,CAAC,CAAC5E,CAAC,EAAE4E,CAAC,CAAC3E,CAAC,EAAE6J,CAAC,EAAEnK,GAAG,CAACO,KAAK,CAAC;AAC/C,CAAC;AAED,OAAO,MAAM6J,QAAQ,GAAGA,CAACpK,GAAmB,EAAEqK,MAAwB,KAAK;EACzE,SAAS;;EACTrK,GAAG,CAACI,MAAM,CAACkK,SAAS,CAACtK,GAAG,CAACO,KAAK,CAAC;AACjC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["enumKey","fitRects","processCircle","processColor","processPath","processRect","processRRect","saturate","BlendMode","FillType","FilterMode","isCubicSampling","MipmapMode","PointMode","VertexMode","drawLine","ctx","props","p1","p2","canvas","x","y","paint","drawOval","rect","Skia","drawImage","image","sampling","_props$fit","fit","src","dst","width","height","drawImageRectCubic","B","C","_sampling$filter","_sampling$mipmap","drawImageRectOptions","filter","Linear","mipmap","None","drawPoints","points","mode","drawVertices","textures","colors","indices","blendMode","vertexMode","Triangles","vertices","MakeVertices","map","c","undefined","defaultBlendMode","DstOver","SrcOver","blend","drawDiffRect","outer","inner","drawDRRect","drawTextPath","path","font","initialOffset","text","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","substring","p","t","getPosTan","adjustedX","adjustedY","push","RSXform","derived","TextBlob","MakeFromRSXform","drawTextBlob","drawText","drawPatch","texture","patch","pos","c2","c1","drawPath","start","trimStart","end","trimEnd","fillType","stroke","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","hasFillType","willMutatePath","pristinePath","copy","setFillType","trim","drawRect","drawRRect","blob","drawGlyphs","glyphs","reduce","acc","glyph","id","positions","drawImageSVG","svg","save","translate","drawSvg","restore","drawParagraph","paragraph","layout","drawPicture","picture","drawAtlas","sprites","transforms","drawCircle","r","drawFill","_props","drawPaint"],"sources":["Drawing.ts"],"sourcesContent":["import {\n enumKey,\n fitRects,\n processCircle,\n processColor,\n processPath,\n processRect,\n processRRect,\n} from \"../../../dom/nodes\";\nimport type {\n AtlasProps,\n CircleProps,\n DiffRectProps,\n DrawingNodeProps,\n GlyphsProps,\n ImageProps,\n ImageSVGProps,\n LineProps,\n OvalProps,\n ParagraphProps,\n PatchProps,\n PathProps,\n PictureProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextBlobProps,\n TextPathProps,\n TextProps,\n VerticesProps,\n} from \"../../../dom/types\";\nimport { saturate } from \"../../../renderer/processors\";\nimport type { SkPoint, SkRSXform } from \"../../../skia/types\";\nimport {\n BlendMode,\n FillType,\n FilterMode,\n isCubicSampling,\n MipmapMode,\n PointMode,\n VertexMode,\n} from \"../../../skia/types\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nexport const drawLine = (ctx: DrawingContext, props: LineProps) => {\n \"worklet\";\n const { p1, p2 } = props;\n ctx.canvas.drawLine(p1.x, p1.y, p2.x, p2.y, ctx.paint);\n};\n\nexport const drawOval = (ctx: DrawingContext, props: OvalProps) => {\n \"worklet\";\n const rect = processRect(ctx.Skia, props);\n ctx.canvas.drawOval(rect, ctx.paint);\n};\n\nexport const drawImage = (ctx: DrawingContext, props: ImageProps) => {\n \"worklet\";\n const { image, sampling } = props;\n if (image) {\n const fit = props.fit ?? \"contain\";\n const rect = processRect(ctx.Skia, props);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n if (sampling && isCubicSampling(sampling)) {\n ctx.canvas.drawImageRectCubic(\n image,\n src,\n dst,\n sampling.B,\n sampling.C,\n ctx.paint\n );\n } else {\n ctx.canvas.drawImageRectOptions(\n image,\n src,\n dst,\n sampling?.filter ?? FilterMode.Linear,\n sampling?.mipmap ?? MipmapMode.None,\n ctx.paint\n );\n }\n }\n};\n\nexport const drawPoints = (ctx: DrawingContext, props: PointsProps) => {\n \"worklet\";\n const { points, mode } = props;\n ctx.canvas.drawPoints(PointMode[enumKey(mode)], points, ctx.paint);\n};\n\nexport const drawVertices = (ctx: DrawingContext, props: VerticesProps) => {\n \"worklet\";\n const { mode, textures, colors, indices, blendMode } = props;\n const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;\n const vertices = ctx.Skia.MakeVertices(\n vertexMode,\n props.vertices,\n textures,\n colors ? colors.map((c) => processColor(ctx.Skia, c)) : undefined,\n indices\n );\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n\n ctx.canvas.drawVertices(vertices, blend, ctx.paint);\n};\n\nexport const drawDiffRect = (ctx: DrawingContext, props: DiffRectProps) => {\n \"worklet\";\n const { outer, inner } = props;\n ctx.canvas.drawDRRect(outer, inner, ctx.paint);\n};\n\nexport const drawTextPath = (ctx: DrawingContext, props: TextPathProps) => {\n \"worklet\";\n const path = processPath(ctx.Skia, props.path);\n const { font, initialOffset } = props;\n if (font) {\n let { text } = props;\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids);\n const rsx: SkRSXform[] = [];\n const meas = ctx.Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const [p, t] = cont.getPosTan(dist);\n const adjustedX = p.x - (width / 2) * t.x;\n const adjustedY = p.y - (width / 2) * t.y;\n rsx.push(ctx.Skia.RSXform(t.x, t.y, adjustedX, adjustedY));\n dist += width / 2;\n }\n const derived = ctx.Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n ctx.canvas.drawTextBlob(derived, 0, 0, ctx.paint);\n }\n};\n\nexport const drawText = (ctx: DrawingContext, props: TextProps) => {\n \"worklet\";\n const { text, x, y, font } = props;\n if (font != null) {\n ctx.canvas.drawText(text, x, y, ctx.paint, font);\n }\n};\n\nexport const drawPatch = (ctx: DrawingContext, props: PatchProps) => {\n \"worklet\";\n const { texture, blendMode, patch } = props;\n const defaultBlendMode = props.colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n\n const points = [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ];\n const colors = props.colors\n ? props.colors.map((c) => processColor(ctx.Skia, c))\n : undefined;\n ctx.canvas.drawPatch(points, colors, texture, mode, ctx.paint);\n};\n\nexport const drawPath = (ctx: DrawingContext, props: PathProps) => {\n \"worklet\";\n const {\n start: trimStart,\n end: trimEnd,\n fillType,\n stroke,\n ...pathProps\n } = props;\n const start = saturate(trimStart);\n const end = saturate(trimEnd);\n const hasStartOffset = start !== 0;\n const hasEndOffset = end !== 1;\n const hasStrokeOptions = stroke !== undefined;\n const hasFillType = !!fillType;\n const willMutatePath =\n hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;\n const pristinePath = processPath(ctx.Skia, pathProps.path);\n const path = willMutatePath ? pristinePath.copy() : pristinePath;\n if (hasFillType) {\n path.setFillType(FillType[enumKey(fillType)]);\n }\n if (hasStrokeOptions) {\n path.stroke(stroke);\n }\n if (hasStartOffset || hasEndOffset) {\n path.trim(start, end, false);\n }\n ctx.canvas.drawPath(path, ctx.paint);\n};\n\nexport const drawRect = (ctx: DrawingContext, props: RectProps) => {\n \"worklet\";\n const derived = processRect(ctx.Skia, props);\n ctx.canvas.drawRect(derived, ctx.paint);\n};\n\nexport const drawRRect = (ctx: DrawingContext, props: RoundedRectProps) => {\n \"worklet\";\n const derived = processRRect(ctx.Skia, props);\n ctx.canvas.drawRRect(derived, ctx.paint);\n};\n\nexport const drawTextBlob = (ctx: DrawingContext, props: TextBlobProps) => {\n \"worklet\";\n const { blob, x, y } = props;\n ctx.canvas.drawTextBlob(blob, x, y, ctx.paint);\n};\n\ninterface ProcessedGlyphs {\n glyphs: number[];\n positions: SkPoint[];\n}\n\nexport const drawGlyphs = (ctx: DrawingContext, props: GlyphsProps) => {\n \"worklet\";\n const derived = props.glyphs.reduce<ProcessedGlyphs>(\n (acc, glyph) => {\n const { id, pos } = glyph;\n acc.glyphs.push(id);\n acc.positions.push(pos);\n return acc;\n },\n { glyphs: [], positions: [] }\n );\n const { glyphs, positions } = derived;\n const { x, y, font } = props;\n if (font) {\n ctx.canvas.drawGlyphs(glyphs, positions, x, y, font, ctx.paint);\n }\n};\n\nexport const drawImageSVG = (ctx: DrawingContext, props: ImageSVGProps) => {\n \"worklet\";\n const { canvas } = ctx;\n const { svg } = props;\n const { x, y, width, height } = props.rect\n ? props.rect\n : { x: props.x, y: props.y, width: props.width, height: props.height };\n if (svg === null) {\n return;\n }\n canvas.save();\n if (x && y) {\n canvas.translate(x, y);\n }\n canvas.drawSvg(svg, width, height);\n canvas.restore();\n};\n\nexport const drawParagraph = (ctx: DrawingContext, props: ParagraphProps) => {\n \"worklet\";\n const { paragraph, x, y, width } = props;\n if (paragraph) {\n paragraph.layout(width);\n paragraph.paint(ctx.canvas, x, y);\n }\n};\n\nexport const drawPicture = (ctx: DrawingContext, props: PictureProps) => {\n \"worklet\";\n const { picture } = props;\n ctx.canvas.drawPicture(picture);\n};\n\nexport const drawAtlas = (ctx: DrawingContext, props: AtlasProps) => {\n \"worklet\";\n const { image, sprites, transforms, colors, blendMode, sampling } = props;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;\n if (image) {\n ctx.canvas.drawAtlas(\n image,\n sprites,\n transforms,\n ctx.paint,\n blend,\n colors,\n sampling\n );\n }\n};\n\nexport const drawCircle = (ctx: DrawingContext, props: CircleProps) => {\n \"worklet\";\n const { c } = processCircle(props);\n const { r } = props;\n ctx.canvas.drawCircle(c.x, c.y, r, ctx.paint);\n};\n\nexport const drawFill = (ctx: DrawingContext, _props: DrawingNodeProps) => {\n \"worklet\";\n ctx.canvas.drawPaint(ctx.paint);\n};\n"],"mappings":"AAAA,SACEA,OAAO,EACPC,QAAQ,EACRC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,YAAY,QACP,oBAAoB;AAuB3B,SAASC,QAAQ,QAAQ,8BAA8B;AAEvD,SACEC,SAAS,EACTC,QAAQ,EACRC,UAAU,EACVC,eAAe,EACfC,UAAU,EACVC,SAAS,EACTC,UAAU,QACL,qBAAqB;AAG5B,OAAO,MAAMC,QAAQ,GAAGA,CAACC,GAAmB,EAAEC,KAAgB,KAAK;EACjE,SAAS;;EACT,MAAM;IAAEC,EAAE;IAAEC;EAAG,CAAC,GAAGF,KAAK;EACxBD,GAAG,CAACI,MAAM,CAACL,QAAQ,CAACG,EAAE,CAACG,CAAC,EAAEH,EAAE,CAACI,CAAC,EAAEH,EAAE,CAACE,CAAC,EAAEF,EAAE,CAACG,CAAC,EAAEN,GAAG,CAACO,KAAK,CAAC;AACxD,CAAC;AAED,OAAO,MAAMC,QAAQ,GAAGA,CAACR,GAAmB,EAAEC,KAAgB,KAAK;EACjE,SAAS;;EACT,MAAMQ,IAAI,GAAGpB,WAAW,CAACW,GAAG,CAACU,IAAI,EAAET,KAAK,CAAC;EACzCD,GAAG,CAACI,MAAM,CAACI,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C/C,CAAC;AAED,OAAO,MAAM6H,QAAQ,GAAGA,CAACpI,GAAmB,EAAEqI,MAAwB,KAAK;EACzE,SAAS;;EACTrI,GAAG,CAACI,MAAM,CAACkI,SAAS,CAACtI,GAAG,CAACO,KAAK,CAAC;AACjC,CAAC","ignoreList":[]}
|
@@ -1,7 +1,9 @@
|
|
1
|
+
import type { SkPicture } from "../skia/types";
|
1
2
|
import type { ISkiaViewApi } from "../views/types";
|
2
3
|
import type { SkiaPictureView } from "../views/SkiaPictureView.web";
|
3
4
|
export type ISkiaViewApiWeb = ISkiaViewApi & {
|
4
5
|
views: Record<string, SkiaPictureView>;
|
6
|
+
deferedPictures: Record<string, SkPicture>;
|
5
7
|
registerView(nativeId: string, view: SkiaPictureView): void;
|
6
8
|
};
|
7
9
|
declare const _default: {};
|
@@ -2,14 +2,23 @@
|
|
2
2
|
|
3
3
|
global.SkiaViewApi = {
|
4
4
|
views: {},
|
5
|
+
deferedPictures: {},
|
5
6
|
web: true,
|
6
7
|
registerView(nativeId, view) {
|
8
|
+
// Maybe a picture for this view was already set
|
9
|
+
if (this.deferedPictures[nativeId]) {
|
10
|
+
view.setPicture(this.deferedPictures[nativeId]);
|
11
|
+
}
|
7
12
|
this.views[nativeId] = view;
|
8
13
|
},
|
9
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
10
15
|
setJsiProperty(nativeId, name, value) {
|
11
16
|
if (name === "picture") {
|
12
|
-
this.views[`${nativeId}`]
|
17
|
+
if (!this.views[`${nativeId}`]) {
|
18
|
+
this.deferedPictures[`${nativeId}`] = value;
|
19
|
+
} else {
|
20
|
+
this.views[`${nativeId}`].setPicture(value);
|
21
|
+
}
|
13
22
|
}
|
14
23
|
},
|
15
24
|
requestRedraw(nativeId) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["global","SkiaViewApi","views","web","registerView","nativeId","view","setJsiProperty","name","value","
|
1
|
+
{"version":3,"names":["global","SkiaViewApi","views","deferedPictures","web","registerView","nativeId","view","setPicture","setJsiProperty","name","value","requestRedraw","redraw","makeImageSnapshot","rect","makeImageSnapshotAsync","Promise","resolve","reject","result","Error"],"sources":["NativeSkiaModule.web.ts"],"sourcesContent":["/* eslint-disable import/no-anonymous-default-export */\nimport type { SkPicture, SkRect } from \"../skia/types\";\nimport type { ISkiaViewApi } from \"../views/types\";\nimport type { SkiaPictureView } from \"../views/SkiaPictureView.web\";\n\nexport type ISkiaViewApiWeb = ISkiaViewApi & {\n views: Record<string, SkiaPictureView>;\n deferedPictures: Record<string, SkPicture>;\n registerView(nativeId: string, view: SkiaPictureView): void;\n};\n\nglobal.SkiaViewApi = {\n views: {},\n deferedPictures: {},\n web: true,\n registerView(nativeId: string, view: SkiaPictureView) {\n // Maybe a picture for this view was already set\n if (this.deferedPictures[nativeId]) {\n view.setPicture(this.deferedPictures[nativeId] as SkPicture);\n }\n this.views[nativeId] = view;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setJsiProperty(nativeId: number, name: string, value: any) {\n if (name === \"picture\") {\n if (!this.views[`${nativeId}`]) {\n this.deferedPictures[`${nativeId}`] = value;\n } else {\n this.views[`${nativeId}`].setPicture(value);\n }\n }\n },\n requestRedraw(nativeId: number) {\n this.views[`${nativeId}`].redraw();\n },\n makeImageSnapshot(nativeId: number, rect?: SkRect) {\n return this.views[`${nativeId}`].makeImageSnapshot(rect);\n },\n makeImageSnapshotAsync(nativeId: number, rect?: SkRect) {\n return new Promise((resolve, reject) => {\n const result = this.views[`${nativeId}`].makeImageSnapshot(rect);\n if (result) {\n resolve(result);\n } else {\n reject(new Error(\"Failed to make image snapshot\"));\n }\n });\n },\n} as ISkiaViewApiWeb;\n\n// eslint-disable-next-line import/no-default-export\nexport default {};\n"],"mappings":"AAAA;;AAWAA,MAAM,CAACC,WAAW,GAAG;EACnBC,KAAK,EAAE,CAAC,CAAC;EACTC,eAAe,EAAE,CAAC,CAAC;EACnBC,GAAG,EAAE,IAAI;EACTC,YAAYA,CAACC,QAA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,CAAC,CAAC;MACpD;IACF,CAAC,CAAC;EACJ;AACF,CAAoB;;AAEpB;AACA,eAAe,CAAC,CAAC","ignoreList":[]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
2
|
export function Mock(CanvasKit: any): {
|
3
|
-
Canvas: ()
|
3
|
+
Canvas: typeof import("react-native").View;
|
4
4
|
useValue: () => {
|
5
5
|
current: number;
|
6
6
|
};
|
@@ -59,5 +59,5 @@ export function Mock(CanvasKit: any): {
|
|
59
59
|
useSVG: () => null;
|
60
60
|
useVideo: () => null;
|
61
61
|
readonly __esModule: boolean;
|
62
|
-
readonly Skia: import("../../../src/
|
62
|
+
readonly Skia: import("../../../src/headless").Skia;
|
63
63
|
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
|
-
export const Skia: import("../../../src/
|
2
|
+
export const Skia: import("../../../src/headless").Skia;
|
@@ -1,7 +1,5 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
|
-
export
|
3
|
-
constructor(msg: any);
|
4
|
-
}
|
2
|
+
export function throwNotImplementedOnRNWeb(): jest.Mock<any, any, any>;
|
5
3
|
export class Host {
|
6
4
|
constructor(CanvasKit: any);
|
7
5
|
CanvasKit: any;
|
@@ -14,5 +12,5 @@ export class BaseHostObject extends Host {
|
|
14
12
|
export class HostObject extends BaseHostObject {
|
15
13
|
static fromValue(value: any): any;
|
16
14
|
}
|
17
|
-
export function getEnum(
|
18
|
-
export function optEnum(
|
15
|
+
export function getEnum(CanvasKit: any, name: any, v: any): any;
|
16
|
+
export function optEnum(CanvasKit: any, name: any, v: any): any;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
2
|
export class JsiSkFont extends _Host.HostObject {
|
3
3
|
constructor(CanvasKit: any, ref: any);
|
4
|
-
measureText(_text: any, _paint: any):
|
4
|
+
measureText(_text: any, _paint: any): jest.Mock<any, any, any>;
|
5
5
|
getTextWidth(text: any, paint: any): any;
|
6
6
|
getMetrics(): {
|
7
7
|
ascent: any;
|
@@ -4,6 +4,6 @@ export class JsiSkFontMgr extends _Host.HostObject {
|
|
4
4
|
dispose(): void;
|
5
5
|
countFamilies(): any;
|
6
6
|
getFamilyName(index: any): any;
|
7
|
-
matchFamilyStyle(_familyName: any, _fontStyle: any):
|
7
|
+
matchFamilyStyle(_familyName: any, _fontStyle: any): jest.Mock<any, any, any>;
|
8
8
|
}
|
9
9
|
import _Host = require("./Host");
|
@@ -3,7 +3,7 @@ export class JsiSkImageFactory extends _Host.Host {
|
|
3
3
|
MakeImageFromViewTag(viewTag: any): Promise<null>;
|
4
4
|
MakeImageFromNativeBuffer(buffer: any, surface: any, image: any): _JsiSkImage.JsiSkImage;
|
5
5
|
MakeImageFromEncoded(encoded: any): _JsiSkImage.JsiSkImage | null;
|
6
|
-
MakeImageFromNativeTextureUnstable():
|
6
|
+
MakeImageFromNativeTextureUnstable(): jest.Mock<any, any, any>;
|
7
7
|
MakeImage(info: any, data: any, bytesPerRow: any): _JsiSkImage.JsiSkImage | null;
|
8
8
|
}
|
9
9
|
import _Host = require("./Host");
|
@@ -11,7 +11,7 @@ export class JsiSkImageFilterFactory extends _Host.Host {
|
|
11
11
|
MakeErode(rx: any, ry: any, input: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
|
12
12
|
MakeDilate(rx: any, ry: any, input: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
|
13
13
|
MakeBlend(mode: any, background: any, foreground: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
|
14
|
-
MakeRuntimeShader(_builder: any, _childShaderName: any, _input: any):
|
14
|
+
MakeRuntimeShader(_builder: any, _childShaderName: any, _input: any): jest.Mock<any, any, any>;
|
15
15
|
}
|
16
16
|
import _Host = require("./Host");
|
17
17
|
import _JsiSkImageFilter = require("./JsiSkImageFilter");
|
@@ -3,8 +3,8 @@ export class JsiSkPathEffectFactory extends _Host.Host {
|
|
3
3
|
MakeCorner(radius: any): _JsiSkPathEffect.JsiSkPathEffect | null;
|
4
4
|
MakeDash(intervals: any, phase: any): _JsiSkPathEffect.JsiSkPathEffect;
|
5
5
|
MakeDiscrete(segLength: any, dev: any, seedAssist: any): _JsiSkPathEffect.JsiSkPathEffect;
|
6
|
-
MakeCompose(_outer: any, _inner: any):
|
7
|
-
MakeSum(_outer: any, _inner: any):
|
6
|
+
MakeCompose(_outer: any, _inner: any): jest.Mock<any, any, any>;
|
7
|
+
MakeSum(_outer: any, _inner: any): jest.Mock<any, any, any>;
|
8
8
|
MakeLine2D(width: any, matrix: any): _JsiSkPathEffect.JsiSkPathEffect | null;
|
9
9
|
MakePath1D(path: any, advance: any, phase: any, style: any): _JsiSkPathEffect.JsiSkPathEffect | null;
|
10
10
|
MakePath2D(matrix: any, path: any): _JsiSkPathEffect.JsiSkPathEffect | null;
|
@@ -4,7 +4,7 @@ export class JsiSkPathFactory extends _Host.Host {
|
|
4
4
|
MakeFromSVGString(str: any): _JsiSkPath.JsiSkPath | null;
|
5
5
|
MakeFromOp(one: any, two: any, op: any): _JsiSkPath.JsiSkPath | null;
|
6
6
|
MakeFromCmds(cmds: any): _JsiSkPath.JsiSkPath | null;
|
7
|
-
MakeFromText(_text: any, _x: any, _y: any, _font: any):
|
7
|
+
MakeFromText(_text: any, _x: any, _y: any, _font: any): jest.Mock<any, any, any>;
|
8
8
|
}
|
9
9
|
import _Host = require("./Host");
|
10
10
|
import _JsiSkPath = require("./JsiSkPath");
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
2
|
export class JsiSkTypefaceFontProvider extends _Host.HostObject {
|
3
3
|
constructor(CanvasKit: any, ref: any);
|
4
|
-
matchFamilyStyle(_name: any, _style: any):
|
4
|
+
matchFamilyStyle(_name: any, _style: any): jest.Mock<any, any, any>;
|
5
5
|
countFamilies(): any;
|
6
6
|
getFamilyName(index: any): any;
|
7
7
|
registerFont(typeface: any, familyName: any): void;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
2
|
export function JsiSkApi(CanvasKit: any): {
|
3
3
|
Point: (x: any, y: any) => _JsiSkPoint.JsiSkPoint;
|
4
|
-
RuntimeShaderBuilder: (_: any) =>
|
4
|
+
RuntimeShaderBuilder: (_: any) => jest.Mock<any, any, any>;
|
5
5
|
RRectXY: (rect: any, rx: any, ry: any) => _JsiSkRRect.JsiSkRRect;
|
6
6
|
RSXform: (scos: any, ssin: any, tx: any, ty: any) => _JsiSkRSXform.JsiSkRSXform;
|
7
7
|
RSXformFromRadians: (scale: any, r: any, tx: any, ty: any, px: any, py: any) => _JsiSkRSXform.JsiSkRSXform;
|
@@ -33,8 +33,8 @@ export function JsiSkApi(CanvasKit: any): {
|
|
33
33
|
ParagraphBuilder: _JsiSkParagraphBuilderFactory.JsiSkParagraphBuilderFactory;
|
34
34
|
NativeBuffer: _JsiSkNativeBufferFactory.JsiSkNativeBufferFactory;
|
35
35
|
Video: (url?: any) => Promise<any>;
|
36
|
-
Context: (_surface: any, _width: any, _height: any) =>
|
37
|
-
Recorder: () =>
|
36
|
+
Context: (_surface: any, _width: any, _height: any) => jest.Mock<any, any, any>;
|
37
|
+
Recorder: () => jest.Mock<any, any, any>;
|
38
38
|
};
|
39
39
|
import _JsiSkPoint = require("./JsiSkPoint");
|
40
40
|
import _JsiSkRRect = require("./JsiSkRRect");
|
@@ -5,7 +5,7 @@ export class JsiVideo {
|
|
5
5
|
ImageFactory: any;
|
6
6
|
videoElement: any;
|
7
7
|
duration(): number;
|
8
|
-
framerate():
|
8
|
+
framerate(): jest.Mock<any, any, any>;
|
9
9
|
setSurface(surface: any): void;
|
10
10
|
webglBuffer: _CanvasKitWebGLBufferImpl.CanvasKitWebGLBufferImpl | undefined;
|
11
11
|
nextImage(): any;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
2
|
export const CommandType: {};
|
3
|
-
export function
|
3
|
+
export function materializeCommand(command: any): any;
|
4
4
|
export function isCommand(command: any, type: any): boolean;
|
5
5
|
export function isGroup(command: any): boolean;
|
6
6
|
export function isDrawCommand(command: any, type: any): boolean;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
2
|
export function drawLine(ctx: any, props: any): void;
|
3
3
|
export function drawOval(ctx: any, props: any): void;
|
4
|
-
export function drawBox(ctx: any, props: any, children: any): void;
|
5
4
|
export function drawImage(ctx: any, props: any): void;
|
6
5
|
export function drawPoints(ctx: any, props: any): void;
|
7
6
|
export function drawVertices(ctx: any, props: any): void;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export function Mock(CanvasKit: any): {
|
2
|
-
Canvas: ()
|
2
|
+
Canvas: typeof import("react-native").View;
|
3
3
|
useValue: () => {
|
4
4
|
current: number;
|
5
5
|
};
|
@@ -147,8 +147,9 @@ export function Mock(CanvasKit: any): {
|
|
147
147
|
x: any;
|
148
148
|
y: any;
|
149
149
|
};
|
150
|
-
interpolatePaths: (value: any, input: any,
|
151
|
-
|
150
|
+
interpolatePaths: (value: any, input: any, // Reanimated hooks
|
151
|
+
outputRange: any, options: any, output: any) => any;
|
152
|
+
Skia: import("../../../src/headless").Skia;
|
152
153
|
loadData: (source: any, factory: any, onError: any) => Promise<any>;
|
153
154
|
useCollectionLoading: (source: any, loader: any) => null;
|
154
155
|
matchFont: (inputStyle?: {}, fontMgr?: import("../../..").SkFontMgr) => import("../../..").SkFont;
|
@@ -193,8 +194,7 @@ export function Mock(CanvasKit: any): {
|
|
193
194
|
B: number;
|
194
195
|
C: number;
|
195
196
|
};
|
196
|
-
MakeCubic: (B: any,
|
197
|
-
C: any) => {
|
197
|
+
MakeCubic: (B: any, C: any) => {
|
198
198
|
B: any;
|
199
199
|
C: any;
|
200
200
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export const Skia: {
|
2
2
|
Point: (x: any, y: any) => import("./web/JsiSkPoint").JsiSkPoint;
|
3
|
-
RuntimeShaderBuilder: (_: any) =>
|
3
|
+
RuntimeShaderBuilder: (_: any) => jest.Mock<any, any, any>;
|
4
4
|
RRectXY: (rect: any, rx: any, ry: any) => import("./web/JsiSkRRect").JsiSkRRect;
|
5
5
|
RSXform: (scos: any, ssin: any, tx: any, ty: any) => import("./web/JsiSkRSXform").JsiSkRSXform;
|
6
6
|
RSXformFromRadians: (scale: any, r: any, tx: any, ty: any, px: any, py: any) => import("./web/JsiSkRSXform").JsiSkRSXform;
|
@@ -32,6 +32,6 @@ export const Skia: {
|
|
32
32
|
ParagraphBuilder: import("./web/JsiSkParagraphBuilderFactory").JsiSkParagraphBuilderFactory;
|
33
33
|
NativeBuffer: import("./web/JsiSkNativeBufferFactory").JsiSkNativeBufferFactory;
|
34
34
|
Video: (url?: any) => Promise<any>;
|
35
|
-
Context: (_surface: any, _width: any, _height: any) =>
|
36
|
-
Recorder: () =>
|
35
|
+
Context: (_surface: any, _width: any, _height: any) => jest.Mock<any, any, any>;
|
36
|
+
Recorder: () => jest.Mock<any, any, any>;
|
37
37
|
};
|
@@ -1,6 +1,4 @@
|
|
1
|
-
export
|
2
|
-
constructor(msg: any);
|
3
|
-
}
|
1
|
+
export function throwNotImplementedOnRNWeb(): jest.Mock<any, any, any>;
|
4
2
|
export class Host {
|
5
3
|
constructor(CanvasKit: any);
|
6
4
|
CanvasKit: any;
|
@@ -13,5 +11,5 @@ export class BaseHostObject extends Host {
|
|
13
11
|
export class HostObject extends BaseHostObject {
|
14
12
|
static fromValue(value: any): any;
|
15
13
|
}
|
16
|
-
export function getEnum(
|
17
|
-
export function optEnum(
|
14
|
+
export function getEnum(CanvasKit: any, name: any, v: any): any;
|
15
|
+
export function optEnum(CanvasKit: any, name: any, v: any): any;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export class JsiSkFont extends HostObject {
|
2
2
|
constructor(CanvasKit: any, ref: any);
|
3
|
-
measureText(_text: any, _paint: any):
|
3
|
+
measureText(_text: any, _paint: any): jest.Mock<any, any, any>;
|
4
4
|
getTextWidth(text: any, paint: any): any;
|
5
5
|
getMetrics(): {
|
6
6
|
ascent: any;
|
@@ -3,6 +3,6 @@ export class JsiSkFontMgr extends HostObject {
|
|
3
3
|
dispose(): void;
|
4
4
|
countFamilies(): any;
|
5
5
|
getFamilyName(index: any): any;
|
6
|
-
matchFamilyStyle(_familyName: any, _fontStyle: any):
|
6
|
+
matchFamilyStyle(_familyName: any, _fontStyle: any): jest.Mock<any, any, any>;
|
7
7
|
}
|
8
8
|
import { HostObject } from "./Host";
|
@@ -2,7 +2,7 @@ export class JsiSkImageFactory extends Host {
|
|
2
2
|
MakeImageFromViewTag(viewTag: any): Promise<null>;
|
3
3
|
MakeImageFromNativeBuffer(buffer: any, surface: any, image: any): JsiSkImage;
|
4
4
|
MakeImageFromEncoded(encoded: any): JsiSkImage | null;
|
5
|
-
MakeImageFromNativeTextureUnstable():
|
5
|
+
MakeImageFromNativeTextureUnstable(): jest.Mock<any, any, any>;
|
6
6
|
MakeImage(info: any, data: any, bytesPerRow: any): JsiSkImage | null;
|
7
7
|
}
|
8
8
|
import { Host } from "./Host";
|
@@ -10,7 +10,7 @@ export class JsiSkImageFilterFactory extends Host {
|
|
10
10
|
MakeErode(rx: any, ry: any, input: any, cropRect: any): JsiSkImageFilter;
|
11
11
|
MakeDilate(rx: any, ry: any, input: any, cropRect: any): JsiSkImageFilter;
|
12
12
|
MakeBlend(mode: any, background: any, foreground: any, cropRect: any): JsiSkImageFilter;
|
13
|
-
MakeRuntimeShader(_builder: any, _childShaderName: any, _input: any):
|
13
|
+
MakeRuntimeShader(_builder: any, _childShaderName: any, _input: any): jest.Mock<any, any, any>;
|
14
14
|
}
|
15
15
|
import { Host } from "./Host";
|
16
16
|
import { JsiSkImageFilter } from "./JsiSkImageFilter";
|
@@ -2,8 +2,8 @@ export class JsiSkPathEffectFactory extends Host {
|
|
2
2
|
MakeCorner(radius: any): JsiSkPathEffect | null;
|
3
3
|
MakeDash(intervals: any, phase: any): JsiSkPathEffect;
|
4
4
|
MakeDiscrete(segLength: any, dev: any, seedAssist: any): JsiSkPathEffect;
|
5
|
-
MakeCompose(_outer: any, _inner: any):
|
6
|
-
MakeSum(_outer: any, _inner: any):
|
5
|
+
MakeCompose(_outer: any, _inner: any): jest.Mock<any, any, any>;
|
6
|
+
MakeSum(_outer: any, _inner: any): jest.Mock<any, any, any>;
|
7
7
|
MakeLine2D(width: any, matrix: any): JsiSkPathEffect | null;
|
8
8
|
MakePath1D(path: any, advance: any, phase: any, style: any): JsiSkPathEffect | null;
|
9
9
|
MakePath2D(matrix: any, path: any): JsiSkPathEffect | null;
|
@@ -3,7 +3,7 @@ export class JsiSkPathFactory extends Host {
|
|
3
3
|
MakeFromSVGString(str: any): JsiSkPath | null;
|
4
4
|
MakeFromOp(one: any, two: any, op: any): JsiSkPath | null;
|
5
5
|
MakeFromCmds(cmds: any): JsiSkPath | null;
|
6
|
-
MakeFromText(_text: any, _x: any, _y: any, _font: any):
|
6
|
+
MakeFromText(_text: any, _x: any, _y: any, _font: any): jest.Mock<any, any, any>;
|
7
7
|
}
|
8
8
|
import { Host } from "./Host";
|
9
9
|
import { JsiSkPath } from "./JsiSkPath";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export class JsiSkTypefaceFontProvider extends HostObject {
|
2
2
|
constructor(CanvasKit: any, ref: any);
|
3
|
-
matchFamilyStyle(_name: any, _style: any):
|
3
|
+
matchFamilyStyle(_name: any, _style: any): jest.Mock<any, any, any>;
|
4
4
|
countFamilies(): any;
|
5
5
|
getFamilyName(index: any): any;
|
6
6
|
registerFont(typeface: any, familyName: any): void;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export function JsiSkApi(CanvasKit: any): {
|
2
2
|
Point: (x: any, y: any) => JsiSkPoint;
|
3
|
-
RuntimeShaderBuilder: (_: any) =>
|
3
|
+
RuntimeShaderBuilder: (_: any) => jest.Mock<any, any, any>;
|
4
4
|
RRectXY: (rect: any, rx: any, ry: any) => JsiSkRRect;
|
5
5
|
RSXform: (scos: any, ssin: any, tx: any, ty: any) => JsiSkRSXform;
|
6
6
|
RSXformFromRadians: (scale: any, r: any, tx: any, ty: any, px: any, py: any) => JsiSkRSXform;
|
@@ -32,8 +32,8 @@ export function JsiSkApi(CanvasKit: any): {
|
|
32
32
|
ParagraphBuilder: JsiSkParagraphBuilderFactory;
|
33
33
|
NativeBuffer: JsiSkNativeBufferFactory;
|
34
34
|
Video: (url?: any) => Promise<any>;
|
35
|
-
Context: (_surface: any, _width: any, _height: any) =>
|
36
|
-
Recorder: () =>
|
35
|
+
Context: (_surface: any, _width: any, _height: any) => jest.Mock<any, any, any>;
|
36
|
+
Recorder: () => jest.Mock<any, any, any>;
|
37
37
|
};
|
38
38
|
import { JsiSkPoint } from "./JsiSkPoint";
|
39
39
|
import { JsiSkRRect } from "./JsiSkRRect";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export let CommandType: {};
|
2
|
-
export function
|
2
|
+
export function materializeCommand(command: any): any;
|
3
3
|
export function isCommand(command: any, type: any): boolean;
|
4
4
|
export function isGroup(command: any): boolean;
|
5
5
|
export function isDrawCommand(command: any, type: any): boolean;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
export function drawLine(ctx: any, props: any): void;
|
2
2
|
export function drawOval(ctx: any, props: any): void;
|
3
|
-
export function drawBox(ctx: any, props: any, children: any): void;
|
4
3
|
export function drawImage(ctx: any, props: any): void;
|
5
4
|
export function drawPoints(ctx: any, props: any): void;
|
6
5
|
export function drawVertices(ctx: any, props: any): void;
|