@shopify/react-native-skia 1.11.8 → 1.11.9-next.1
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/CMakeLists.txt +30 -153
- package/android/build.gradle +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/external/reanimated/textures.js +4 -3
- package/lib/commonjs/external/reanimated/textures.js.map +1 -1
- package/lib/commonjs/headless/index.d.ts +1 -1
- package/lib/commonjs/headless/index.js +2 -2
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +2 -2
- package/lib/commonjs/renderer/Canvas.js +10 -27
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.d.ts +2 -2
- package/lib/commonjs/renderer/Offscreen.js +4 -4
- package/lib/commonjs/renderer/Offscreen.js.map +1 -1
- package/lib/commonjs/renderer/__tests__/setup.d.ts +5 -5
- package/lib/commonjs/sksg/Container.d.ts +3 -1
- package/lib/commonjs/sksg/Container.js +7 -1
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/HostConfig.d.ts +1 -1
- package/lib/commonjs/sksg/HostConfig.js +36 -6
- package/lib/commonjs/sksg/HostConfig.js.map +1 -1
- package/lib/commonjs/sksg/Reconciler.d.ts +3 -2
- package/lib/commonjs/sksg/Reconciler.js +16 -6
- package/lib/commonjs/sksg/Reconciler.js.map +1 -1
- package/lib/module/Platform/Platform.web.js +1 -1
- package/lib/module/Platform/Platform.web.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js +1 -2
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.js +3 -3
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +3 -5
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/external/reanimated/buffers.js +1 -2
- package/lib/module/external/reanimated/buffers.js.map +1 -1
- package/lib/module/external/reanimated/textures.js +5 -4
- package/lib/module/external/reanimated/textures.js.map +1 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.js +1 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/module/external/reanimated/useVideo.js +10 -23
- package/lib/module/external/reanimated/useVideo.js.map +1 -1
- package/lib/module/headless/index.d.ts +1 -1
- package/lib/module/headless/index.js +2 -2
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +2 -2
- package/lib/module/renderer/Canvas.js +9 -27
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Offscreen.d.ts +2 -2
- package/lib/module/renderer/Offscreen.js +4 -4
- package/lib/module/renderer/Offscreen.js.map +1 -1
- package/lib/module/renderer/__tests__/setup.d.ts +5 -5
- package/lib/module/skia/core/Vector.js +1 -1
- package/lib/module/skia/core/Vector.js.map +1 -1
- package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js +1 -4
- package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js.map +1 -1
- package/lib/module/skia/web/Host.js +1 -7
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkAnimatedImage.js +3 -6
- package/lib/module/skia/web/JsiSkAnimatedImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +3 -6
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilter.js +3 -6
- package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js +3 -6
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasureIter.js +3 -6
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.js +3 -6
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +3 -6
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +8 -12
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilter.js +3 -6
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilter.js +3 -6
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js +5 -8
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +3 -6
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilder.js +2 -3
- package/lib/module/skia/web/JsiSkParagraphBuilder.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphStyle.js +15 -15
- package/lib/module/skia/web/JsiSkParagraphStyle.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +3 -6
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffect.js +3 -6
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js +3 -6
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js +3 -6
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.js +3 -6
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.js +3 -6
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.js +3 -6
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.js +3 -6
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +3 -6
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkSVG.js +5 -8
- package/lib/module/skia/web/JsiSkSVG.js.map +1 -1
- package/lib/module/skia/web/JsiSkShader.js +3 -6
- package/lib/module/skia/web/JsiSkShader.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.js +3 -6
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.js +3 -6
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.js +3 -6
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.js +1 -4
- package/lib/module/skia/web/JsiSkTypefaceFontProvider.js.map +1 -1
- package/lib/module/skia/web/JsiSkVertices.js +3 -6
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/module/skia/web/JsiVideo.js +2 -5
- package/lib/module/skia/web/JsiVideo.js.map +1 -1
- package/lib/module/sksg/Container.d.ts +3 -1
- package/lib/module/sksg/Container.js +11 -8
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/HostConfig.d.ts +1 -1
- package/lib/module/sksg/HostConfig.js +36 -7
- package/lib/module/sksg/HostConfig.js.map +1 -1
- package/lib/module/sksg/Reconciler.d.ts +3 -2
- package/lib/module/sksg/Reconciler.js +16 -11
- package/lib/module/sksg/Reconciler.js.map +1 -1
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js +1 -5
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Recorder.js +3 -6
- package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Visitor.js +1 -1
- package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Drawing.js +2 -4
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Shaders.js +2 -3
- package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +9 -12
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaPictureView.js +1 -5
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaPictureView.web.js +1 -4
- package/lib/module/views/SkiaPictureView.web.js.map +1 -1
- package/lib/module/web/LoadSkiaWeb.js +1 -2
- package/lib/module/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/web/WithSkiaWeb.js +1 -1
- package/lib/module/web/WithSkiaWeb.js.map +1 -1
- package/lib/typescript/lib/commonjs/headless/index.d.ts +1 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +9 -1
- package/lib/typescript/lib/commonjs/renderer/Offscreen.d.ts +2 -2
- package/lib/typescript/lib/commonjs/sksg/Container.d.ts +3 -0
- package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +21 -4
- package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +9 -2
- package/lib/typescript/lib/module/headless/index.d.ts +1 -1
- package/lib/typescript/lib/module/renderer/Canvas.d.ts +9 -1
- package/lib/typescript/lib/module/renderer/Offscreen.d.ts +2 -2
- package/lib/typescript/lib/module/skia/web/CanvasKitWebGLBufferImpl.d.ts +2 -2
- package/lib/typescript/lib/module/skia/web/JsiSkAnimatedImage.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkData.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkImage.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkSVG.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkTypeface.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkTypefaceFontProvider.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/typescript/lib/module/skia/web/JsiVideo.d.ts +2 -2
- package/lib/typescript/lib/module/sksg/Container.d.ts +7 -12
- package/lib/typescript/lib/module/sksg/HostConfig.d.ts +20 -4
- package/lib/typescript/lib/module/sksg/Reconciler.d.ts +18 -17
- package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
- package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +5 -2
- package/lib/typescript/lib/module/views/SkiaBaseWebView.d.ts +12 -11
- package/lib/typescript/lib/module/views/SkiaPictureView.d.ts +2 -2
- package/lib/typescript/lib/module/views/SkiaPictureView.web.d.ts +1 -1
- package/lib/typescript/src/headless/index.d.ts +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +2 -2
- package/lib/typescript/src/renderer/Offscreen.d.ts +2 -2
- package/lib/typescript/src/renderer/__tests__/setup.d.ts +5 -5
- package/lib/typescript/src/sksg/Container.d.ts +3 -1
- package/lib/typescript/src/sksg/HostConfig.d.ts +1 -1
- package/lib/typescript/src/sksg/Reconciler.d.ts +3 -2
- package/libs/apple/libskia.xcframework/Info.plist +15 -15
- package/libs/apple/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/macos-arm64_x86_64/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/tvos-arm64_arm64e/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/apple/libskottie.xcframework/Info.plist +8 -8
- package/libs/apple/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/macos-arm64_x86_64/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/tvos-arm64_arm64e/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/apple/libskparagraph.xcframework/Info.plist +7 -7
- package/libs/apple/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/macos-arm64_x86_64/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/tvos-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/apple/libsksg.xcframework/Info.plist +12 -12
- package/libs/apple/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/macos-arm64_x86_64/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/tvos-arm64_arm64e/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/tvos-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/apple/libskshaper.xcframework/Info.plist +14 -14
- package/libs/apple/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/macos-arm64_x86_64/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/tvos-arm64_arm64e/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/Info.plist +14 -14
- package/libs/apple/libskunicode_core.xcframework/ios-arm64_arm64e/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/macos-arm64_x86_64/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/tvos-arm64_arm64e/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +13 -13
- package/libs/apple/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/macos-arm64_x86_64/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/tvos-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libsvg.xcframework/Info.plist +11 -11
- package/libs/apple/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/macos-arm64_x86_64/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/tvos-arm64_arm64e/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/tvos-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +10 -9
- package/src/external/reanimated/textures.tsx +5 -4
- package/src/headless/index.ts +2 -2
- package/src/renderer/Canvas.tsx +57 -80
- package/src/renderer/Offscreen.tsx +4 -4
- package/src/renderer/__tests__/Data.spec.tsx +9 -10
- package/src/renderer/__tests__/Drawings.spec.tsx +11 -11
- package/src/renderer/__tests__/FitBox.spec.tsx +10 -10
- package/src/renderer/__tests__/Glyphs.spec.tsx +2 -2
- package/src/renderer/__tests__/Image.spec.tsx +2 -2
- package/src/renderer/__tests__/Paths.spec.tsx +8 -8
- package/src/renderer/__tests__/Picture.spec.tsx +10 -12
- package/src/renderer/__tests__/Simple.spec.tsx +6 -6
- package/src/renderer/__tests__/Surfaces.spec.tsx +2 -2
- package/src/renderer/__tests__/Text.spec.tsx +12 -12
- package/src/renderer/__tests__/Transform.spec.tsx +8 -8
- package/src/renderer/__tests__/documentation/Group.spec.tsx +12 -12
- package/src/renderer/__tests__/documentation/getting-started/HelloWorld.spec.tsx +2 -2
- package/src/renderer/__tests__/documentation/paint/Overview.spec.tsx +8 -8
- package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx +4 -4
- package/src/renderer/__tests__/e2e/Atlas.spec.tsx +3 -3
- package/src/renderer/__tests__/e2e/Offscreen.spec.tsx +1 -1
- package/src/renderer/__tests__/examples/BlendModes.spec.tsx +4 -4
- package/src/renderer/__tests__/setup.tsx +13 -13
- package/src/sksg/Container.ts +9 -1
- package/src/sksg/HostConfig.ts +37 -7
- package/src/sksg/Reconciler.ts +17 -6
- package/src/sksg/__tests__/Simple.spec.tsx +8 -8
- package/lib/commonjs/sksg/HostConfig2.d.ts +0 -19
- package/lib/commonjs/sksg/HostConfig2.js +0 -159
- package/lib/commonjs/sksg/HostConfig2.js.map +0 -1
- package/lib/module/sksg/HostConfig2.d.ts +0 -19
- package/lib/module/sksg/HostConfig2.js +0 -152
- package/lib/module/sksg/HostConfig2.js.map +0 -1
- package/lib/typescript/lib/commonjs/sksg/HostConfig2.d.ts +0 -44
- package/lib/typescript/lib/module/sksg/HostConfig2.d.ts +0 -43
- package/lib/typescript/src/sksg/HostConfig2.d.ts +0 -19
- package/src/sksg/HostConfig2.ts +0 -247
@@ -8,22 +8,25 @@
|
|
8
8
|
<key>BinaryPath</key>
|
9
9
|
<string>libsvg.a</string>
|
10
10
|
<key>LibraryIdentifier</key>
|
11
|
-
<string>
|
11
|
+
<string>tvos-arm64_arm64e_x86_64-simulator</string>
|
12
12
|
<key>LibraryPath</key>
|
13
13
|
<string>libsvg.a</string>
|
14
14
|
<key>SupportedArchitectures</key>
|
15
15
|
<array>
|
16
16
|
<string>arm64</string>
|
17
17
|
<string>arm64e</string>
|
18
|
+
<string>x86_64</string>
|
18
19
|
</array>
|
19
20
|
<key>SupportedPlatform</key>
|
20
|
-
<string>
|
21
|
+
<string>tvos</string>
|
22
|
+
<key>SupportedPlatformVariant</key>
|
23
|
+
<string>simulator</string>
|
21
24
|
</dict>
|
22
25
|
<dict>
|
23
26
|
<key>BinaryPath</key>
|
24
27
|
<string>libsvg.a</string>
|
25
28
|
<key>LibraryIdentifier</key>
|
26
|
-
<string>
|
29
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
27
30
|
<key>LibraryPath</key>
|
28
31
|
<string>libsvg.a</string>
|
29
32
|
<key>SupportedArchitectures</key>
|
@@ -33,7 +36,7 @@
|
|
33
36
|
<string>x86_64</string>
|
34
37
|
</array>
|
35
38
|
<key>SupportedPlatform</key>
|
36
|
-
<string>
|
39
|
+
<string>ios</string>
|
37
40
|
<key>SupportedPlatformVariant</key>
|
38
41
|
<string>simulator</string>
|
39
42
|
</dict>
|
@@ -56,7 +59,7 @@
|
|
56
59
|
<key>BinaryPath</key>
|
57
60
|
<string>libsvg.a</string>
|
58
61
|
<key>LibraryIdentifier</key>
|
59
|
-
<string>
|
62
|
+
<string>ios-arm64_arm64e</string>
|
60
63
|
<key>LibraryPath</key>
|
61
64
|
<string>libsvg.a</string>
|
62
65
|
<key>SupportedArchitectures</key>
|
@@ -65,25 +68,22 @@
|
|
65
68
|
<string>arm64e</string>
|
66
69
|
</array>
|
67
70
|
<key>SupportedPlatform</key>
|
68
|
-
<string>
|
71
|
+
<string>ios</string>
|
69
72
|
</dict>
|
70
73
|
<dict>
|
71
74
|
<key>BinaryPath</key>
|
72
75
|
<string>libsvg.a</string>
|
73
76
|
<key>LibraryIdentifier</key>
|
74
|
-
<string>
|
77
|
+
<string>tvos-arm64_arm64e</string>
|
75
78
|
<key>LibraryPath</key>
|
76
79
|
<string>libsvg.a</string>
|
77
80
|
<key>SupportedArchitectures</key>
|
78
81
|
<array>
|
79
82
|
<string>arm64</string>
|
80
83
|
<string>arm64e</string>
|
81
|
-
<string>x86_64</string>
|
82
84
|
</array>
|
83
85
|
<key>SupportedPlatform</key>
|
84
|
-
<string>
|
85
|
-
<key>SupportedPlatformVariant</key>
|
86
|
-
<string>simulator</string>
|
86
|
+
<string>tvos</string>
|
87
87
|
</dict>
|
88
88
|
</array>
|
89
89
|
<key>CFBundlePackageType</key>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/package.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"setup-skia-web": "./scripts/setup-canvaskit.js"
|
9
9
|
},
|
10
10
|
"title": "React Native Skia",
|
11
|
-
"version": "1.11.
|
11
|
+
"version": "1.11.9-next.1",
|
12
12
|
"description": "High-performance React Native Graphics using Skia",
|
13
13
|
"main": "lib/module/index.js",
|
14
14
|
"react-native": "src/index.ts",
|
@@ -76,9 +76,9 @@
|
|
76
76
|
"licenseFilename": "LICENSE.md",
|
77
77
|
"readmeFilename": "README.md",
|
78
78
|
"peerDependencies": {
|
79
|
-
"react": ">=
|
80
|
-
"react-native": ">=0.
|
81
|
-
"react-native-reanimated": ">=
|
79
|
+
"react": ">=19.0",
|
80
|
+
"react-native": ">=0.78",
|
81
|
+
"react-native-reanimated": ">=3.0.0"
|
82
82
|
},
|
83
83
|
"peerDependenciesMeta": {
|
84
84
|
"react-native": {
|
@@ -108,10 +108,10 @@
|
|
108
108
|
"pixelmatch": "5.3.0",
|
109
109
|
"pngjs": "6.0.0",
|
110
110
|
"prettier": "2.8.7",
|
111
|
-
"react": "
|
112
|
-
"react-native": "0.
|
111
|
+
"react": "19.0.0",
|
112
|
+
"react-native": "0.78.0",
|
113
113
|
"react-native-builder-bob": "0.18.2",
|
114
|
-
"react-native-reanimated": "^3.
|
114
|
+
"react-native-reanimated": "^3.17.1",
|
115
115
|
"rimraf": "3.0.2",
|
116
116
|
"semantic-release": "^24.1.0",
|
117
117
|
"semantic-release-yarn": "^3.0.2",
|
@@ -122,7 +122,7 @@
|
|
122
122
|
},
|
123
123
|
"dependencies": {
|
124
124
|
"canvaskit-wasm": "0.39.1",
|
125
|
-
"react-reconciler": "0.
|
125
|
+
"react-reconciler": "0.31.0"
|
126
126
|
},
|
127
127
|
"eslintIgnore": [
|
128
128
|
"node_modules/",
|
@@ -154,5 +154,6 @@
|
|
154
154
|
}
|
155
155
|
]
|
156
156
|
]
|
157
|
-
}
|
157
|
+
},
|
158
|
+
"stableVersion": "0.0.0"
|
158
159
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { useEffect, useMemo } from "react";
|
1
|
+
import { useEffect, useMemo, useState } from "react";
|
2
2
|
import type { ReactElement } from "react";
|
3
3
|
import type { SharedValue } from "react-native-reanimated";
|
4
4
|
|
@@ -27,13 +27,14 @@ const createTexture = (
|
|
27
27
|
|
28
28
|
export const useTexture = (element: ReactElement, size: SkSize) => {
|
29
29
|
const { width, height } = size;
|
30
|
-
const picture =
|
31
|
-
|
30
|
+
const [picture, setPicture] = useState<SkPicture | null>(null);
|
31
|
+
useEffect(() => {
|
32
|
+
drawAsPicture(element, {
|
32
33
|
x: 0,
|
33
34
|
y: 0,
|
34
35
|
width,
|
35
36
|
height,
|
36
|
-
});
|
37
|
+
}).then((pic) => setPicture(pic));
|
37
38
|
}, [element, width, height]);
|
38
39
|
return usePictureAsTexture(picture, size);
|
39
40
|
};
|
package/src/headless/index.ts
CHANGED
@@ -29,9 +29,9 @@ export const getSkiaExports = () => {
|
|
29
29
|
return { Skia };
|
30
30
|
};
|
31
31
|
|
32
|
-
export const drawOffscreen = (surface: SkSurface, element: ReactNode) => {
|
32
|
+
export const drawOffscreen = async (surface: SkSurface, element: ReactNode) => {
|
33
33
|
const root = new SkiaSGRoot(Skia);
|
34
|
-
root.render(element);
|
34
|
+
await root.render(element);
|
35
35
|
const canvas = surface.getCanvas();
|
36
36
|
root.drawOnCanvas(canvas);
|
37
37
|
root.unmount();
|
package/src/renderer/Canvas.tsx
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { FC } from "react";
|
2
2
|
import React, {
|
3
|
-
forwardRef,
|
4
3
|
useCallback,
|
5
4
|
useEffect,
|
6
5
|
useImperativeHandle,
|
@@ -26,7 +25,7 @@ interface CanvasRef extends FC<CanvasProps> {
|
|
26
25
|
|
27
26
|
export const useCanvasRef = () => useRef<CanvasRef>(null);
|
28
27
|
|
29
|
-
const NativeSkiaPictureView = SkiaPictureViewNativeComponent;
|
28
|
+
//const NativeSkiaPictureView = SkiaPictureViewNativeComponent;
|
30
29
|
|
31
30
|
// TODO: no need to go through the JS thread for this
|
32
31
|
const useOnSizeEvent = (
|
@@ -52,87 +51,65 @@ export interface CanvasProps extends ViewProps {
|
|
52
51
|
debug?: boolean;
|
53
52
|
opaque?: boolean;
|
54
53
|
onSize?: SharedValue<SkSize>;
|
55
|
-
|
54
|
+
ref?: React.Ref<CanvasRef>;
|
56
55
|
}
|
57
56
|
|
58
|
-
export const Canvas =
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
const onLayout = useOnSizeEvent(onSize, _onLayout);
|
73
|
-
// Native ID
|
74
|
-
const nativeId = useMemo(() => {
|
75
|
-
return SkiaViewNativeId.current++;
|
76
|
-
}, []);
|
57
|
+
export const Canvas = ({
|
58
|
+
debug,
|
59
|
+
opaque,
|
60
|
+
children,
|
61
|
+
onSize,
|
62
|
+
onLayout: _onLayout,
|
63
|
+
ref,
|
64
|
+
...viewProps
|
65
|
+
}: CanvasProps) => {
|
66
|
+
const onLayout = useOnSizeEvent(onSize, _onLayout);
|
67
|
+
// Native ID
|
68
|
+
const nativeId = useMemo(() => {
|
69
|
+
return SkiaViewNativeId.current++;
|
70
|
+
}, []);
|
77
71
|
|
78
|
-
|
79
|
-
|
72
|
+
// Root
|
73
|
+
const root = useMemo(() => new SkiaSGRoot(Skia, nativeId), [nativeId]);
|
80
74
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
75
|
+
// Render effects
|
76
|
+
useEffect(() => {
|
77
|
+
root.render(children);
|
78
|
+
}, [children, root]);
|
85
79
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
80
|
+
useEffect(() => {
|
81
|
+
return () => {
|
82
|
+
root.unmount();
|
83
|
+
};
|
84
|
+
}, [root]);
|
91
85
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
}
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
},
|
123
|
-
getNativeId: () => {
|
124
|
-
return nativeId;
|
125
|
-
},
|
126
|
-
}));
|
127
|
-
return (
|
128
|
-
<NativeSkiaPictureView
|
129
|
-
collapsable={false}
|
130
|
-
nativeID={`${nativeId}`}
|
131
|
-
debug={debug}
|
132
|
-
opaque={opaque}
|
133
|
-
onLayout={onLayout}
|
134
|
-
{...viewProps}
|
135
|
-
/>
|
136
|
-
);
|
137
|
-
}
|
138
|
-
);
|
86
|
+
// Component methods
|
87
|
+
useImperativeHandle(
|
88
|
+
ref,
|
89
|
+
() =>
|
90
|
+
({
|
91
|
+
makeImageSnapshot: (rect?: SkRect) => {
|
92
|
+
return SkiaViewApi.makeImageSnapshot(nativeId, rect);
|
93
|
+
},
|
94
|
+
makeImageSnapshotAsync: (rect?: SkRect) => {
|
95
|
+
return SkiaViewApi.makeImageSnapshotAsync(nativeId, rect);
|
96
|
+
},
|
97
|
+
redraw: () => {
|
98
|
+
SkiaViewApi.requestRedraw(nativeId);
|
99
|
+
},
|
100
|
+
getNativeId: () => {
|
101
|
+
return nativeId;
|
102
|
+
},
|
103
|
+
} as CanvasRef)
|
104
|
+
);
|
105
|
+
return (
|
106
|
+
<SkiaPictureViewNativeComponent
|
107
|
+
collapsable={false}
|
108
|
+
nativeID={`${nativeId}`}
|
109
|
+
debug={debug}
|
110
|
+
opaque={opaque}
|
111
|
+
onLayout={onLayout}
|
112
|
+
{...viewProps}
|
113
|
+
/>
|
114
|
+
);
|
115
|
+
};
|
@@ -14,19 +14,19 @@ export const isOnMainThread = () => {
|
|
14
14
|
);
|
15
15
|
};
|
16
16
|
|
17
|
-
export const drawAsPicture = (element: ReactElement, bounds?: SkRect) => {
|
17
|
+
export const drawAsPicture = async (element: ReactElement, bounds?: SkRect) => {
|
18
18
|
const recorder = Skia.PictureRecorder();
|
19
19
|
const canvas = recorder.beginRecording(bounds);
|
20
20
|
const root = new SkiaSGRoot(Skia);
|
21
|
-
root.render(element);
|
21
|
+
await root.render(element);
|
22
22
|
root.drawOnCanvas(canvas);
|
23
23
|
const picture = recorder.finishRecordingAsPicture();
|
24
24
|
root.unmount();
|
25
25
|
return picture;
|
26
26
|
};
|
27
27
|
|
28
|
-
export const drawAsImage = (element: ReactElement, size: SkSize) => {
|
29
|
-
return drawAsImageFromPicture(drawAsPicture(element), size);
|
28
|
+
export const drawAsImage = async (element: ReactElement, size: SkSize) => {
|
29
|
+
return drawAsImageFromPicture(await drawAsPicture(element), size);
|
30
30
|
};
|
31
31
|
|
32
32
|
export const drawAsImageFromPicture = (picture: SkPicture, size: SkSize) => {
|
@@ -39,29 +39,28 @@ describe("Data Loading", () => {
|
|
39
39
|
expect(SkiaRenderer).toBeDefined();
|
40
40
|
});
|
41
41
|
it("Should accept null as an argument", async () => {
|
42
|
-
const { surface, draw } = mountCanvas(<CheckData />);
|
43
|
-
draw();
|
42
|
+
const { surface, draw } = await mountCanvas(<CheckData />);
|
43
|
+
await draw();
|
44
44
|
processResult(surface, "snapshots/font/green.png");
|
45
|
-
await
|
46
|
-
draw();
|
45
|
+
await draw();
|
47
46
|
processResult(surface, "snapshots/font/green.png");
|
48
47
|
});
|
49
48
|
|
50
49
|
it("Should load a font file", async () => {
|
51
|
-
const { surface, draw } = mountCanvas(<CheckFont />);
|
52
|
-
draw();
|
50
|
+
const { surface, draw } = await mountCanvas(<CheckFont />);
|
51
|
+
await draw();
|
53
52
|
processResult(surface, "snapshots/font/red.png");
|
54
53
|
await wait(1500);
|
55
|
-
draw();
|
54
|
+
await draw();
|
56
55
|
processResult(surface, "snapshots/font/green.png");
|
57
56
|
});
|
58
57
|
|
59
58
|
it("Should load an image", async () => {
|
60
|
-
const { surface, draw } = mountCanvas(<CheckImage />);
|
61
|
-
draw();
|
59
|
+
const { surface, draw } = await mountCanvas(<CheckImage />);
|
60
|
+
await draw();
|
62
61
|
processResult(surface, "snapshots/font/red.png");
|
63
62
|
await wait(1500);
|
64
|
-
draw();
|
63
|
+
await draw();
|
65
64
|
processResult(surface, "snapshots/font/green.png");
|
66
65
|
});
|
67
66
|
});
|
@@ -30,9 +30,9 @@ const CheckEmptyCanvas = () => {
|
|
30
30
|
};
|
31
31
|
|
32
32
|
describe("Test introductionary examples from our documentation", () => {
|
33
|
-
it("Should blend colors using multiplication", () => {
|
33
|
+
it("Should blend colors using multiplication", async () => {
|
34
34
|
const r = width * 0.33;
|
35
|
-
const surface = drawOnNode(
|
35
|
+
const surface = await drawOnNode(
|
36
36
|
<Group blendMode="multiply">
|
37
37
|
<Circle cx={r} cy={r} r={r} color="cyan" />
|
38
38
|
<Circle cx={width - r} cy={r} r={r} color="magenta" />
|
@@ -42,9 +42,9 @@ describe("Test introductionary examples from our documentation", () => {
|
|
42
42
|
processResult(surface, "snapshots/drawings/blend-mode-multiply.png");
|
43
43
|
});
|
44
44
|
|
45
|
-
it("Should use a blur image filter", () => {
|
45
|
+
it("Should use a blur image filter", async () => {
|
46
46
|
const r = width * 0.33;
|
47
|
-
const surface = drawOnNode(
|
47
|
+
const surface = await drawOnNode(
|
48
48
|
<Group blendMode="multiply">
|
49
49
|
<Blur blur={30} />
|
50
50
|
<Circle cx={r} cy={r} r={r} color="cyan" />
|
@@ -55,10 +55,10 @@ describe("Test introductionary examples from our documentation", () => {
|
|
55
55
|
processResult(surface, "snapshots/drawings/blur-node.png");
|
56
56
|
});
|
57
57
|
|
58
|
-
it("Should use multiple paint definitions for one drawing command", () => {
|
58
|
+
it("Should use multiple paint definitions for one drawing command", async () => {
|
59
59
|
const r = width / 4;
|
60
60
|
const strokeWidth = 50;
|
61
|
-
const surface = drawOnNode(
|
61
|
+
const surface = await drawOnNode(
|
62
62
|
<>
|
63
63
|
<Circle cx={width / 2} cy={width / 2} r={r} color="red">
|
64
64
|
<Paint color="lightblue" />
|
@@ -70,7 +70,7 @@ describe("Test introductionary examples from our documentation", () => {
|
|
70
70
|
processResult(surface, "snapshots/drawings/multiple-paints.png");
|
71
71
|
});
|
72
72
|
|
73
|
-
it("Should draw DRect", () => {
|
73
|
+
it("Should draw DRect", async () => {
|
74
74
|
const { rrect, rect } = importSkia();
|
75
75
|
const padding = 25 * PIXEL_RATIO;
|
76
76
|
const outer = rrect(rect(0, 0, width, width), padding, padding);
|
@@ -79,18 +79,18 @@ describe("Test introductionary examples from our documentation", () => {
|
|
79
79
|
padding * 2,
|
80
80
|
padding * 2
|
81
81
|
);
|
82
|
-
const surface = drawOnNode(
|
82
|
+
const surface = await drawOnNode(
|
83
83
|
<DiffRect inner={inner} outer={outer} color="lightblue" />
|
84
84
|
);
|
85
85
|
processResult(surface, docPath("shapes/drect.png"));
|
86
86
|
});
|
87
87
|
|
88
88
|
it("should clear the canvas even if it's empty", async () => {
|
89
|
-
const { surface, draw } = mountCanvas(<CheckEmptyCanvas />);
|
90
|
-
draw();
|
89
|
+
const { surface, draw } = await mountCanvas(<CheckEmptyCanvas />);
|
90
|
+
await draw();
|
91
91
|
processResult(surface, "snapshots/green.png");
|
92
92
|
await wait(1000);
|
93
|
-
draw();
|
93
|
+
await draw();
|
94
94
|
processResult(surface, "snapshots/transparent.png");
|
95
95
|
});
|
96
96
|
});
|
@@ -9,9 +9,9 @@ import { Circle, FitBox, Rect, Image, Group, fitbox } from "../components";
|
|
9
9
|
import { drawOnNode, width, height, importSkia } from "./setup";
|
10
10
|
|
11
11
|
describe("FitBox", () => {
|
12
|
-
it("Should scale the rectangle in half", () => {
|
12
|
+
it("Should scale the rectangle in half", async () => {
|
13
13
|
const { Skia } = importSkia();
|
14
|
-
const surface = drawOnNode(
|
14
|
+
const surface = await drawOnNode(
|
15
15
|
<FitBox
|
16
16
|
src={Skia.XYWHRect(0, 0, width, height)}
|
17
17
|
dst={Skia.XYWHRect(width / 4, height / 4, width / 2, height / 2)}
|
@@ -21,9 +21,9 @@ describe("FitBox", () => {
|
|
21
21
|
);
|
22
22
|
processResult(surface, "snapshots/drawings/lightblue-rect.png");
|
23
23
|
});
|
24
|
-
it("Should take the bottom right quarter of the circle and scale to the full canvas", () => {
|
24
|
+
it("Should take the bottom right quarter of the circle and scale to the full canvas", async () => {
|
25
25
|
const { Skia } = importSkia();
|
26
|
-
const surface = drawOnNode(
|
26
|
+
const surface = await drawOnNode(
|
27
27
|
<FitBox
|
28
28
|
src={Skia.XYWHRect(width / 2, height / 2, width / 2, height / 2)}
|
29
29
|
dst={Skia.XYWHRect(0, 0, width, height)}
|
@@ -38,7 +38,7 @@ describe("FitBox", () => {
|
|
38
38
|
);
|
39
39
|
processResult(surface, "snapshots/drawings/lightblue-quarter-circle.png");
|
40
40
|
});
|
41
|
-
it("Should scale the image (1)", () => {
|
41
|
+
it("Should scale the image (1)", async () => {
|
42
42
|
const { Skia, rect } = importSkia();
|
43
43
|
const image = Skia.Image.MakeImageFromEncoded(
|
44
44
|
Skia.Data.fromBytes(
|
@@ -47,7 +47,7 @@ describe("FitBox", () => {
|
|
47
47
|
)
|
48
48
|
)
|
49
49
|
)!;
|
50
|
-
const surface = drawOnNode(
|
50
|
+
const surface = await drawOnNode(
|
51
51
|
<Group
|
52
52
|
transform={fitbox(
|
53
53
|
"cover",
|
@@ -66,7 +66,7 @@ describe("FitBox", () => {
|
|
66
66
|
);
|
67
67
|
processResult(surface, "snapshots/drawings/scaled-image.png");
|
68
68
|
});
|
69
|
-
it("Should scale the image (2)", () => {
|
69
|
+
it("Should scale the image (2)", async () => {
|
70
70
|
const { Skia, rect } = importSkia();
|
71
71
|
const image = Skia.Image.MakeImageFromEncoded(
|
72
72
|
Skia.Data.fromBytes(
|
@@ -76,7 +76,7 @@ describe("FitBox", () => {
|
|
76
76
|
)
|
77
77
|
)!;
|
78
78
|
const screen = rect(256, 128, 256, 512);
|
79
|
-
const surface = drawOnNode(
|
79
|
+
const surface = await drawOnNode(
|
80
80
|
<Group>
|
81
81
|
<Image
|
82
82
|
image={image}
|
@@ -95,7 +95,7 @@ describe("FitBox", () => {
|
|
95
95
|
);
|
96
96
|
processResult(surface, "snapshots/drawings/scaled-image2.png");
|
97
97
|
});
|
98
|
-
it("Should rotate and scale the image", () => {
|
98
|
+
it("Should rotate and scale the image", async () => {
|
99
99
|
const { Skia, rect } = importSkia();
|
100
100
|
const image = Skia.Image.MakeImageFromEncoded(
|
101
101
|
Skia.Data.fromBytes(
|
@@ -107,7 +107,7 @@ describe("FitBox", () => {
|
|
107
107
|
const screen = rect(256, 128, 256, 512);
|
108
108
|
const imageRect = rect(0, 0, image.width(), image.height());
|
109
109
|
const transform = fitbox("contain", imageRect, screen, 270);
|
110
|
-
const surface = drawOnNode(
|
110
|
+
const surface = await drawOnNode(
|
111
111
|
<Group>
|
112
112
|
<Image
|
113
113
|
image={image}
|
@@ -25,7 +25,7 @@ describe("Glyphs", () => {
|
|
25
25
|
font = Skia.Font(tf!, 64);
|
26
26
|
expect(font !== null).toBe(true);
|
27
27
|
});
|
28
|
-
it("Should draw glyphs in lightblue", () => {
|
28
|
+
it("Should draw glyphs in lightblue", async () => {
|
29
29
|
const { Skia } = importSkia();
|
30
30
|
const ids = font.getGlyphIDs("ab");
|
31
31
|
const glyphs = [
|
@@ -38,7 +38,7 @@ describe("Glyphs", () => {
|
|
38
38
|
),
|
39
39
|
},
|
40
40
|
];
|
41
|
-
const surface = drawOnNode(
|
41
|
+
const surface = await drawOnNode(
|
42
42
|
<Glyphs x={0} y={0} font={font} glyphs={glyphs} color="lightblue" />
|
43
43
|
);
|
44
44
|
processResult(surface, "snapshots/glyphs/simple.png");
|
@@ -9,7 +9,7 @@ import { Fill, ImageShader, Shader } from "../components";
|
|
9
9
|
import { drawOnNode, width, height, importSkia } from "./setup";
|
10
10
|
|
11
11
|
describe("Test Image Component", () => {
|
12
|
-
it("Should display the image with a filter", () => {
|
12
|
+
it("Should display the image with a filter", async () => {
|
13
13
|
const { Skia } = importSkia();
|
14
14
|
const image = Skia.Image.MakeImageFromEncoded(
|
15
15
|
Skia.Data.fromBytes(
|
@@ -26,7 +26,7 @@ half4 main(float2 xy) {
|
|
26
26
|
xy.x += sin(xy.y / r) * 4;
|
27
27
|
return image.eval(xy).rbga;
|
28
28
|
}`)!;
|
29
|
-
const surface = drawOnNode(
|
29
|
+
const surface = await drawOnNode(
|
30
30
|
<Fill>
|
31
31
|
<Shader source={filter} uniforms={{ r: 50 }}>
|
32
32
|
<ImageShader
|
@@ -8,7 +8,7 @@ import { drawOnNode, width, importSkia } from "./setup";
|
|
8
8
|
const size = width;
|
9
9
|
|
10
10
|
describe("Path Examples", () => {
|
11
|
-
it("Should draw an arc", () => {
|
11
|
+
it("Should draw an arc", async () => {
|
12
12
|
const { Skia } = importSkia();
|
13
13
|
const path = Skia.Path.Make();
|
14
14
|
const arcRect = {
|
@@ -18,11 +18,11 @@ describe("Path Examples", () => {
|
|
18
18
|
height: size,
|
19
19
|
};
|
20
20
|
path.addArc(arcRect, 45, 270);
|
21
|
-
const surface = drawOnNode(<Path path={path} color="lightblue" />);
|
21
|
+
const surface = await drawOnNode(<Path path={path} color="lightblue" />);
|
22
22
|
processResult(surface, "snapshots/paths/arc.png");
|
23
23
|
});
|
24
24
|
|
25
|
-
it("Should draw an oval", () => {
|
25
|
+
it("Should draw an oval", async () => {
|
26
26
|
const { Skia } = importSkia();
|
27
27
|
const path = Skia.Path.Make();
|
28
28
|
const rct = {
|
@@ -32,11 +32,11 @@ describe("Path Examples", () => {
|
|
32
32
|
height: size,
|
33
33
|
};
|
34
34
|
path.addOval(rct);
|
35
|
-
const surface = drawOnNode(<Path path={path} color="lightblue" />);
|
35
|
+
const surface = await drawOnNode(<Path path={path} color="lightblue" />);
|
36
36
|
processResult(surface, "snapshots/paths/oval.png");
|
37
37
|
});
|
38
38
|
|
39
|
-
it("Should draw an rounded rectangle", () => {
|
39
|
+
it("Should draw an rounded rectangle", async () => {
|
40
40
|
const { Skia } = importSkia();
|
41
41
|
const path = Skia.Path.Make();
|
42
42
|
path.addRRect({
|
@@ -49,11 +49,11 @@ describe("Path Examples", () => {
|
|
49
49
|
rx: size / 4,
|
50
50
|
ry: size / 4,
|
51
51
|
});
|
52
|
-
const surface = drawOnNode(<Path path={path} color="lightblue" />);
|
52
|
+
const surface = await drawOnNode(<Path path={path} color="lightblue" />);
|
53
53
|
processResult(surface, "snapshots/paths/rrect.png");
|
54
54
|
});
|
55
55
|
|
56
|
-
it("Should draw a polygon", () => {
|
56
|
+
it("Should draw a polygon", async () => {
|
57
57
|
const { Skia, vec } = importSkia();
|
58
58
|
const path = Skia.Path.Make();
|
59
59
|
const r = size / 4;
|
@@ -67,7 +67,7 @@ describe("Path Examples", () => {
|
|
67
67
|
true
|
68
68
|
);
|
69
69
|
|
70
|
-
const surface = drawOnNode(
|
70
|
+
const surface = await drawOnNode(
|
71
71
|
<Path path={path} strokeWidth={4} style="stroke" color="lightblue" />
|
72
72
|
);
|
73
73
|
processResult(surface, "snapshots/paths/poly.png");
|