@nativescript/canvas 2.0.0-webgpu.3 → 2.0.0-webgpu.31

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.
Files changed (198) hide show
  1. package/Canvas/common.d.ts +4 -9
  2. package/Canvas/common.js +37 -126
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +0 -1
  5. package/Canvas/index.android.js +45 -38
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.d.ts +11 -3
  8. package/Canvas/index.ios.js +49 -40
  9. package/Canvas/index.ios.js.map +1 -1
  10. package/Canvas/utils.d.ts +3 -0
  11. package/Canvas/utils.js +85 -0
  12. package/Canvas/utils.js.map +1 -0
  13. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -0
  14. package/Canvas2D/CanvasRenderingContext2D/index.js +1 -0
  15. package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
  16. package/Dom/Group.d.ts +1 -2
  17. package/Dom/Group.js.map +1 -1
  18. package/Dom/Image.js +0 -1
  19. package/Dom/Image.js.map +1 -1
  20. package/Dom/Paint.d.ts +1 -1
  21. package/Dom/shapes/Path.d.ts +1 -1
  22. package/ImageAsset/index.js +77 -33
  23. package/ImageAsset/index.js.map +1 -1
  24. package/ImageBitmap/index.js +107 -20
  25. package/ImageBitmap/index.js.map +1 -1
  26. package/README.md +2 -4
  27. package/WebGL/WebGLRenderingContext/index.js +74 -31
  28. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  29. package/WebGL2/WebGL2RenderingContext/index.js +4 -4
  30. package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
  31. package/WebGPU/GPU.js +4 -3
  32. package/WebGPU/GPU.js.map +1 -1
  33. package/WebGPU/GPUAdapter.d.ts +6 -3
  34. package/WebGPU/GPUAdapter.js +31 -0
  35. package/WebGPU/GPUAdapter.js.map +1 -1
  36. package/WebGPU/GPUBindGroup.d.ts +1 -0
  37. package/WebGPU/GPUBindGroup.js +3 -0
  38. package/WebGPU/GPUBindGroup.js.map +1 -1
  39. package/WebGPU/GPUBindGroupLayout.d.ts +1 -0
  40. package/WebGPU/GPUBindGroupLayout.js +3 -0
  41. package/WebGPU/GPUBindGroupLayout.js.map +1 -1
  42. package/WebGPU/GPUBuffer.js +10 -2
  43. package/WebGPU/GPUBuffer.js.map +1 -1
  44. package/WebGPU/GPUCanvasContext.d.ts +3 -2
  45. package/WebGPU/GPUCanvasContext.js +52 -10
  46. package/WebGPU/GPUCanvasContext.js.map +1 -1
  47. package/WebGPU/GPUCommandBuffer.d.ts +1 -0
  48. package/WebGPU/GPUCommandBuffer.js +3 -0
  49. package/WebGPU/GPUCommandBuffer.js.map +1 -1
  50. package/WebGPU/GPUCommandEncoder.d.ts +3 -9
  51. package/WebGPU/GPUCommandEncoder.js +94 -41
  52. package/WebGPU/GPUCommandEncoder.js.map +1 -1
  53. package/WebGPU/GPUComputePassEncoder.d.ts +1 -0
  54. package/WebGPU/GPUComputePassEncoder.js +3 -0
  55. package/WebGPU/GPUComputePassEncoder.js.map +1 -1
  56. package/WebGPU/GPUComputePipeline.d.ts +1 -0
  57. package/WebGPU/GPUComputePipeline.js +3 -0
  58. package/WebGPU/GPUComputePipeline.js.map +1 -1
  59. package/WebGPU/GPUDevice.d.ts +17 -79
  60. package/WebGPU/GPUDevice.js +76 -91
  61. package/WebGPU/GPUDevice.js.map +1 -1
  62. package/WebGPU/GPUExternalTexture.d.ts +1 -0
  63. package/WebGPU/GPUExternalTexture.js +3 -0
  64. package/WebGPU/GPUExternalTexture.js.map +1 -1
  65. package/WebGPU/GPUPipelineLayout.d.ts +1 -0
  66. package/WebGPU/GPUPipelineLayout.js +3 -0
  67. package/WebGPU/GPUPipelineLayout.js.map +1 -1
  68. package/WebGPU/GPUQuerySet.d.ts +1 -0
  69. package/WebGPU/GPUQuerySet.js +3 -0
  70. package/WebGPU/GPUQuerySet.js.map +1 -1
  71. package/WebGPU/GPUQueue.d.ts +1 -0
  72. package/WebGPU/GPUQueue.js +56 -14
  73. package/WebGPU/GPUQueue.js.map +1 -1
  74. package/WebGPU/GPURenderBundle.d.ts +1 -0
  75. package/WebGPU/GPURenderBundle.js +3 -0
  76. package/WebGPU/GPURenderBundle.js.map +1 -1
  77. package/WebGPU/GPURenderBundleEncoder.d.ts +4 -2
  78. package/WebGPU/GPURenderBundleEncoder.js +7 -3
  79. package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
  80. package/WebGPU/GPURenderPassEncoder.d.ts +2 -1
  81. package/WebGPU/GPURenderPassEncoder.js +5 -2
  82. package/WebGPU/GPURenderPassEncoder.js.map +1 -1
  83. package/WebGPU/GPURenderPipeline.d.ts +1 -0
  84. package/WebGPU/GPURenderPipeline.js +3 -0
  85. package/WebGPU/GPURenderPipeline.js.map +1 -1
  86. package/WebGPU/GPUSampler.d.ts +1 -0
  87. package/WebGPU/GPUSampler.js +3 -0
  88. package/WebGPU/GPUSampler.js.map +1 -1
  89. package/WebGPU/GPUShaderModule.d.ts +1 -1
  90. package/WebGPU/GPUShaderModule.js +2 -2
  91. package/WebGPU/GPUShaderModule.js.map +1 -1
  92. package/WebGPU/GPUTexture.d.ts +1 -0
  93. package/WebGPU/GPUTexture.js +3 -0
  94. package/WebGPU/GPUTexture.js.map +1 -1
  95. package/WebGPU/GPUTextureView.d.ts +1 -0
  96. package/WebGPU/GPUTextureView.js +3 -0
  97. package/WebGPU/GPUTextureView.js.map +1 -1
  98. package/WebGPU/Interfaces.d.ts +95 -4
  99. package/WebGPU/Types.d.ts +9 -1
  100. package/WebGPU/Utils.d.ts +6 -0
  101. package/WebGPU/Utils.js +224 -0
  102. package/WebGPU/Utils.js.map +1 -1
  103. package/angular/esm2022/index.mjs +4 -4
  104. package/angular/fesm2022/nativescript-canvas-angular.mjs +4 -4
  105. package/package.json +1 -1
  106. package/platforms/android/canvas-release.aar +0 -0
  107. package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
  108. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  109. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +40 -12
  110. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +7 -0
  111. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +227 -62
  112. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  113. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  114. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +7341 -6577
  115. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +62 -4
  116. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  117. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +62 -4
  118. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
  119. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  120. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +650 -644
  121. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  122. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +80 -24
  123. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +7 -0
  124. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +227 -62
  125. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  126. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  127. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  128. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +7341 -6577
  129. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +62 -4
  130. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  131. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +62 -4
  132. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +7341 -6577
  133. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +62 -4
  134. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  135. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +62 -4
  136. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
  137. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +27 -27
  138. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  139. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +652 -646
  140. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +704 -684
  141. package/platforms/ios/src/NSOperationQueueWrapper.h +1 -1
  142. package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
  143. package/platforms/ios/src/cpp/AsyncCallback.h +16 -8
  144. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +208 -789
  145. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +18 -28
  146. package/platforms/ios/src/cpp/ImageAssetImpl.h +3 -3
  147. package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +60 -3
  148. package/platforms/ios/src/cpp/ImageBitmapImpl.h +10 -3
  149. package/platforms/ios/src/cpp/PromiseCallback.h +1 -2
  150. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +1 -1
  151. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +3 -3
  152. package/platforms/ios/src/cpp/canvas2d/Path2D.h +5 -5
  153. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +106 -1
  154. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +26 -23
  155. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +31 -5
  156. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +4 -1
  157. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +26 -0
  158. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +3 -0
  159. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +41 -7
  160. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +4 -0
  161. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -5
  162. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +28 -1
  163. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +3 -0
  164. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +75 -79
  165. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +4 -0
  166. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +42 -14
  167. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +3 -0
  168. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +25 -0
  169. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +2 -0
  170. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +1597 -674
  171. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +2 -0
  172. package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +2 -1
  173. package/platforms/ios/src/cpp/webgpu/GPUImpl.h +1 -1
  174. package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
  175. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +26 -0
  176. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +3 -1
  177. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +1 -2
  178. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +1 -1
  179. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +50 -13
  180. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +3 -0
  181. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +43 -14
  182. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +3 -0
  183. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +25 -0
  184. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +3 -0
  185. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +39 -13
  186. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +3 -0
  187. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +25 -0
  188. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +3 -0
  189. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +26 -0
  190. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +4 -1
  191. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +24 -0
  192. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +3 -0
  193. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +34 -8
  194. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +2 -0
  195. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +26 -0
  196. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +3 -0
  197. package/platforms/ios/src/cpp/webgpu/GPUUtils.h +511 -0
  198. package/utils.d.ts +1 -1
