@shopify/react-native-skia 2.10.0 → 2.11.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/CMakeLists.txt +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/dawn/include/dawn/dawn_proc.h +53 -0
- package/cpp/dawn/include/dawn/dawn_proc_table.h +330 -0
- package/cpp/dawn/include/dawn/dawn_thread_dispatch_proc.h +47 -0
- package/cpp/dawn/include/dawn/dawn_version.h +41 -0
- package/cpp/dawn/include/dawn/native/D3D11Backend.h +65 -0
- package/cpp/dawn/include/dawn/native/D3D12Backend.h +86 -0
- package/cpp/dawn/include/dawn/native/D3DBackend.h +56 -0
- package/cpp/dawn/include/dawn/native/DawnNative.h +369 -0
- package/cpp/dawn/include/dawn/native/MetalBackend.h +56 -0
- package/cpp/dawn/include/dawn/native/NullBackend.h +39 -0
- package/cpp/dawn/include/dawn/native/OpenGLBackend.h +89 -0
- package/cpp/dawn/include/dawn/native/VulkanBackend.h +183 -0
- package/cpp/dawn/include/dawn/native/WebGPUBackend.h +49 -0
- package/cpp/dawn/include/dawn/native/dawn_native_export.h +49 -0
- package/cpp/dawn/include/dawn/platform/DawnPlatform.h +210 -0
- package/cpp/dawn/include/dawn/platform/dawn_platform_export.h +49 -0
- package/cpp/dawn/include/dawn/replay/Replay.h +99 -0
- package/cpp/dawn/include/dawn/replay/dawn_replay_export.h +49 -0
- package/cpp/dawn/include/dawn/webgpu_cpp_print.h +2844 -0
- package/cpp/dawn/include/tint/tint.h +90 -0
- package/cpp/dawn/include/webgpu/webgpu.h +4987 -0
- package/cpp/dawn/include/webgpu/webgpu_cpp.h +10080 -0
- package/cpp/dawn/include/webgpu/webgpu_cpp_chained_struct.h +57 -0
- package/cpp/dawn/include/webgpu/webgpu_enum_class_bitmasks.h +161 -0
- package/cpp/dawn/include/webgpu/webgpu_glfw.h +88 -0
- 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/cpp/skia/src/gpu/graphite/ContextOptionsPriv.h +45 -0
- package/cpp/skia/src/gpu/graphite/ResourceTypes.h +360 -0
- package/cpp/skia/src/gpu/graphite/TextureProxyView.h +105 -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/libs/.graphite +1 -0
- package/package.json +8 -9
- 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
package/android/CMakeLists.txt
CHANGED
|
@@ -70,6 +70,7 @@ if(SK_GRAPHITE)
|
|
|
70
70
|
set(BACKEND_SOURCES
|
|
71
71
|
#TODO: is this source needed to be added?
|
|
72
72
|
"${PROJECT_SOURCE_DIR}/../cpp/rnskia/RNDawnWindowContext.cpp"
|
|
73
|
+
"${PROJECT_SOURCE_DIR}/../cpp/rnskia/RNDawnInterop.cpp"
|
|
73
74
|
)
|
|
74
75
|
else()
|
|
75
76
|
add_definitions(-DSK_GL -DSK_GANESH)
|
|
@@ -114,39 +115,6 @@ add_library(
|
|
|
114
115
|
${BACKEND_SOURCES}
|
|
115
116
|
)
|
|
116
117
|
|
|
117
|
-
if(SK_GRAPHITE)
|
|
118
|
-
target_sources(${PACKAGE_NAME} PRIVATE
|
|
119
|
-
# WebGPU async system
|
|
120
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/async/AsyncTaskHandle.cpp"
|
|
121
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/async/RuntimeContext.cpp"
|
|
122
|
-
|
|
123
|
-
# WebGPU API
|
|
124
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPU.cpp"
|
|
125
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUAdapter.cpp"
|
|
126
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUBindGroup.cpp"
|
|
127
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUBuffer.cpp"
|
|
128
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUCanvasContext.cpp"
|
|
129
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUCommandEncoder.cpp"
|
|
130
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUComputePassEncoder.cpp"
|
|
131
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUComputePipeline.cpp"
|
|
132
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUDevice.cpp"
|
|
133
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUDeviceLostInfo.cpp"
|
|
134
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUExternalTexture.cpp"
|
|
135
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUQuerySet.cpp"
|
|
136
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUQueue.cpp"
|
|
137
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPURenderBundleEncoder.cpp"
|
|
138
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPURenderPassEncoder.cpp"
|
|
139
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPURenderPipeline.cpp"
|
|
140
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUShaderModule.cpp"
|
|
141
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUSharedFence.cpp"
|
|
142
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUSharedTextureMemory.cpp"
|
|
143
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUSupportedLimits.cpp"
|
|
144
|
-
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUTexture.cpp"
|
|
145
|
-
|
|
146
|
-
# WebGPU Canvas JNI bindings
|
|
147
|
-
"${PROJECT_SOURCE_DIR}/cpp/jni/JniWebGPUView.cpp"
|
|
148
|
-
)
|
|
149
|
-
endif()
|
|
150
118
|
|
|
151
119
|
|
|
152
120
|
target_include_directories(
|
|
@@ -176,12 +144,8 @@ target_include_directories(
|
|
|
176
144
|
../cpp/rnskia/values
|
|
177
145
|
../cpp/utils
|
|
178
146
|
|
|
179
|
-
#
|
|
147
|
+
# Shared JSI infrastructure (cpp/jsi) via prefix-qualified includes
|
|
180
148
|
../cpp
|
|
181
|
-
../cpp/rnwgpu
|
|
182
|
-
../cpp/rnwgpu/api
|
|
183
|
-
../cpp/rnwgpu/api/descriptors
|
|
184
|
-
../cpp/rnwgpu/async
|
|
185
149
|
|
|
186
150
|
${libfbjni_include_DIRS}
|
|
187
151
|
)
|
|
@@ -214,8 +178,10 @@ add_library(jsonreader STATIC IMPORTED)
|
|
|
214
178
|
set_property(TARGET jsonreader PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libjsonreader.a")
|
|
215
179
|
|
|
216
180
|
if(SK_GRAPHITE)
|
|
217
|
-
|
|
218
|
-
|
|
181
|
+
# Dawn is a shared library, the same artifact react-native-webgpu links, so
|
|
182
|
+
# an app that installs both packages loads exactly one Dawn copy.
|
|
183
|
+
add_library(webgpu_dawn SHARED IMPORTED)
|
|
184
|
+
set_property(TARGET webgpu_dawn PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libwebgpu_dawn.so")
|
|
219
185
|
endif()
|
|
220
186
|
|
|
221
187
|
find_library(
|
|
@@ -390,7 +356,7 @@ endif()
|
|
|
390
356
|
if(SK_GRAPHITE)
|
|
391
357
|
target_link_libraries(${PACKAGE_NAME}
|
|
392
358
|
${COMMON_LIBS}
|
|
393
|
-
|
|
359
|
+
webgpu_dawn
|
|
394
360
|
)
|
|
395
361
|
else()
|
|
396
362
|
target_link_libraries(${PACKAGE_NAME}
|
package/android/build.gradle
CHANGED
|
@@ -88,6 +88,39 @@ def skiaLibsPath = useGraphite
|
|
|
88
88
|
: "${resolveNodePackage('react-native-skia-graphite-android', projectDir)}/libs")
|
|
89
89
|
: "${resolveNodePackage('react-native-skia-android', projectDir)}/libs"
|
|
90
90
|
|
|
91
|
+
// Both packages must link the exact same Dawn artifact: compare this
|
|
92
|
+
// Graphite build's Dawn release tag (libs/.dawn-version) with the tag
|
|
93
|
+
// react-native-webgpu declares in its package.json `dawn` field.
|
|
94
|
+
if (useGraphite) {
|
|
95
|
+
def dawnMarker = file("${projectDir}/../libs/.dawn-version")
|
|
96
|
+
def webgpuDir = null
|
|
97
|
+
try {
|
|
98
|
+
webgpuDir = resolveNodePackage('react-native-webgpu', projectDir)
|
|
99
|
+
} catch (Exception ignored) {
|
|
100
|
+
// react-native-webgpu not installed: nothing to check
|
|
101
|
+
}
|
|
102
|
+
if (dawnMarker.exists() && webgpuDir != null) {
|
|
103
|
+
def skiaDawn = dawnMarker.text.trim()
|
|
104
|
+
def webgpuJson = new groovy.json.JsonSlurper().parse(file("${webgpuDir}/package.json"))
|
|
105
|
+
if (webgpuJson.dawn == null) {
|
|
106
|
+
throw new GradleException(
|
|
107
|
+
"react-native-skia: the installed react-native-webgpu " +
|
|
108
|
+
"(${webgpuJson.version}) does not declare a `dawn` field in its " +
|
|
109
|
+
"package.json, so it predates shared-Dawn support and cannot be " +
|
|
110
|
+
"paired with this Graphite build (which links ${skiaDawn}). " +
|
|
111
|
+
"Upgrade react-native-webgpu.")
|
|
112
|
+
}
|
|
113
|
+
def webgpuDawn = "dawn-" + webgpuJson.dawn.toString().replace('/', '-')
|
|
114
|
+
if (skiaDawn != webgpuDawn) {
|
|
115
|
+
throw new GradleException(
|
|
116
|
+
"react-native-skia: Dawn version mismatch. This Graphite build links " +
|
|
117
|
+
"${skiaDawn} but react-native-webgpu links ${webgpuDawn}. " +
|
|
118
|
+
"Align the two packages so the app contains exactly one Dawn.")
|
|
119
|
+
}
|
|
120
|
+
logger.warn("react-native-skia: Dawn versions match (${skiaDawn})")
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
91
124
|
logger.warn("react-native-skia: SK_GRAPHITE: ${useGraphite}")
|
|
92
125
|
logger.warn("react-native-skia: Skia libs: ${skiaLibsPath}")
|
|
93
126
|
logger.warn("react-native-skia: node_modules/ found at: ${nodeModules}")
|
|
@@ -43,8 +43,7 @@ public class RNSkiaPackage extends TurboReactPackage {
|
|
|
43
43
|
@Override
|
|
44
44
|
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
45
45
|
return Arrays.<ViewManager>asList(
|
|
46
|
-
new SkiaPictureViewManager()
|
|
47
|
-
new WebGPUViewManager()
|
|
46
|
+
new SkiaPictureViewManager()
|
|
48
47
|
);
|
|
49
48
|
}
|
|
50
49
|
|
|
@@ -21,36 +21,30 @@ class JsiNativeBufferFactory
|
|
|
21
21
|
public:
|
|
22
22
|
static constexpr const char *CLASS_NAME = "NativeBufferFactory";
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
// Native buffer pointers travel as BigInts, which the void* converter
|
|
25
|
+
// produces/consumes.
|
|
26
|
+
void *MakeFromImage(sk_sp<SkImage> image) {
|
|
26
27
|
image->makeNonTextureImage();
|
|
27
28
|
uint64_t pointer = getContext()->makeNativeBuffer(image);
|
|
28
|
-
return
|
|
29
|
+
return reinterpret_cast<void *>(pointer);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
auto width = static_cast<int>(arguments[0].asNumber());
|
|
33
|
-
auto height = static_cast<int>(arguments[1].asNumber());
|
|
32
|
+
void *MakeTestBuffer(int width, int height) {
|
|
34
33
|
uint64_t pointer = getContext()->makeTestNativeBuffer(width, height);
|
|
35
|
-
return
|
|
34
|
+
return reinterpret_cast<void *>(pointer);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
jsi::BigInt pointer = arguments[0].asBigInt(runtime);
|
|
41
|
-
const uintptr_t nativeBufferPointer = pointer.asUint64(runtime);
|
|
42
|
-
|
|
43
|
-
getContext()->releaseNativeBuffer(nativeBufferPointer);
|
|
44
|
-
return jsi::Value::undefined();
|
|
37
|
+
void Release(void *pointer) {
|
|
38
|
+
getContext()->releaseNativeBuffer(reinterpret_cast<uintptr_t>(pointer));
|
|
45
39
|
}
|
|
46
40
|
|
|
47
41
|
static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
installMethod(runtime, prototype, "Release",
|
|
43
|
+
&JsiNativeBufferFactory::Release);
|
|
44
|
+
installMethod(runtime, prototype, "MakeFromImage",
|
|
45
|
+
&JsiNativeBufferFactory::MakeFromImage);
|
|
46
|
+
installMethod(runtime, prototype, "MakeTestBuffer",
|
|
47
|
+
&JsiNativeBufferFactory::MakeTestBuffer);
|
|
54
48
|
}
|
|
55
49
|
|
|
56
50
|
size_t getMemoryPressure() override { return 1024; }
|
|
@@ -35,34 +35,31 @@ public:
|
|
|
35
35
|
static constexpr const char *CLASS_NAME = "AnimatedImage";
|
|
36
36
|
|
|
37
37
|
// TODO-API: Properties?
|
|
38
|
-
|
|
38
|
+
std::shared_ptr<JsiSkImage> getCurrentFrame() {
|
|
39
39
|
auto image = getObject()->getCurrentFrame();
|
|
40
|
-
return
|
|
41
|
-
runtime, std::make_shared<JsiSkImage>(getContext(), std::move(image)));
|
|
40
|
+
return std::make_shared<JsiSkImage>(getContext(), std::move(image));
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
return static_cast<int>(getObject()->getFrameCount());
|
|
46
|
-
}
|
|
43
|
+
int getFrameCount() { return static_cast<int>(getObject()->getFrameCount()); }
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
int currentFrameDuration() {
|
|
49
46
|
return static_cast<int>(getObject()->currentFrameDuration());
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
|
|
49
|
+
int decodeNextFrame() {
|
|
53
50
|
return static_cast<int>(getObject()->decodeNextFrame());
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
|
|
57
54
|
installCommon(runtime, prototype);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
installMethod(runtime, prototype, "getFrameCount",
|
|
56
|
+
&JsiSkAnimatedImage::getFrameCount);
|
|
57
|
+
installMethod(runtime, prototype, "getCurrentFrame",
|
|
58
|
+
&JsiSkAnimatedImage::getCurrentFrame);
|
|
59
|
+
installMethod(runtime, prototype, "currentFrameDuration",
|
|
60
|
+
&JsiSkAnimatedImage::currentFrameDuration);
|
|
61
|
+
installMethod(runtime, prototype, "decodeNextFrame",
|
|
62
|
+
&JsiSkAnimatedImage::decodeNextFrame);
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
JsiSkAnimatedImage(std::shared_ptr<RNSkPlatformContext> context,
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
#include <memory>
|
|
4
4
|
#include <utility>
|
|
5
|
+
#include <variant>
|
|
5
6
|
|
|
6
7
|
#include <jsi/jsi.h>
|
|
7
8
|
|
|
8
9
|
#include "JsiSkAnimatedImage.h"
|
|
10
|
+
#include "JsiSkConverters.h"
|
|
9
11
|
#include "JsiSkData.h"
|
|
10
12
|
#include "JsiSkNativeObjects.h"
|
|
11
13
|
#include "jsi/JsiPromises.h"
|
|
@@ -19,22 +21,22 @@ class JsiSkAnimatedImageFactory
|
|
|
19
21
|
public:
|
|
20
22
|
static constexpr const char *CLASS_NAME = "AnimatedImageFactory";
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
std::variant<std::nullptr_t, std::shared_ptr<JsiSkAnimatedImage>>
|
|
25
|
+
MakeAnimatedImageFromEncoded(sk_sp<SkData> data) {
|
|
24
26
|
auto codec = SkAndroidCodec::MakeFromData(data);
|
|
25
27
|
auto image = SkAnimatedImage::Make(std::move(codec));
|
|
26
28
|
if (image == nullptr) {
|
|
27
|
-
return
|
|
29
|
+
return nullptr;
|
|
28
30
|
}
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
+
return std::make_shared<JsiSkAnimatedImage>(getContext(),
|
|
32
|
+
std::move(image));
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
size_t getMemoryPressure() override { return 1024; }
|
|
34
36
|
|
|
35
37
|
static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
installMethod(runtime, prototype, "MakeAnimatedImageFromEncoded",
|
|
39
|
+
&JsiSkAnimatedImageFactory::MakeAnimatedImageFromEncoded);
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
explicit JsiSkAnimatedImageFactory(
|
package/cpp/api/JsiSkApi.h
CHANGED
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
#ifdef SK_GRAPHITE
|
|
10
10
|
#include "rnskia/RNDawnContext.h"
|
|
11
|
-
#include "rnwgpu/api/GPUDevice.h"
|
|
12
|
-
#include "rnwgpu/async/RuntimeContext.h"
|
|
13
11
|
#endif
|
|
14
12
|
|
|
15
13
|
#include "JsiNativeBuffer.h"
|
|
@@ -173,88 +171,94 @@ public:
|
|
|
173
171
|
JSI_HOST_FUNCTION(Color) {
|
|
174
172
|
return JsiSkColor::createCtor()(runtime, thisValue, arguments, count);
|
|
175
173
|
}
|
|
176
|
-
JSI_HOST_FUNCTION(
|
|
177
|
-
return JsiRecorder::createCtor(getContext())(runtime, thisValue, arguments,
|
|
178
|
-
count);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
JSI_HOST_FUNCTION(hasDevice) {
|
|
182
|
-
#ifdef SK_GRAPHITE
|
|
183
|
-
return jsi::Value(true);
|
|
184
|
-
#else
|
|
185
|
-
return jsi::Value(false);
|
|
186
|
-
#endif
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
JSI_HOST_FUNCTION(getDevice) {
|
|
174
|
+
JSI_HOST_FUNCTION(getNativeDevice) {
|
|
190
175
|
#ifdef SK_GRAPHITE
|
|
176
|
+
// Raw WGPUDevice pointer of the Graphite device, as a BigInt. Consumed by
|
|
177
|
+
// react-native-webgpu's importDevice(), which AddRefs it; the pointer
|
|
178
|
+
// stays owned by DawnContext and is valid for the process lifetime.
|
|
191
179
|
auto &dawnContext = DawnContext::getInstance();
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
runtime, dawnContext.getWGPUInstance());
|
|
196
|
-
auto device = std::make_shared<rnwgpu::GPUDevice>(
|
|
197
|
-
dawnContext.getWGPUDevice(), context, "Skia Device");
|
|
198
|
-
return rnwgpu::GPUDevice::create(runtime, device);
|
|
180
|
+
return jsi::BigInt::fromUint64(
|
|
181
|
+
runtime,
|
|
182
|
+
reinterpret_cast<uint64_t>(dawnContext.getWGPUDevice().Get()));
|
|
199
183
|
#else
|
|
200
184
|
throw jsi::JSError(runtime,
|
|
201
|
-
"
|
|
185
|
+
"getNativeDevice() is only available with the Graphite "
|
|
202
186
|
"backend. Rebuild with SK_GRAPHITE enabled.");
|
|
203
187
|
#endif
|
|
204
188
|
}
|
|
205
189
|
|
|
190
|
+
JSI_HOST_FUNCTION(Recorder) {
|
|
191
|
+
return JsiRecorder::createCtor(getContext())(runtime, thisValue, arguments,
|
|
192
|
+
count);
|
|
193
|
+
}
|
|
194
|
+
|
|
206
195
|
// Factory properties: like the legacy HostObject implementation, each
|
|
207
196
|
// property access returns a fresh JS wrapper around the shared factory
|
|
208
197
|
// instance.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
198
|
+
std::shared_ptr<JsiSkSVGFactory> getSVGFactory() { return _svgFactory; }
|
|
199
|
+
std::shared_ptr<JsiSkImageFactory> getImageFactory() {
|
|
200
|
+
return _imageFactory;
|
|
201
|
+
}
|
|
202
|
+
std::shared_ptr<JsiSkAnimatedImageFactory> getAnimatedImageFactory() {
|
|
203
|
+
return _animatedImageFactory;
|
|
204
|
+
}
|
|
205
|
+
std::shared_ptr<JsiSkTypefaceFactory> getTypefaceFactory() {
|
|
206
|
+
return _typefaceFactory;
|
|
213
207
|
}
|
|
214
|
-
|
|
215
|
-
|
|
208
|
+
std::shared_ptr<JsiSkDataFactory> getDataFactory() { return _dataFactory; }
|
|
209
|
+
std::shared_ptr<JsiSkImageFilterFactory> getImageFilterFactory() {
|
|
210
|
+
return _imageFilterFactory;
|
|
216
211
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return makeJsiObject(runtime, _imageFilterFactory);
|
|
212
|
+
std::shared_ptr<JsiSkPathEffectFactory> getPathEffectFactory() {
|
|
213
|
+
return _pathEffectFactory;
|
|
220
214
|
}
|
|
221
|
-
|
|
222
|
-
|
|
215
|
+
std::shared_ptr<JsiSkPathFactory> getPathFactory() { return _pathFactory; }
|
|
216
|
+
std::shared_ptr<JsiSkPathBuilderFactory> getPathBuilderFactory() {
|
|
217
|
+
return _pathBuilderFactory;
|
|
223
218
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return makeJsiObject(runtime, _pathBuilderFactory);
|
|
219
|
+
std::shared_ptr<JsiSkColorFilterFactory> getColorFilterFactory() {
|
|
220
|
+
return _colorFilterFactory;
|
|
227
221
|
}
|
|
228
|
-
|
|
229
|
-
return
|
|
222
|
+
std::shared_ptr<JsiSkMaskFilterFactory> getMaskFilterFactory() {
|
|
223
|
+
return _maskFilterFactory;
|
|
230
224
|
}
|
|
231
|
-
|
|
232
|
-
return
|
|
225
|
+
std::shared_ptr<JsiSkRuntimeEffectFactory> getRuntimeEffectFactory() {
|
|
226
|
+
return _runtimeEffectFactory;
|
|
233
227
|
}
|
|
234
|
-
|
|
235
|
-
return
|
|
228
|
+
std::shared_ptr<JsiSkShaderFactory> getShaderFactory() {
|
|
229
|
+
return _shaderFactory;
|
|
236
230
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
return makeJsiObject(runtime, _textBlobFactory);
|
|
231
|
+
std::shared_ptr<JsiSkTextBlobFactory> getTextBlobFactory() {
|
|
232
|
+
return _textBlobFactory;
|
|
240
233
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
234
|
+
std::shared_ptr<JsiSkSurfaceFactory> getSurfaceFactory() {
|
|
235
|
+
return _surfaceFactory;
|
|
236
|
+
}
|
|
237
|
+
std::shared_ptr<JsiSkPictureFactory> getPictureFactory() {
|
|
238
|
+
return _pictureFactory;
|
|
239
|
+
}
|
|
240
|
+
std::shared_ptr<JsiSkFontMgrFactory> getFontMgrFactory() {
|
|
241
|
+
return _fontMgrFactory;
|
|
242
|
+
}
|
|
243
|
+
std::shared_ptr<JsiSkottieFactory> getSkottieFactory() {
|
|
244
|
+
return _skottieFactory;
|
|
245
|
+
}
|
|
246
|
+
std::shared_ptr<JsiSkTypefaceFontProviderFactory>
|
|
247
|
+
getTypefaceFontProviderFactory() {
|
|
248
|
+
return _typefaceFontProviderFactory;
|
|
247
249
|
}
|
|
248
|
-
|
|
249
|
-
return
|
|
250
|
+
std::shared_ptr<JsiSkParagraphBuilderFactory> getParagraphBuilderFactory() {
|
|
251
|
+
return _paragraphBuilderFactory;
|
|
250
252
|
}
|
|
251
|
-
|
|
252
|
-
return
|
|
253
|
+
std::shared_ptr<JsiNativeBufferFactory> getNativeBufferFactory() {
|
|
254
|
+
return _nativeBufferFactory;
|
|
253
255
|
}
|
|
254
256
|
|
|
255
257
|
static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
|
|
256
258
|
installHostMethod(runtime, prototype, "Video", &JsiSkApi::Video);
|
|
257
259
|
installHostMethod(runtime, prototype, "Context", &JsiSkApi::Context);
|
|
260
|
+
installHostMethod(runtime, prototype, "getNativeDevice",
|
|
261
|
+
&JsiSkApi::getNativeDevice);
|
|
258
262
|
installHostMethod(runtime, prototype, "Font", &JsiSkApi::Font);
|
|
259
263
|
installHostMethod(runtime, prototype, "Paint", &JsiSkApi::Paint);
|
|
260
264
|
installHostMethod(runtime, prototype, "RSXform", &JsiSkApi::RSXform);
|
|
@@ -274,39 +278,39 @@ public:
|
|
|
274
278
|
&JsiSkApi::PictureRecorder);
|
|
275
279
|
installHostMethod(runtime, prototype, "Color", &JsiSkApi::Color);
|
|
276
280
|
installHostMethod(runtime, prototype, "Recorder", &JsiSkApi::Recorder);
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
281
|
+
installGetter(runtime, prototype, "SVG", &JsiSkApi::getSVGFactory);
|
|
282
|
+
installGetter(runtime, prototype, "Image", &JsiSkApi::getImageFactory);
|
|
283
|
+
installGetter(runtime, prototype, "AnimatedImage",
|
|
284
|
+
&JsiSkApi::getAnimatedImageFactory);
|
|
285
|
+
installGetter(runtime, prototype, "Typeface",
|
|
286
|
+
&JsiSkApi::getTypefaceFactory);
|
|
287
|
+
installGetter(runtime, prototype, "Data", &JsiSkApi::getDataFactory);
|
|
288
|
+
installGetter(runtime, prototype, "ImageFilter",
|
|
289
|
+
&JsiSkApi::getImageFilterFactory);
|
|
290
|
+
installGetter(runtime, prototype, "PathEffect",
|
|
291
|
+
&JsiSkApi::getPathEffectFactory);
|
|
292
|
+
installGetter(runtime, prototype, "Path", &JsiSkApi::getPathFactory);
|
|
293
|
+
installGetter(runtime, prototype, "PathBuilder",
|
|
294
|
+
&JsiSkApi::getPathBuilderFactory);
|
|
295
|
+
installGetter(runtime, prototype, "ColorFilter",
|
|
296
|
+
&JsiSkApi::getColorFilterFactory);
|
|
297
|
+
installGetter(runtime, prototype, "MaskFilter",
|
|
298
|
+
&JsiSkApi::getMaskFilterFactory);
|
|
299
|
+
installGetter(runtime, prototype, "RuntimeEffect",
|
|
300
|
+
&JsiSkApi::getRuntimeEffectFactory);
|
|
301
|
+
installGetter(runtime, prototype, "Shader", &JsiSkApi::getShaderFactory);
|
|
302
|
+
installGetter(runtime, prototype, "TextBlob",
|
|
303
|
+
&JsiSkApi::getTextBlobFactory);
|
|
304
|
+
installGetter(runtime, prototype, "Surface", &JsiSkApi::getSurfaceFactory);
|
|
305
|
+
installGetter(runtime, prototype, "Picture", &JsiSkApi::getPictureFactory);
|
|
306
|
+
installGetter(runtime, prototype, "FontMgr", &JsiSkApi::getFontMgrFactory);
|
|
307
|
+
installGetter(runtime, prototype, "Skottie", &JsiSkApi::getSkottieFactory);
|
|
308
|
+
installGetter(runtime, prototype, "TypefaceFontProvider",
|
|
309
|
+
&JsiSkApi::getTypefaceFontProviderFactory);
|
|
310
|
+
installGetter(runtime, prototype, "ParagraphBuilder",
|
|
311
|
+
&JsiSkApi::getParagraphBuilderFactory);
|
|
312
|
+
installGetter(runtime, prototype, "NativeBuffer",
|
|
313
|
+
&JsiSkApi::getNativeBufferFactory);
|
|
310
314
|
}
|
|
311
315
|
|
|
312
316
|
private:
|