@nativescript/canvas 2.0.0-beta.9 → 2.0.0-rc.0
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 +15 -24
- package/Canvas/common.js +147 -203
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +13 -15
- package/Canvas/index.android.js +152 -151
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +23 -11
- package/Canvas/index.ios.d.ts +14 -6
- package/Canvas/index.ios.js +213 -124
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas/utils.d.ts +3 -0
- package/Canvas/utils.js +85 -0
- package/Canvas/utils.js.map +1 -0
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +4 -2
- package/Canvas2D/CanvasRenderingContext2D/index.js +79 -85
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.d.ts +14 -0
- package/Canvas2D/DOMMatrix/index.js +62 -0
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js +4 -6
- 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/Fonts/FontFace.android.d.ts +46 -0
- package/Fonts/FontFace.android.js +197 -0
- package/Fonts/FontFace.android.js.map +1 -0
- package/Fonts/FontFace.ios.d.ts +45 -0
- package/Fonts/FontFace.ios.js +169 -0
- package/Fonts/FontFace.ios.js.map +1 -0
- package/Fonts/FontFaceSet.android.d.ts +31 -0
- package/Fonts/FontFaceSet.android.js +119 -0
- package/Fonts/FontFaceSet.android.js.map +1 -0
- package/Fonts/FontFaceSet.ios.d.ts +31 -0
- package/Fonts/FontFaceSet.ios.js +109 -0
- package/Fonts/FontFaceSet.ios.js.map +1 -0
- package/Fonts/index.d.ts +2 -0
- package/Fonts/index.js +3 -0
- package/Fonts/index.js.map +1 -0
- package/ImageAsset/index.d.ts +8 -3
- package/ImageAsset/index.js +206 -11
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.js +110 -23
- 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.d.ts +1 -1
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
- package/WebGL/WebGLRenderingContext/index.js +144 -46
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
- package/WebGL2/WebGL2RenderingContext/index.js +7 -8
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/Constants.d.ts +36 -0
- package/WebGPU/Constants.js +42 -0
- package/WebGPU/Constants.js.map +1 -0
- package/WebGPU/Errors.d.ts +18 -0
- package/WebGPU/Errors.js +21 -0
- package/WebGPU/Errors.js.map +1 -0
- package/WebGPU/GPU.d.ts +13 -0
- package/WebGPU/GPU.js +36 -0
- package/WebGPU/GPU.js.map +1 -0
- package/WebGPU/GPUAdapter.d.ts +26 -0
- package/WebGPU/GPUAdapter.js +93 -0
- package/WebGPU/GPUAdapter.js.map +1 -0
- package/WebGPU/GPUAdapterInfo.d.ts +9 -0
- package/WebGPU/GPUAdapterInfo.js +24 -0
- package/WebGPU/GPUAdapterInfo.js.map +1 -0
- package/WebGPU/GPUBindGroup.d.ts +6 -0
- package/WebGPU/GPUBindGroup.js +15 -0
- package/WebGPU/GPUBindGroup.js.map +1 -0
- package/WebGPU/GPUBindGroupLayout.d.ts +6 -0
- package/WebGPU/GPUBindGroupLayout.js +15 -0
- package/WebGPU/GPUBindGroupLayout.js.map +1 -0
- package/WebGPU/GPUBuffer.d.ts +15 -0
- package/WebGPU/GPUBuffer.js +66 -0
- package/WebGPU/GPUBuffer.js.map +1 -0
- package/WebGPU/GPUCanvasContext.d.ts +42 -0
- package/WebGPU/GPUCanvasContext.js +149 -0
- package/WebGPU/GPUCanvasContext.js.map +1 -0
- package/WebGPU/GPUCommandBuffer.d.ts +6 -0
- package/WebGPU/GPUCommandBuffer.js +15 -0
- package/WebGPU/GPUCommandBuffer.js.map +1 -0
- package/WebGPU/GPUCommandEncoder.d.ts +35 -0
- package/WebGPU/GPUCommandEncoder.js +163 -0
- package/WebGPU/GPUCommandEncoder.js.map +1 -0
- package/WebGPU/GPUComputePassEncoder.d.ts +17 -0
- package/WebGPU/GPUComputePassEncoder.js +53 -0
- package/WebGPU/GPUComputePassEncoder.js.map +1 -0
- package/WebGPU/GPUComputePipeline.d.ts +8 -0
- package/WebGPU/GPUComputePipeline.js +19 -0
- package/WebGPU/GPUComputePipeline.js.map +1 -0
- package/WebGPU/GPUDevice.d.ts +111 -0
- package/WebGPU/GPUDevice.js +341 -0
- package/WebGPU/GPUDevice.js.map +1 -0
- package/WebGPU/GPUDeviceLostInfo.d.ts +1 -0
- package/WebGPU/GPUDeviceLostInfo.js +10 -0
- package/WebGPU/GPUDeviceLostInfo.js.map +1 -0
- package/WebGPU/GPUExternalTexture.d.ts +6 -0
- package/WebGPU/GPUExternalTexture.js +15 -0
- package/WebGPU/GPUExternalTexture.js.map +1 -0
- package/WebGPU/GPUPipelineLayout.d.ts +6 -0
- package/WebGPU/GPUPipelineLayout.js +15 -0
- package/WebGPU/GPUPipelineLayout.js.map +1 -0
- package/WebGPU/GPUQuerySet.d.ts +6 -0
- package/WebGPU/GPUQuerySet.js +15 -0
- package/WebGPU/GPUQuerySet.js.map +1 -0
- package/WebGPU/GPUQueue.d.ts +15 -0
- package/WebGPU/GPUQueue.js +128 -0
- package/WebGPU/GPUQueue.js.map +1 -0
- package/WebGPU/GPURenderBundle.d.ts +6 -0
- package/WebGPU/GPURenderBundle.js +15 -0
- package/WebGPU/GPURenderBundle.js.map +1 -0
- package/WebGPU/GPURenderBundleEncoder.d.ts +22 -0
- package/WebGPU/GPURenderBundleEncoder.js +65 -0
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -0
- package/WebGPU/GPURenderPassEncoder.d.ts +33 -0
- package/WebGPU/GPURenderPassEncoder.js +106 -0
- package/WebGPU/GPURenderPassEncoder.js.map +1 -0
- package/WebGPU/GPURenderPipeline.d.ts +8 -0
- package/WebGPU/GPURenderPipeline.js +19 -0
- package/WebGPU/GPURenderPipeline.js.map +1 -0
- package/WebGPU/GPUSampler.d.ts +6 -0
- package/WebGPU/GPUSampler.js +15 -0
- package/WebGPU/GPUSampler.js.map +1 -0
- package/WebGPU/GPUShaderModule.d.ts +6 -0
- package/WebGPU/GPUShaderModule.js +15 -0
- package/WebGPU/GPUShaderModule.js.map +1 -0
- package/WebGPU/GPUTexture.d.ts +18 -0
- package/WebGPU/GPUTexture.js +47 -0
- package/WebGPU/GPUTexture.js.map +1 -0
- package/WebGPU/GPUTextureView.d.ts +6 -0
- package/WebGPU/GPUTextureView.js +15 -0
- package/WebGPU/GPUTextureView.js.map +1 -0
- package/WebGPU/Interfaces.d.ts +246 -0
- package/WebGPU/Interfaces.js +2 -0
- package/WebGPU/Interfaces.js.map +1 -0
- package/WebGPU/Types.d.ts +47 -0
- package/WebGPU/Types.js +2 -0
- package/WebGPU/Types.js.map +1 -0
- package/WebGPU/Utils.d.ts +7 -0
- package/WebGPU/Utils.js +301 -0
- package/WebGPU/Utils.js.map +1 -0
- package/WebGPU/index.d.ts +28 -0
- package/WebGPU/index.js +29 -0
- package/WebGPU/index.js.map +1 -0
- package/angular/{esm2020 → esm2022}/index.mjs +5 -5
- package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs +4 -4
- package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs.map +1 -1
- package/angular/package.json +4 -10
- package/common.d.ts +0 -3
- package/common.js +1 -5
- package/common.js.map +1 -1
- package/helpers.js.map +1 -1
- package/index.d.ts +4 -2
- package/index.js +37 -3
- package/index.js.map +1 -1
- package/package.json +2 -5
- 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 +194 -56
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +1 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +152 -151
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2901 -411
- 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 +10901 -8099
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Black.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Bold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraLight.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Light.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Medium.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-SemiBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoMath-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Bold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-BoldItalic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Italic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Medium.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-MediumItalic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBoldItalic.ttf +0 -0
- 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 +994 -663
- 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 +388 -112
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +1 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +152 -151
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2901 -411
- 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 +10901 -8099
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +10901 -8099
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +143 -33
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Black.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Bold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraLight.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Light.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Medium.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-SemiBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoMath-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Bold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-BoldItalic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Italic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Medium.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-MediumItalic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBoldItalic.ttf +0 -0
- 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 +993 -662
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +1037 -641
- package/platforms/ios/build.xcconfig +3 -1
- package/platforms/ios/src/NSOperationQueueWrapper.h +3 -1
- package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
- package/platforms/ios/src/cpp/AsyncCallback.h +214 -0
- package/platforms/ios/src/cpp/Caches.h +69 -1
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +647 -1166
- package/platforms/ios/src/cpp/CanvasJSIModule.h +11 -1
- package/platforms/ios/src/cpp/Helpers.h +2 -129
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +600 -437
- package/platforms/ios/src/cpp/ImageAssetImpl.h +18 -10
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +63 -6
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +12 -4
- 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 +197 -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 -11
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +193 -90
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +77 -23
- 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 +409 -3
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +29 -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 +247 -160
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +6 -6
- 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 +1067 -960
- 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 +371 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +63 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +174 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +58 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +79 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +79 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +277 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +63 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +379 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +57 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +81 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1217 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +73 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +293 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +65 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +109 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +51 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +3701 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +97 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +200 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +80 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +49 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +136 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +605 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +59 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +501 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +74 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +78 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +723 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +92 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +109 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +52 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +79 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +80 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +1304 -0
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +288 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +386 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +77 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +79 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +756 -0
- package/react/index.d.ts +1 -1
- package/utils.d.ts +1 -1
- package/utils.js.map +1 -1
- package/SVG/Circle.d.ts +0 -11
- package/SVG/Circle.js +0 -21
- package/SVG/Circle.js.map +0 -1
- package/SVG/ClipPath.d.ts +0 -4
- package/SVG/ClipPath.js +0 -9
- package/SVG/ClipPath.js.map +0 -1
- package/SVG/Defs.d.ts +0 -4
- package/SVG/Defs.js +0 -9
- package/SVG/Defs.js.map +0 -1
- package/SVG/Ellipse.d.ts +0 -13
- package/SVG/Ellipse.js +0 -26
- package/SVG/Ellipse.js.map +0 -1
- package/SVG/G.d.ts +0 -7
- package/SVG/G.js +0 -9
- package/SVG/G.js.map +0 -1
- package/SVG/Image.d.ts +0 -11
- package/SVG/Image.js +0 -40
- package/SVG/Image.js.map +0 -1
- package/SVG/Line.d.ts +0 -13
- package/SVG/Line.js +0 -26
- package/SVG/Line.js.map +0 -1
- package/SVG/LinearGradient.d.ts +0 -10
- package/SVG/LinearGradient.js +0 -13
- package/SVG/LinearGradient.js.map +0 -1
- package/SVG/Path.d.ts +0 -7
- package/SVG/Path.js +0 -14
- package/SVG/Path.js.map +0 -1
- package/SVG/Pattern.d.ts +0 -4
- package/SVG/Pattern.js +0 -9
- package/SVG/Pattern.js.map +0 -1
- package/SVG/Polygon.d.ts +0 -7
- package/SVG/Polygon.js +0 -14
- package/SVG/Polygon.js.map +0 -1
- package/SVG/Polyline.d.ts +0 -7
- package/SVG/Polyline.js +0 -14
- package/SVG/Polyline.js.map +0 -1
- package/SVG/Rect.d.ts +0 -8
- package/SVG/Rect.js +0 -13
- package/SVG/Rect.js.map +0 -1
- package/SVG/SVG.d.ts +0 -32
- package/SVG/SVG.js +0 -204
- package/SVG/SVG.js.map +0 -1
- package/SVG/SVGItem.d.ts +0 -5
- package/SVG/SVGItem.js +0 -8
- package/SVG/SVGItem.js.map +0 -1
- package/SVG/Stop.d.ts +0 -5
- package/SVG/Stop.js +0 -9
- package/SVG/Stop.js.map +0 -1
- package/SVG/Symbol.d.ts +0 -4
- package/SVG/Symbol.js +0 -9
- package/SVG/Symbol.js.map +0 -1
- package/SVG/Text.d.ts +0 -14
- package/SVG/Text.js +0 -26
- package/SVG/Text.js.map +0 -1
- package/SVG/Use.d.ts +0 -4
- package/SVG/Use.js +0 -9
- package/SVG/Use.js.map +0 -1
- package/SVG/index.d.ts +0 -18
- package/SVG/index.js +0 -19
- package/SVG/index.js.map +0 -1
- package/angular/fesm2020/nativescript-canvas-angular.mjs +0 -24
- package/angular/fesm2020/nativescript-canvas-angular.mjs.map +0 -1
- package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
- package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
- package/platforms/ios/src/cpp/URLImpl.cpp +0 -464
- package/platforms/ios/src/cpp/URLImpl.h +0 -121
- 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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 23/06/2024.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#ifndef CANVAS_ANDROID_GPUCOMMANDENCODERIMPL_H
|
|
6
|
+
#define CANVAS_ANDROID_GPUCOMMANDENCODERIMPL_H
|
|
7
|
+
|
|
8
|
+
#include "Helpers.h"
|
|
9
|
+
#include "ObjectWrapperImpl.h"
|
|
10
|
+
#include "GPUUtils.h"
|
|
11
|
+
|
|
12
|
+
class GPUCommandEncoderImpl : ObjectWrapperImpl {
|
|
13
|
+
public:
|
|
14
|
+
explicit GPUCommandEncoderImpl(const CanvasGPUCommandEncoder *encoder);
|
|
15
|
+
|
|
16
|
+
~GPUCommandEncoderImpl() {
|
|
17
|
+
canvas_native_webgpu_command_encoder_release(this->encoder_);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const CanvasGPUCommandEncoder *GetEncoder();
|
|
21
|
+
|
|
22
|
+
static void Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolate);
|
|
23
|
+
|
|
24
|
+
static GPUCommandEncoderImpl *GetPointer(const v8::Local<v8::Object> &object);
|
|
25
|
+
|
|
26
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
27
|
+
|
|
28
|
+
static v8::Local<v8::Object> NewInstance(v8::Isolate *isolate, GPUCommandEncoderImpl *encoder) {
|
|
29
|
+
auto context = isolate->GetCurrentContext();
|
|
30
|
+
v8::EscapableHandleScope scope(isolate);
|
|
31
|
+
auto object = GPUCommandEncoderImpl::GetCtor(isolate)->GetFunction(
|
|
32
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
+
SetNativeType(encoder, NativeType::GPUCommandEncoder);
|
|
34
|
+
object->SetAlignedPointerInInternalField(0, encoder);
|
|
35
|
+
encoder->BindFinalizer(isolate, object);
|
|
36
|
+
return scope.Escape(object);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static void GetLabel(v8::Local<v8::Name> name,
|
|
40
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
41
|
+
|
|
42
|
+
static void BeginComputePass(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
43
|
+
|
|
44
|
+
static void BeginRenderPass(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
45
|
+
|
|
46
|
+
static void ClearBuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
47
|
+
|
|
48
|
+
static void CopyBufferToBuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
49
|
+
|
|
50
|
+
static void CopyBufferToTexture(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
51
|
+
|
|
52
|
+
static void CopyTextureToBuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
53
|
+
|
|
54
|
+
static void CopyTextureToTexture(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
55
|
+
|
|
56
|
+
static void Finish(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
57
|
+
|
|
58
|
+
static void InsertDebugMarker(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
59
|
+
|
|
60
|
+
static void PopDebugGroup(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
61
|
+
|
|
62
|
+
static void PushDebugGroup(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
63
|
+
|
|
64
|
+
static void ResolveQuerySet(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
65
|
+
|
|
66
|
+
static void WriteTimestamp(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
67
|
+
|
|
68
|
+
private:
|
|
69
|
+
const CanvasGPUCommandEncoder *encoder_;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
#endif //CANVAS_ANDROID_GPUCOMMANDENCODERIMPL_H
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 23/06/2024.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include "GPUComputePassEncoderImpl.h"
|
|
6
|
+
#include "Caches.h"
|
|
7
|
+
#include "GPUBindGroupImpl.h"
|
|
8
|
+
#include "GPUComputePipelineImpl.h"
|
|
9
|
+
#include "GPUBufferImpl.h"
|
|
10
|
+
|
|
11
|
+
GPUComputePassEncoderImpl::GPUComputePassEncoderImpl(const CanvasGPUComputePassEncoder *pass)
|
|
12
|
+
: computePass_(
|
|
13
|
+
pass) {}
|
|
14
|
+
|
|
15
|
+
const CanvasGPUComputePassEncoder *GPUComputePassEncoderImpl::GetComputePass() {
|
|
16
|
+
return this->computePass_;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
void GPUComputePassEncoderImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolate) {
|
|
21
|
+
v8::Locker locker(isolate);
|
|
22
|
+
v8::Isolate::Scope isolate_scope(isolate);
|
|
23
|
+
v8::HandleScope handle_scope(isolate);
|
|
24
|
+
|
|
25
|
+
auto ctor = GetCtor(isolate);
|
|
26
|
+
auto context = isolate->GetCurrentContext();
|
|
27
|
+
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
28
|
+
|
|
29
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUComputePassEncoder"),
|
|
30
|
+
func).FromJust();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
GPUComputePassEncoderImpl *
|
|
34
|
+
GPUComputePassEncoderImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
35
|
+
auto ptr = object->GetAlignedPointerFromInternalField(0);
|
|
36
|
+
if (ptr == nullptr) {
|
|
37
|
+
return nullptr;
|
|
38
|
+
}
|
|
39
|
+
return static_cast<GPUComputePassEncoderImpl *>(ptr);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
v8::Local<v8::FunctionTemplate> GPUComputePassEncoderImpl::GetCtor(v8::Isolate *isolate) {
|
|
43
|
+
auto cache = Caches::Get(isolate);
|
|
44
|
+
auto ctor = cache->GPUComputePassEncoderTmpl.get();
|
|
45
|
+
if (ctor != nullptr) {
|
|
46
|
+
return ctor->Get(isolate);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
50
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(2);
|
|
51
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "GPUComputePassEncoder"));
|
|
52
|
+
|
|
53
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
54
|
+
tmpl->SetInternalFieldCount(2);
|
|
55
|
+
|
|
56
|
+
tmpl->SetLazyDataProperty(
|
|
57
|
+
ConvertToV8String(isolate, "label"),
|
|
58
|
+
GetLabel
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
tmpl->Set(
|
|
62
|
+
ConvertToV8String(isolate, "dispatchWorkgroups"),
|
|
63
|
+
v8::FunctionTemplate::New(isolate, &DispatchWorkgroups));
|
|
64
|
+
|
|
65
|
+
tmpl->Set(
|
|
66
|
+
ConvertToV8String(isolate, "dispatchWorkgroupsIndirect"),
|
|
67
|
+
v8::FunctionTemplate::New(isolate, &DispatchWorkgroupsIndirect));
|
|
68
|
+
|
|
69
|
+
tmpl->Set(
|
|
70
|
+
ConvertToV8String(isolate, "end"),
|
|
71
|
+
v8::FunctionTemplate::New(isolate, &End));
|
|
72
|
+
|
|
73
|
+
tmpl->Set(
|
|
74
|
+
ConvertToV8String(isolate, "insertDebugMarker"),
|
|
75
|
+
v8::FunctionTemplate::New(isolate, &InsertDebugMarker));
|
|
76
|
+
|
|
77
|
+
tmpl->Set(
|
|
78
|
+
ConvertToV8String(isolate, "popDebugGroup"),
|
|
79
|
+
v8::FunctionTemplate::New(isolate, &PopDebugGroup));
|
|
80
|
+
|
|
81
|
+
tmpl->Set(
|
|
82
|
+
ConvertToV8String(isolate, "pushDebugGroup"),
|
|
83
|
+
v8::FunctionTemplate::New(isolate, &PushDebugGroup));
|
|
84
|
+
|
|
85
|
+
tmpl->Set(
|
|
86
|
+
ConvertToV8String(isolate, "setBindGroup"),
|
|
87
|
+
v8::FunctionTemplate::New(isolate, &SetBindGroup));
|
|
88
|
+
|
|
89
|
+
tmpl->Set(
|
|
90
|
+
ConvertToV8String(isolate, "setPipeline"),
|
|
91
|
+
v8::FunctionTemplate::New(isolate, &SetPipeline));
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
cache->GPUComputePassEncoderTmpl =
|
|
95
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>
|
|
96
|
+
(isolate, ctorTmpl);
|
|
97
|
+
return ctorTmpl;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
void
|
|
101
|
+
GPUComputePassEncoderImpl::GetLabel(v8::Local<v8::Name> name,
|
|
102
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
103
|
+
auto ptr = GetPointer(info.This());
|
|
104
|
+
if (ptr != nullptr) {
|
|
105
|
+
auto label = canvas_native_webgpu_compute_pass_encoder_get_label(ptr->computePass_);
|
|
106
|
+
if (label == nullptr) {
|
|
107
|
+
info.GetReturnValue().SetEmptyString();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
info.GetReturnValue().Set(
|
|
111
|
+
ConvertToV8String(info.GetIsolate(), label)
|
|
112
|
+
);
|
|
113
|
+
canvas_native_string_destroy(label);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
info.GetReturnValue().SetEmptyString();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
void
|
|
122
|
+
GPUComputePassEncoderImpl::DispatchWorkgroups(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
123
|
+
auto *ptr = GetPointer(args.This());
|
|
124
|
+
if (ptr == nullptr) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
auto isolate = args.GetIsolate();
|
|
129
|
+
auto context = isolate->GetCurrentContext();
|
|
130
|
+
|
|
131
|
+
auto workgroupCountXVal = args[0];
|
|
132
|
+
auto workgroupCountYVal = args[1];
|
|
133
|
+
auto workgroupCountZVal = args[2];
|
|
134
|
+
|
|
135
|
+
uint32_t workgroupCountY = 1;
|
|
136
|
+
uint32_t workgroupCountZ = 1;
|
|
137
|
+
|
|
138
|
+
if (workgroupCountYVal->IsUint32()) {
|
|
139
|
+
workgroupCountY = workgroupCountYVal.As<v8::Uint32>()->Value();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (workgroupCountZVal->IsUint32()) {
|
|
143
|
+
workgroupCountZ = workgroupCountZVal.As<v8::Uint32>()->Value();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (workgroupCountXVal->IsUint32()) {
|
|
147
|
+
canvas_native_webgpu_compute_pass_encoder_dispatch_workgroups(ptr->GetComputePass(),
|
|
148
|
+
workgroupCountXVal->Uint32Value(
|
|
149
|
+
context).FromJust(),
|
|
150
|
+
workgroupCountY,
|
|
151
|
+
workgroupCountZ);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
void GPUComputePassEncoderImpl::DispatchWorkgroupsIndirect(
|
|
157
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
158
|
+
auto *ptr = GetPointer(args.This());
|
|
159
|
+
if (ptr == nullptr) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
auto isolate = args.GetIsolate();
|
|
163
|
+
auto context = isolate->GetCurrentContext();
|
|
164
|
+
|
|
165
|
+
auto indirectBuffer = args[0];
|
|
166
|
+
auto indirectOffset = args[1];
|
|
167
|
+
|
|
168
|
+
auto type = GetNativeType(indirectBuffer);
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
if (type == NativeType::GPUBuffer) {
|
|
172
|
+
auto buffer = GPUBufferImpl::GetPointer(indirectBuffer.As<v8::Object>());
|
|
173
|
+
auto offset = (size_t) indirectOffset->NumberValue(context).FromJust();
|
|
174
|
+
canvas_native_webgpu_compute_pass_encoder_dispatch_workgroups_indirect(
|
|
175
|
+
ptr->GetComputePass(), buffer->GetGPUBuffer(), offset);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
void GPUComputePassEncoderImpl::End(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
182
|
+
auto *ptr = GetPointer(args.This());
|
|
183
|
+
if (ptr == nullptr) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
canvas_native_webgpu_compute_pass_encoder_end(ptr->GetComputePass());
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
void
|
|
191
|
+
GPUComputePassEncoderImpl::InsertDebugMarker(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
192
|
+
auto *ptr = GetPointer(args.This());
|
|
193
|
+
if (ptr == nullptr) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
auto isolate = args.GetIsolate();
|
|
198
|
+
|
|
199
|
+
auto markerLabelVal = args[0];
|
|
200
|
+
if (markerLabelVal->IsString()) {
|
|
201
|
+
auto markerLabel = ConvertFromV8String(isolate, markerLabelVal);
|
|
202
|
+
canvas_native_webgpu_compute_pass_encoder_insert_debug_marker(ptr->GetComputePass(),
|
|
203
|
+
markerLabel.c_str());
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
void GPUComputePassEncoderImpl::PopDebugGroup(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
208
|
+
auto *ptr = GetPointer(args.This());
|
|
209
|
+
if (ptr == nullptr) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
canvas_native_webgpu_compute_pass_encoder_pop_debug_group(ptr->GetComputePass());
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
void GPUComputePassEncoderImpl::PushDebugGroup(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
217
|
+
auto *ptr = GetPointer(args.This());
|
|
218
|
+
if (ptr == nullptr) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
auto isolate = args.GetIsolate();
|
|
223
|
+
|
|
224
|
+
auto groupLabelVal = args[0];
|
|
225
|
+
if (groupLabelVal->IsString()) {
|
|
226
|
+
auto groupLabel = ConvertFromV8String(isolate, groupLabelVal);
|
|
227
|
+
canvas_native_webgpu_compute_pass_encoder_push_debug_group(ptr->GetComputePass(),
|
|
228
|
+
groupLabel.c_str());
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
void GPUComputePassEncoderImpl::SetBindGroup(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
233
|
+
auto *ptr = GetPointer(args.This());
|
|
234
|
+
if (ptr == nullptr) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
auto isolate = args.GetIsolate();
|
|
239
|
+
auto context = isolate->GetCurrentContext();
|
|
240
|
+
|
|
241
|
+
auto indexVal = args[0];
|
|
242
|
+
auto bindGroupVal = args[1];
|
|
243
|
+
auto dynamicOffsets = args[2];
|
|
244
|
+
auto dynamicOffsetsStart = args[3];
|
|
245
|
+
auto dynamicOffsetsLength = args[4];
|
|
246
|
+
|
|
247
|
+
const CanvasGPUBindGroup *bindGroup = nullptr;
|
|
248
|
+
|
|
249
|
+
auto type = GetNativeType(bindGroupVal);
|
|
250
|
+
|
|
251
|
+
if (type == NativeType::GPUBindGroup) {
|
|
252
|
+
auto group = GPUBindGroupImpl::GetPointer(bindGroupVal.As<v8::Object>());
|
|
253
|
+
bindGroup = group->GetBindGroup();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
auto index = indexVal->Uint32Value(context).FromJust();
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
if (dynamicOffsets->IsUint8Array()) {
|
|
260
|
+
auto buf = dynamicOffsets.As<v8::Uint32Array>();
|
|
261
|
+
auto buffer = buf->Buffer();
|
|
262
|
+
auto store = buffer->GetBackingStore();
|
|
263
|
+
auto offset = buf->ByteOffset();
|
|
264
|
+
auto data = static_cast<uint8_t *>(buffer->GetBackingStore()->Data()) + offset;
|
|
265
|
+
auto size = buf->Length();
|
|
266
|
+
auto start = (size_t) dynamicOffsetsStart->NumberValue(context).FromJust();
|
|
267
|
+
auto offset_length = (size_t) dynamicOffsetsLength->NumberValue(context).FromJust();
|
|
268
|
+
canvas_native_webgpu_compute_pass_encoder_set_bind_group(ptr->GetComputePass(), index,
|
|
269
|
+
bindGroup,
|
|
270
|
+
static_cast<const uint32_t *>(static_cast<void *>(data)),
|
|
271
|
+
size, start, offset_length);
|
|
272
|
+
} else {
|
|
273
|
+
canvas_native_webgpu_compute_pass_encoder_set_bind_group(ptr->GetComputePass(), index,
|
|
274
|
+
bindGroup,
|
|
275
|
+
nullptr, 0, 0, 0);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
void GPUComputePassEncoderImpl::SetPipeline(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
280
|
+
auto *ptr = GetPointer(args.This());
|
|
281
|
+
if (ptr == nullptr) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
auto pipelineVal = args[0];
|
|
286
|
+
if (pipelineVal->IsObject()) {
|
|
287
|
+
auto pipeline = GPUComputePipelineImpl::GetPointer(pipelineVal.As<v8::Object>());
|
|
288
|
+
if (pipeline != nullptr) {
|
|
289
|
+
canvas_native_webgpu_compute_pass_encoder_set_pipeline(ptr->GetComputePass(),
|
|
290
|
+
pipeline->GetGPUPipeline());
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 23/06/2024.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#ifndef CANVAS_ANDROID_GPUCOMPUTEPASSENCODERIMPL_H
|
|
6
|
+
#define CANVAS_ANDROID_GPUCOMPUTEPASSENCODERIMPL_H
|
|
7
|
+
|
|
8
|
+
#include "Helpers.h"
|
|
9
|
+
#include "ObjectWrapperImpl.h"
|
|
10
|
+
|
|
11
|
+
class GPUComputePassEncoderImpl : ObjectWrapperImpl {
|
|
12
|
+
public:
|
|
13
|
+
explicit GPUComputePassEncoderImpl(const CanvasGPUComputePassEncoder *computePass);
|
|
14
|
+
|
|
15
|
+
~GPUComputePassEncoderImpl() {
|
|
16
|
+
canvas_native_webgpu_compute_pass_encoder_release(this->computePass_);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const CanvasGPUComputePassEncoder *GetComputePass();
|
|
20
|
+
|
|
21
|
+
static void Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolate);
|
|
22
|
+
|
|
23
|
+
static GPUComputePassEncoderImpl *GetPointer(const v8::Local<v8::Object> &object);
|
|
24
|
+
|
|
25
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
26
|
+
|
|
27
|
+
static v8::Local<v8::Object>
|
|
28
|
+
NewInstance(v8::Isolate *isolate, GPUComputePassEncoderImpl *pass) {
|
|
29
|
+
auto context = isolate->GetCurrentContext();
|
|
30
|
+
v8::EscapableHandleScope scope(isolate);
|
|
31
|
+
auto object = GPUComputePassEncoderImpl::GetCtor(isolate)->GetFunction(
|
|
32
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
+
SetNativeType(pass, NativeType::GPUComputePass);
|
|
34
|
+
object->SetAlignedPointerInInternalField(0, pass);
|
|
35
|
+
pass->BindFinalizer(isolate, object);
|
|
36
|
+
return scope.Escape(object);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static void GetLabel(v8::Local<v8::Name> name,
|
|
40
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
41
|
+
|
|
42
|
+
static void DispatchWorkgroups(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
43
|
+
|
|
44
|
+
static void DispatchWorkgroupsIndirect(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
45
|
+
|
|
46
|
+
static void End(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
47
|
+
|
|
48
|
+
static void InsertDebugMarker(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
49
|
+
|
|
50
|
+
static void PopDebugGroup(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
51
|
+
|
|
52
|
+
static void PushDebugGroup(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
53
|
+
|
|
54
|
+
static void SetBindGroup(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
55
|
+
|
|
56
|
+
static void SetPipeline(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
private:
|
|
61
|
+
const CanvasGPUComputePassEncoder *computePass_;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
#endif //CANVAS_ANDROID_GPUCOMPUTEPASSENCODERIMPL_H
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 17/07/2024.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include "GPUComputePipelineImpl.h"
|
|
6
|
+
#include "Caches.h"
|
|
7
|
+
#include "GPUBindGroupLayoutImpl.h"
|
|
8
|
+
|
|
9
|
+
GPUComputePipelineImpl::GPUComputePipelineImpl(const CanvasGPUComputePipeline *pipeline)
|
|
10
|
+
: pipeline_(
|
|
11
|
+
pipeline) {}
|
|
12
|
+
|
|
13
|
+
const CanvasGPUComputePipeline *GPUComputePipelineImpl::GetGPUPipeline() {
|
|
14
|
+
return this->pipeline_;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
void GPUComputePipelineImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolate) {
|
|
19
|
+
v8::Locker locker(isolate);
|
|
20
|
+
v8::Isolate::Scope isolate_scope(isolate);
|
|
21
|
+
v8::HandleScope handle_scope(isolate);
|
|
22
|
+
|
|
23
|
+
auto ctor = GetCtor(isolate);
|
|
24
|
+
auto context = isolate->GetCurrentContext();
|
|
25
|
+
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
26
|
+
|
|
27
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "GPUComputePipeline"), func).FromJust();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
GPUComputePipelineImpl *GPUComputePipelineImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
31
|
+
auto ptr = object->GetAlignedPointerFromInternalField(0);
|
|
32
|
+
if (ptr == nullptr) {
|
|
33
|
+
return nullptr;
|
|
34
|
+
}
|
|
35
|
+
return static_cast<GPUComputePipelineImpl *>(ptr);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
v8::Local<v8::FunctionTemplate> GPUComputePipelineImpl::GetCtor(v8::Isolate *isolate) {
|
|
39
|
+
auto cache = Caches::Get(isolate);
|
|
40
|
+
auto ctor = cache->GPUComputePipelineTmpl.get();
|
|
41
|
+
if (ctor != nullptr) {
|
|
42
|
+
return ctor->Get(isolate);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
46
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(2);
|
|
47
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "GPUComputePipeline"));
|
|
48
|
+
|
|
49
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
50
|
+
tmpl->SetInternalFieldCount(2);
|
|
51
|
+
|
|
52
|
+
tmpl->SetLazyDataProperty(
|
|
53
|
+
ConvertToV8String(isolate, "label"),
|
|
54
|
+
GetLabel
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
tmpl->Set(
|
|
58
|
+
ConvertToV8String(isolate, "getBindGroupLayout"),
|
|
59
|
+
v8::FunctionTemplate::New(isolate, &GetBindGroupLayout));
|
|
60
|
+
|
|
61
|
+
cache->GPUComputePipelineTmpl =
|
|
62
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
63
|
+
return ctorTmpl;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void
|
|
67
|
+
GPUComputePipelineImpl::GetLabel(v8::Local<v8::Name> name,
|
|
68
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
69
|
+
auto ptr = GetPointer(info.This());
|
|
70
|
+
if (ptr != nullptr) {
|
|
71
|
+
auto label = canvas_native_webgpu_compute_pipeline_get_label(ptr->pipeline_);
|
|
72
|
+
if (label == nullptr) {
|
|
73
|
+
info.GetReturnValue().SetEmptyString();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
info.GetReturnValue().Set(
|
|
77
|
+
ConvertToV8String(info.GetIsolate(), label)
|
|
78
|
+
);
|
|
79
|
+
canvas_native_string_destroy(label);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
info.GetReturnValue().SetEmptyString();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
void GPUComputePipelineImpl::GetBindGroupLayout(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
88
|
+
auto *ptr = GetPointer(args.This());
|
|
89
|
+
if (ptr == nullptr) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
auto isolate = args.GetIsolate();
|
|
94
|
+
auto context = isolate->GetCurrentContext();
|
|
95
|
+
auto index = args[0]->Uint32Value(context).ToChecked();
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
auto group_layout = canvas_native_webgpu_compute_pipeline_get_bind_group_layout(
|
|
99
|
+
ptr->GetGPUPipeline(), index);
|
|
100
|
+
|
|
101
|
+
if (group_layout != nullptr) {
|
|
102
|
+
auto ret = GPUBindGroupLayoutImpl::NewInstance(isolate,
|
|
103
|
+
new GPUBindGroupLayoutImpl(group_layout));
|
|
104
|
+
args.GetReturnValue().Set(ret);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
args.GetReturnValue().SetUndefined();
|
|
109
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 17/07/2024.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#ifndef CANVAS_ANDROID_GPUCOMPUTEPIPELINEIMPL_H
|
|
6
|
+
#define CANVAS_ANDROID_GPUCOMPUTEPIPELINEIMPL_H
|
|
7
|
+
|
|
8
|
+
#include "Common.h"
|
|
9
|
+
#include "Helpers.h"
|
|
10
|
+
#include "ObjectWrapperImpl.h"
|
|
11
|
+
|
|
12
|
+
class GPUComputePipelineImpl : ObjectWrapperImpl {
|
|
13
|
+
public:
|
|
14
|
+
explicit GPUComputePipelineImpl(const CanvasGPUComputePipeline *pipeline);
|
|
15
|
+
|
|
16
|
+
~GPUComputePipelineImpl() {
|
|
17
|
+
canvas_native_webgpu_compute_pipeline_release(this->pipeline_);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const CanvasGPUComputePipeline *GetGPUPipeline();
|
|
21
|
+
|
|
22
|
+
static void Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolate);
|
|
23
|
+
|
|
24
|
+
static GPUComputePipelineImpl *GetPointer(const v8::Local<v8::Object> &object);
|
|
25
|
+
|
|
26
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
27
|
+
|
|
28
|
+
static v8::Local<v8::Object>
|
|
29
|
+
NewInstance(v8::Isolate *isolate, GPUComputePipelineImpl *pipeline) {
|
|
30
|
+
auto context = isolate->GetCurrentContext();
|
|
31
|
+
v8::EscapableHandleScope scope(isolate);
|
|
32
|
+
auto object = GPUComputePipelineImpl::GetCtor(isolate)->GetFunction(
|
|
33
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
34
|
+
SetNativeType(pipeline, NativeType::GPUComputePipeline);
|
|
35
|
+
object->SetAlignedPointerInInternalField(0, pipeline);
|
|
36
|
+
pipeline->BindFinalizer(isolate, object);
|
|
37
|
+
return scope.Escape(object);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static void GetLabel(v8::Local<v8::Name> name,
|
|
41
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
42
|
+
|
|
43
|
+
static void GetBindGroupLayout(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
private:
|
|
47
|
+
const CanvasGPUComputePipeline *pipeline_;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
#endif //CANVAS_ANDROID_GPUCOMPUTEPIPELINEIMPL_H
|