@nativescript/canvas 2.0.0-webgpu.1 → 2.0.0-webgpu.11
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/Canvas/common.d.ts +2 -16
- package/Canvas/common.js +1 -62
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +6 -8
- package/Canvas/index.android.js +116 -62
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +7 -8
- package/Canvas/index.ios.d.ts +3 -2
- package/Canvas/index.ios.js +115 -74
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -0
- package/Canvas2D/CanvasRenderingContext2D/index.js +72 -72
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.js +1 -1
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/Dom/Dom.js +8 -1
- package/Dom/Dom.js.map +1 -1
- package/Dom/Group.d.ts +1 -2
- package/Dom/Group.js.map +1 -1
- package/Dom/Image.d.ts +4 -1
- package/Dom/Image.js +15 -2
- package/Dom/Image.js.map +1 -1
- package/Dom/Paint.d.ts +1 -1
- package/Dom/Paint.js.map +1 -1
- package/Dom/Text.js.map +1 -1
- package/Dom/shaders/LinearGradient.js.map +1 -1
- package/Dom/shaders/TwoPointConicalGradient.js.map +1 -1
- package/Dom/shapes/Atlas.js.map +1 -1
- package/Dom/shapes/Circle.js.map +1 -1
- package/Dom/shapes/Line.js.map +1 -1
- package/Dom/shapes/Oval.js.map +1 -1
- package/Dom/shapes/Path.d.ts +1 -1
- package/Dom/shapes/Path.js.map +1 -1
- package/Dom/shapes/Rect.js.map +1 -1
- package/Dom/shapes/RoundedRect.js.map +1 -1
- package/Dom/shapes/index.js.map +1 -1
- package/ImageAsset/index.d.ts +3 -1
- package/ImageAsset/index.js +38 -6
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.js +3 -3
- package/ImageBitmap/index.js.map +1 -1
- package/README.md +62 -3
- package/TextDecoder/index.js +3 -3
- package/TextDecoder/index.js.map +1 -1
- package/TextEncoder/index.js +3 -3
- package/TextEncoder/index.js.map +1 -1
- package/WebGL/WebGLExtensions/index.js +5 -5
- package/WebGL/WebGLExtensions/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/Constants.js.map +1 -1
- package/WebGPU/GPU.js.map +1 -1
- package/WebGPU/GPUAdapter.d.ts +4 -2
- package/WebGPU/GPUAdapter.js +3 -0
- package/WebGPU/GPUAdapter.js.map +1 -1
- package/WebGPU/GPUAdapterInfo.js.map +1 -1
- package/WebGPU/GPUBindGroup.d.ts +1 -0
- package/WebGPU/GPUBindGroup.js +3 -0
- package/WebGPU/GPUBindGroup.js.map +1 -1
- package/WebGPU/GPUBindGroupLayout.d.ts +1 -0
- package/WebGPU/GPUBindGroupLayout.js +3 -0
- package/WebGPU/GPUBindGroupLayout.js.map +1 -1
- package/WebGPU/GPUBuffer.js +6 -2
- package/WebGPU/GPUBuffer.js.map +1 -1
- package/WebGPU/GPUCanvasContext.d.ts +1 -1
- package/WebGPU/GPUCanvasContext.js +13 -10
- package/WebGPU/GPUCanvasContext.js.map +1 -1
- package/WebGPU/GPUCommandBuffer.d.ts +1 -0
- package/WebGPU/GPUCommandBuffer.js +3 -0
- package/WebGPU/GPUCommandBuffer.js.map +1 -1
- package/WebGPU/GPUCommandEncoder.d.ts +1 -0
- package/WebGPU/GPUCommandEncoder.js +3 -0
- package/WebGPU/GPUCommandEncoder.js.map +1 -1
- package/WebGPU/GPUComputePassEncoder.d.ts +1 -0
- package/WebGPU/GPUComputePassEncoder.js +3 -0
- package/WebGPU/GPUComputePassEncoder.js.map +1 -1
- package/WebGPU/GPUComputePipeline.d.ts +1 -0
- package/WebGPU/GPUComputePipeline.js +3 -0
- package/WebGPU/GPUComputePipeline.js.map +1 -1
- package/WebGPU/GPUDevice.d.ts +4 -4
- package/WebGPU/GPUDevice.js +32 -9
- package/WebGPU/GPUDevice.js.map +1 -1
- package/WebGPU/GPUExternalTexture.d.ts +1 -0
- package/WebGPU/GPUExternalTexture.js +3 -0
- package/WebGPU/GPUExternalTexture.js.map +1 -1
- package/WebGPU/GPUPipelineLayout.d.ts +1 -0
- package/WebGPU/GPUPipelineLayout.js +3 -0
- package/WebGPU/GPUPipelineLayout.js.map +1 -1
- package/WebGPU/GPUQuerySet.d.ts +1 -0
- package/WebGPU/GPUQuerySet.js +3 -0
- package/WebGPU/GPUQuerySet.js.map +1 -1
- package/WebGPU/GPUQueue.d.ts +1 -0
- package/WebGPU/GPUQueue.js +11 -0
- package/WebGPU/GPUQueue.js.map +1 -1
- package/WebGPU/GPURenderBundle.d.ts +1 -0
- package/WebGPU/GPURenderBundle.js +3 -0
- package/WebGPU/GPURenderBundle.js.map +1 -1
- package/WebGPU/GPURenderBundleEncoder.d.ts +4 -2
- package/WebGPU/GPURenderBundleEncoder.js +7 -3
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
- package/WebGPU/GPURenderPassEncoder.d.ts +2 -1
- package/WebGPU/GPURenderPassEncoder.js +5 -2
- package/WebGPU/GPURenderPassEncoder.js.map +1 -1
- package/WebGPU/GPURenderPipeline.d.ts +1 -0
- package/WebGPU/GPURenderPipeline.js +3 -0
- package/WebGPU/GPURenderPipeline.js.map +1 -1
- package/WebGPU/GPUSampler.d.ts +1 -0
- package/WebGPU/GPUSampler.js +3 -0
- package/WebGPU/GPUSampler.js.map +1 -1
- package/WebGPU/GPUShaderModule.d.ts +1 -1
- package/WebGPU/GPUShaderModule.js +2 -2
- package/WebGPU/GPUShaderModule.js.map +1 -1
- package/WebGPU/GPUTexture.d.ts +1 -0
- package/WebGPU/GPUTexture.js +3 -0
- package/WebGPU/GPUTexture.js.map +1 -1
- package/WebGPU/GPUTextureView.d.ts +1 -0
- package/WebGPU/GPUTextureView.js +3 -0
- package/WebGPU/GPUTextureView.js.map +1 -1
- package/WebGPU/Interfaces.d.ts +14 -4
- package/WebGPU/Types.d.ts +28 -27
- package/WebGPU/Utils.d.ts +1 -1
- package/WebGPU/Utils.js.map +1 -1
- package/angular/{esm2020 → esm2022}/index.mjs +5 -5
- package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs +4 -4
- package/angular/{fesm2020 → fesm2022}/nativescript-canvas-angular.mjs.map +1 -1
- package/angular/package.json +4 -10
- package/helpers.js.map +1 -1
- package/package.json +2 -2
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +26 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2091 -2055
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +971 -205
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +645 -602
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +52 -18
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2091 -2055
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +971 -205
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +971 -205
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +38 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +25 -25
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +647 -604
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +685 -638
- package/platforms/ios/src/NSOperationQueueWrapper.h +2 -0
- package/platforms/ios/src/cpp/AsyncCallback.h +206 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +13 -13
- package/platforms/ios/src/cpp/Helpers.h +2 -164
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +13 -13
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +1 -1
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +2 -1
- package/platforms/ios/src/cpp/JSIReadFileCallback.h +4 -4
- package/platforms/ios/src/cpp/NativeType.h +87 -0
- package/platforms/ios/src/cpp/ObjectWrapperImpl.h +50 -0
- package/platforms/ios/src/cpp/OneByteStringResource.cpp +2 -2
- package/platforms/ios/src/cpp/PromiseCallback.h +198 -0
- package/platforms/ios/src/cpp/RafImpl.h +2 -2
- package/platforms/ios/src/cpp/TextDecoderImpl.cpp +0 -6
- package/platforms/ios/src/cpp/TextDecoderImpl.h +3 -3
- package/platforms/ios/src/cpp/TextEncoderImpl.cpp +1 -1
- package/platforms/ios/src/cpp/TextEncoderImpl.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +8 -7
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +1 -1
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +146 -76
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +74 -20
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +5 -6
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +4 -4
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +10 -10
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +2 -2
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +6 -3
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +7 -7
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLProgram.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +8 -8
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLShader.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +5 -5
- package/platforms/ios/src/cpp/webgl/WebGLTexture.h +3 -2
- package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +5 -5
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +722 -722
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +137 -69
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +32 -6
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +5 -2
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +27 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +80 -32
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +8 -4
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +19 -14
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +29 -2
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +455 -457
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +5 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +42 -14
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +26 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +3 -1
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +1699 -727
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +4 -2
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +54 -41
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +27 -1
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +8 -5
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +2 -3
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +65 -25
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +42 -14
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +26 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +34 -7
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +26 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +4 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +27 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +5 -2
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +25 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +5 -2
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +33 -8
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +6 -4
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +27 -1
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +5 -2
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +511 -0
- package/react/index.d.ts +1 -1
- package/utils.d.ts +1 -1
- package/utils.js.map +1 -1
- package/angular/fesm2015/nativescript-canvas-angular.mjs.map +0 -1
- package/angular/fesm2020/nativescript-canvas-angular.mjs +0 -24
- package/typings/objc!CanvasNative.d.ts +0 -2038
- package/typings/objc!CanvasNative.js +0 -1
- package/typings/objc!CanvasNative.js.map +0 -1
- /package/angular/{esm2020 → esm2022}/nativescript-canvas-angular.mjs +0 -0
|
@@ -21,7 +21,7 @@ void GPUBufferImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolat
|
|
|
21
21
|
auto context = isolate->GetCurrentContext();
|
|
22
22
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
23
23
|
|
|
24
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUBuffer"), func).FromJust()
|
|
24
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUBuffer"), func).FromJust();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
GPUBufferImpl *GPUBufferImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -75,6 +75,11 @@ v8::Local<v8::FunctionTemplate> GPUBufferImpl::GetCtor(v8::Isolate *isolate) {
|
|
|
75
75
|
ConvertToV8String(isolate, "getMappedRange"),
|
|
76
76
|
v8::FunctionTemplate::New(isolate, &GetMappedRange));
|
|
77
77
|
|
|
78
|
+
tmpl->SetLazyDataProperty(
|
|
79
|
+
ConvertToV8String(isolate, "label"),
|
|
80
|
+
GetLabel
|
|
81
|
+
);
|
|
82
|
+
|
|
78
83
|
|
|
79
84
|
cache->GPUBufferTmpl =
|
|
80
85
|
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
@@ -127,12 +132,17 @@ void GPUBufferImpl::UnMap(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
127
132
|
canvas_native_webgpu_buffer_unmap(ptr->GetGPUBuffer());
|
|
128
133
|
}
|
|
129
134
|
|
|
135
|
+
struct MapAsyncData {
|
|
136
|
+
enum CanvasGPUErrorType type;
|
|
137
|
+
char* error;
|
|
138
|
+
};
|
|
130
139
|
|
|
131
140
|
void GPUBufferImpl::MapAsync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
132
141
|
GPUBufferImpl *ptr = GetPointer(args.This());
|
|
133
142
|
if (ptr == nullptr) {
|
|
134
143
|
return;
|
|
135
144
|
}
|
|
145
|
+
|
|
136
146
|
auto isolate = args.GetIsolate();
|
|
137
147
|
auto context = isolate->GetCurrentContext();
|
|
138
148
|
auto mode = args[0]->Int32Value(context).ToChecked();
|
|
@@ -154,42 +164,59 @@ void GPUBufferImpl::MapAsync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
154
164
|
auto resolver = v8::Promise::Resolver::New(isolate->GetCurrentContext()).ToLocalChecked();
|
|
155
165
|
args.GetReturnValue().Set(resolver->GetPromise());
|
|
156
166
|
|
|
157
|
-
v8::Global<v8::Promise::Resolver> promise(isolate, resolver);
|
|
158
167
|
auto callback = new PromiseCallback{
|
|
159
168
|
isolate,
|
|
160
|
-
|
|
169
|
+
resolver,
|
|
170
|
+
[](bool done, void *data){
|
|
171
|
+
auto async_data = static_cast<PromiseCallback *>(data);
|
|
172
|
+
auto func = async_data->inner_.get();
|
|
173
|
+
if (func != nullptr && func->isolate_ != nullptr) {
|
|
174
|
+
v8::Isolate *isolate = func->isolate_;
|
|
175
|
+
v8::Locker locker(isolate);
|
|
176
|
+
v8::Isolate::Scope isolate_scope(
|
|
177
|
+
isolate);
|
|
178
|
+
v8::HandleScope handle_scope(
|
|
179
|
+
isolate);
|
|
180
|
+
v8::Local<v8::Promise::Resolver> callback = func->callback_.Get(
|
|
181
|
+
isolate);
|
|
182
|
+
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
183
|
+
v8::Context::Scope context_scope(
|
|
184
|
+
context);
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
if (func->data == nullptr) {
|
|
188
|
+
callback->Resolve(context, v8::Undefined(isolate));
|
|
189
|
+
} else {
|
|
190
|
+
auto errorData = static_cast<MapAsyncData*>(func->data);
|
|
191
|
+
callback->Reject(context,
|
|
192
|
+
v8::Exception::Error(
|
|
193
|
+
ConvertToV8String(
|
|
194
|
+
isolate,
|
|
195
|
+
errorData->error)));
|
|
196
|
+
canvas_native_string_destroy(
|
|
197
|
+
errorData->error);
|
|
198
|
+
delete errorData;
|
|
199
|
+
func->data = nullptr;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
delete static_cast<PromiseCallback *>(data);
|
|
203
|
+
}
|
|
161
204
|
};
|
|
162
|
-
|
|
163
|
-
|
|
205
|
+
callback->prepare();
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
canvas_native_webgpu_buffer_map_async(ptr->GetGPUBuffer(), mode == 1 ? GPUMapMode::GPUMapModeRead : GPUMapMode::GPUMapModeWrite, offset, size,
|
|
209
|
+
[](enum CanvasGPUErrorType type, char *error, void *data) {
|
|
164
210
|
if (data != nullptr) {
|
|
165
|
-
auto
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
isolate);
|
|
173
|
-
v8::Local<v8::Promise::Resolver> callback = func->callback.Get(
|
|
174
|
-
isolate);
|
|
175
|
-
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
176
|
-
v8::Context::Scope context_scope(
|
|
177
|
-
context);
|
|
178
|
-
|
|
179
|
-
auto ret = v8::Object::New(
|
|
180
|
-
isolate);
|
|
181
|
-
if (error == nullptr) {
|
|
182
|
-
callback->Resolve(context, ret);
|
|
183
|
-
} else {
|
|
184
|
-
callback->Reject(context,
|
|
185
|
-
v8::Exception::Error(
|
|
186
|
-
ConvertToV8String(
|
|
187
|
-
isolate,
|
|
188
|
-
error)));
|
|
189
|
-
canvas_native_string_destroy(
|
|
190
|
-
error);
|
|
211
|
+
auto async_data = static_cast<PromiseCallback *>(data);
|
|
212
|
+
auto inner = async_data->inner_.get();
|
|
213
|
+
if (inner != nullptr) {
|
|
214
|
+
if(error != nullptr){
|
|
215
|
+
inner->data = new MapAsyncData {
|
|
216
|
+
type, error
|
|
217
|
+
};
|
|
191
218
|
}
|
|
192
|
-
|
|
219
|
+
async_data->execute(true);
|
|
193
220
|
}
|
|
194
221
|
}
|
|
195
222
|
}, callback);
|
|
@@ -227,3 +254,24 @@ void GPUBufferImpl::GetMappedRange(const v8::FunctionCallbackInfo<v8::Value> &ar
|
|
|
227
254
|
args.GetReturnValue().Set(ab);
|
|
228
255
|
}
|
|
229
256
|
}
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
void
|
|
260
|
+
GPUBufferImpl::GetLabel(v8::Local<v8::Name> name,
|
|
261
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
262
|
+
auto ptr = GetPointer(info.This());
|
|
263
|
+
if (ptr != nullptr) {
|
|
264
|
+
auto label = canvas_native_webgpu_buffer_get_label(ptr->buffer_);
|
|
265
|
+
if (label == nullptr) {
|
|
266
|
+
info.GetReturnValue().SetEmptyString();
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
info.GetReturnValue().Set(
|
|
270
|
+
ConvertToV8String(info.GetIsolate(), label)
|
|
271
|
+
);
|
|
272
|
+
canvas_native_string_destroy(label);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
info.GetReturnValue().SetEmptyString();
|
|
277
|
+
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#include "Helpers.h"
|
|
9
9
|
#include "ObjectWrapperImpl.h"
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
class GPUBufferImpl : ObjectWrapperImpl {
|
|
12
13
|
public:
|
|
13
14
|
explicit GPUBufferImpl(const CanvasGPUBuffer *buffer);
|
|
@@ -24,14 +25,14 @@ public:
|
|
|
24
25
|
|
|
25
26
|
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
26
27
|
|
|
27
|
-
static v8::Local<v8::Object> NewInstance(v8::Isolate *isolate, GPUBufferImpl *
|
|
28
|
+
static v8::Local<v8::Object> NewInstance(v8::Isolate *isolate, GPUBufferImpl *buffer) {
|
|
28
29
|
auto context = isolate->GetCurrentContext();
|
|
29
30
|
v8::EscapableHandleScope scope(isolate);
|
|
30
31
|
auto object = GPUBufferImpl::GetCtor(isolate)->GetFunction(
|
|
31
32
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
32
|
-
SetNativeType(
|
|
33
|
-
object->SetAlignedPointerInInternalField(0,
|
|
34
|
-
|
|
33
|
+
SetNativeType(buffer, NativeType::GPUBuffer);
|
|
34
|
+
object->SetAlignedPointerInInternalField(0, buffer);
|
|
35
|
+
buffer->BindFinalizer(isolate, object);
|
|
35
36
|
return scope.Escape(object);
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -50,6 +51,9 @@ public:
|
|
|
50
51
|
|
|
51
52
|
static void GetMappedRange(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
52
53
|
|
|
54
|
+
static void GetLabel(v8::Local<v8::Name> name,
|
|
55
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
56
|
+
|
|
53
57
|
|
|
54
58
|
private:
|
|
55
59
|
const CanvasGPUBuffer *buffer_;
|
|
@@ -224,9 +224,14 @@ void GPUCanvasContextImpl::GetCurrentTexture(const v8::FunctionCallbackInfo<v8::
|
|
|
224
224
|
auto texture = canvas_native_webgpu_context_get_current_texture(ctx);
|
|
225
225
|
|
|
226
226
|
if (texture != nullptr) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
if(canvas_native_webgpu_texture_get_status(texture) == SurfaceGetCurrentTextureStatusSuccess){
|
|
228
|
+
auto textureImpl = new GPUTextureImpl(texture);
|
|
229
|
+
auto ret = GPUTextureImpl::NewInstance(isolate, textureImpl);
|
|
230
|
+
args.GetReturnValue().Set(ret);
|
|
231
|
+
}else {
|
|
232
|
+
canvas_native_webgpu_texture_release(texture);
|
|
233
|
+
args.GetReturnValue().SetNull();
|
|
234
|
+
}
|
|
230
235
|
return;
|
|
231
236
|
}
|
|
232
237
|
|
|
@@ -270,7 +275,7 @@ void GPUCanvasContextImpl::GetCapabilities(const v8::FunctionCallbackInfo<v8::Va
|
|
|
270
275
|
auto formats = v8::Array::New(isolate, (int) formats_len);
|
|
271
276
|
for (int i = 0; i < formats_len; i++) {
|
|
272
277
|
auto format = canvas_native_string_buffer_get_value_at(cap->formats, i);
|
|
273
|
-
formats->Set(context, i, ConvertToV8String(isolate, format));
|
|
278
|
+
formats->Set(context, i, ConvertToV8String(isolate, format)).FromJust();
|
|
274
279
|
canvas_native_string_destroy(format);
|
|
275
280
|
}
|
|
276
281
|
|
|
@@ -280,7 +285,7 @@ void GPUCanvasContextImpl::GetCapabilities(const v8::FunctionCallbackInfo<v8::Va
|
|
|
280
285
|
|
|
281
286
|
for (int i = 0; i < present_modes_len; i++) {
|
|
282
287
|
auto mode = canvas_native_string_buffer_get_value_at(cap->present_modes, i);
|
|
283
|
-
present_modes->Set(context, i, ConvertToV8String(isolate, mode));
|
|
288
|
+
present_modes->Set(context, i, ConvertToV8String(isolate, mode)).FromJust();
|
|
284
289
|
canvas_native_string_destroy(mode);
|
|
285
290
|
}
|
|
286
291
|
|
|
@@ -290,15 +295,15 @@ void GPUCanvasContextImpl::GetCapabilities(const v8::FunctionCallbackInfo<v8::Va
|
|
|
290
295
|
|
|
291
296
|
for (int i = 0; i < alpha_modes_len; i++) {
|
|
292
297
|
auto mode = canvas_native_string_buffer_get_value_at(cap->alpha_modes, i);
|
|
293
|
-
alpha_modes->Set(context, i, ConvertToV8String(isolate, mode));
|
|
298
|
+
alpha_modes->Set(context, i, ConvertToV8String(isolate, mode)).FromJust();
|
|
294
299
|
canvas_native_string_destroy(mode);
|
|
295
300
|
}
|
|
296
301
|
|
|
297
|
-
ret->Set(context, ConvertToV8String(isolate, "format"), formats);
|
|
298
|
-
ret->Set(context, ConvertToV8String(isolate, "presentModes"), present_modes);
|
|
299
|
-
ret->Set(context, ConvertToV8String(isolate, "alphaModes"), alpha_modes);
|
|
302
|
+
ret->Set(context, ConvertToV8String(isolate, "format"), formats).FromJust();
|
|
303
|
+
ret->Set(context, ConvertToV8String(isolate, "presentModes"), present_modes).FromJust();
|
|
304
|
+
ret->Set(context, ConvertToV8String(isolate, "alphaModes"), alpha_modes).FromJust();
|
|
300
305
|
ret->Set(context, ConvertToV8String(isolate, "usages"),
|
|
301
|
-
v8::Uint32::NewFromUnsigned(isolate, cap->usages));
|
|
306
|
+
v8::Uint32::NewFromUnsigned(isolate, cap->usages)).FromJust();
|
|
302
307
|
|
|
303
308
|
canvas_native_webgpu_struct_surface_capabilities_release(cap);
|
|
304
309
|
|
|
@@ -309,9 +314,9 @@ void GPUCanvasContextImpl::GetCapabilities(const v8::FunctionCallbackInfo<v8::Va
|
|
|
309
314
|
|
|
310
315
|
}
|
|
311
316
|
|
|
312
|
-
ret->Set(context, ConvertToV8String(isolate, "format"), v8::Array::New(isolate));
|
|
313
|
-
ret->Set(context, ConvertToV8String(isolate, "presentModes"), v8::Array::New(isolate));
|
|
314
|
-
ret->Set(context, ConvertToV8String(isolate, "alphaModes"), v8::Array::New(isolate));
|
|
315
|
-
ret->Set(context, ConvertToV8String(isolate, "usages"), v8::Uint32::New(isolate, 0));
|
|
317
|
+
ret->Set(context, ConvertToV8String(isolate, "format"), v8::Array::New(isolate)).FromJust();
|
|
318
|
+
ret->Set(context, ConvertToV8String(isolate, "presentModes"), v8::Array::New(isolate)).FromJust();
|
|
319
|
+
ret->Set(context, ConvertToV8String(isolate, "alphaModes"), v8::Array::New(isolate)).FromJust();
|
|
320
|
+
ret->Set(context, ConvertToV8String(isolate, "usages"), v8::Uint32::New(isolate, 0)).FromJust();
|
|
316
321
|
args.GetReturnValue().Set(ret);
|
|
317
322
|
}
|
|
@@ -31,7 +31,7 @@ public:
|
|
|
31
31
|
v8::EscapableHandleScope scope(isolate);
|
|
32
32
|
auto object = GPUCanvasContextImpl::GetCtor(isolate)->GetFunction(
|
|
33
33
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
34
|
-
SetNativeType(
|
|
34
|
+
SetNativeType(ctx, NativeType::GPUCanvasContext);
|
|
35
35
|
object->SetAlignedPointerInInternalField(0, ctx);
|
|
36
36
|
ctx->BindFinalizer(isolate, object);
|
|
37
37
|
return scope.Escape(object);
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
#include "GPUCommandBufferImpl.h"
|
|
6
6
|
#include "Caches.h"
|
|
7
7
|
|
|
8
|
-
GPUCommandBufferImpl::GPUCommandBufferImpl(const CanvasGPUCommandBuffer *commandBuffer)
|
|
8
|
+
GPUCommandBufferImpl::GPUCommandBufferImpl(const CanvasGPUCommandBuffer *commandBuffer)
|
|
9
|
+
: commandBuffer_(
|
|
9
10
|
commandBuffer) {}
|
|
10
11
|
|
|
11
12
|
const CanvasGPUCommandBuffer *GPUCommandBufferImpl::GetGPUCommandBuffer() {
|
|
@@ -22,7 +23,7 @@ void GPUCommandBufferImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate
|
|
|
22
23
|
auto context = isolate->GetCurrentContext();
|
|
23
24
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
24
25
|
|
|
25
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "GPUCommandBuffer"), func).FromJust()
|
|
26
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUCommandBuffer"), func).FromJust();
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
GPUCommandBufferImpl *GPUCommandBufferImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -47,8 +48,34 @@ v8::Local<v8::FunctionTemplate> GPUCommandBufferImpl::GetCtor(v8::Isolate *isola
|
|
|
47
48
|
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
48
49
|
tmpl->SetInternalFieldCount(2);
|
|
49
50
|
|
|
51
|
+
tmpl->SetLazyDataProperty(
|
|
52
|
+
ConvertToV8String(isolate, "label"),
|
|
53
|
+
GetLabel
|
|
54
|
+
);
|
|
55
|
+
|
|
50
56
|
|
|
51
57
|
cache->GPUCommandBufferTmpl =
|
|
52
58
|
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
53
59
|
return ctorTmpl;
|
|
54
60
|
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
void
|
|
64
|
+
GPUCommandBufferImpl::GetLabel(v8::Local<v8::Name> name,
|
|
65
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
66
|
+
auto ptr = GetPointer(info.This());
|
|
67
|
+
if (ptr != nullptr) {
|
|
68
|
+
auto label = canvas_native_webgpu_command_buffer_get_label(ptr->commandBuffer_);
|
|
69
|
+
if (label == nullptr) {
|
|
70
|
+
info.GetReturnValue().SetEmptyString();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
info.GetReturnValue().Set(
|
|
74
|
+
ConvertToV8String(info.GetIsolate(), label)
|
|
75
|
+
);
|
|
76
|
+
canvas_native_string_destroy(label);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
info.GetReturnValue().SetEmptyString();
|
|
81
|
+
}
|
|
@@ -31,12 +31,15 @@ public:
|
|
|
31
31
|
v8::EscapableHandleScope scope(isolate);
|
|
32
32
|
auto object = GPUCommandBufferImpl::GetCtor(isolate)->GetFunction(
|
|
33
33
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
34
|
-
SetNativeType(
|
|
34
|
+
SetNativeType(commandBuffer, NativeType::GPUCommandBuffer);
|
|
35
35
|
object->SetAlignedPointerInInternalField(0, commandBuffer);
|
|
36
36
|
commandBuffer->BindFinalizer(isolate, object);
|
|
37
37
|
return scope.Escape(object);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
static void GetLabel(v8::Local<v8::Name> name,
|
|
41
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
42
|
+
|
|
40
43
|
private:
|
|
41
44
|
const CanvasGPUCommandBuffer *commandBuffer_;
|
|
42
45
|
};
|