@shopify/react-native-skia 0.1.234 → 0.1.237
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkApi.h +2 -0
- package/cpp/api/JsiSkCanvas.h +36 -0
- package/cpp/api/JsiSkRSXform.h +35 -7
- package/cpp/api/JsiSkTypefaceFactory.h +2 -1
- package/cpp/rnskia/dom/JsiDomApi.h +2 -0
- package/cpp/rnskia/dom/nodes/JsiAtlasNode.h +60 -0
- package/cpp/rnskia/dom/props/RSXformProp.h +52 -0
- package/cpp/rnskia/dom/props/RectProp.h +31 -0
- package/cpp/skia/include/android/AHardwareBufferUtils.h +23 -0
- package/cpp/skia/include/android/GrAHardwareBufferUtils.h +2 -0
- package/cpp/skia/include/android/graphite/SurfaceAndroid.h +59 -0
- package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
- package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
- package/cpp/skia/include/codec/SkCodec.h +21 -3
- package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
- package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
- package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
- package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
- package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
- package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
- package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
- package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
- package/cpp/skia/include/config/SkUserConfig.h +3 -1
- package/cpp/skia/include/core/SkCanvas.h +66 -37
- package/cpp/skia/include/core/SkColorFilter.h +5 -2
- package/cpp/skia/include/core/SkContourMeasure.h +1 -0
- package/cpp/skia/include/core/SkDocument.h +1 -0
- package/cpp/skia/include/core/SkFont.h +14 -24
- package/cpp/skia/include/core/SkFontArguments.h +1 -1
- package/cpp/skia/include/core/SkFontMetrics.h +1 -1
- package/cpp/skia/include/core/SkFontMgr.h +0 -7
- package/cpp/skia/include/core/SkGraphics.h +13 -0
- package/cpp/skia/include/core/SkMesh.h +9 -13
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPathMeasure.h +2 -0
- package/cpp/skia/include/core/SkSerialProcs.h +29 -11
- package/cpp/skia/include/core/SkSize.h +3 -3
- package/cpp/skia/include/core/SkStream.h +3 -13
- package/cpp/skia/include/core/SkSurface.h +6 -3
- package/cpp/skia/include/core/SkSurfaceProps.h +2 -4
- package/cpp/skia/include/core/SkTraceMemoryDump.h +15 -0
- package/cpp/skia/include/core/SkTypeface.h +8 -56
- package/cpp/skia/include/core/SkTypes.h +8 -0
- package/cpp/skia/include/core/SkVertices.h +1 -1
- package/cpp/skia/include/docs/SkMultiPictureDocument.h +53 -0
- package/cpp/skia/include/docs/SkPDFDocument.h +11 -0
- package/cpp/skia/include/effects/SkGradientShader.h +9 -0
- package/cpp/skia/include/effects/SkRuntimeEffect.h +3 -7
- package/cpp/skia/include/gpu/GrBackendSemaphore.h +33 -47
- package/cpp/skia/include/gpu/GrBackendSurface.h +2 -3
- package/cpp/skia/include/gpu/GrContextOptions.h +0 -6
- package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +44 -28
- package/cpp/skia/include/gpu/GrDirectContext.h +12 -31
- package/cpp/skia/include/gpu/GrTypes.h +1 -16
- package/cpp/skia/include/gpu/MutableTextureState.h +35 -80
- package/cpp/skia/include/gpu/ShaderErrorHandler.h +11 -1
- package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +2 -2
- package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +3 -2
- package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
- package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +30 -0
- package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
- package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -0
- package/cpp/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h +6 -0
- package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +3 -3
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +39 -27
- package/cpp/skia/include/gpu/graphite/Context.h +39 -13
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +2 -0
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +2 -1
- package/cpp/skia/include/gpu/graphite/Image.h +106 -87
- package/cpp/skia/include/gpu/graphite/Recorder.h +24 -3
- package/cpp/skia/include/gpu/graphite/Surface.h +7 -2
- package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +41 -2
- package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +11 -6
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -2
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +6 -6
- package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -0
- package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
- package/cpp/skia/include/gpu/vk/GrVkTypes.h +1 -44
- package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
- package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +25 -0
- package/cpp/skia/include/gpu/vk/VulkanTypes.h +44 -0
- package/cpp/skia/include/ports/SkFontConfigInterface.h +3 -6
- package/cpp/skia/include/private/SkEncodedInfo.h +5 -0
- package/cpp/skia/include/private/SkExif.h +102 -0
- package/cpp/skia/include/private/SkGainmapInfo.h +11 -1
- package/cpp/skia/include/private/base/SkAssert.h +16 -0
- package/cpp/skia/include/private/base/SkDeque.h +2 -7
- package/cpp/skia/include/private/base/SkLoadUserConfig.h +1 -1
- package/cpp/skia/include/private/base/SkTArray.h +69 -28
- package/cpp/skia/include/private/base/SkThreadAnnotations.h +18 -5
- package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +26 -30
- package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +4 -3
- package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +8 -6
- package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +29 -0
- package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +12 -9
- package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +16 -11
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -2
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +9 -2
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +31 -3
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10624 -5716
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +2 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +2 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +28 -1
- package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +2 -1
- package/cpp/skia/include/utils/mac/SkCGUtils.h +23 -11
- package/cpp/skia/modules/skcms/skcms.h +2 -410
- package/cpp/skia/modules/skcms/src/Transform_inl.h +831 -704
- package/cpp/skia/modules/skcms/src/skcms_Transform.h +161 -0
- package/cpp/skia/modules/skcms/src/skcms_internals.h +136 -0
- package/cpp/skia/modules/skcms/src/skcms_public.h +404 -0
- package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
- package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -0
- package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -2
- package/cpp/skia/modules/skparagraph/include/TextStyle.h +4 -3
- package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -3
- package/cpp/skia/modules/skresources/include/SkResources.h +28 -17
- package/cpp/skia/modules/skunicode/include/SkUnicode.h +12 -0
- package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -1
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +4 -1
- package/cpp/skia/src/base/SkUTF.h +7 -0
- package/cpp/skia/src/core/SkTHash.h +20 -8
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +60 -57
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +47 -0
- package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +1 -0
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/commonjs/dom/nodes/drawings/index.js +13 -0
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +7 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +1 -0
- package/lib/commonjs/dom/types/NodeType.js +1 -0
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.d.ts +2 -1
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/external/reanimated/buffers.d.ts +5 -0
- package/lib/commonjs/external/reanimated/buffers.js +48 -0
- package/lib/commonjs/external/reanimated/buffers.js.map +1 -0
- package/lib/commonjs/external/reanimated/index.d.ts +2 -0
- package/lib/commonjs/external/reanimated/index.js +26 -0
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.js +13 -1
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/commonjs/external/reanimated/moduleWrapper.js +5 -3
- package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/commonjs/external/reanimated/textures.d.ts +5 -0
- package/lib/commonjs/external/reanimated/textures.js +38 -0
- package/lib/commonjs/external/reanimated/textures.js.map +1 -0
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +8 -1
- package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/commonjs/headless/index.js +1 -1
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +8 -0
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +1 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.d.ts +1 -1
- package/lib/commonjs/renderer/Container.js +2 -1
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +3 -1
- package/lib/commonjs/renderer/HostComponents.js +3 -0
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/Offscreen.d.ts +4 -1
- package/lib/commonjs/renderer/Offscreen.js +28 -10
- package/lib/commonjs/renderer/Offscreen.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
- package/lib/commonjs/renderer/Reconciler.js +7 -4
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/commonjs/renderer/components/shapes/Atlas.js +17 -0
- package/lib/commonjs/renderer/components/shapes/Atlas.js.map +1 -0
- package/lib/commonjs/renderer/components/shapes/index.d.ts +1 -0
- package/lib/commonjs/renderer/components/shapes/index.js +13 -0
- package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/commonjs/skia/core/AnimatedImage.js +4 -1
- package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +1 -1
- package/lib/commonjs/skia/core/Data.js +11 -4
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Rect.d.ts +2 -2
- package/lib/commonjs/skia/types/Canvas.d.ts +16 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.d.ts +8 -0
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +2 -2
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/skia/types/RSXform.d.ts +7 -1
- package/lib/commonjs/skia/types/RSXform.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.d.ts +4 -0
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +3 -2
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +19 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/commonjs/skia/web/JsiSkRSXform.js +33 -2
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +3 -2
- package/lib/commonjs/skia/web/JsiSkRect.js +7 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +2 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +5 -0
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/module/dom/nodes/JsiSkDOM.js +61 -57
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/module/dom/nodes/drawings/AtlasNode.js +34 -0
- package/lib/module/dom/nodes/drawings/AtlasNode.js.map +1 -0
- package/lib/module/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/module/dom/nodes/drawings/index.js +1 -0
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +7 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +1 -0
- package/lib/module/dom/types/NodeType.js +1 -0
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/SkDOM.d.ts +2 -1
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/external/reanimated/buffers.d.ts +5 -0
- package/lib/module/external/reanimated/buffers.js +27 -0
- package/lib/module/external/reanimated/buffers.js.map +1 -0
- package/lib/module/external/reanimated/index.d.ts +2 -0
- package/lib/module/external/reanimated/index.js +2 -0
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.js +13 -1
- package/lib/module/external/reanimated/interpolators.js.map +1 -1
- package/lib/module/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/module/external/reanimated/moduleWrapper.js +3 -2
- package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/module/external/reanimated/textures.d.ts +5 -0
- package/lib/module/external/reanimated/textures.js +24 -0
- package/lib/module/external/reanimated/textures.js.map +1 -0
- package/lib/module/external/reanimated/useAnimatedImageValue.js +7 -1
- package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
- package/lib/module/headless/index.js +1 -1
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/mock/index.js +8 -0
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +1 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.d.ts +1 -1
- package/lib/module/renderer/Container.js +2 -1
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +3 -1
- package/lib/module/renderer/HostComponents.js +3 -0
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/Offscreen.d.ts +4 -1
- package/lib/module/renderer/Offscreen.js +19 -9
- package/lib/module/renderer/Offscreen.js.map +1 -1
- package/lib/module/renderer/Reconciler.d.ts +1 -1
- package/lib/module/renderer/Reconciler.js +7 -4
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/module/renderer/components/shapes/Atlas.js +5 -0
- package/lib/module/renderer/components/shapes/Atlas.js.map +1 -0
- package/lib/module/renderer/components/shapes/index.d.ts +1 -0
- package/lib/module/renderer/components/shapes/index.js +1 -0
- package/lib/module/renderer/components/shapes/index.js.map +1 -1
- package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/module/skia/core/AnimatedImage.js +4 -1
- package/lib/module/skia/core/AnimatedImage.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +1 -1
- package/lib/module/skia/core/Data.js +11 -4
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Rect.d.ts +2 -2
- package/lib/module/skia/types/Canvas.d.ts +16 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Image/Image.d.ts +8 -0
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +2 -2
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/skia/types/RSXform.d.ts +7 -1
- package/lib/module/skia/types/RSXform.js.map +1 -1
- package/lib/module/skia/types/Rect.d.ts +4 -0
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +3 -2
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/module/skia/web/JsiSkCanvas.js +18 -0
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/module/skia/web/JsiSkRSXform.js +34 -3
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.d.ts +3 -2
- package/lib/module/skia/web/JsiSkRect.js +7 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js +2 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +5 -0
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +5 -3
- package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +8 -0
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +1 -0
- package/lib/typescript/src/dom/types/Drawings.d.ts +7 -1
- package/lib/typescript/src/dom/types/NodeType.d.ts +1 -0
- package/lib/typescript/src/dom/types/SkDOM.d.ts +2 -1
- package/lib/typescript/src/external/reanimated/buffers.d.ts +5 -0
- package/lib/typescript/src/external/reanimated/index.d.ts +2 -0
- package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +1 -0
- package/lib/typescript/src/external/reanimated/textures.d.ts +5 -0
- package/lib/typescript/src/renderer/Container.d.ts +1 -1
- package/lib/typescript/src/renderer/HostComponents.d.ts +3 -1
- package/lib/typescript/src/renderer/Offscreen.d.ts +4 -1
- package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
- package/lib/typescript/src/renderer/components/shapes/Atlas.d.ts +4 -0
- package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
- package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
- package/lib/typescript/src/skia/core/Data.d.ts +1 -1
- package/lib/typescript/src/skia/core/Rect.d.ts +2 -2
- package/lib/typescript/src/skia/types/Canvas.d.ts +16 -1
- package/lib/typescript/src/skia/types/Image/Image.d.ts +8 -0
- package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
- package/lib/typescript/src/skia/types/RSXform.d.ts +7 -1
- package/lib/typescript/src/skia/types/Rect.d.ts +4 -0
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/types/Skia.d.ts +3 -2
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +2 -1
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -2
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -2
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/arm64-v8a/libskparagraph.a +0 -0
- package/libs/android/arm64-v8a/libsksg.a +0 -0
- package/libs/android/arm64-v8a/libskshaper.a +0 -0
- package/libs/android/arm64-v8a/libskunicode.a +0 -0
- package/libs/android/arm64-v8a/libsvg.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
- package/libs/android/armeabi-v7a/libsksg.a +0 -0
- package/libs/android/armeabi-v7a/libskshaper.a +0 -0
- package/libs/android/armeabi-v7a/libskunicode.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86/libskparagraph.a +0 -0
- package/libs/android/x86/libsksg.a +0 -0
- package/libs/android/x86/libskshaper.a +0 -0
- package/libs/android/x86/libskunicode.a +0 -0
- package/libs/android/x86/libsvg.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/android/x86_64/libskparagraph.a +0 -0
- package/libs/android/x86_64/libsksg.a +0 -0
- package/libs/android/x86_64/libskshaper.a +0 -0
- package/libs/android/x86_64/libskunicode.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +1 -1
- package/src/dom/nodes/JsiSkDOM.ts +63 -56
- package/src/dom/nodes/drawings/AtlasNode.ts +24 -0
- package/src/dom/nodes/drawings/index.ts +1 -0
- package/src/dom/types/Drawings.ts +9 -0
- package/src/dom/types/NodeType.ts +1 -0
- package/src/dom/types/SkDOM.ts +2 -0
- package/src/external/reanimated/buffers.ts +53 -0
- package/src/external/reanimated/index.ts +2 -0
- package/src/external/reanimated/interpolators.ts +15 -2
- package/src/external/reanimated/moduleWrapper.ts +1 -0
- package/src/external/reanimated/textures.tsx +38 -0
- package/src/external/reanimated/useAnimatedImageValue.ts +15 -4
- package/src/headless/index.ts +1 -1
- package/src/mock/index.ts +8 -0
- package/src/renderer/Canvas.tsx +1 -1
- package/src/renderer/Container.tsx +3 -2
- package/src/renderer/HostComponents.ts +6 -1
- package/src/renderer/Offscreen.tsx +24 -11
- package/src/renderer/Reconciler.tsx +5 -2
- package/src/renderer/components/shapes/Atlas.tsx +8 -0
- package/src/renderer/components/shapes/index.ts +1 -0
- package/src/skia/core/AnimatedImage.ts +3 -2
- package/src/skia/core/Data.ts +8 -4
- package/src/skia/types/Canvas.ts +32 -1
- package/src/skia/types/Image/Image.ts +10 -0
- package/src/skia/types/Matrix4.ts +2 -2
- package/src/skia/types/RSXform.ts +7 -1
- package/src/skia/types/Rect.ts +6 -0
- package/src/skia/types/Shader/Shader.ts +6 -1
- package/src/skia/types/Skia.ts +10 -2
- package/src/skia/web/JsiSkCanvas.ts +60 -23
- package/src/skia/web/JsiSkRSXform.ts +28 -4
- package/src/skia/web/JsiSkRect.ts +12 -2
- package/src/skia/web/JsiSkTextBlobFactory.ts +5 -5
- package/src/skia/web/JsiSkia.ts +15 -0
- package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -142
- package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +0 -107
- package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +0 -32
- package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +0 -83
- package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +0 -47
- package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +0 -57
- package/cpp/skia/include/utils/SkBase64.h +0 -53
- package/cpp/skia/modules/skcms/skcms_internal.h +0 -56
@@ -38,6 +38,7 @@ import type {
|
|
38
38
|
BoxProps,
|
39
39
|
BoxShadowProps,
|
40
40
|
ChildrenProps,
|
41
|
+
AtlasProps,
|
41
42
|
} from "../types";
|
42
43
|
import type {
|
43
44
|
BlendImageFilterProps,
|
@@ -55,7 +56,6 @@ import type {
|
|
55
56
|
Path1DPathEffectProps,
|
56
57
|
Path2DPathEffectProps,
|
57
58
|
} from "../types/PathEffects";
|
58
|
-
import { NATIVE_DOM } from "../../renderer/HostComponents";
|
59
59
|
import type { ParagraphProps } from "../types/Paragraph";
|
60
60
|
|
61
61
|
import {
|
@@ -80,6 +80,7 @@ import {
|
|
80
80
|
BackdropFilterNode,
|
81
81
|
BoxNode,
|
82
82
|
BoxShadowNode,
|
83
|
+
AtlasNode,
|
83
84
|
} from "./drawings";
|
84
85
|
import {
|
85
86
|
BlendImageFilterNode,
|
@@ -125,200 +126,206 @@ import { LayerNode } from "./LayerNode";
|
|
125
126
|
import { ParagraphNode } from "./drawings/ParagraphNode";
|
126
127
|
|
127
128
|
export class JsiSkDOM implements SkDOM {
|
128
|
-
constructor(private ctx: NodeContext) {}
|
129
|
+
constructor(private ctx: NodeContext, private native: boolean) {}
|
129
130
|
|
130
131
|
Layer(props?: ChildrenProps) {
|
131
|
-
return
|
132
|
+
return this.native
|
132
133
|
? global.SkiaDomApi.LayerNode(props ?? {})
|
133
134
|
: new LayerNode(this.ctx, props ?? {});
|
134
135
|
}
|
135
136
|
|
136
137
|
Group(props?: GroupProps) {
|
137
|
-
return
|
138
|
+
return this.native
|
138
139
|
? global.SkiaDomApi.GroupNode(props ?? {})
|
139
140
|
: new GroupNode(this.ctx, props ?? {});
|
140
141
|
}
|
141
142
|
|
142
143
|
Paint(props: PaintProps) {
|
143
|
-
return
|
144
|
+
return this.native
|
144
145
|
? global.SkiaDomApi.PaintNode(props ?? {})
|
145
146
|
: new PaintNode(this.ctx, props);
|
146
147
|
}
|
147
148
|
|
148
149
|
// Drawings
|
149
150
|
Fill(props?: DrawingNodeProps) {
|
150
|
-
return
|
151
|
+
return this.native
|
151
152
|
? global.SkiaDomApi.FillNode(props ?? {})
|
152
153
|
: new FillNode(this.ctx, props);
|
153
154
|
}
|
154
155
|
|
155
156
|
Image(props: ImageProps) {
|
156
|
-
return
|
157
|
+
return this.native
|
157
158
|
? global.SkiaDomApi.ImageNode(props ?? {})
|
158
159
|
: new ImageNode(this.ctx, props);
|
159
160
|
}
|
160
161
|
|
161
162
|
Circle(props: CircleProps) {
|
162
|
-
return
|
163
|
+
return this.native
|
163
164
|
? global.SkiaDomApi.CircleNode(props ?? {})
|
164
165
|
: new CircleNode(this.ctx, props);
|
165
166
|
}
|
166
167
|
|
167
168
|
Path(props: PathProps) {
|
168
|
-
return
|
169
|
+
return this.native
|
169
170
|
? global.SkiaDomApi.PathNode(props ?? {})
|
170
171
|
: new PathNode(this.ctx, props);
|
171
172
|
}
|
172
173
|
|
173
174
|
Line(props: LineProps) {
|
174
|
-
return
|
175
|
+
return this.native
|
175
176
|
? global.SkiaDomApi.LineNode(props ?? {})
|
176
177
|
: new LineNode(this.ctx, props);
|
177
178
|
}
|
178
179
|
|
179
180
|
Oval(props: OvalProps) {
|
180
|
-
return
|
181
|
+
return this.native
|
181
182
|
? global.SkiaDomApi.OvalNode(props ?? {})
|
182
183
|
: new OvalNode(this.ctx, props);
|
183
184
|
}
|
184
185
|
|
185
186
|
Patch(props: PatchProps) {
|
186
|
-
return
|
187
|
+
return this.native
|
187
188
|
? global.SkiaDomApi.PatchNode(props ?? {})
|
188
189
|
: new PatchNode(this.ctx, props);
|
189
190
|
}
|
190
191
|
|
191
192
|
Points(props: PointsProps) {
|
192
|
-
return
|
193
|
+
return this.native
|
193
194
|
? global.SkiaDomApi.PointsNode(props ?? {})
|
194
195
|
: new PointsNode(this.ctx, props);
|
195
196
|
}
|
196
197
|
|
197
198
|
Rect(props: RectProps) {
|
198
|
-
return
|
199
|
+
return this.native
|
199
200
|
? global.SkiaDomApi.RectNode(props)
|
200
201
|
: new RectNode(this.ctx, props);
|
201
202
|
}
|
202
203
|
|
203
204
|
RRect(props: RoundedRectProps) {
|
204
|
-
return
|
205
|
+
return this.native
|
205
206
|
? global.SkiaDomApi.RRectNode(props)
|
206
207
|
: new RRectNode(this.ctx, props);
|
207
208
|
}
|
208
209
|
|
209
210
|
Vertices(props: VerticesProps) {
|
210
|
-
return
|
211
|
+
return this.native
|
211
212
|
? global.SkiaDomApi.VerticesNode(props)
|
212
213
|
: new VerticesNode(this.ctx, props);
|
213
214
|
}
|
214
215
|
|
215
216
|
Text(props: TextProps) {
|
216
|
-
return
|
217
|
+
return this.native
|
217
218
|
? global.SkiaDomApi.TextNode(props)
|
218
219
|
: new TextNode(this.ctx, props);
|
219
220
|
}
|
220
221
|
|
221
222
|
TextPath(props: TextPathProps) {
|
222
|
-
return
|
223
|
+
return this.native
|
223
224
|
? global.SkiaDomApi.TextPathNode(props)
|
224
225
|
: new TextPathNode(this.ctx, props);
|
225
226
|
}
|
226
227
|
|
227
228
|
TextBlob(props: TextBlobProps) {
|
228
|
-
return
|
229
|
+
return this.native
|
229
230
|
? global.SkiaDomApi.TextBlobNode(props)
|
230
231
|
: new TextBlobNode(this.ctx, props);
|
231
232
|
}
|
232
233
|
|
233
234
|
Glyphs(props: GlyphsProps) {
|
234
|
-
return
|
235
|
+
return this.native
|
235
236
|
? global.SkiaDomApi.GlyphsNode(props)
|
236
237
|
: new GlyphsNode(this.ctx, props);
|
237
238
|
}
|
238
239
|
|
239
240
|
DiffRect(props: DiffRectProps) {
|
240
|
-
return
|
241
|
+
return this.native
|
241
242
|
? global.SkiaDomApi.DiffRectNode(props)
|
242
243
|
: new DiffRectNode(this.ctx, props);
|
243
244
|
}
|
244
245
|
|
245
246
|
Picture(props: PictureProps) {
|
246
|
-
return
|
247
|
+
return this.native
|
247
248
|
? global.SkiaDomApi.PictureNode(props)
|
248
249
|
: new PictureNode(this.ctx, props);
|
249
250
|
}
|
250
251
|
|
252
|
+
Atlas(props: AtlasProps) {
|
253
|
+
return this.native
|
254
|
+
? global.SkiaDomApi.AtlasNode(props)
|
255
|
+
: new AtlasNode(this.ctx, props);
|
256
|
+
}
|
257
|
+
|
251
258
|
ImageSVG(props: ImageSVGProps) {
|
252
|
-
return
|
259
|
+
return this.native
|
253
260
|
? global.SkiaDomApi.ImageSVGNode(props)
|
254
261
|
: new ImageSVGNode(this.ctx, props);
|
255
262
|
}
|
256
263
|
|
257
264
|
// BlurMaskFilters
|
258
265
|
BlurMaskFilter(props: BlurMaskFilterProps) {
|
259
|
-
return
|
266
|
+
return this.native
|
260
267
|
? global.SkiaDomApi.BlurMaskFilterNode(props)
|
261
268
|
: new BlurMaskFilterNode(this.ctx, props);
|
262
269
|
}
|
263
270
|
|
264
271
|
// ImageFilters
|
265
272
|
BlendImageFilter(props: BlendImageFilterProps) {
|
266
|
-
return
|
273
|
+
return this.native
|
267
274
|
? global.SkiaDomApi.BlendImageFilterNode(props)
|
268
275
|
: new BlendImageFilterNode(this.ctx, props);
|
269
276
|
}
|
270
277
|
|
271
278
|
DropShadowImageFilter(props: DropShadowImageFilterProps) {
|
272
|
-
return
|
279
|
+
return this.native
|
273
280
|
? global.SkiaDomApi.DropShadowImageFilterNode(props)
|
274
281
|
: new DropShadowImageFilterNode(this.ctx, props);
|
275
282
|
}
|
276
283
|
|
277
284
|
DisplacementMapImageFilter(props: DisplacementMapImageFilterProps) {
|
278
|
-
return
|
285
|
+
return this.native
|
279
286
|
? global.SkiaDomApi.DisplacementMapImageFilterNode(props)
|
280
287
|
: new DisplacementMapImageFilterNode(this.ctx, props);
|
281
288
|
}
|
282
289
|
|
283
290
|
BlurImageFilter(props: BlurImageFilterProps) {
|
284
|
-
return
|
291
|
+
return this.native
|
285
292
|
? global.SkiaDomApi.BlurImageFilterNode(props)
|
286
293
|
: new BlurImageFilterNode(this.ctx, props);
|
287
294
|
}
|
288
295
|
|
289
296
|
OffsetImageFilter(props: OffsetImageFilterProps) {
|
290
|
-
return
|
297
|
+
return this.native
|
291
298
|
? global.SkiaDomApi.OffsetImageFilterNode(props)
|
292
299
|
: new OffsetImageFilterNode(this.ctx, props);
|
293
300
|
}
|
294
301
|
|
295
302
|
MorphologyImageFilter(props: MorphologyImageFilterProps) {
|
296
|
-
return
|
303
|
+
return this.native
|
297
304
|
? global.SkiaDomApi.MorphologyImageFilterNode(props)
|
298
305
|
: new MorphologyImageFilterNode(this.ctx, props);
|
299
306
|
}
|
300
307
|
|
301
308
|
RuntimeShaderImageFilter(props: RuntimeShaderImageFilterProps) {
|
302
|
-
return
|
309
|
+
return this.native
|
303
310
|
? global.SkiaDomApi.RuntimeShaderImageFilterNode(props)
|
304
311
|
: new RuntimeShaderImageFilterNode(this.ctx, props);
|
305
312
|
}
|
306
313
|
|
307
314
|
// Color Filters
|
308
315
|
MatrixColorFilter(props: MatrixColorFilterProps) {
|
309
|
-
return
|
316
|
+
return this.native
|
310
317
|
? global.SkiaDomApi.MatrixColorFilterNode(props)
|
311
318
|
: new MatrixColorFilterNode(this.ctx, props);
|
312
319
|
}
|
313
320
|
|
314
321
|
BlendColorFilter(props: BlendColorFilterProps) {
|
315
|
-
return
|
322
|
+
return this.native
|
316
323
|
? global.SkiaDomApi.BlendColorFilterNode(props)
|
317
324
|
: new BlendColorFilterNode(this.ctx, props);
|
318
325
|
}
|
319
326
|
|
320
327
|
LumaColorFilter() {
|
321
|
-
return
|
328
|
+
return this.native
|
322
329
|
? global.SkiaDomApi.LumaColorFilterNode()
|
323
330
|
: new LumaColorFilterNode(this.ctx);
|
324
331
|
}
|
@@ -338,136 +345,136 @@ export class JsiSkDOM implements SkDOM {
|
|
338
345
|
}
|
339
346
|
|
340
347
|
LerpColorFilter(props: LerpColorFilterProps) {
|
341
|
-
return
|
348
|
+
return this.native
|
342
349
|
? global.SkiaDomApi.LerpColorFilterNode(props)
|
343
350
|
: new LerpColorFilterNode(this.ctx, props);
|
344
351
|
}
|
345
352
|
|
346
353
|
// Shaders
|
347
354
|
Shader(props: ShaderProps) {
|
348
|
-
return
|
355
|
+
return this.native
|
349
356
|
? global.SkiaDomApi.ShaderNode(props)
|
350
357
|
: new ShaderNode(this.ctx, props);
|
351
358
|
}
|
352
359
|
|
353
360
|
ImageShader(props: ImageShaderProps) {
|
354
|
-
return
|
361
|
+
return this.native
|
355
362
|
? global.SkiaDomApi.ImageShaderNode(props)
|
356
363
|
: new ImageShaderNode(this.ctx, props);
|
357
364
|
}
|
358
365
|
|
359
366
|
ColorShader(props: ColorProps) {
|
360
|
-
return
|
367
|
+
return this.native
|
361
368
|
? global.SkiaDomApi.ColorShaderNode(props)
|
362
369
|
: new ColorNode(this.ctx, props);
|
363
370
|
}
|
364
371
|
|
365
372
|
SweepGradient(props: SweepGradientProps) {
|
366
|
-
return
|
373
|
+
return this.native
|
367
374
|
? global.SkiaDomApi.SweepGradientNode(props)
|
368
375
|
: new SweepGradientNode(this.ctx, props);
|
369
376
|
}
|
370
377
|
|
371
378
|
Turbulence(props: TurbulenceProps) {
|
372
|
-
return
|
379
|
+
return this.native
|
373
380
|
? global.SkiaDomApi.TurbulenceNode(props)
|
374
381
|
: new TurbulenceNode(this.ctx, props);
|
375
382
|
}
|
376
383
|
|
377
384
|
FractalNoise(props: FractalNoiseProps) {
|
378
|
-
return
|
385
|
+
return this.native
|
379
386
|
? global.SkiaDomApi.FractalNoiseNode(props)
|
380
387
|
: new FractalNoiseNode(this.ctx, props);
|
381
388
|
}
|
382
389
|
|
383
390
|
LinearGradient(props: LinearGradientProps) {
|
384
|
-
return
|
391
|
+
return this.native
|
385
392
|
? global.SkiaDomApi.LinearGradientNode(props)
|
386
393
|
: new LinearGradientNode(this.ctx, props);
|
387
394
|
}
|
388
395
|
|
389
396
|
RadialGradient(props: RadialGradientProps) {
|
390
|
-
return
|
397
|
+
return this.native
|
391
398
|
? global.SkiaDomApi.RadialGradientNode(props)
|
392
399
|
: new RadialGradientNode(this.ctx, props);
|
393
400
|
}
|
394
401
|
|
395
402
|
TwoPointConicalGradient(props: TwoPointConicalGradientProps) {
|
396
|
-
return
|
403
|
+
return this.native
|
397
404
|
? global.SkiaDomApi.TwoPointConicalGradientNode(props)
|
398
405
|
: new TwoPointConicalGradientNode(this.ctx, props);
|
399
406
|
}
|
400
407
|
|
401
408
|
// Path Effects
|
402
409
|
CornerPathEffect(props: CornerPathEffectProps) {
|
403
|
-
return
|
410
|
+
return this.native
|
404
411
|
? global.SkiaDomApi.CornerPathEffectNode(props)
|
405
412
|
: new CornerPathEffectNode(this.ctx, props);
|
406
413
|
}
|
407
414
|
|
408
415
|
DiscretePathEffect(props: DiscretePathEffectProps) {
|
409
|
-
return
|
416
|
+
return this.native
|
410
417
|
? global.SkiaDomApi.DiscretePathEffectNode(props)
|
411
418
|
: new DiscretePathEffectNode(this.ctx, props);
|
412
419
|
}
|
413
420
|
|
414
421
|
DashPathEffect(props: DashPathEffectProps) {
|
415
|
-
return
|
422
|
+
return this.native
|
416
423
|
? global.SkiaDomApi.DashPathEffectNode(props)
|
417
424
|
: new DashPathEffectNode(this.ctx, props);
|
418
425
|
}
|
419
426
|
|
420
427
|
Path1DPathEffect(props: Path1DPathEffectProps) {
|
421
|
-
return
|
428
|
+
return this.native
|
422
429
|
? global.SkiaDomApi.Path1DPathEffectNode(props)
|
423
430
|
: new Path1DPathEffectNode(this.ctx, props);
|
424
431
|
}
|
425
432
|
|
426
433
|
Path2DPathEffect(props: Path2DPathEffectProps) {
|
427
|
-
return
|
434
|
+
return this.native
|
428
435
|
? global.SkiaDomApi.Path2DPathEffectNode(props)
|
429
436
|
: new Path2DPathEffectNode(this.ctx, props);
|
430
437
|
}
|
431
438
|
|
432
439
|
SumPathEffect() {
|
433
|
-
return
|
440
|
+
return this.native
|
434
441
|
? global.SkiaDomApi.SumPathEffectNode()
|
435
442
|
: new SumPathEffectNode(this.ctx);
|
436
443
|
}
|
437
444
|
|
438
445
|
Line2DPathEffect(props: Line2DPathEffectProps) {
|
439
|
-
return
|
446
|
+
return this.native
|
440
447
|
? global.SkiaDomApi.Line2DPathEffectNode(props)
|
441
448
|
: new Line2DPathEffectNode(this.ctx, props);
|
442
449
|
}
|
443
450
|
|
444
451
|
Blend(props: BlendProps) {
|
445
|
-
return
|
452
|
+
return this.native
|
446
453
|
? global.SkiaDomApi.BlendNode(props)
|
447
454
|
: new BlendNode(this.ctx, props);
|
448
455
|
}
|
449
456
|
|
450
457
|
BackdropFilter(props: ChildrenProps) {
|
451
|
-
return
|
458
|
+
return this.native
|
452
459
|
? global.SkiaDomApi.BackdropFilterNode(props)
|
453
460
|
: new BackdropFilterNode(this.ctx, props);
|
454
461
|
}
|
455
462
|
|
456
463
|
Box(props: BoxProps) {
|
457
|
-
return
|
464
|
+
return this.native
|
458
465
|
? global.SkiaDomApi.BoxNode(props)
|
459
466
|
: new BoxNode(this.ctx, props);
|
460
467
|
}
|
461
468
|
|
462
469
|
BoxShadow(props: BoxShadowProps) {
|
463
|
-
return
|
470
|
+
return this.native
|
464
471
|
? global.SkiaDomApi.BoxShadowNode(props)
|
465
472
|
: new BoxShadowNode(this.ctx, props);
|
466
473
|
}
|
467
474
|
|
468
475
|
// Paragraph
|
469
476
|
Paragraph(props: ParagraphProps) {
|
470
|
-
return
|
477
|
+
return this.native
|
471
478
|
? global.SkiaDomApi.ParagraphNode(props)
|
472
479
|
: new ParagraphNode(this.ctx, props);
|
473
480
|
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { BlendMode } from "../../../skia/types";
|
2
|
+
import type { AtlasProps, DrawingContext } from "../../types";
|
3
|
+
import { NodeType } from "../../types";
|
4
|
+
import { JsiDrawingNode } from "../DrawingNode";
|
5
|
+
import type { NodeContext } from "../Node";
|
6
|
+
import { enumKey } from "../datatypes";
|
7
|
+
|
8
|
+
export class AtlasNode extends JsiDrawingNode<AtlasProps, null> {
|
9
|
+
protected deriveProps() {
|
10
|
+
return null;
|
11
|
+
}
|
12
|
+
|
13
|
+
constructor(ctx: NodeContext, props: AtlasProps) {
|
14
|
+
super(ctx, NodeType.Atlas, props);
|
15
|
+
}
|
16
|
+
|
17
|
+
draw({ canvas, paint }: DrawingContext) {
|
18
|
+
const { image, sprites, transforms, colors, blendMode } = this.props;
|
19
|
+
const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;
|
20
|
+
if (image) {
|
21
|
+
canvas.drawAtlas(image, sprites, transforms, paint, blend, colors);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
@@ -15,6 +15,8 @@ import type {
|
|
15
15
|
SkSVG,
|
16
16
|
SkPaint,
|
17
17
|
SkRect,
|
18
|
+
SkRSXform,
|
19
|
+
SkColor,
|
18
20
|
} from "../../skia/types";
|
19
21
|
|
20
22
|
import type {
|
@@ -58,6 +60,13 @@ export type RectProps = RectDef & DrawingNodeProps;
|
|
58
60
|
|
59
61
|
export type RoundedRectProps = RRectDef & DrawingNodeProps;
|
60
62
|
|
63
|
+
export interface AtlasProps extends DrawingNodeProps {
|
64
|
+
image: SkImage | null;
|
65
|
+
sprites: SkRect[];
|
66
|
+
transforms: SkRSXform[];
|
67
|
+
colors?: SkColor[];
|
68
|
+
}
|
69
|
+
|
61
70
|
export interface CubicBezierHandle {
|
62
71
|
pos: Vector;
|
63
72
|
c1: Vector;
|
package/src/dom/types/SkDOM.ts
CHANGED
@@ -36,6 +36,7 @@ import type {
|
|
36
36
|
DrawingNodeProps,
|
37
37
|
BoxProps,
|
38
38
|
BoxShadowProps,
|
39
|
+
AtlasProps,
|
39
40
|
} from "./Drawings";
|
40
41
|
import type { BlurMaskFilterProps } from "./MaskFilters";
|
41
42
|
import type {
|
@@ -90,6 +91,7 @@ export interface SkDOM {
|
|
90
91
|
DiffRect(props: DiffRectProps): DrawingNode<DiffRectProps>;
|
91
92
|
Picture(props: PictureProps): DrawingNode<PictureProps>;
|
92
93
|
ImageSVG(props: ImageSVGProps): DrawingNode<ImageSVGProps>;
|
94
|
+
Atlas(props: AtlasProps): DrawingNode<AtlasProps>;
|
93
95
|
|
94
96
|
// BlurMaskFilters
|
95
97
|
BlurMaskFilter(
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { useMemo } from "react";
|
2
|
+
|
3
|
+
import type { SkColor, SkHostRect, SkPoint, SkRSXform } from "../../skia/types";
|
4
|
+
import { Skia } from "../../skia";
|
5
|
+
|
6
|
+
import { useDerivedValue, useSharedValue } from "./moduleWrapper";
|
7
|
+
import { notifyChange } from "./interpolators";
|
8
|
+
|
9
|
+
const useBuffer = <T>(
|
10
|
+
size: number,
|
11
|
+
bufferInitializer: () => T,
|
12
|
+
modifier: (input: T, index: number) => void
|
13
|
+
) => {
|
14
|
+
const buffer = useMemo(
|
15
|
+
() => new Array(size).fill(0).map(bufferInitializer),
|
16
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
17
|
+
[size]
|
18
|
+
);
|
19
|
+
const transforms = useSharedValue(buffer);
|
20
|
+
|
21
|
+
useDerivedValue(() => {
|
22
|
+
buffer.forEach((val, index) => {
|
23
|
+
modifier(val, index);
|
24
|
+
});
|
25
|
+
// Assuming notifyChange is a function that notifies about the change in transforms.
|
26
|
+
notifyChange(transforms);
|
27
|
+
});
|
28
|
+
|
29
|
+
return transforms;
|
30
|
+
};
|
31
|
+
|
32
|
+
export const useRectBuffer = (
|
33
|
+
size: number,
|
34
|
+
modifier: (input: SkHostRect, index: number) => void
|
35
|
+
) => useBuffer(size, () => Skia.XYWHRect(0, 0, 0, 0), modifier);
|
36
|
+
|
37
|
+
// Usage for RSXform Buffer
|
38
|
+
export const useRSXformBuffer = (
|
39
|
+
size: number,
|
40
|
+
modifier: (input: SkRSXform, index: number) => void
|
41
|
+
) => useBuffer(size, () => Skia.RSXform(1, 0, 0, 0), modifier);
|
42
|
+
|
43
|
+
// Usage for Point Buffer
|
44
|
+
export const usePointBuffer = (
|
45
|
+
size: number,
|
46
|
+
modifier: (input: SkPoint, index: number) => void
|
47
|
+
) => useBuffer(size, () => Skia.Point(0, 0), modifier);
|
48
|
+
|
49
|
+
// Usage for Color Buffer
|
50
|
+
export const useColorBuffer = (
|
51
|
+
size: number,
|
52
|
+
modifier: (input: SkColor, index: number) => void
|
53
|
+
) => useBuffer(size, () => Skia.Color("black"), modifier);
|
@@ -87,8 +87,20 @@ export const usePathInterpolation = (
|
|
87
87
|
input: number[],
|
88
88
|
outputRange: SkPath[],
|
89
89
|
options?: ExtrapolationType
|
90
|
-
) =>
|
91
|
-
|
90
|
+
) => {
|
91
|
+
// Check if all paths in outputRange are interpolable
|
92
|
+
const allPathsInterpolable = outputRange
|
93
|
+
.slice(1)
|
94
|
+
.every((path) => outputRange[0].isInterpolatable(path));
|
95
|
+
if (!allPathsInterpolable) {
|
96
|
+
// Handle the case where not all paths are interpolable
|
97
|
+
// For example, throw an error or return early
|
98
|
+
throw new Error(
|
99
|
+
`Not all paths in the output range are interpolable.
|
100
|
+
See: https://shopify.github.io/react-native-skia/docs/animations/hooks#usepathinterpolation`
|
101
|
+
);
|
102
|
+
}
|
103
|
+
return useInterpolator(
|
92
104
|
() => Skia.Path.Make(),
|
93
105
|
value,
|
94
106
|
interpolatePaths,
|
@@ -96,6 +108,7 @@ export const usePathInterpolation = (
|
|
96
108
|
outputRange,
|
97
109
|
options
|
98
110
|
);
|
111
|
+
};
|
99
112
|
|
100
113
|
export const useVectorInterpolation = (
|
101
114
|
value: SharedValue<number>,
|
@@ -63,6 +63,7 @@ export const stopMapper: (mapperID: number) => void =
|
|
63
63
|
Reanimated2?.stopMapper || throwOnMissingReanimated;
|
64
64
|
|
65
65
|
export const runOnJS = Reanimated2?.runOnJS || throwOnMissingReanimated;
|
66
|
+
export const runOnUI = Reanimated2?.runOnUI || throwOnMissingReanimated;
|
66
67
|
|
67
68
|
export const useAnimatedReaction: <T>(
|
68
69
|
prepare: () => T,
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { useEffect, useMemo } from "react";
|
2
|
+
import type { ReactElement } from "react";
|
3
|
+
import type { SharedValue } from "react-native-reanimated";
|
4
|
+
|
5
|
+
import type { SkImage, SkPicture, SkSize } from "../../skia/types";
|
6
|
+
import {
|
7
|
+
drawAsImageFromPicture,
|
8
|
+
drawAsPicture,
|
9
|
+
} from "../../renderer/Offscreen";
|
10
|
+
|
11
|
+
import { runOnUI, useSharedValue } from "./moduleWrapper";
|
12
|
+
|
13
|
+
const createTextureValue = (
|
14
|
+
texture: SharedValue<SkImage | null>,
|
15
|
+
picture: SkPicture,
|
16
|
+
size: SkSize
|
17
|
+
) => {
|
18
|
+
"worklet";
|
19
|
+
texture.value = drawAsImageFromPicture(picture, size);
|
20
|
+
};
|
21
|
+
|
22
|
+
export const useTextureValue = (element: ReactElement, size: SkSize) => {
|
23
|
+
const picture = useMemo(() => {
|
24
|
+
return drawAsPicture(element);
|
25
|
+
}, [element]);
|
26
|
+
return useTextureValueFromPicture(picture, size);
|
27
|
+
};
|
28
|
+
|
29
|
+
export const useTextureValueFromPicture = (
|
30
|
+
picture: SkPicture,
|
31
|
+
size: SkSize
|
32
|
+
) => {
|
33
|
+
const texture = useSharedValue<SkImage | null>(null);
|
34
|
+
useEffect(() => {
|
35
|
+
runOnUI(createTextureValue)(texture, picture, size);
|
36
|
+
}, [texture, picture, size]);
|
37
|
+
return texture;
|
38
|
+
};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { useEffect } from "react";
|
1
2
|
import type { FrameInfo } from "react-native-reanimated";
|
2
3
|
|
3
4
|
import { useAnimatedImage } from "../../skia/core/AnimatedImage";
|
@@ -15,10 +16,14 @@ export const useAnimatedImageValue = (source: DataSourceParam) => {
|
|
15
16
|
throwOnMissingReanimated();
|
16
17
|
const currentFrame = useSharedValue<null | SkImage>(null);
|
17
18
|
const lastTimestamp = useSharedValue(0);
|
18
|
-
const animatedImage = useAnimatedImage(
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
const animatedImage = useAnimatedImage(
|
20
|
+
source,
|
21
|
+
(err) => {
|
22
|
+
console.error(err);
|
23
|
+
throw new Error(`Could not load animated image - got '${err.message}'`);
|
24
|
+
},
|
25
|
+
false
|
26
|
+
);
|
22
27
|
const frameDuration =
|
23
28
|
animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;
|
24
29
|
|
@@ -47,5 +52,11 @@ export const useAnimatedImageValue = (source: DataSourceParam) => {
|
|
47
52
|
lastTimestamp.value = timestamp;
|
48
53
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
49
54
|
}, true);
|
55
|
+
useEffect(() => {
|
56
|
+
return () => {
|
57
|
+
animatedImage?.dispose();
|
58
|
+
};
|
59
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
60
|
+
}, []);
|
50
61
|
return currentFrame;
|
51
62
|
};
|
package/src/headless/index.ts
CHANGED
@@ -25,7 +25,7 @@ export const makeOffscreenSurface = (width: number, height: number) => {
|
|
25
25
|
};
|
26
26
|
|
27
27
|
export const drawOffscreen = (surface: SkSurface, element: ReactNode) => {
|
28
|
-
const root = new SkiaRoot(Skia);
|
28
|
+
const root = new SkiaRoot(Skia, false);
|
29
29
|
root.render(element);
|
30
30
|
const canvas = surface.getCanvas();
|
31
31
|
const ctx = new JsiDrawingContext(Skia, canvas);
|