@@ -342,11 +342,13 @@ SWIFT_CLASS_NAMED("CanvasHelpers")
342
342
  + (NSMutableData * _Nonnull)getBytesFromUIImage:(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
343
343
  + (int64_t)createPattern:(int64_t)context :(UIImage * _Nonnull)image :(NSString * _Nonnull)repetition SWIFT_WARN_UNUSED_RESULT;
344
344
  + (BOOL)loadImageAssetWithContext:(int64_t)asset :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
345
+ + (BOOL)loadImageAssetWithPath:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
345
346
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy SWIFT_WARN_UNUSED_RESULT;
346
347
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy dw:(float)dw dh:(float)dh SWIFT_WARN_UNUSED_RESULT;
347
348
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image sx:(float)sx sy:(float)sy sw:(float)sw sh:(float)sh dx:(float)dx dy:(float)dy dw:(float)dw dh:(float)dh SWIFT_WARN_UNUSED_RESULT;
348
349
  + (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
349
350
  + (int64_t)initWebGPUWithView:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
351
+ + (void)resizeWebGPUWithView:(int64_t)context :(int64_t)view :(uint32_t)width :(uint32_t)height;
350
352
  + (int64_t)initGLWithView:(int64_t)view :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
351
353
  + (int64_t)initSharedGLWithView:(int64_t)view :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas :(int64_t)shared_context SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
352
354
  + (int64_t)initGLWithWidthAndHeight:(int32_t)width :(int32_t)height :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
@@ -404,6 +406,7 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSMutableDic
404
406
  @property (nonatomic, copy) void (^ _Nullable touchEventListener)(NSString * _Nonnull, UIGestureRecognizer * _Nonnull);
405
407
  - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
406
408
  - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
409
+ @property (nonatomic) BOOL ignoreTouchEvents;
407
410
  - (void)setListener:(id <NSCCanvasListener> _Nullable)listener;
408
411
  @property (nonatomic) NSInteger surfaceWidth;
409
412
  @property (nonatomic) NSInteger surfaceHeight;
@@ -442,11 +445,27 @@ SWIFT_CLASS_NAMED("NSCCanvasRenderingContext2D")
442
445
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
443
446
  @end
444
447
 
448
+ @class NSCRender;
449
+ @class AVPlayer;
450
+ @class AVPlayerItemVideoOutput;
451
+
452
+ SWIFT_CLASS_NAMED("NSCCanvasUtils")
453
+ @interface NSCCanvasUtils : NSObject
454
+ + (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
455
+ + (CVOpenGLESTextureRef _Nullable)createImage:(CVOpenGLESTextureCacheRef _Nonnull)texturecache :(CVImageBufferRef _Nonnull)buffer :(CFDictionaryRef _Nullable)textureAttributes :(GLenum)target :(GLint)internalFormat :(GLsizei)width :(GLsizei)height :(GLenum)format :(GLenum)type :(NSInteger)planeIndex SWIFT_WARN_UNUSED_RESULT;
456
+ + (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
457
+ + (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
458
+ + (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
459
+ - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
460
+ @end
461
+
445
462
 
446
463
  SWIFT_CLASS_NAMED("NSCImageAsset")
447
464
  @interface NSCImageAsset : NSObject
448
465
  + (BOOL)loadImageFromImageSync:(int64_t)context :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
449
466
  + (void)loadImageFromImage:(int64_t)context :(UIImage * _Nonnull)image :(void (^ _Nonnull)(BOOL))callback;
467
+ + (BOOL)loadImageFromPathSync:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
468
+ + (void)loadImageFromPath:(int64_t)asset :(NSString * _Nonnull)path :(void (^ _Nonnull)(BOOL))callback;
450
469
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
451
470
  @end
452
471
 
@@ -462,11 +481,28 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) dispatch_que
462
481
  SWIFT_CLASS_NAMED("NSCRender")
463
482
  @interface NSCRender : NSObject
464
483
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
465
- - (void)texImage2D:(int32_t)target :(int32_t)level :(int32_t)internalFormat :(int32_t)format :(int32_t)type :(NSCCanvas * _Nonnull)source :(NSCCanvas * _Nonnull)dest :(BOOL)flipYWebGL;
466
- - (void)createSurface;
467
484
  @end
468
485
 
469
486
 
487
+ SWIFT_CLASS_NAMED("NSCVideoFrame")
488
+ @interface NSCVideoFrame : NSObject
489
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
490
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
491
+ @end
492
+
493
+ typedef SWIFT_ENUM_NAMED(NSInteger, NSCVideoFrameFormat, "NSCVideoFrameFormat", open) {
494
+ NSCVideoFrameFormatI420 = 0,
495
+ NSCVideoFrameFormatI420A = 1,
496
+ NSCVideoFrameFormatI422 = 2,
497
+ NSCVideoFrameFormatI444 = 3,
498
+ NSCVideoFrameFormatNV12 = 4,
499
+ NSCVideoFrameFormatRGBA = 5,
500
+ NSCVideoFrameFormatRGBX = 6,
501
+ NSCVideoFrameFormatBGRA = 7,
502
+ NSCVideoFrameFormatBGRX = 8,
503
+ };
504
+
505
+
470
506
  SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
471
507
  @interface NSCWebGLRenderingContext : NSObject
472
508
  + (void)texImage2D:(int64_t)context :(int32_t)target :(int32_t)level :(int32_t)internalformat :(int32_t)format :(int32_t)type :(uint8_t * _Nonnull)data :(NSUInteger)size :(CGSize)dimensions :(BOOL)flipY;
@@ -474,17 +510,9 @@ SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
474
510
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
475
511
  @end
476
512
 
477
- @class AVPlayer;
478
- @class AVPlayerItemVideoOutput;
479
513
 
480
- SWIFT_CLASS_NAMED("Utils")
481
- @interface Utils : NSObject
482
- + (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
483
- + (CVOpenGLESTextureRef _Nullable)createImage:(CVOpenGLESTextureCacheRef _Nonnull)texturecache :(CVImageBufferRef _Nonnull)buffer :(CFDictionaryRef _Nullable)textureAttributes :(GLenum)target :(GLint)internalFormat :(GLsizei)width :(GLsizei)height :(GLenum)format :(GLenum)type :(NSInteger)planeIndex SWIFT_WARN_UNUSED_RESULT;
484
- + (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
485
- + (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(NSCRender * _Nonnull)render :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
486
- + (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
487
- - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
514
+ @interface UIView (SWIFT_EXTENSION(CanvasNative))
515
+ - (void)getBoundingClientRect:(void * _Nonnull)buffer;
488
516
  @end
489
517
 
490
518
  #endif
@@ -839,11 +867,13 @@ SWIFT_CLASS_NAMED("CanvasHelpers")
839
867
  + (NSMutableData * _Nonnull)getBytesFromUIImage:(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
840
868
  + (int64_t)createPattern:(int64_t)context :(UIImage * _Nonnull)image :(NSString * _Nonnull)repetition SWIFT_WARN_UNUSED_RESULT;
841
869
  + (BOOL)loadImageAssetWithContext:(int64_t)asset :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
870
+ + (BOOL)loadImageAssetWithPath:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
842
871
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy SWIFT_WARN_UNUSED_RESULT;
843
872
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy dw:(float)dw dh:(float)dh SWIFT_WARN_UNUSED_RESULT;
844
873
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image sx:(float)sx sy:(float)sy sw:(float)sw sh:(float)sh dx:(float)dx dy:(float)dy dw:(float)dw dh:(float)dh SWIFT_WARN_UNUSED_RESULT;
845
874
  + (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
846
875
  + (int64_t)initWebGPUWithView:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
876
+ + (void)resizeWebGPUWithView:(int64_t)context :(int64_t)view :(uint32_t)width :(uint32_t)height;
847
877
  + (int64_t)initGLWithView:(int64_t)view :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
848
878
  + (int64_t)initSharedGLWithView:(int64_t)view :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas :(int64_t)shared_context SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
849
879
  + (int64_t)initGLWithWidthAndHeight:(int32_t)width :(int32_t)height :(BOOL)alpha :(BOOL)antialias :(BOOL)depth :(BOOL)fail_if_major_performance_caveat :(int32_t)power_preference :(BOOL)premultiplied_alpha :(BOOL)preserve_drawing_buffer :(BOOL)stencil :(BOOL)desynchronized :(BOOL)xr_compatible :(int32_t)version :(BOOL)is_canvas SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
@@ -901,6 +931,7 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NSMutableDic
901
931
  @property (nonatomic, copy) void (^ _Nullable touchEventListener)(NSString * _Nonnull, UIGestureRecognizer * _Nonnull);
902
932
  - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
903
933
  - (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
934
+ @property (nonatomic) BOOL ignoreTouchEvents;
904
935
  - (void)setListener:(id <NSCCanvasListener> _Nullable)listener;
905
936
  @property (nonatomic) NSInteger surfaceWidth;
906
937
  @property (nonatomic) NSInteger surfaceHeight;
@@ -939,11 +970,27 @@ SWIFT_CLASS_NAMED("NSCCanvasRenderingContext2D")
939
970
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
940
971
  @end
941
972
 
973
+ @class NSCRender;
974
+ @class AVPlayer;
975
+ @class AVPlayerItemVideoOutput;
976
+
977
+ SWIFT_CLASS_NAMED("NSCCanvasUtils")
978
+ @interface NSCCanvasUtils : NSObject
979
+ + (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
980
+ + (CVOpenGLESTextureRef _Nullable)createImage:(CVOpenGLESTextureCacheRef _Nonnull)texturecache :(CVImageBufferRef _Nonnull)buffer :(CFDictionaryRef _Nullable)textureAttributes :(GLenum)target :(GLint)internalFormat :(GLsizei)width :(GLsizei)height :(GLenum)format :(GLenum)type :(NSInteger)planeIndex SWIFT_WARN_UNUSED_RESULT;
981
+ + (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
982
+ + (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
983
+ + (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
984
+ - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
985
+ @end
986
+
942
987
 
943
988
  SWIFT_CLASS_NAMED("NSCImageAsset")
944
989
  @interface NSCImageAsset : NSObject
945
990
  + (BOOL)loadImageFromImageSync:(int64_t)context :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
946
991
  + (void)loadImageFromImage:(int64_t)context :(UIImage * _Nonnull)image :(void (^ _Nonnull)(BOOL))callback;
992
+ + (BOOL)loadImageFromPathSync:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
993
+ + (void)loadImageFromPath:(int64_t)asset :(NSString * _Nonnull)path :(void (^ _Nonnull)(BOOL))callback;
947
994
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
948
995
  @end
949
996
 
@@ -959,11 +1006,28 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) dispatch_que
959
1006
  SWIFT_CLASS_NAMED("NSCRender")
960
1007
  @interface NSCRender : NSObject
961
1008
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
962
- - (void)texImage2D:(int32_t)target :(int32_t)level :(int32_t)internalFormat :(int32_t)format :(int32_t)type :(NSCCanvas * _Nonnull)source :(NSCCanvas * _Nonnull)dest :(BOOL)flipYWebGL;
963
- - (void)createSurface;
964
1009
  @end
965
1010
 
966
1011
 
1012
+ SWIFT_CLASS_NAMED("NSCVideoFrame")
1013
+ @interface NSCVideoFrame : NSObject
1014
+ - (nonnull instancetype)init SWIFT_UNAVAILABLE;
1015
+ + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1016
+ @end
1017
+
1018
+ typedef SWIFT_ENUM_NAMED(NSInteger, NSCVideoFrameFormat, "NSCVideoFrameFormat", open) {
1019
+ NSCVideoFrameFormatI420 = 0,
1020
+ NSCVideoFrameFormatI420A = 1,
1021
+ NSCVideoFrameFormatI422 = 2,
1022
+ NSCVideoFrameFormatI444 = 3,
1023
+ NSCVideoFrameFormatNV12 = 4,
1024
+ NSCVideoFrameFormatRGBA = 5,
1025
+ NSCVideoFrameFormatRGBX = 6,
1026
+ NSCVideoFrameFormatBGRA = 7,
1027
+ NSCVideoFrameFormatBGRX = 8,
1028
+ };
1029
+
1030
+
967
1031
  SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
968
1032
  @interface NSCWebGLRenderingContext : NSObject
969
1033
  + (void)texImage2D:(int64_t)context :(int32_t)target :(int32_t)level :(int32_t)internalformat :(int32_t)format :(int32_t)type :(uint8_t * _Nonnull)data :(NSUInteger)size :(CGSize)dimensions :(BOOL)flipY;
@@ -971,17 +1035,9 @@ SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
971
1035
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
972
1036
  @end
973
1037
 
974
- @class AVPlayer;
975
- @class AVPlayerItemVideoOutput;
976
1038
 
977
- SWIFT_CLASS_NAMED("Utils")
978
- @interface Utils : NSObject
979
- + (CVOpenGLESTextureCacheRef _Nullable)createTextureCache SWIFT_WARN_UNUSED_RESULT;
980
- + (CVOpenGLESTextureRef _Nullable)createImage:(CVOpenGLESTextureCacheRef _Nonnull)texturecache :(CVImageBufferRef _Nonnull)buffer :(CFDictionaryRef _Nullable)textureAttributes :(GLenum)target :(GLint)internalFormat :(GLsizei)width :(GLsizei)height :(GLenum)format :(GLenum)type :(NSInteger)planeIndex SWIFT_WARN_UNUSED_RESULT;
981
- + (NSCRender * _Nonnull)setupRender SWIFT_WARN_UNUSED_RESULT;
982
- + (void)drawFrame:(AVPlayer * _Nonnull)player :(AVPlayerItemVideoOutput * _Nonnull)output :(CGSize)videoSize :(NSCRender * _Nonnull)render :(int32_t)internalFormat :(int32_t)format :(BOOL)flipYWebGL;
983
- + (BOOL)writeToFile:(NSData * _Nonnull)data :(NSString * _Nonnull)path error:(NSError * _Nullable * _Nullable)error;
984
- - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
1039
+ @interface UIView (SWIFT_EXTENSION(CanvasNative))
1040
+ - (void)getBoundingClientRect:(void * _Nonnull)buffer;
985
1041
  @end
986
1042
 
987
1043
  #endif
@@ -20,6 +20,13 @@ long long canvas_native_init_ios_webgpu_uiview(int64_t instance,
20
20
  uint32_t height);
21
21
  #endif
22
22
 
23
+ #if defined(TARGET_OS_IOS)
24
+ void canvas_native_resize_ios_webgpu_uiview(int64_t context,
25
+ int64_t view,
26
+ uint32_t width,
27
+ uint32_t height);
28
+ #endif
29
+
23
30
  long long canvas_native_init_ios_gl(int64_t view,
24
31
  bool alpha,
25
32
  bool antialias,