@shopify/react-native-skia 2.10.0 → 2.10.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 +7 -41
- package/android/build.gradle +33 -0
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
- package/cpp/api/JsiNativeBuffer.h +14 -20
- package/cpp/api/JsiSkAnimatedImage.h +13 -16
- package/cpp/api/JsiSkAnimatedImageFactory.h +9 -7
- package/cpp/api/JsiSkApi.h +94 -90
- package/cpp/api/JsiSkCanvas.h +108 -251
- package/cpp/api/JsiSkColorFilterFactory.h +45 -63
- package/cpp/api/JsiSkContourMeasure.h +19 -29
- package/cpp/api/JsiSkContourMeasureIter.h +6 -6
- package/cpp/api/JsiSkConverters.h +410 -0
- package/cpp/api/JsiSkDataFactory.h +9 -15
- package/cpp/api/JsiSkFont.h +99 -180
- package/cpp/api/JsiSkFontMgr.h +19 -21
- package/cpp/api/JsiSkFontMgrFactory.h +4 -5
- package/cpp/api/JsiSkImage.h +66 -66
- package/cpp/api/JsiSkImageFactory.h +66 -63
- package/cpp/api/JsiSkImageFilterFactory.h +354 -608
- package/cpp/api/JsiSkImageInfo.h +10 -13
- package/cpp/api/JsiSkMaskFilterFactory.h +8 -11
- package/cpp/api/JsiSkMatrix.h +36 -73
- package/cpp/api/JsiSkNativeObjects.h +60 -92
- package/cpp/api/JsiSkPaint.h +73 -131
- package/cpp/api/JsiSkParagraph.h +36 -53
- package/cpp/api/JsiSkParagraphBuilder.h +36 -64
- package/cpp/api/JsiSkParagraphBuilderFactory.h +11 -16
- package/cpp/api/JsiSkPath.h +216 -349
- package/cpp/api/JsiSkPathBuilder.h +133 -269
- package/cpp/api/JsiSkPathBuilderFactory.h +11 -11
- package/cpp/api/JsiSkPathEffectFactory.h +52 -72
- package/cpp/api/JsiSkPathFactory.h +129 -195
- package/cpp/api/JsiSkPicture.h +12 -18
- package/cpp/api/JsiSkPictureRecorder.h +14 -15
- package/cpp/api/JsiSkPoint.h +4 -4
- package/cpp/api/JsiSkRRect.h +7 -8
- package/cpp/api/JsiSkRSXform.h +10 -23
- package/cpp/api/JsiSkRect.h +23 -31
- package/cpp/api/JsiSkRuntimeEffect.h +67 -83
- package/cpp/api/JsiSkRuntimeEffectFactory.h +6 -10
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +5 -14
- package/cpp/api/JsiSkSVG.h +4 -4
- package/cpp/api/JsiSkShaderFactory.h +153 -225
- package/cpp/api/JsiSkSkottie.h +104 -126
- package/cpp/api/JsiSkSurface.h +11 -14
- package/cpp/api/JsiSkSurfaceFactory.h +6 -7
- package/cpp/api/JsiSkTextBlobFactory.h +31 -54
- package/cpp/api/JsiSkTypeface.h +8 -12
- package/cpp/api/JsiSkTypefaceFactory.h +9 -7
- package/cpp/api/JsiSkTypefaceFontProvider.h +22 -23
- package/cpp/api/JsiSkTypefaceFontProviderFactory.h +5 -6
- package/cpp/api/JsiSkVertices.h +6 -8
- package/cpp/api/JsiSkiaContext.h +10 -11
- package/cpp/api/JsiVideo.h +31 -71
- package/cpp/jsi/JSIConverter.h +0 -31
- package/cpp/jsi/NativeObject.h +11 -6
- package/cpp/rnskia/RNDawnContext.h +18 -2
- package/cpp/rnskia/RNDawnInterop.cpp +19 -0
- package/cpp/rnskia/RNDawnUtils.h +18 -1
- package/cpp/rnskia/RNSkManager.cpp +5 -162
- package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkaroundsAutogen.h +2 -0
- package/lib/commonjs/mock/index.js +0 -1
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +15 -6
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +5 -15
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/types/index.d.ts +0 -1
- package/lib/commonjs/skia/types/index.js +0 -11
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +1 -4
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/views/index.d.ts +0 -1
- package/lib/commonjs/views/index.js +0 -11
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/module/mock/index.js +0 -1
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/skia/types/Image/ImageFactory.d.ts +15 -6
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +5 -15
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/types/index.d.ts +0 -1
- package/lib/module/skia/types/index.js +0 -1
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.d.ts +2 -2
- package/lib/module/skia/web/JsiSkImageFactory.js +2 -2
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +1 -4
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/views/index.d.ts +0 -1
- package/lib/module/views/index.js +0 -1
- package/lib/module/views/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/mock/index.d.ts +0 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +2 -2
- package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +1 -2
- package/lib/typescript/lib/module/mock/index.d.ts +0 -2
- package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -2
- package/lib/typescript/lib/module/skia/types/index.d.ts +0 -1
- package/lib/typescript/lib/module/skia/web/JsiSkImageFactory.d.ts +2 -2
- package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +1 -2
- package/lib/typescript/lib/module/views/index.d.ts +0 -1
- package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +15 -6
- package/lib/typescript/src/skia/types/Skia.d.ts +5 -15
- package/lib/typescript/src/skia/types/index.d.ts +0 -1
- package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +2 -2
- package/lib/typescript/src/views/index.d.ts +0 -1
- package/package.json +3 -4
- package/react-native-skia.podspec +38 -4
- package/src/mock/index.ts +0 -1
- package/src/skia/types/Image/ImageFactory.ts +15 -6
- package/src/skia/types/Skia.ts +5 -15
- package/src/skia/types/index.ts +0 -1
- package/src/skia/web/JsiSkImageFactory.ts +3 -3
- package/src/skia/web/JsiSkia.ts +2 -5
- package/src/views/index.ts +0 -1
- package/android/cpp/jni/JniWebGPUView.cpp +0 -112
- package/android/cpp/rnskia-android/SkiaPlatformContext.h +0 -26
- package/android/src/main/java/com/shopify/reactnative/skia/WebGPUSurfaceView.java +0 -43
- package/android/src/main/java/com/shopify/reactnative/skia/WebGPUTextureView.java +0 -50
- package/android/src/main/java/com/shopify/reactnative/skia/WebGPUView.java +0 -98
- package/android/src/main/java/com/shopify/reactnative/skia/WebGPUViewAPI.java +0 -19
- package/android/src/main/java/com/shopify/reactnative/skia/WebGPUViewManager.java +0 -58
- package/apple/RNWebGPUAppleNativeBuffer.mm +0 -33
- package/apple/SkiaPlatformContext.h +0 -20
- package/apple/SkiaPlatformContext.mm +0 -21
- package/apple/SkiaWebGPUView.mm +0 -81
- package/apple/WebGPUMetalView.mm +0 -136
- package/cpp/rnwgpu/ArrayBuffer.h +0 -116
- package/cpp/rnwgpu/Canvas.h +0 -52
- package/cpp/rnwgpu/PlatformContext.h +0 -18
- package/cpp/rnwgpu/SurfaceRegistry.h +0 -605
- package/cpp/rnwgpu/api/AppleNativeBuffer.h +0 -22
- package/cpp/rnwgpu/api/Convertors.h +0 -783
- package/cpp/rnwgpu/api/External.h +0 -12
- package/cpp/rnwgpu/api/GPU.cpp +0 -162
- package/cpp/rnwgpu/api/GPU.h +0 -60
- package/cpp/rnwgpu/api/GPUAdapter.cpp +0 -239
- package/cpp/rnwgpu/api/GPUAdapter.h +0 -60
- package/cpp/rnwgpu/api/GPUAdapterInfo.h +0 -57
- package/cpp/rnwgpu/api/GPUBindGroup.cpp +0 -3
- package/cpp/rnwgpu/api/GPUBindGroup.h +0 -51
- package/cpp/rnwgpu/api/GPUBindGroupLayout.h +0 -52
- package/cpp/rnwgpu/api/GPUBuffer.cpp +0 -107
- package/cpp/rnwgpu/api/GPUBuffer.h +0 -88
- package/cpp/rnwgpu/api/GPUCanvasContext.cpp +0 -75
- package/cpp/rnwgpu/api/GPUCanvasContext.h +0 -70
- package/cpp/rnwgpu/api/GPUCommandBuffer.h +0 -45
- package/cpp/rnwgpu/api/GPUCommandEncoder.cpp +0 -179
- package/cpp/rnwgpu/api/GPUCommandEncoder.h +0 -111
- package/cpp/rnwgpu/api/GPUCompilationInfo.h +0 -79
- package/cpp/rnwgpu/api/GPUCompilationMessage.h +0 -36
- package/cpp/rnwgpu/api/GPUComputePassEncoder.cpp +0 -60
- package/cpp/rnwgpu/api/GPUComputePassEncoder.h +0 -85
- package/cpp/rnwgpu/api/GPUComputePipeline.cpp +0 -12
- package/cpp/rnwgpu/api/GPUComputePipeline.h +0 -60
- package/cpp/rnwgpu/api/GPUDevice.cpp +0 -613
- package/cpp/rnwgpu/api/GPUDevice.h +0 -258
- package/cpp/rnwgpu/api/GPUDeviceLostInfo.cpp +0 -7
- package/cpp/rnwgpu/api/GPUDeviceLostInfo.h +0 -40
- package/cpp/rnwgpu/api/GPUError.h +0 -35
- package/cpp/rnwgpu/api/GPUExtent3D.h +0 -66
- package/cpp/rnwgpu/api/GPUExternalTexture.cpp +0 -139
- package/cpp/rnwgpu/api/GPUExternalTexture.h +0 -95
- package/cpp/rnwgpu/api/GPUFeatures.h +0 -203
- package/cpp/rnwgpu/api/GPUInternalError.h +0 -31
- package/cpp/rnwgpu/api/GPUOrigin2D.h +0 -55
- package/cpp/rnwgpu/api/GPUOrigin3D.h +0 -62
- package/cpp/rnwgpu/api/GPUOutOfMemoryError.h +0 -33
- package/cpp/rnwgpu/api/GPUPipelineLayout.h +0 -45
- package/cpp/rnwgpu/api/GPUQuerySet.cpp +0 -11
- package/cpp/rnwgpu/api/GPUQuerySet.h +0 -73
- package/cpp/rnwgpu/api/GPUQueue.cpp +0 -179
- package/cpp/rnwgpu/api/GPUQueue.h +0 -84
- package/cpp/rnwgpu/api/GPURenderBundle.h +0 -44
- package/cpp/rnwgpu/api/GPURenderBundleEncoder.cpp +0 -131
- package/cpp/rnwgpu/api/GPURenderBundleEncoder.h +0 -110
- package/cpp/rnwgpu/api/GPURenderPassEncoder.cpp +0 -165
- package/cpp/rnwgpu/api/GPURenderPassEncoder.h +0 -130
- package/cpp/rnwgpu/api/GPURenderPipeline.cpp +0 -13
- package/cpp/rnwgpu/api/GPURenderPipeline.h +0 -61
- package/cpp/rnwgpu/api/GPUSampler.h +0 -44
- package/cpp/rnwgpu/api/GPUShaderModule.cpp +0 -56
- package/cpp/rnwgpu/api/GPUShaderModule.h +0 -66
- package/cpp/rnwgpu/api/GPUSharedFence.cpp +0 -80
- package/cpp/rnwgpu/api/GPUSharedFence.h +0 -53
- package/cpp/rnwgpu/api/GPUSharedTextureMemory.cpp +0 -135
- package/cpp/rnwgpu/api/GPUSharedTextureMemory.h +0 -75
- package/cpp/rnwgpu/api/GPUSupportedLimits.cpp +0 -129
- package/cpp/rnwgpu/api/GPUSupportedLimits.h +0 -131
- package/cpp/rnwgpu/api/GPUTexture.cpp +0 -47
- package/cpp/rnwgpu/api/GPUTexture.h +0 -162
- package/cpp/rnwgpu/api/GPUTextureView.h +0 -44
- package/cpp/rnwgpu/api/GPUUncapturedErrorEvent.h +0 -60
- package/cpp/rnwgpu/api/GPUValidationError.h +0 -32
- package/cpp/rnwgpu/api/ImageBitmap.h +0 -62
- package/cpp/rnwgpu/api/NativeBufferUtils.h +0 -87
- package/cpp/rnwgpu/api/RNWebGPU.h +0 -82
- package/cpp/rnwgpu/api/WebGPUConstants.h +0 -36
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupDescriptor.h +0 -64
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupEntry.h +0 -78
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutDescriptor.h +0 -56
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutEntry.h +0 -97
- package/cpp/rnwgpu/api/descriptors/GPUBlendComponent.h +0 -57
- package/cpp/rnwgpu/api/descriptors/GPUBlendState.h +0 -52
- package/cpp/rnwgpu/api/descriptors/GPUBufferBinding.h +0 -56
- package/cpp/rnwgpu/api/descriptors/GPUBufferBindingLayout.h +0 -56
- package/cpp/rnwgpu/api/descriptors/GPUBufferDescriptor.h +0 -59
- package/cpp/rnwgpu/api/descriptors/GPUBufferUsage.h +0 -39
- package/cpp/rnwgpu/api/descriptors/GPUCanvasConfiguration.h +0 -76
- package/cpp/rnwgpu/api/descriptors/GPUColor.h +0 -66
- package/cpp/rnwgpu/api/descriptors/GPUColorTargetState.h +0 -58
- package/cpp/rnwgpu/api/descriptors/GPUColorWrite.h +0 -29
- package/cpp/rnwgpu/api/descriptors/GPUCommandBufferDescriptor.h +0 -45
- package/cpp/rnwgpu/api/descriptors/GPUCommandEncoderDescriptor.h +0 -45
- package/cpp/rnwgpu/api/descriptors/GPUComputePassDescriptor.h +0 -56
- package/cpp/rnwgpu/api/descriptors/GPUComputePassTimestampWrites.h +0 -58
- package/cpp/rnwgpu/api/descriptors/GPUComputePipelineDescriptor.h +0 -67
- package/cpp/rnwgpu/api/descriptors/GPUDawnTogglesDescriptor.h +0 -56
- package/cpp/rnwgpu/api/descriptors/GPUDepthStencilState.h +0 -103
- package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +0 -109
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureBindingLayout.h +0 -38
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +0 -90
- package/cpp/rnwgpu/api/descriptors/GPUFragmentState.h +0 -73
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyBuffer.h +0 -62
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +0 -63
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTexture.h +0 -65
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTextureTagged.h +0 -81
- package/cpp/rnwgpu/api/descriptors/GPUImageDataLayout.h +0 -54
- package/cpp/rnwgpu/api/descriptors/GPUMapMode.h +0 -22
- package/cpp/rnwgpu/api/descriptors/GPUMultisampleState.h +0 -54
- package/cpp/rnwgpu/api/descriptors/GPUPipelineLayoutDescriptor.h +0 -57
- package/cpp/rnwgpu/api/descriptors/GPUPrimitiveState.h +0 -69
- package/cpp/rnwgpu/api/descriptors/GPUProgrammableStage.h +0 -61
- package/cpp/rnwgpu/api/descriptors/GPUQuerySetDescriptor.h +0 -55
- package/cpp/rnwgpu/api/descriptors/GPUQueueDescriptor.h +0 -43
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleDescriptor.h +0 -45
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleEncoderDescriptor.h +0 -80
- package/cpp/rnwgpu/api/descriptors/GPURenderPassColorAttachment.h +0 -81
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDepthStencilAttachment.h +0 -101
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDescriptor.h +0 -92
- package/cpp/rnwgpu/api/descriptors/GPURenderPassTimestampWrites.h +0 -58
- package/cpp/rnwgpu/api/descriptors/GPURenderPipelineDescriptor.h +0 -103
- package/cpp/rnwgpu/api/descriptors/GPURequestAdapterOptions.h +0 -51
- package/cpp/rnwgpu/api/descriptors/GPUSamplerBindingLayout.h +0 -45
- package/cpp/rnwgpu/api/descriptors/GPUSamplerDescriptor.h +0 -110
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleCompilationHint.h +0 -60
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleDescriptor.h +0 -62
- package/cpp/rnwgpu/api/descriptors/GPUShaderStage.h +0 -25
- package/cpp/rnwgpu/api/descriptors/GPUSharedFenceDescriptor.h +0 -58
- package/cpp/rnwgpu/api/descriptors/GPUSharedFenceState.h +0 -51
- package/cpp/rnwgpu/api/descriptors/GPUSharedTextureMemoryDescriptor.h +0 -73
- package/cpp/rnwgpu/api/descriptors/GPUStencilFaceState.h +0 -64
- package/cpp/rnwgpu/api/descriptors/GPUStorageTextureBindingLayout.h +0 -59
- package/cpp/rnwgpu/api/descriptors/GPUTextureBindingLayout.h +0 -59
- package/cpp/rnwgpu/api/descriptors/GPUTextureDescriptor.h +0 -91
- package/cpp/rnwgpu/api/descriptors/GPUTextureUsage.h +0 -29
- package/cpp/rnwgpu/api/descriptors/GPUTextureViewDescriptor.h +0 -91
- package/cpp/rnwgpu/api/descriptors/GPUUncapturedErrorEventInit.h +0 -64
- package/cpp/rnwgpu/api/descriptors/GPUVertexAttribute.h +0 -53
- package/cpp/rnwgpu/api/descriptors/GPUVertexBufferLayout.h +0 -62
- package/cpp/rnwgpu/api/descriptors/GPUVertexState.h +0 -73
- package/cpp/rnwgpu/api/descriptors/Unions.h +0 -1969
- package/cpp/rnwgpu/async/AsyncTaskHandle.cpp +0 -213
- package/cpp/rnwgpu/async/AsyncTaskHandle.h +0 -58
- package/cpp/rnwgpu/async/RuntimeContext.cpp +0 -199
- package/cpp/rnwgpu/async/RuntimeContext.h +0 -134
- package/lib/commonjs/skia/types/WebGPU.d.ts +0 -184
- package/lib/commonjs/skia/types/WebGPU.js +0 -105
- package/lib/commonjs/skia/types/WebGPU.js.map +0 -1
- package/lib/commonjs/specs/WebGPUViewNativeComponent.d.ts +0 -8
- package/lib/commonjs/specs/WebGPUViewNativeComponent.js +0 -10
- package/lib/commonjs/specs/WebGPUViewNativeComponent.js.map +0 -1
- package/lib/commonjs/specs/WebGPUViewNativeComponent.web.d.ts +0 -8
- package/lib/commonjs/specs/WebGPUViewNativeComponent.web.js +0 -103
- package/lib/commonjs/specs/WebGPUViewNativeComponent.web.js.map +0 -1
- package/lib/commonjs/specs/utils.d.ts +0 -1
- package/lib/commonjs/specs/utils.js +0 -11
- package/lib/commonjs/specs/utils.js.map +0 -1
- package/lib/commonjs/views/WebGPUCanvas.d.ts +0 -33
- package/lib/commonjs/views/WebGPUCanvas.js +0 -79
- package/lib/commonjs/views/WebGPUCanvas.js.map +0 -1
- package/lib/commonjs/views/WebGPUCanvas.web.d.ts +0 -23
- package/lib/commonjs/views/WebGPUCanvas.web.js +0 -20
- package/lib/commonjs/views/WebGPUCanvas.web.js.map +0 -1
- package/lib/module/skia/types/WebGPU.d.ts +0 -184
- package/lib/module/skia/types/WebGPU.js +0 -99
- package/lib/module/skia/types/WebGPU.js.map +0 -1
- package/lib/module/specs/WebGPUViewNativeComponent.d.ts +0 -8
- package/lib/module/specs/WebGPUViewNativeComponent.js +0 -4
- package/lib/module/specs/WebGPUViewNativeComponent.js.map +0 -1
- package/lib/module/specs/WebGPUViewNativeComponent.web.d.ts +0 -8
- package/lib/module/specs/WebGPUViewNativeComponent.web.js +0 -96
- package/lib/module/specs/WebGPUViewNativeComponent.web.js.map +0 -1
- package/lib/module/specs/utils.d.ts +0 -1
- package/lib/module/specs/utils.js +0 -5
- package/lib/module/specs/utils.js.map +0 -1
- package/lib/module/views/WebGPUCanvas.d.ts +0 -33
- package/lib/module/views/WebGPUCanvas.js +0 -70
- package/lib/module/views/WebGPUCanvas.js.map +0 -1
- package/lib/module/views/WebGPUCanvas.web.d.ts +0 -23
- package/lib/module/views/WebGPUCanvas.web.js +0 -12
- package/lib/module/views/WebGPUCanvas.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/skia/types/WebGPU.d.ts +0 -2
- package/lib/typescript/lib/commonjs/specs/WebGPUViewNativeComponent.d.ts +0 -4
- package/lib/typescript/lib/commonjs/specs/WebGPUViewNativeComponent.web.d.ts +0 -3
- package/lib/typescript/lib/commonjs/specs/utils.d.ts +0 -2
- package/lib/typescript/lib/commonjs/views/WebGPUCanvas.d.ts +0 -6
- package/lib/typescript/lib/commonjs/views/WebGPUCanvas.web.d.ts +0 -6
- package/lib/typescript/lib/module/skia/types/WebGPU.d.ts +0 -31
- package/lib/typescript/lib/module/specs/WebGPUViewNativeComponent.d.ts +0 -2
- package/lib/typescript/lib/module/specs/WebGPUViewNativeComponent.web.d.ts +0 -2
- package/lib/typescript/lib/module/specs/utils.d.ts +0 -1
- package/lib/typescript/lib/module/views/WebGPUCanvas.d.ts +0 -7
- package/lib/typescript/lib/module/views/WebGPUCanvas.web.d.ts +0 -8
- package/lib/typescript/src/skia/types/WebGPU.d.ts +0 -184
- package/lib/typescript/src/specs/WebGPUViewNativeComponent.d.ts +0 -8
- package/lib/typescript/src/specs/WebGPUViewNativeComponent.web.d.ts +0 -8
- package/lib/typescript/src/specs/utils.d.ts +0 -1
- package/lib/typescript/src/views/WebGPUCanvas.d.ts +0 -33
- package/lib/typescript/src/views/WebGPUCanvas.web.d.ts +0 -23
- package/src/skia/types/WebGPU.ts +0 -226
- package/src/specs/WebGPUViewNativeComponent.ts +0 -11
- package/src/specs/WebGPUViewNativeComponent.web.ts +0 -110
- package/src/specs/utils.ts +0 -4
- package/src/views/WebGPUCanvas.tsx +0 -125
- package/src/views/WebGPUCanvas.web.tsx +0 -36
|
@@ -25,17 +25,6 @@ Object.keys(_types).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
-
var _WebGPUCanvas = require("./WebGPUCanvas");
|
|
29
|
-
Object.keys(_WebGPUCanvas).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _WebGPUCanvas[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _WebGPUCanvas[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
28
|
var _formats = require("./formats");
|
|
40
29
|
Object.keys(_formats).forEach(function (key) {
|
|
41
30
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_SkiaPictureView","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_types","
|
|
1
|
+
{"version":3,"names":["_SkiaPictureView","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_types","_formats"],"sources":["index.ts"],"sourcesContent":["export * from \"./SkiaPictureView\";\nexport * from \"./types\";\nexport * from \"./formats\";\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,QAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,QAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,QAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,QAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/lib/module/mock/index.js
CHANGED
|
@@ -24,7 +24,6 @@ export const Mock = CanvasKit => {
|
|
|
24
24
|
...require("../dom/types"),
|
|
25
25
|
...require("../dom/nodes"),
|
|
26
26
|
Canvas: require("react-native").View,
|
|
27
|
-
WebGPUCanvas: require("react-native").View,
|
|
28
27
|
getPreferredHighBitDepthCanvasFormat: () => "rgba16float",
|
|
29
28
|
SkiaPictureView: require("react-native").View,
|
|
30
29
|
JsiSkImage: JsiSkImage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["JsiSkApi","JsiSkImage","Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","Skia","require","Canvas","View","
|
|
1
|
+
{"version":3,"names":["JsiSkApi","JsiSkImage","Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","Skia","require","Canvas","View","getPreferredHighBitDepthCanvasFormat","SkiaPictureView","drawAsPicture","drawAsImage","drawAsImageFromPicture","useCanvasRef","useCanvasSize","ref","size","width","height","useValue","useComputedValue","useTiming","useLoop","useSpring","useClockValue","useValueEffect","isOnMainThread","isFabric","useClock","usePathInterpolation","useImageAsTexture","useTextureValue","useTextureValueFromPicture","useRSXformBuffer","usePointBuffer","useColorBuffer","useRectBuffer","useBuffer","useRawData","useData","useFont","Font","useFonts","useTypeface","useImage","useSVG","useVideo"],"sources":["index.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport { JsiSkApi } from \"../skia/web\";\nimport { JsiSkImage } from \"../skia/web/JsiSkImage\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Noop: () => any = () => undefined;\nconst NoopValue = () => ({ current: 0 });\nconst NoopSharedValue = () => ({ value: 0 });\n\nexport const Mock = (CanvasKit: CanvasKit) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n global.SkiaApi = JsiSkApi(CanvasKit);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const Skia = global.SkiaApi;\n return {\n Skia,\n ...require(\"../renderer/components\"),\n ...require(\"../skia\"),\n ...require(\"../animation\"),\n ...require(\"../dom/types\"),\n ...require(\"../dom/nodes\"),\n Canvas: require(\"react-native\").View,\n getPreferredHighBitDepthCanvasFormat: () => \"rgba16float\",\n SkiaPictureView: require(\"react-native\").View,\n JsiSkImage: JsiSkImage,\n drawAsPicture: Noop,\n drawAsImage: Noop,\n drawAsImageFromPicture: Noop,\n useCanvasRef: NoopValue,\n useCanvasSize: () => ({\n ref: {\n current: 0,\n },\n size: {\n width: 0,\n height: 0,\n },\n }),\n // Skia Animations\n useValue: NoopValue,\n useComputedValue: NoopValue,\n useTiming: NoopValue,\n useLoop: NoopValue,\n useSpring: NoopValue,\n useClockValue: NoopValue,\n useValueEffect: Noop,\n // Reanimated hooks\n isOnMainThread: () => true,\n isFabric: true,\n useClock: NoopSharedValue,\n usePathInterpolation: NoopSharedValue,\n useImageAsTexture: NoopSharedValue,\n useTextureValue: NoopSharedValue,\n useTextureValueFromPicture: NoopSharedValue,\n useRSXformBuffer: NoopSharedValue,\n usePointBuffer: NoopSharedValue,\n useColorBuffer: NoopSharedValue,\n useRectBuffer: NoopSharedValue,\n useBuffer: NoopSharedValue,\n useRawData: Noop,\n useData: Noop,\n useFont: () => Skia.Font(undefined, 0),\n useFonts: Noop,\n useTypeface: () => null,\n useImage: () => null,\n useSVG: () => null,\n useVideo: () => null,\n };\n};\n"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,aAAa;AACtC,SAASC,UAAU,QAAQ,wBAAwB;;AAEnD;AACA,MAAMC,IAAe,GAAGA,CAAA,KAAMC,SAAS;AACvC,MAA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AAA,KAAM,IAAI;IAC1BC,QAAQ,EAAE,IAAI;IACdC,QAAQ,EAAE9B,eAAe;IACzB+B,oBAAoB,EAAE/B,eAAe;IACrCgC,iBAAiB,EAAEhC,eAAe;IAClCiC,eAAe,EAAEjC,eAAe;IAChCkC,0BAA0B,EAAElC,eAAe;IAC3CmC,gBAAgB,EAAEnC,eAAe;IACjCoC,cAAc,EAAEpC,eAAe;IAC/BqC,cAAc,EAAErC,eAAe;IAC/BsC,aAAa,EAAEtC,eAAe;IAC9BuC,SAAS,EAAEvC,eAAe;IAC1BwC,UAAU,EAAE5C,IAAI;IAChB6C,OAAO,EAAE7C,IAAI;IACb8C,OAAO,EAAEA,CAAA,KAAMpC,IAAI,CAACqC,IAAI,CAAC9C,SAAS,EAAE,CAAC,CAAC;IACtC+C,QAAQ,EAAEhD,IAAI;IACdiD,WAAW,EAAEA,CAAA,KAAM,IAAI;IACvBC,QAAQ,EAAEA,CAAA,KAAM,IAAI;IACpBC,MAAM,EAAEA,CAAA,KAAM,IAAI;IAClBC,QAAQ,EAAEA,CAAA,KAAM;EAClB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -80,22 +80,31 @@ export interface ImageFactory {
|
|
|
80
80
|
MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): SkImage | null;
|
|
81
81
|
/**
|
|
82
82
|
* Creates an SkImage from a WebGPU texture.
|
|
83
|
-
* This allows using textures rendered by WebGPU in Skia drawings.
|
|
83
|
+
* This allows using textures rendered by WebGPU in Skia drawings. The
|
|
84
|
+
* texture crosses the package boundary as a raw pointer: pass
|
|
85
|
+
* `texture.nativePointer` from a react-native-webgpu GPUTexture created on
|
|
86
|
+
* the shared device (importDevice(Skia.getNativeDevice())). The native side
|
|
87
|
+
* takes its own reference, so the handle stays valid even if the JS
|
|
88
|
+
* GPUTexture is garbage collected — but do not call texture.destroy()
|
|
89
|
+
* while the image is in use: destroy() releases the underlying GPU
|
|
90
|
+
* resource regardless of reference counts.
|
|
84
91
|
*
|
|
85
92
|
* Note: This method is only available when the Graphite backend is enabled.
|
|
86
93
|
*
|
|
87
|
-
* @param
|
|
94
|
+
* @param pointer - The WGPUTexture pointer (texture.nativePointer)
|
|
88
95
|
* @returns An SkImage wrapping the texture, or throws if the texture is invalid
|
|
89
96
|
*/
|
|
90
|
-
|
|
97
|
+
MakeImageFromNativeTexture(pointer: bigint): SkImage;
|
|
91
98
|
/**
|
|
92
99
|
* Creates a WebGPU texture from an SkImage.
|
|
93
|
-
* This allows using Skia images in WebGPU rendering pipelines.
|
|
100
|
+
* This allows using Skia images in WebGPU rendering pipelines. The
|
|
101
|
+
* returned pointer carries one reference and must be adopted exactly once
|
|
102
|
+
* with react-native-webgpu's adoptTexture(), which owns it from then on.
|
|
94
103
|
*
|
|
95
104
|
* Note: This method is only available when the Graphite backend is enabled.
|
|
96
105
|
*
|
|
97
106
|
* @param image - An SkImage to convert to a texture
|
|
98
|
-
* @returns A
|
|
107
|
+
* @returns A WGPUTexture pointer for adoptTexture(), or throws on failure
|
|
99
108
|
*/
|
|
100
|
-
|
|
109
|
+
MakeNativeTextureFromImage(image: SkImage): bigint;
|
|
101
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AlphaType"],"sources":["ImageFactory.ts"],"sourcesContent":["import type { SkData } from \"../Data\";\nimport type { NativeBuffer } from \"../NativeBuffer\";\n\nimport type { ColorType } from \"./ColorType\";\nimport type { SkImage } from \"./Image\";\n\nexport enum AlphaType {\n Unknown,\n Opaque,\n Premul,\n Unpremul,\n}\n\nexport interface ImageInfo {\n alphaType: AlphaType;\n // TODO: add support for color space\n // colorSpace: ColorSpace;\n colorType: ColorType;\n height: number;\n width: number;\n}\n\nexport interface ImageFactory {\n MakeNull: () => SkImage;\n /**\n * Return an Image backed by the encoded data, but attempt to defer decoding until the image\n * is actually used/drawn. This deferral allows the system to cache the result, either on the\n * CPU or on the GPU, depending on where the image is drawn.\n * This decoding uses the codecs that have been compiled into CanvasKit. If the bytes are\n * invalid (or an unrecognized codec), null will be returned. See Image.h for more details.\n * @param data - Data object with bytes of data\n * @returns If the encoded format is not supported, or subset is outside of the bounds of the decoded\n * image, nullptr is returned.\n */\n MakeImageFromEncoded: (encoded: SkData) => SkImage | null;\n\n /**\n * Return an Image backed by a given native buffer.\n * The native buffer must be a valid owning reference.\n *\n * For instance, this API is used by\n * [react-native-vision-camera](https://github.com/mrousavy/react-native-vision-camera)\n * to render a Skia Camera preview.\n *\n * - On Android; This is an `AHardwareBuffer*`\n * - On iOS, this is a `CVPixelBufferRef`\n * @param nativeBuffer A strong `uintptr_t` pointer to the native buffer\n * @throws Throws an error if the Image could not be created, for example when the given\n * native buffer is invalid.\n */\n MakeImageFromNativeBuffer: (nativeBuffer: NativeBuffer) => SkImage;\n\n /**\n *\n * Return an Image backed by a given native texture.\n *\n * The native texture must be a valid owning reference.\n *\n * This API might be used to integrate with other libraries using gpu textures,\n * or to transfer images between different threads.\n *\n * @param texture A native texture handle\n * @param width The width of the texture\n * @param height The height of the texture\n * @param mipmapped Whether the texture is mipmapped\n * @throws Throws an error if the Image could not be created, for example when the given native texture is invalid.\n *\n * @returns Returns a valid SkImage, if the texture is invalid, an error is thrown.\n */\n MakeImageFromNativeTextureUnstable: (\n texture: unknown,\n width: number,\n height: number,\n mipmapped?: boolean,\n outputImage?: SkImage\n ) => SkImage;\n\n /**\n * Returns an image that will be a screenshot of the view represented by\n * the view tag\n * @param viewTag - The tag of the view to make an image from.\n * @returns Returns a valid SkImage, if the view tag is invalid, nullptr is returned.\n */\n MakeImageFromViewTag: (viewTag: number) => Promise<SkImage | null>;\n\n /**\n * Returns an image with the given pixel data and format.\n * Note that we will always make a copy of the pixel data, because of inconsistencies in\n * behavior between GPU and CPU (i.e. the pixel data will be turned into a GPU texture and\n * not modifiable after creation).\n *\n * @param info\n * @param data - bytes representing the pixel data.\n * @param bytesPerRow\n */\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): SkImage | null;\n\n /**\n * Creates an SkImage from a WebGPU texture.\n * This allows using textures rendered by WebGPU in Skia drawings.\n *\n * Note: This method is only available when the Graphite backend is enabled.\n *\n * @param
|
|
1
|
+
{"version":3,"names":["AlphaType"],"sources":["ImageFactory.ts"],"sourcesContent":["import type { SkData } from \"../Data\";\nimport type { NativeBuffer } from \"../NativeBuffer\";\n\nimport type { ColorType } from \"./ColorType\";\nimport type { SkImage } from \"./Image\";\n\nexport enum AlphaType {\n Unknown,\n Opaque,\n Premul,\n Unpremul,\n}\n\nexport interface ImageInfo {\n alphaType: AlphaType;\n // TODO: add support for color space\n // colorSpace: ColorSpace;\n colorType: ColorType;\n height: number;\n width: number;\n}\n\nexport interface ImageFactory {\n MakeNull: () => SkImage;\n /**\n * Return an Image backed by the encoded data, but attempt to defer decoding until the image\n * is actually used/drawn. This deferral allows the system to cache the result, either on the\n * CPU or on the GPU, depending on where the image is drawn.\n * This decoding uses the codecs that have been compiled into CanvasKit. If the bytes are\n * invalid (or an unrecognized codec), null will be returned. See Image.h for more details.\n * @param data - Data object with bytes of data\n * @returns If the encoded format is not supported, or subset is outside of the bounds of the decoded\n * image, nullptr is returned.\n */\n MakeImageFromEncoded: (encoded: SkData) => SkImage | null;\n\n /**\n * Return an Image backed by a given native buffer.\n * The native buffer must be a valid owning reference.\n *\n * For instance, this API is used by\n * [react-native-vision-camera](https://github.com/mrousavy/react-native-vision-camera)\n * to render a Skia Camera preview.\n *\n * - On Android; This is an `AHardwareBuffer*`\n * - On iOS, this is a `CVPixelBufferRef`\n * @param nativeBuffer A strong `uintptr_t` pointer to the native buffer\n * @throws Throws an error if the Image could not be created, for example when the given\n * native buffer is invalid.\n */\n MakeImageFromNativeBuffer: (nativeBuffer: NativeBuffer) => SkImage;\n\n /**\n *\n * Return an Image backed by a given native texture.\n *\n * The native texture must be a valid owning reference.\n *\n * This API might be used to integrate with other libraries using gpu textures,\n * or to transfer images between different threads.\n *\n * @param texture A native texture handle\n * @param width The width of the texture\n * @param height The height of the texture\n * @param mipmapped Whether the texture is mipmapped\n * @throws Throws an error if the Image could not be created, for example when the given native texture is invalid.\n *\n * @returns Returns a valid SkImage, if the texture is invalid, an error is thrown.\n */\n MakeImageFromNativeTextureUnstable: (\n texture: unknown,\n width: number,\n height: number,\n mipmapped?: boolean,\n outputImage?: SkImage\n ) => SkImage;\n\n /**\n * Returns an image that will be a screenshot of the view represented by\n * the view tag\n * @param viewTag - The tag of the view to make an image from.\n * @returns Returns a valid SkImage, if the view tag is invalid, nullptr is returned.\n */\n MakeImageFromViewTag: (viewTag: number) => Promise<SkImage | null>;\n\n /**\n * Returns an image with the given pixel data and format.\n * Note that we will always make a copy of the pixel data, because of inconsistencies in\n * behavior between GPU and CPU (i.e. the pixel data will be turned into a GPU texture and\n * not modifiable after creation).\n *\n * @param info\n * @param data - bytes representing the pixel data.\n * @param bytesPerRow\n */\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): SkImage | null;\n\n /**\n * Creates an SkImage from a WebGPU texture.\n * This allows using textures rendered by WebGPU in Skia drawings. The\n * texture crosses the package boundary as a raw pointer: pass\n * `texture.nativePointer` from a react-native-webgpu GPUTexture created on\n * the shared device (importDevice(Skia.getNativeDevice())). The native side\n * takes its own reference, so the handle stays valid even if the JS\n * GPUTexture is garbage collected — but do not call texture.destroy()\n * while the image is in use: destroy() releases the underlying GPU\n * resource regardless of reference counts.\n *\n * Note: This method is only available when the Graphite backend is enabled.\n *\n * @param pointer - The WGPUTexture pointer (texture.nativePointer)\n * @returns An SkImage wrapping the texture, or throws if the texture is invalid\n */\n MakeImageFromNativeTexture(pointer: bigint): SkImage;\n\n /**\n * Creates a WebGPU texture from an SkImage.\n * This allows using Skia images in WebGPU rendering pipelines. The\n * returned pointer carries one reference and must be adopted exactly once\n * with react-native-webgpu's adoptTexture(), which owns it from then on.\n *\n * Note: This method is only available when the Graphite backend is enabled.\n *\n * @param image - An SkImage to convert to a texture\n * @returns A WGPUTexture pointer for adoptTexture(), or throws on failure\n */\n MakeNativeTextureFromImage(image: SkImage): bigint;\n}\n"],"mappings":"AAMA,WAAYA,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA","ignoreList":[]}
|
|
@@ -86,20 +86,10 @@ export interface Skia {
|
|
|
86
86
|
NativeBuffer: NativeBufferFactory;
|
|
87
87
|
Recorder(): JsiRecorder;
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
89
|
+
* Raw WGPUDevice pointer of Skia's Graphite device, as a BigInt. Pass it to
|
|
90
|
+
* react-native-webgpu's importDevice() to get a GPUDevice sharing Skia's
|
|
91
|
+
* device (zero-copy interop). Only available on Graphite builds; throws
|
|
92
|
+
* otherwise.
|
|
92
93
|
*/
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Returns the shared WebGPU device used by Skia's Graphite backend.
|
|
96
|
-
* This allows direct access to the GPU device for WebGPU operations.
|
|
97
|
-
*
|
|
98
|
-
* Note: This method is only available when the Graphite backend is enabled.
|
|
99
|
-
* Use hasDevice() to check availability before calling this method.
|
|
100
|
-
*
|
|
101
|
-
* @returns The GPUDevice used by Skia
|
|
102
|
-
* @throws Error if Graphite backend is not enabled
|
|
103
|
-
*/
|
|
104
|
-
getDevice(): GPUDevice;
|
|
94
|
+
getNativeDevice(): bigint;
|
|
105
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["Skia.ts"],"sourcesContent":["import type { ImageFilterFactory } from \"./ImageFilter\";\nimport type { PathFactory, PathBuilderFactory } from \"./Path\";\nimport type { ColorFilterFactory } from \"./ColorFilter\";\nimport type { SkFont, FontMgrFactory } from \"./Font\";\nimport type { SkTypeface, TypefaceFactory } from \"./Typeface\";\nimport type { ImageFactory } from \"./Image\";\nimport type { MaskFilterFactory } from \"./MaskFilter\";\nimport type { SkPaint } from \"./Paint\";\nimport type { SkHostRect, SkRect } from \"./Rect\";\nimport type { SkRRect } from \"./RRect\";\nimport type {\n RuntimeEffectFactory,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n} from \"./RuntimeEffect\";\nimport type { ShaderFactory } from \"./Shader\";\nimport type { SkMatrix } from \"./Matrix\";\nimport type { PathEffectFactory } from \"./PathEffect\";\nimport type { SkPoint } from \"./Point\";\nimport type { SkVertices, VertexMode } from \"./Vertices/Vertices\";\nimport type { DataFactory } from \"./Data\";\nimport type { SVGFactory } from \"./SVG\";\nimport type { TextBlobFactory } from \"./TextBlob\";\nimport type { SkSurface, SurfaceFactory } from \"./Surface\";\nimport type { SkRSXform } from \"./RSXform\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkContourMeasureIter } from \"./ContourMeasure\";\nimport type { PictureFactory, SkPictureRecorder } from \"./Picture\";\nimport type { Color, SkColor } from \"./Color\";\nimport type { TypefaceFontProviderFactory } from \"./Paragraph/TypefaceFontProviderFactory\";\nimport type { AnimatedImageFactory } from \"./AnimatedImage\";\nimport type { ParagraphBuilderFactory } from \"./Paragraph/ParagraphBuilder\";\nimport type { Video } from \"./Video\";\nimport type { NativeBufferFactory } from \"./NativeBuffer\";\nimport type { JsiRecorder } from \"./Recorder\";\nimport type { SkottieFactory } from \"./Skottie\";\n\nexport interface SkiaContext {\n getSurface(): SkSurface;\n present(): void;\n}\n\n/**\n * Declares the interface for the native Skia API\n */\nexport interface Skia {\n Point: (x: number, y: number) => SkPoint;\n XYWHRect: (x: number, y: number, width: number, height: number) => SkHostRect;\n RuntimeShaderBuilder: (rt: SkRuntimeEffect) => SkRuntimeShaderBuilder;\n RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;\n RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;\n RSXformFromRadians: (\n scale: number,\n radians: number,\n tx: number,\n ty: number,\n px: number,\n py: number\n ) => SkRSXform;\n Color: (color: Color) => SkColor;\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ) => SkContourMeasureIter;\n Paint: () => SkPaint;\n PictureRecorder: () => SkPictureRecorder;\n Picture: PictureFactory;\n Path: PathFactory;\n PathBuilder: PathBuilderFactory;\n Matrix: (matrix?: readonly number[]) => SkMatrix;\n ColorFilter: ColorFilterFactory;\n Font: (typeface?: SkTypeface, size?: number) => SkFont;\n Typeface: TypefaceFactory;\n TypefaceFontProvider: TypefaceFontProviderFactory;\n FontMgr: FontMgrFactory;\n MaskFilter: MaskFilterFactory;\n RuntimeEffect: RuntimeEffectFactory;\n ImageFilter: ImageFilterFactory;\n Shader: ShaderFactory;\n PathEffect: PathEffectFactory;\n /**\n * Returns an Vertices based on the given positions and optional parameters.\n * See SkVertices.h (especially the Builder) for more details.\n * @param mode\n * @param positions\n * @param textureCoordinates\n * @param colors - either a list of int colors or a flattened color array.\n * @param indices\n * @param isVolatile\n */\n MakeVertices(\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n ): SkVertices;\n Data: DataFactory;\n Image: ImageFactory;\n AnimatedImage: AnimatedImageFactory;\n SVG: SVGFactory;\n TextBlob: TextBlobFactory;\n Surface: SurfaceFactory;\n ParagraphBuilder: ParagraphBuilderFactory;\n Skottie: SkottieFactory;\n Video: (url: string) => Promise<Video> | Video;\n Context(surface: bigint, width: number, height: number): SkiaContext;\n NativeBuffer: NativeBufferFactory;\n Recorder(): JsiRecorder;\n /**\n *
|
|
1
|
+
{"version":3,"names":[],"sources":["Skia.ts"],"sourcesContent":["import type { ImageFilterFactory } from \"./ImageFilter\";\nimport type { PathFactory, PathBuilderFactory } from \"./Path\";\nimport type { ColorFilterFactory } from \"./ColorFilter\";\nimport type { SkFont, FontMgrFactory } from \"./Font\";\nimport type { SkTypeface, TypefaceFactory } from \"./Typeface\";\nimport type { ImageFactory } from \"./Image\";\nimport type { MaskFilterFactory } from \"./MaskFilter\";\nimport type { SkPaint } from \"./Paint\";\nimport type { SkHostRect, SkRect } from \"./Rect\";\nimport type { SkRRect } from \"./RRect\";\nimport type {\n RuntimeEffectFactory,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n} from \"./RuntimeEffect\";\nimport type { ShaderFactory } from \"./Shader\";\nimport type { SkMatrix } from \"./Matrix\";\nimport type { PathEffectFactory } from \"./PathEffect\";\nimport type { SkPoint } from \"./Point\";\nimport type { SkVertices, VertexMode } from \"./Vertices/Vertices\";\nimport type { DataFactory } from \"./Data\";\nimport type { SVGFactory } from \"./SVG\";\nimport type { TextBlobFactory } from \"./TextBlob\";\nimport type { SkSurface, SurfaceFactory } from \"./Surface\";\nimport type { SkRSXform } from \"./RSXform\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkContourMeasureIter } from \"./ContourMeasure\";\nimport type { PictureFactory, SkPictureRecorder } from \"./Picture\";\nimport type { Color, SkColor } from \"./Color\";\nimport type { TypefaceFontProviderFactory } from \"./Paragraph/TypefaceFontProviderFactory\";\nimport type { AnimatedImageFactory } from \"./AnimatedImage\";\nimport type { ParagraphBuilderFactory } from \"./Paragraph/ParagraphBuilder\";\nimport type { Video } from \"./Video\";\nimport type { NativeBufferFactory } from \"./NativeBuffer\";\nimport type { JsiRecorder } from \"./Recorder\";\nimport type { SkottieFactory } from \"./Skottie\";\n\nexport interface SkiaContext {\n getSurface(): SkSurface;\n present(): void;\n}\n\n/**\n * Declares the interface for the native Skia API\n */\nexport interface Skia {\n Point: (x: number, y: number) => SkPoint;\n XYWHRect: (x: number, y: number, width: number, height: number) => SkHostRect;\n RuntimeShaderBuilder: (rt: SkRuntimeEffect) => SkRuntimeShaderBuilder;\n RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;\n RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;\n RSXformFromRadians: (\n scale: number,\n radians: number,\n tx: number,\n ty: number,\n px: number,\n py: number\n ) => SkRSXform;\n Color: (color: Color) => SkColor;\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ) => SkContourMeasureIter;\n Paint: () => SkPaint;\n PictureRecorder: () => SkPictureRecorder;\n Picture: PictureFactory;\n Path: PathFactory;\n PathBuilder: PathBuilderFactory;\n Matrix: (matrix?: readonly number[]) => SkMatrix;\n ColorFilter: ColorFilterFactory;\n Font: (typeface?: SkTypeface, size?: number) => SkFont;\n Typeface: TypefaceFactory;\n TypefaceFontProvider: TypefaceFontProviderFactory;\n FontMgr: FontMgrFactory;\n MaskFilter: MaskFilterFactory;\n RuntimeEffect: RuntimeEffectFactory;\n ImageFilter: ImageFilterFactory;\n Shader: ShaderFactory;\n PathEffect: PathEffectFactory;\n /**\n * Returns an Vertices based on the given positions and optional parameters.\n * See SkVertices.h (especially the Builder) for more details.\n * @param mode\n * @param positions\n * @param textureCoordinates\n * @param colors - either a list of int colors or a flattened color array.\n * @param indices\n * @param isVolatile\n */\n MakeVertices(\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n ): SkVertices;\n Data: DataFactory;\n Image: ImageFactory;\n AnimatedImage: AnimatedImageFactory;\n SVG: SVGFactory;\n TextBlob: TextBlobFactory;\n Surface: SurfaceFactory;\n ParagraphBuilder: ParagraphBuilderFactory;\n Skottie: SkottieFactory;\n Video: (url: string) => Promise<Video> | Video;\n Context(surface: bigint, width: number, height: number): SkiaContext;\n NativeBuffer: NativeBufferFactory;\n Recorder(): JsiRecorder;\n /**\n * Raw WGPUDevice pointer of Skia's Graphite device, as a BigInt. Pass it to\n * react-native-webgpu's importDevice() to get a GPUDevice sharing Skia's\n * device (zero-copy interop). Only available on Graphite builds; throws\n * otherwise.\n */\n getNativeDevice(): bigint;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Picture\";\nexport * from \"./Data\";\nexport * from \"./SVG\";\nexport * from \"./Surface\";\nexport * from \"./Vertices\";\nexport * from \"./RuntimeEffect\";\nexport * from \"./Shader\";\nexport * from \"./Image\";\nexport * from \"./AnimatedImage\";\nexport * from \"./ColorFilter\";\nexport * from \"./ImageFilter\";\nexport * from \"./Font\";\nexport * from \"./Typeface\";\nexport * from \"./Paint\";\nexport * from \"./Path\";\nexport * from \"./Color\";\nexport * from \"./Canvas\";\nexport * from \"./ContourMeasure\";\nexport * from \"./MaskFilter\";\nexport * from \"./Matrix\";\nexport * from \"./PathEffect\";\nexport * from \"./Point\";\nexport * from \"./Rect\";\nexport * from \"./RRect\";\nexport * from \"./RSXform\";\nexport * from \"./JsiInstance\";\nexport * from \"./Skia\";\nexport * from \"./TextBlob\";\nexport * from \"./Size\";\nexport * from \"./Paragraph\";\nexport * from \"./Matrix4\";\nexport * from \"./NativeBuffer\";\nexport * from \"./
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Picture\";\nexport * from \"./Data\";\nexport * from \"./SVG\";\nexport * from \"./Surface\";\nexport * from \"./Vertices\";\nexport * from \"./RuntimeEffect\";\nexport * from \"./Shader\";\nexport * from \"./Image\";\nexport * from \"./AnimatedImage\";\nexport * from \"./ColorFilter\";\nexport * from \"./ImageFilter\";\nexport * from \"./Font\";\nexport * from \"./Typeface\";\nexport * from \"./Paint\";\nexport * from \"./Path\";\nexport * from \"./Color\";\nexport * from \"./Canvas\";\nexport * from \"./ContourMeasure\";\nexport * from \"./MaskFilter\";\nexport * from \"./Matrix\";\nexport * from \"./PathEffect\";\nexport * from \"./Point\";\nexport * from \"./Rect\";\nexport * from \"./RRect\";\nexport * from \"./RSXform\";\nexport * from \"./JsiInstance\";\nexport * from \"./Skia\";\nexport * from \"./TextBlob\";\nexport * from \"./Size\";\nexport * from \"./Paragraph\";\nexport * from \"./Matrix4\";\nexport * from \"./NativeBuffer\";\nexport * from \"./Recorder\";\nexport * from \"./Video\";\nexport * from \"./Skottie\";\n"],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,OAAO;AACrB,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,iBAAiB;AAC/B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,cAAc,kBAAkB;AAChC,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,eAAe;AAC7B,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,aAAa;AAC3B,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,WAAW","ignoreList":[]}
|
|
@@ -11,6 +11,6 @@ export declare class JsiSkImageFactory extends Host implements ImageFactory {
|
|
|
11
11
|
MakeImageFromEncoded(encoded: SkData): JsiSkImage | null;
|
|
12
12
|
MakeImageFromNativeTextureUnstable(): SkImage;
|
|
13
13
|
MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): JsiSkImage | null;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
MakeImageFromNativeTexture(_pointer: bigint): SkImage;
|
|
15
|
+
MakeNativeTextureFromImage(_image: SkImage): bigint;
|
|
16
16
|
}
|
|
@@ -63,10 +63,10 @@ export class JsiSkImageFactory extends Host {
|
|
|
63
63
|
}
|
|
64
64
|
return new JsiSkImage(this.CanvasKit, image);
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
MakeImageFromNativeTexture(_pointer) {
|
|
67
67
|
return throwNotImplementedOnRNWeb();
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
MakeNativeTextureFromImage(_image) {
|
|
70
70
|
return throwNotImplementedOnRNWeb();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CanvasKitWebGLBuffer","isNativeBufferWeb","Host","getEnum","throwNotImplementedOnRNWeb","JsiSkImage","JsiSkData","JsiSkImageFactory","constructor","CanvasKit","MakeNull","MakeImageFromViewTag","viewTag","view","console","log","Promise","resolve","MakeImageFromNativeBuffer","buffer","surface","image","Error","img","HTMLImageElement","HTMLVideoElement","ImageBitmap","MakeLazyImageFromTextureSource","toImage","MakeImageFromCanvasImageSource","makeImageFromTextureSource","updateTextureFromSource","MakeImageFromEncoded","encoded","fromValue","MakeImageFromNativeTextureUnstable","MakeImage","info","data","bytesPerRow","alphaType","colorSpace","ColorSpace","SRGB","colorType","height","width","
|
|
1
|
+
{"version":3,"names":["CanvasKitWebGLBuffer","isNativeBufferWeb","Host","getEnum","throwNotImplementedOnRNWeb","JsiSkImage","JsiSkData","JsiSkImageFactory","constructor","CanvasKit","MakeNull","MakeImageFromViewTag","viewTag","view","console","log","Promise","resolve","MakeImageFromNativeBuffer","buffer","surface","image","Error","img","HTMLImageElement","HTMLVideoElement","ImageBitmap","MakeLazyImageFromTextureSource","toImage","MakeImageFromCanvasImageSource","makeImageFromTextureSource","updateTextureFromSource","MakeImageFromEncoded","encoded","fromValue","MakeImageFromNativeTextureUnstable","MakeImage","info","data","bytesPerRow","alphaType","colorSpace","ColorSpace","SRGB","colorType","height","width","MakeImageFromNativeTexture","_pointer","MakeNativeTextureFromImage","_image"],"sources":["JsiSkImageFactory.ts"],"sourcesContent":["import type { CanvasKit, Image } from \"canvaskit-wasm\";\n\nimport { CanvasKitWebGLBuffer, isNativeBufferWeb } from \"../types\";\nimport type {\n SkData,\n ImageInfo,\n SkImage,\n NativeBuffer,\n ImageFactory,\n} from \"../types\";\n\nimport { Host, getEnum, throwNotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkData } from \"./JsiSkData\";\nimport type { JsiSkSurface } from \"./JsiSkSurface\";\nimport type { CanvasKitWebGLBufferImpl } from \"./CanvasKitWebGLBufferImpl\";\n\nexport class JsiSkImageFactory extends Host implements ImageFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeNull() {\n return new JsiSkImage(this.CanvasKit, null as unknown as Image);\n }\n\n MakeImageFromViewTag(viewTag: number): Promise<SkImage | null> {\n const view = viewTag as unknown as HTMLElement;\n // TODO: Implement screenshot from view in React JS\n console.log(view);\n return Promise.resolve(null);\n }\n\n MakeImageFromNativeBuffer(\n buffer: NativeBuffer,\n surface?: JsiSkSurface,\n image?: JsiSkImage\n ) {\n if (!isNativeBufferWeb(buffer)) {\n throw new Error(\"Invalid NativeBuffer\");\n }\n if (!surface) {\n let img: Image;\n if (\n buffer instanceof HTMLImageElement ||\n buffer instanceof HTMLVideoElement ||\n buffer instanceof ImageBitmap\n ) {\n img = this.CanvasKit.MakeLazyImageFromTextureSource(buffer);\n } else if (buffer instanceof CanvasKitWebGLBuffer) {\n img = (\n buffer as CanvasKitWebGLBuffer as CanvasKitWebGLBufferImpl\n ).toImage();\n } else {\n img = this.CanvasKit.MakeImageFromCanvasImageSource(buffer);\n }\n return new JsiSkImage(this.CanvasKit, img);\n } else if (!image) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const img = (surface as any).makeImageFromTextureSource(buffer) as Image;\n return new JsiSkImage(this.CanvasKit, img);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const img = (surface as any).updateTextureFromSource(\n image,\n buffer\n ) as Image;\n return new JsiSkImage(this.CanvasKit, img);\n }\n }\n\n MakeImageFromEncoded(encoded: SkData) {\n const image = this.CanvasKit.MakeImageFromEncoded(\n JsiSkData.fromValue(encoded)\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n MakeImageFromNativeTextureUnstable() {\n return throwNotImplementedOnRNWeb<SkImage>();\n }\n\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number) {\n // see toSkImageInfo() from canvaskit\n const image = this.CanvasKit.MakeImage(\n {\n alphaType: getEnum(this.CanvasKit, \"AlphaType\", info.alphaType),\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n colorType: getEnum(this.CanvasKit, \"ColorType\", info.colorType),\n height: info.height,\n width: info.width,\n },\n JsiSkData.fromValue(data),\n bytesPerRow\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n MakeImageFromNativeTexture(_pointer: bigint): SkImage {\n return throwNotImplementedOnRNWeb<SkImage>();\n }\n\n MakeNativeTextureFromImage(_image: SkImage): bigint {\n return throwNotImplementedOnRNWeb<bigint>();\n }\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,EAAEC,iBAAiB,QAAQ,UAAU;AASlE,SAASC,IAAI,EAAEC,OAAO,EAAEC,0BAA0B,QAAQ,QAAQ;AAClE,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,aAAa;AAIvC,OAAO,MAAMC,iBAAiB,SAASL,IAAI,CAAyB;EAClEM,WAAWA,CAACC,SAAoB,EAAE;IAChC,KAAK,CAACA,SAAS,CAAC;EAClB;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,IAAIL,UAAU,CAAC,IAAI,CAACI,SAAS,EAAE,IAAwB,CAAC;EACjE;EAEAE,oBAAoBA,CAACC,OAAe,EAA2B;IAC7D,MAAMC,IAAI,GAAGD,OAAiC;IAC9C;IACAE,OAAO,CAACC,GAAG,CAACF,IAAI,CAAC;IACjB,OAAOG,OAAO,CAACC,OAAO,CAAC,IAAI,CAAC;EAC9B;EAEAC,yBAAyBA,CACvBC,MAAoB,EACpBC,OAAsB,EACtBC,KAAkB,EAClB;IACA,IAAI,CAACpB,iBAAiB,C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IACnC,OAAO/B,0BAA0B,CAAU,CAAC;EAC9C;EAEAgC,SAASA,CAACC,IAAe,EAAEC,IAAY,EAAEC,WAAmB,EAAE;IAC5D;IACA,MAAMlB,KAAK,GAAG,IAAI,CAACZ,SAAS,CAAC2B,SAAS,CACpC;MACEI,SAAS,EAAErC,OAAO,CAAC,IAAI,CAACM,SAAS,EAAE,WAAW,EAAE4B,IAAI,CAACG,SAAS,CAAC;MAC/DC,UAAU,EAAE,IAAI,CAAChC,SAAS,CAACiC,UAAU,CAACC,IAAI;MAC1CC,SAAS,EAAEzC,OAAO,CAAC,IAAI,CAACM,SAAS,EAAE,WAAW,EAAE4B,IAAI,CAACO,SAAS,CAAC;MAC/DC,MAAM,EAAER,IAAI,CAACQ,MAAM;MACnBC,KAAK,EAAET,IAAI,CAACS;IACd,CAAC,EACDxC,SAAS,CAAC4B,SAAS,CAACI,IAAI,CAAC,EACzBC,WACF,CAAC;IACD,IAAIlB,KAAK,KAAK,IAAI,EAAE;MAClB,OAAO,IAAI;IACb;IACA,OAAO,IAAIhB,UAAU,CAAC,IAAI,CAACI,SAAS,EAAEY,KAAK,CAAC;EAC9C;EAEA0B,0BAA0BA,CAACC,QAAgB,EAAW;IACpD,OAAO5C,0BAA0B,CAAU,CAAC;EAC9C;EAEA6C,0BAA0BA,CAACC,MAAe,EAAU;IAClD,OAAO9C,0BAA0B,CAAS,CAAC;EAC7C;AACF","ignoreList":[]}
|
|
@@ -93,11 +93,8 @@ export const JsiSkApi = CanvasKit => ({
|
|
|
93
93
|
Recorder: () => {
|
|
94
94
|
return throwNotImplementedOnRNWeb();
|
|
95
95
|
},
|
|
96
|
-
|
|
96
|
+
getNativeDevice: () => {
|
|
97
97
|
return throwNotImplementedOnRNWeb();
|
|
98
|
-
},
|
|
99
|
-
hasDevice: () => {
|
|
100
|
-
return false;
|
|
101
98
|
}
|
|
102
99
|
});
|
|
103
100
|
//# sourceMappingURL=JsiSkia.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","JsiSkContourMeasureIter","JsiSkPictureRecorder","JsiSkPictureFactory","JsiSkPathFactory","JsiSkPathBuilderFactory","JsiSkMatrix","JsiSkColorFilterFactory","JsiSkTypefaceFactory","JsiSkMaskFilterFactory","JsiSkRuntimeEffectFactory","JsiSkImageFilterFactory","JsiSkShaderFactory","JsiSkPathEffectFactory","JsiSkDataFactory","JsiSkImageFactory","JsiSkSVGFactory","JsiSkTextBlobFactory","JsiSkFont","MakeVertices","JsiSkPath","JsiSkTypeface","JsiSkTypefaceFontProviderFactory","JsiSkFontMgrFactory","JsiSkAnimatedImageFactory","JsiSkParagraphBuilderFactory","JsiSkNativeBufferFactory","createVideo","throwNotImplementedOnRNWeb","JsiSkottieFactory","JsiSkApi","CanvasKit","Point","x","y","Float32Array","of","RuntimeShaderBuilder","_","RRectXY","rect","rx","ry","RSXform","scos","ssin","tx","ty","RSXformFromRadians","scale","r","px","py","s","Math","sin","c","cos","ContourMeasureIter","path","forceClosed","resScale","p","pathFromValue","iter","delete","Paint","paint","setAntiAlias","PictureRecorder","Picture","Path","PathBuilder","Matrix","matrix","identity","ColorFilter","Font","typeface","size","undefined","fromValue","Typeface","MaskFilter","RuntimeEffect","ImageFilter","Shader","PathEffect","bind","Data","Image","AnimatedImage","SVG","TextBlob","XYWHRect","width","height","Surface","TypefaceFontProvider","FontMgr","ParagraphBuilder","NativeBuffer","Skottie","Video","Context","_surface","_width","_height","Recorder","getDevice","hasDevice"],"sources":["JsiSkia.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n JsiRecorder,\n SkContourMeasureIter,\n Skia,\n SkiaContext,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkPathBuilderFactory } from \"./JsiSkPathBuilderFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\nimport { JsiSkTypefaceFontProviderFactory } from \"./JsiSkTypefaceFontProviderFactory\";\nimport { JsiSkFontMgrFactory } from \"./JsiSkFontMgrFactory\";\nimport { JsiSkAnimatedImageFactory } from \"./JsiSkAnimatedImageFactory\";\nimport { JsiSkParagraphBuilderFactory } from \"./JsiSkParagraphBuilderFactory\";\nimport { JsiSkNativeBufferFactory } from \"./JsiSkNativeBufferFactory\";\nimport { createVideo } from \"./JsiVideo\";\nimport { throwNotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkottieFactory } from \"./JsiSkottieFactory\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect) => {\n return throwNotImplementedOnRNWeb<SkRuntimeShaderBuilder>();\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, rect, rx, ry),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n RSXformFromRadians: (\n scale: number,\n r: number,\n tx: number,\n ty: number,\n px: number,\n py: number\n ) => {\n const s = Math.sin(r) * scale;\n const c = Math.cos(r) * scale;\n return new JsiSkRSXform(\n CanvasKit,\n Float32Array.of(c, s, tx - c * px + s * py, ty - s * px - c * py)\n );\n },\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n (() => {\n const p = JsiSkPath.pathFromValue(path);\n const iter = new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(p, forceClosed, resScale)\n );\n p.delete();\n return iter;\n })(),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n PathBuilder: new JsiSkPathBuilderFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n AnimatedImage: new JsiSkAnimatedImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n TypefaceFontProvider: new JsiSkTypefaceFontProviderFactory(CanvasKit),\n FontMgr: new JsiSkFontMgrFactory(CanvasKit),\n ParagraphBuilder: new JsiSkParagraphBuilderFactory(CanvasKit),\n NativeBuffer: new JsiSkNativeBufferFactory(CanvasKit),\n Skottie: new JsiSkottieFactory(CanvasKit),\n Video: createVideo.bind(null, CanvasKit),\n Context: (_surface: bigint, _width: number, _height: number) => {\n return throwNotImplementedOnRNWeb<SkiaContext>();\n },\n Recorder: () => {\n return throwNotImplementedOnRNWeb<JsiRecorder>();\n },\n getDevice: () => {\n return throwNotImplementedOnRNWeb<GPUDevice>();\n },\n hasDevice: () => {\n return false;\n },\n});\n"],"mappings":"AAcA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,QAAQ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zE,iBAAiB,CAACE,SAAS,CAAC;EACzCwE,KAAK,EAAE5E,WAAW,CAAC6D,IAAI,CAAC,IAAI,EAAEzD,SAAS,CAAC;EACxCyE,OAAO,EAAEA,CAACC,QAAgB,EAAEC,MAAc,EAAEC,OAAe,KAAK;IAC9D,OAAO/E,0BAA0B,CAAc,CAAC;EAClD,CAAC;EACDgF,QAAQ,EAAEA,CAAA,KAAM;IACd,OAAOhF,0BAA0B,CAAc,CAAC;EAClD,CAAC;EACDiF,SAAS,EAAEA,CAAA,KAAM;IACf,OAAOjF,0BAA0B,CAAY,CAAC;EAChD,CAAC;EACDkF,SAAS,EAAEA,CAAA,KAAM;IACf,OAAO,KAAK;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","JsiSkContourMeasureIter","JsiSkPictureRecorder","JsiSkPictureFactory","JsiSkPathFactory","JsiSkPathBuilderFactory","JsiSkMatrix","JsiSkColorFilterFactory","JsiSkTypefaceFactory","JsiSkMaskFilterFactory","JsiSkRuntimeEffectFactory","JsiSkImageFilterFactory","JsiSkShaderFactory","JsiSkPathEffectFactory","JsiSkDataFactory","JsiSkImageFactory","JsiSkSVGFactory","JsiSkTextBlobFactory","JsiSkFont","MakeVertices","JsiSkPath","JsiSkTypeface","JsiSkTypefaceFontProviderFactory","JsiSkFontMgrFactory","JsiSkAnimatedImageFactory","JsiSkParagraphBuilderFactory","JsiSkNativeBufferFactory","createVideo","throwNotImplementedOnRNWeb","JsiSkottieFactory","JsiSkApi","CanvasKit","Point","x","y","Float32Array","of","RuntimeShaderBuilder","_","RRectXY","rect","rx","ry","RSXform","scos","ssin","tx","ty","RSXformFromRadians","scale","r","px","py","s","Math","sin","c","cos","ContourMeasureIter","path","forceClosed","resScale","p","pathFromValue","iter","delete","Paint","paint","setAntiAlias","PictureRecorder","Picture","Path","PathBuilder","Matrix","matrix","identity","ColorFilter","Font","typeface","size","undefined","fromValue","Typeface","MaskFilter","RuntimeEffect","ImageFilter","Shader","PathEffect","bind","Data","Image","AnimatedImage","SVG","TextBlob","XYWHRect","width","height","Surface","TypefaceFontProvider","FontMgr","ParagraphBuilder","NativeBuffer","Skottie","Video","Context","_surface","_width","_height","Recorder","getNativeDevice"],"sources":["JsiSkia.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n JsiRecorder,\n SkContourMeasureIter,\n Skia,\n SkiaContext,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkPathBuilderFactory } from \"./JsiSkPathBuilderFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\nimport { JsiSkTypefaceFontProviderFactory } from \"./JsiSkTypefaceFontProviderFactory\";\nimport { JsiSkFontMgrFactory } from \"./JsiSkFontMgrFactory\";\nimport { JsiSkAnimatedImageFactory } from \"./JsiSkAnimatedImageFactory\";\nimport { JsiSkParagraphBuilderFactory } from \"./JsiSkParagraphBuilderFactory\";\nimport { JsiSkNativeBufferFactory } from \"./JsiSkNativeBufferFactory\";\nimport { createVideo } from \"./JsiVideo\";\nimport { throwNotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkottieFactory } from \"./JsiSkottieFactory\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect) => {\n return throwNotImplementedOnRNWeb<SkRuntimeShaderBuilder>();\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, rect, rx, ry),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n RSXformFromRadians: (\n scale: number,\n r: number,\n tx: number,\n ty: number,\n px: number,\n py: number\n ) => {\n const s = Math.sin(r) * scale;\n const c = Math.cos(r) * scale;\n return new JsiSkRSXform(\n CanvasKit,\n Float32Array.of(c, s, tx - c * px + s * py, ty - s * px - c * py)\n );\n },\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n (() => {\n const p = JsiSkPath.pathFromValue(path);\n const iter = new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(p, forceClosed, resScale)\n );\n p.delete();\n return iter;\n })(),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n PathBuilder: new JsiSkPathBuilderFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n AnimatedImage: new JsiSkAnimatedImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n TypefaceFontProvider: new JsiSkTypefaceFontProviderFactory(CanvasKit),\n FontMgr: new JsiSkFontMgrFactory(CanvasKit),\n ParagraphBuilder: new JsiSkParagraphBuilderFactory(CanvasKit),\n NativeBuffer: new JsiSkNativeBufferFactory(CanvasKit),\n Skottie: new JsiSkottieFactory(CanvasKit),\n Video: createVideo.bind(null, CanvasKit),\n Context: (_surface: bigint, _width: number, _height: number) => {\n return throwNotImplementedOnRNWeb<SkiaContext>();\n },\n Recorder: () => {\n return throwNotImplementedOnRNWeb<JsiRecorder>();\n },\n getNativeDevice: () => {\n return throwNotImplementedOnRNWeb<bigint>();\n },\n});\n"],"mappings":"AAcA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,KAAK,QAAQ,cAAc;AACpC,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,yBAAyB,QAAQ,6BAA6B;AACvE,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,oBAAoB,QAAQ,wBAAwB;AAC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IpG,SAAS,CAACmC,SAAS,EAAEA,SAAS,CAAC+D,QAAQ,CAAC7D,CAAC,EAAEC,CAAC,EAAE6D,KAAK,EAAEC,MAAM,CAAC,CAAC;EAC1E,CAAC;EACDC,OAAO,EAAE,IAAInG,mBAAmB,CAACiC,SAAS,CAAC;EAC3CmE,oBAAoB,EAAE,IAAI5E,gCAAgC,CAACS,SAAS,CAAC;EACrEoE,OAAO,EAAE,IAAI5E,mBAAmB,CAACQ,SAAS,CAAC;EAC3CqE,gBAAgB,EAAE,IAAI3E,4BAA4B,CAACM,SAAS,CAAC;EAC7DsE,YAAY,EAAE,IAAI3E,wBAAwB,CAACK,SAAS,CAAC;EACrDuE,OAAO,EAAE,IAAIzE,iBAAiB,CAACE,SAAS,CAAC;EACzCwE,KAAK,EAAE5E,WAAW,CAAC6D,IAAI,CAAC,IAAI,EAAEzD,SAAS,CAAC;EACxCyE,OAAO,EAAEA,CAACC,QAAgB,EAAEC,MAAc,EAAEC,OAAe,KAAK;IAC9D,OAAO/E,0BAA0B,CAAc,CAAC;EAClD,CAAC;EACDgF,QAAQ,EAAEA,CAAA,KAAM;IACd,OAAOhF,0BAA0B,CAAc,CAAC;EAClD,CAAC;EACDiF,eAAe,EAAEA,CAAA,KAAM;IACrB,OAAOjF,0BAA0B,CAAS,CAAC;EAC7C;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./SkiaPictureView\";\nexport * from \"./types\";\nexport * from \"./
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./SkiaPictureView\";\nexport * from \"./types\";\nexport * from \"./formats\";\n"],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,SAAS;AACvB,cAAc,WAAW","ignoreList":[]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export const __esModule: boolean;
|
|
2
2
|
export function Mock(CanvasKit: any): {
|
|
3
3
|
Canvas: typeof import("react-native").View;
|
|
4
|
-
WebGPUCanvas: typeof import("react-native").View;
|
|
5
4
|
getPreferredHighBitDepthCanvasFormat: () => string;
|
|
6
5
|
SkiaPictureView: typeof import("react-native").View;
|
|
7
6
|
JsiSkImage: typeof _JsiSkImage.JsiSkImage;
|
|
@@ -6,8 +6,8 @@ export class JsiSkImageFactory extends _Host.Host {
|
|
|
6
6
|
MakeImageFromEncoded(encoded: any): _JsiSkImage.JsiSkImage | null;
|
|
7
7
|
MakeImageFromNativeTextureUnstable(): jest.Mock<any, any, any>;
|
|
8
8
|
MakeImage(info: any, data: any, bytesPerRow: any): _JsiSkImage.JsiSkImage | null;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
MakeImageFromNativeTexture(_pointer: any): jest.Mock<any, any, any>;
|
|
10
|
+
MakeNativeTextureFromImage(_image: any): jest.Mock<any, any, any>;
|
|
11
11
|
}
|
|
12
12
|
import _Host = require("./Host");
|
|
13
13
|
import _JsiSkImage = require("./JsiSkImage");
|
|
@@ -37,8 +37,7 @@ export function JsiSkApi(CanvasKit: any): {
|
|
|
37
37
|
Video: (url?: any) => Promise<any>;
|
|
38
38
|
Context: (_surface: any, _width: any, _height: any) => jest.Mock<any, any, any>;
|
|
39
39
|
Recorder: () => jest.Mock<any, any, any>;
|
|
40
|
-
|
|
41
|
-
hasDevice: () => boolean;
|
|
40
|
+
getNativeDevice: () => jest.Mock<any, any, any>;
|
|
42
41
|
};
|
|
43
42
|
import _JsiSkPoint = require("./JsiSkPoint");
|
|
44
43
|
import _JsiSkRRect = require("./JsiSkRRect");
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export function Mock(CanvasKit: any): {
|
|
2
2
|
Canvas: typeof import("react-native").View;
|
|
3
|
-
WebGPUCanvas: typeof import("react-native").View;
|
|
4
3
|
getPreferredHighBitDepthCanvasFormat: () => string;
|
|
5
4
|
SkiaPictureView: typeof import("react-native").View;
|
|
6
5
|
JsiSkImage: typeof JsiSkImage;
|
|
@@ -307,7 +306,6 @@ export function Mock(CanvasKit: any): {
|
|
|
307
306
|
isNativeBufferAddr: (buffer: any) => buffer is BigInt;
|
|
308
307
|
isNativeBufferWeb: (buffer: any) => boolean;
|
|
309
308
|
isNativeBufferNode: (buffer: any) => buffer is ArrayBuffer;
|
|
310
|
-
installWebGPU: any;
|
|
311
309
|
LineBreakType: {};
|
|
312
310
|
VerticalTextAlign: {};
|
|
313
311
|
ResizePolicy: {};
|
|
@@ -36,6 +36,5 @@ export const Skia: {
|
|
|
36
36
|
Video: (url?: any) => Promise<any>;
|
|
37
37
|
Context: (_surface: any, _width: any, _height: any) => jest.Mock<any, any, any>;
|
|
38
38
|
Recorder: () => jest.Mock<any, any, any>;
|
|
39
|
-
|
|
40
|
-
hasDevice: () => boolean;
|
|
39
|
+
getNativeDevice: () => jest.Mock<any, any, any>;
|
|
41
40
|
};
|
|
@@ -5,8 +5,8 @@ export class JsiSkImageFactory extends Host {
|
|
|
5
5
|
MakeImageFromEncoded(encoded: any): JsiSkImage | null;
|
|
6
6
|
MakeImageFromNativeTextureUnstable(): jest.Mock<any, any, any>;
|
|
7
7
|
MakeImage(info: any, data: any, bytesPerRow: any): JsiSkImage | null;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
MakeImageFromNativeTexture(_pointer: any): jest.Mock<any, any, any>;
|
|
9
|
+
MakeNativeTextureFromImage(_image: any): jest.Mock<any, any, any>;
|
|
10
10
|
}
|
|
11
11
|
import { Host } from "./Host";
|
|
12
12
|
import { JsiSkImage } from "./JsiSkImage";
|
|
@@ -36,8 +36,7 @@ export function JsiSkApi(CanvasKit: any): {
|
|
|
36
36
|
Video: (url?: any) => Promise<any>;
|
|
37
37
|
Context: (_surface: any, _width: any, _height: any) => jest.Mock<any, any, any>;
|
|
38
38
|
Recorder: () => jest.Mock<any, any, any>;
|
|
39
|
-
|
|
40
|
-
hasDevice: () => boolean;
|
|
39
|
+
getNativeDevice: () => jest.Mock<any, any, any>;
|
|
41
40
|
};
|
|
42
41
|
import { JsiSkPoint } from "./JsiSkPoint";
|
|
43
42
|
import { JsiSkRRect } from "./JsiSkRRect";
|
|
@@ -80,22 +80,31 @@ export interface ImageFactory {
|
|
|
80
80
|
MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): SkImage | null;
|
|
81
81
|
/**
|
|
82
82
|
* Creates an SkImage from a WebGPU texture.
|
|
83
|
-
* This allows using textures rendered by WebGPU in Skia drawings.
|
|
83
|
+
* This allows using textures rendered by WebGPU in Skia drawings. The
|
|
84
|
+
* texture crosses the package boundary as a raw pointer: pass
|
|
85
|
+
* `texture.nativePointer` from a react-native-webgpu GPUTexture created on
|
|
86
|
+
* the shared device (importDevice(Skia.getNativeDevice())). The native side
|
|
87
|
+
* takes its own reference, so the handle stays valid even if the JS
|
|
88
|
+
* GPUTexture is garbage collected — but do not call texture.destroy()
|
|
89
|
+
* while the image is in use: destroy() releases the underlying GPU
|
|
90
|
+
* resource regardless of reference counts.
|
|
84
91
|
*
|
|
85
92
|
* Note: This method is only available when the Graphite backend is enabled.
|
|
86
93
|
*
|
|
87
|
-
* @param
|
|
94
|
+
* @param pointer - The WGPUTexture pointer (texture.nativePointer)
|
|
88
95
|
* @returns An SkImage wrapping the texture, or throws if the texture is invalid
|
|
89
96
|
*/
|
|
90
|
-
|
|
97
|
+
MakeImageFromNativeTexture(pointer: bigint): SkImage;
|
|
91
98
|
/**
|
|
92
99
|
* Creates a WebGPU texture from an SkImage.
|
|
93
|
-
* This allows using Skia images in WebGPU rendering pipelines.
|
|
100
|
+
* This allows using Skia images in WebGPU rendering pipelines. The
|
|
101
|
+
* returned pointer carries one reference and must be adopted exactly once
|
|
102
|
+
* with react-native-webgpu's adoptTexture(), which owns it from then on.
|
|
94
103
|
*
|
|
95
104
|
* Note: This method is only available when the Graphite backend is enabled.
|
|
96
105
|
*
|
|
97
106
|
* @param image - An SkImage to convert to a texture
|
|
98
|
-
* @returns A
|
|
107
|
+
* @returns A WGPUTexture pointer for adoptTexture(), or throws on failure
|
|
99
108
|
*/
|
|
100
|
-
|
|
109
|
+
MakeNativeTextureFromImage(image: SkImage): bigint;
|
|
101
110
|
}
|
|
@@ -86,20 +86,10 @@ export interface Skia {
|
|
|
86
86
|
NativeBuffer: NativeBufferFactory;
|
|
87
87
|
Recorder(): JsiRecorder;
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
89
|
+
* Raw WGPUDevice pointer of Skia's Graphite device, as a BigInt. Pass it to
|
|
90
|
+
* react-native-webgpu's importDevice() to get a GPUDevice sharing Skia's
|
|
91
|
+
* device (zero-copy interop). Only available on Graphite builds; throws
|
|
92
|
+
* otherwise.
|
|
92
93
|
*/
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Returns the shared WebGPU device used by Skia's Graphite backend.
|
|
96
|
-
* This allows direct access to the GPU device for WebGPU operations.
|
|
97
|
-
*
|
|
98
|
-
* Note: This method is only available when the Graphite backend is enabled.
|
|
99
|
-
* Use hasDevice() to check availability before calling this method.
|
|
100
|
-
*
|
|
101
|
-
* @returns The GPUDevice used by Skia
|
|
102
|
-
* @throws Error if Graphite backend is not enabled
|
|
103
|
-
*/
|
|
104
|
-
getDevice(): GPUDevice;
|
|
94
|
+
getNativeDevice(): bigint;
|
|
105
95
|
}
|
|
@@ -11,6 +11,6 @@ export declare class JsiSkImageFactory extends Host implements ImageFactory {
|
|
|
11
11
|
MakeImageFromEncoded(encoded: SkData): JsiSkImage | null;
|
|
12
12
|
MakeImageFromNativeTextureUnstable(): SkImage;
|
|
13
13
|
MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): JsiSkImage | null;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
MakeImageFromNativeTexture(_pointer: bigint): SkImage;
|
|
15
|
+
MakeNativeTextureFromImage(_image: SkImage): bigint;
|
|
16
16
|
}
|
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": "2.10.
|
|
11
|
+
"version": "2.10.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",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"rimraf": "3.0.2",
|
|
132
132
|
"semantic-release": "^24.1.0",
|
|
133
133
|
"semantic-release-yarn": "^3.0.2",
|
|
134
|
-
"tar": "^7.5.
|
|
134
|
+
"tar": "^7.5.21",
|
|
135
135
|
"ts-jest": "29.4.3",
|
|
136
136
|
"tsx": "^4.21.0",
|
|
137
137
|
"typescript": "^5.2.2",
|
|
@@ -163,8 +163,7 @@
|
|
|
163
163
|
},
|
|
164
164
|
"ios": {
|
|
165
165
|
"componentProvider": {
|
|
166
|
-
"SkiaPictureView": "SkiaPictureView"
|
|
167
|
-
"SkiaWebGPUView": "SkiaWebGPUView"
|
|
166
|
+
"SkiaPictureView": "SkiaPictureView"
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
169
|
},
|