@nativescript/canvas 2.0.0-webgpu.2 → 2.0.0-webgpu.20

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 (250) hide show
  1. package/Canvas/common.d.ts +3 -4
  2. package/Canvas/common.js +35 -125
  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 +73 -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 +72 -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 +45 -7
  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 +94 -4
  99. package/WebGPU/Types.d.ts +9 -1
  100. package/WebGPU/Utils.d.ts +6 -0
  101. package/WebGPU/Utils.js +221 -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/angular/package.json +20 -0
  106. package/package.json +1 -3
  107. package/platforms/android/canvas-release.aar +0 -0
  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 +9 -0
  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 +224 -61
  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 +6871 -5995
  115. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +7 -0
  116. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +7 -0
  117. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  118. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +656 -644
  119. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  120. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +18 -0
  121. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +7 -0
  122. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +224 -61
  123. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  124. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  125. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  126. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +6871 -5995
  127. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +7 -0
  128. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -0
  129. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +6871 -5995
  130. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +7 -0
  131. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +7 -0
  132. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +27 -27
  133. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  134. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +658 -646
  135. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +696 -684
  136. package/platforms/ios/src/NSOperationQueueWrapper.h +3 -1
  137. package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
  138. package/platforms/ios/src/cpp/AsyncCallback.h +214 -0
  139. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +123 -47
  140. package/platforms/ios/src/cpp/Helpers.h +2 -164
  141. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +18 -26
  142. package/platforms/ios/src/cpp/ImageAssetImpl.h +3 -3
  143. package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +60 -3
  144. package/platforms/ios/src/cpp/ImageBitmapImpl.h +12 -4
  145. package/platforms/ios/src/cpp/NativeType.h +87 -0
  146. package/platforms/ios/src/cpp/ObjectWrapperImpl.h +50 -0
  147. package/platforms/ios/src/cpp/PromiseCallback.h +197 -0
  148. package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +7 -6
  149. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +1 -1
  150. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +1 -1
  151. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +6 -6
  152. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +18 -13
  153. package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +2 -2
  154. package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +1 -1
  155. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +10 -10
  156. package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +6 -3
  157. package/platforms/ios/src/cpp/canvas2d/Path2D.h +5 -5
  158. package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +1 -1
  159. package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +1 -1
  160. package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +1 -1
  161. package/platforms/ios/src/cpp/webgl/WebGLProgram.h +3 -3
  162. package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +3 -3
  163. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +106 -1
  164. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
  165. package/platforms/ios/src/cpp/webgl/WebGLShader.h +1 -1
  166. package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +5 -5
  167. package/platforms/ios/src/cpp/webgl/WebGLTexture.h +3 -2
  168. package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +2 -2
  169. package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +1 -1
  170. package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +1 -1
  171. package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +1 -1
  172. package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +1 -1
  173. package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +1 -1
  174. package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +1 -1
  175. package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +1 -1
  176. package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +2 -2
  177. package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +5 -5
  178. package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
  179. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +1 -1
  180. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +1 -1
  181. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
  182. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +1 -1
  183. package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
  184. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +1 -1
  185. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +1 -1
  186. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
  187. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +2 -2
  188. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +1 -1
  189. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +1 -1
  190. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +1 -1
  191. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
  192. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +1 -1
  193. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +1 -1
  194. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1 -1
  195. package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +1 -1
  196. package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +1 -1
  197. package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +1 -1
  198. package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +1 -1
  199. package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +2 -2
  200. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +142 -73
  201. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +1 -1
  202. package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +1 -1
  203. package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +1 -1
  204. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +32 -6
  205. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +5 -2
  206. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +27 -1
  207. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +4 -1
  208. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +80 -32
  209. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +8 -4
  210. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -5
  211. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +1 -1
  212. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +29 -2
  213. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +4 -1
  214. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +101 -106
  215. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +5 -1
  216. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +42 -14
  217. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +4 -1
  218. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +26 -1
  219. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +3 -1
  220. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +1683 -733
  221. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +3 -1
  222. package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +53 -39
  223. package/platforms/ios/src/cpp/webgpu/GPUImpl.h +2 -2
  224. package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
  225. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +27 -1
  226. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +8 -5
  227. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +2 -3
  228. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +2 -2
  229. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +88 -36
  230. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +4 -1
  231. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +43 -14
  232. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +4 -1
  233. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +26 -1
  234. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +4 -1
  235. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +32 -6
  236. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +4 -1
  237. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +26 -1
  238. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +4 -1
  239. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +27 -1
  240. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +5 -2
  241. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +25 -1
  242. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +5 -2
  243. package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +2 -2
  244. package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +2 -2
  245. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +34 -8
  246. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +6 -4
  247. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +27 -1
  248. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +5 -2
  249. package/platforms/ios/src/cpp/webgpu/GPUUtils.h +511 -0
  250. 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;
@@ -447,6 +449,8 @@ SWIFT_CLASS_NAMED("NSCImageAsset")
447
449
  @interface NSCImageAsset : NSObject
448
450
  + (BOOL)loadImageFromImageSync:(int64_t)context :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
449
451
  + (void)loadImageFromImage:(int64_t)context :(UIImage * _Nonnull)image :(void (^ _Nonnull)(BOOL))callback;
452
+ + (BOOL)loadImageFromPathSync:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
453
+ + (void)loadImageFromPath:(int64_t)asset :(NSString * _Nonnull)path :(void (^ _Nonnull)(BOOL))callback;
450
454
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
451
455
  @end
452
456
 
@@ -474,6 +478,11 @@ SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
474
478
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
475
479
  @end
476
480
 
481
+
482
+ @interface UIView (SWIFT_EXTENSION(CanvasNative))
483
+ - (void)getBoundingClientRect:(void * _Nonnull)buffer;
484
+ @end
485
+
477
486
  @class AVPlayer;
478
487
  @class AVPlayerItemVideoOutput;
479
488
 
@@ -839,11 +848,13 @@ SWIFT_CLASS_NAMED("CanvasHelpers")
839
848
  + (NSMutableData * _Nonnull)getBytesFromUIImage:(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
840
849
  + (int64_t)createPattern:(int64_t)context :(UIImage * _Nonnull)image :(NSString * _Nonnull)repetition SWIFT_WARN_UNUSED_RESULT;
841
850
  + (BOOL)loadImageAssetWithContext:(int64_t)asset :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
851
+ + (BOOL)loadImageAssetWithPath:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
842
852
  + (BOOL)drawImageWithContext:(int64_t)context image:(UIImage * _Nonnull)image dx:(float)dx dy:(float)dy SWIFT_WARN_UNUSED_RESULT;
843
853
  + (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
854
  + (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
855
  + (int64_t)initWebGPUWithViewLayer:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
846
856
  + (int64_t)initWebGPUWithView:(int64_t)instance :(int64_t)view :(uint32_t)width :(uint32_t)height SWIFT_METHOD_FAMILY(none) SWIFT_WARN_UNUSED_RESULT;
857
+ + (void)resizeWebGPUWithView:(int64_t)context :(int64_t)view :(uint32_t)width :(uint32_t)height;
847
858
  + (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
859
  + (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
860
  + (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;
@@ -944,6 +955,8 @@ SWIFT_CLASS_NAMED("NSCImageAsset")
944
955
  @interface NSCImageAsset : NSObject
945
956
  + (BOOL)loadImageFromImageSync:(int64_t)context :(UIImage * _Nonnull)image SWIFT_WARN_UNUSED_RESULT;
946
957
  + (void)loadImageFromImage:(int64_t)context :(UIImage * _Nonnull)image :(void (^ _Nonnull)(BOOL))callback;
958
+ + (BOOL)loadImageFromPathSync:(int64_t)asset :(NSString * _Nonnull)path SWIFT_WARN_UNUSED_RESULT;
959
+ + (void)loadImageFromPath:(int64_t)asset :(NSString * _Nonnull)path :(void (^ _Nonnull)(BOOL))callback;
947
960
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
948
961
  @end
949
962
 
@@ -971,6 +984,11 @@ SWIFT_CLASS_NAMED("NSCWebGLRenderingContext")
971
984
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
972
985
  @end
973
986
 
987
+
988
+ @interface UIView (SWIFT_EXTENSION(CanvasNative))
989
+ - (void)getBoundingClientRect:(void * _Nonnull)buffer;
990
+ @end
991
+
974
992
  @class AVPlayer;
975
993
  @class AVPlayerItemVideoOutput;
976
994
 
@@ -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,
@@ -594,6 +594,16 @@ typedef enum PaintStyleType {
594
594
  PaintStyleTypePattern,
595
595
  } PaintStyleType;
596
596
 
597
+ typedef enum SurfaceGetCurrentTextureStatus {
598
+ SurfaceGetCurrentTextureStatusSuccess = 0,
599
+ SurfaceGetCurrentTextureStatusTimeout = 1,
600
+ SurfaceGetCurrentTextureStatusOutdated = 2,
601
+ SurfaceGetCurrentTextureStatusLost = 3,
602
+ SurfaceGetCurrentTextureStatusOutOfMemory = 4,
603
+ SurfaceGetCurrentTextureStatusDeviceLost = 5,
604
+ SurfaceGetCurrentTextureStatusForce32 = 2147483647,
605
+ } SurfaceGetCurrentTextureStatus;
606
+
597
607
  typedef enum TextBaseLine {
598
608
  TextBaseLineTOP = 0,
599
609
  TextBaseLineHANGING = 1,
@@ -1760,6 +1770,29 @@ typedef struct CanvasOrigin2d {
1760
1770
  uint32_t y;
1761
1771
  } CanvasOrigin2d;
1762
1772
 
1773
+ typedef struct CanvasImageCopyImageAsset {
1774
+ /**
1775
+ * The texture to be copied from. The copy source data is captured at the moment
1776
+ * the copy is issued.
1777
+ */
1778
+ const struct ImageAsset *source;
1779
+ /**
1780
+ * The base texel used for copying from the external image. Together
1781
+ * with the `copy_size` argument to copy functions, defines the
1782
+ * sub-region of the image to copy.
1783
+ *
1784
+ * Relative to the top left of the image.
1785
+ *
1786
+ * Must be [`Origin2d::ZERO`] if [`DownlevelFlags::UNRESTRICTED_EXTERNAL_TEXTURE_COPIES`] is not supported.
1787
+ */
1788
+ struct CanvasOrigin2d origin;
1789
+ /**
1790
+ * If the Y coordinate of the image should be flipped. Even if this is
1791
+ * true, `origin` is still relative to the top left.
1792
+ */
1793
+ bool flip_y;
1794
+ } CanvasImageCopyImageAsset;
1795
+
1763
1796
  typedef struct CanvasImageCopyExternalImage {
1764
1797
  /**
1765
1798
  * The texture to be copied from. The copy source data is captured at the moment
@@ -2105,7 +2138,7 @@ struct PaintStyle *canvas_native_context_create_pattern(const struct CanvasRende
2105
2138
  enum CanvasRepetition repetition);
2106
2139
 
2107
2140
  struct PaintStyle *canvas_native_context_create_pattern_asset(struct CanvasRenderingContext2D *context,
2108
- struct ImageAsset *asset,
2141
+ const struct ImageAsset *asset,
2109
2142
  enum CanvasRepetition repetition);
2110
2143
 
2111
2144
  struct PaintStyle *canvas_native_context_create_pattern_encoded(struct CanvasRenderingContext2D *context,
@@ -2198,14 +2231,14 @@ void canvas_native_context_draw_image_dx_dy_asset(struct CanvasRenderingContext2
2198
2231
  float dy);
2199
2232
 
2200
2233
  void canvas_native_context_draw_image_dx_dy_dw_dh_asset(struct CanvasRenderingContext2D *context,
2201
- struct ImageAsset *asset,
2234
+ const struct ImageAsset *asset,
2202
2235
  float dx,
2203
2236
  float dy,
2204
2237
  float d_width,
2205
2238
  float d_height);
2206
2239
 
2207
2240
  void canvas_native_context_draw_image_asset(struct CanvasRenderingContext2D *context,
2208
- struct ImageAsset *asset,
2241
+ const struct ImageAsset *asset,
2209
2242
  float sx,
2210
2243
  float sy,
2211
2244
  float s_width,
@@ -2286,7 +2319,7 @@ void canvas_native_context_draw_atlas_encoded(struct CanvasRenderingContext2D *c
2286
2319
  int32_t blend_mode);
2287
2320
 
2288
2321
  void canvas_native_context_draw_atlas_asset(struct CanvasRenderingContext2D *context,
2289
- struct ImageAsset *asset,
2322
+ const struct ImageAsset *asset,
2290
2323
  const float *xform,
2291
2324
  uintptr_t xform_size,
2292
2325
  const float *tex,
@@ -2490,34 +2523,34 @@ void canvas_native_image_filter_reference(const struct ImageFilter *value);
2490
2523
 
2491
2524
  void canvas_native_image_filter_release(const struct ImageFilter *value);
2492
2525
 
2493
- struct ImageAsset *canvas_native_image_bitmap_create_from_asset(struct ImageAsset *asset,
2494
- bool flip_y,
2495
- enum ImageBitmapPremultiplyAlpha premultiply_alpha,
2496
- enum ImageBitmapColorSpaceConversion color_space_conversion,
2497
- enum ImageBitmapResizeQuality resize_quality,
2498
- float resize_width,
2499
- float resize_height);
2500
-
2501
- struct ImageAsset *canvas_native_image_bitmap_create_from_asset_src_rect(struct ImageAsset *asset,
2502
- float sx,
2503
- float sy,
2504
- float s_width,
2505
- float s_height,
2506
- bool flip_y,
2507
- enum ImageBitmapPremultiplyAlpha premultiply_alpha,
2508
- enum ImageBitmapColorSpaceConversion color_space_conversion,
2509
- enum ImageBitmapResizeQuality resize_quality,
2510
- float resize_width,
2511
- float resize_height);
2512
-
2513
- struct ImageAsset *canvas_native_image_bitmap_create_from_encoded_bytes(const uint8_t *bytes,
2514
- uintptr_t size,
2515
- bool flip_y,
2516
- enum ImageBitmapPremultiplyAlpha premultiply_alpha,
2517
- enum ImageBitmapColorSpaceConversion color_space_conversion,
2518
- enum ImageBitmapResizeQuality resize_quality,
2519
- float resize_width,
2520
- float resize_height);
2526
+ const struct ImageAsset *canvas_native_image_bitmap_create_from_asset(const struct ImageAsset *asset,
2527
+ bool flip_y,
2528
+ enum ImageBitmapPremultiplyAlpha premultiply_alpha,
2529
+ enum ImageBitmapColorSpaceConversion color_space_conversion,
2530
+ enum ImageBitmapResizeQuality resize_quality,
2531
+ float resize_width,
2532
+ float resize_height);
2533
+
2534
+ const struct ImageAsset *canvas_native_image_bitmap_create_from_asset_src_rect(const struct ImageAsset *asset,
2535
+ float sx,
2536
+ float sy,
2537
+ float s_width,
2538
+ float s_height,
2539
+ bool flip_y,
2540
+ enum ImageBitmapPremultiplyAlpha premultiply_alpha,
2541
+ enum ImageBitmapColorSpaceConversion color_space_conversion,
2542
+ enum ImageBitmapResizeQuality resize_quality,
2543
+ float resize_width,
2544
+ float resize_height);
2545
+
2546
+ const struct ImageAsset *canvas_native_image_bitmap_create_from_encoded_bytes(const uint8_t *bytes,
2547
+ uintptr_t size,
2548
+ bool flip_y,
2549
+ enum ImageBitmapPremultiplyAlpha premultiply_alpha,
2550
+ enum ImageBitmapColorSpaceConversion color_space_conversion,
2551
+ enum ImageBitmapResizeQuality resize_quality,
2552
+ float resize_width,
2553
+ float resize_height);
2521
2554
 
2522
2555
  bool canvas_native_image_bitmap_create_from_encoded_bytes_with_output(const uint8_t *bytes,
2523
2556
  uintptr_t size,
@@ -2527,20 +2560,20 @@ bool canvas_native_image_bitmap_create_from_encoded_bytes_with_output(const uint
2527
2560
  enum ImageBitmapResizeQuality resize_quality,
2528
2561
  float resize_width,
2529
2562
  float resize_height,
2530
- struct ImageAsset *output);
2531
-
2532
- struct ImageAsset *canvas_native_image_bitmap_create_from_encoded_bytes_src_rect(const uint8_t *bytes,
2533
- uintptr_t size,
2534
- float sx,
2535
- float sy,
2536
- float s_width,
2537
- float s_height,
2538
- bool flip_y,
2539
- enum ImageBitmapPremultiplyAlpha premultiply_alpha,
2540
- enum ImageBitmapColorSpaceConversion color_space_conversion,
2541
- enum ImageBitmapResizeQuality resize_quality,
2542
- float resize_width,
2543
- float resize_height);
2563
+ const struct ImageAsset *output);
2564
+
2565
+ const struct ImageAsset *canvas_native_image_bitmap_create_from_encoded_bytes_src_rect(const uint8_t *bytes,
2566
+ uintptr_t size,
2567
+ float sx,
2568
+ float sy,
2569
+ float s_width,
2570
+ float s_height,
2571
+ bool flip_y,
2572
+ enum ImageBitmapPremultiplyAlpha premultiply_alpha,
2573
+ enum ImageBitmapColorSpaceConversion color_space_conversion,
2574
+ enum ImageBitmapResizeQuality resize_quality,
2575
+ float resize_width,
2576
+ float resize_height);
2544
2577
 
2545
2578
  bool canvas_native_image_bitmap_create_from_encoded_bytes_src_rect_with_output(const uint8_t *bytes,
2546
2579
  uintptr_t size,
@@ -2554,7 +2587,7 @@ bool canvas_native_image_bitmap_create_from_encoded_bytes_src_rect_with_output(c
2554
2587
  enum ImageBitmapResizeQuality resize_quality,
2555
2588
  float resize_width,
2556
2589
  float resize_height,
2557
- struct ImageAsset *output);
2590
+ const struct ImageAsset *output);
2558
2591
 
2559
2592
  struct ImageData *canvas_native_image_data_create(int32_t width, int32_t height);
2560
2593
 
@@ -2876,14 +2909,20 @@ void canvas_native_webgpu_adapter_info_reference(const struct CanvasGPUAdapterIn
2876
2909
 
2877
2910
  void canvas_native_webgpu_adapter_info_release(const struct CanvasGPUAdapterInfo *info);
2878
2911
 
2912
+ char *canvas_native_webgpu_bind_group_get_label(const struct CanvasGPUBindGroup *bind_group);
2913
+
2879
2914
  void canvas_native_webgpu_bind_group_reference(const struct CanvasGPUBindGroup *bind_group);
2880
2915
 
2881
2916
  void canvas_native_webgpu_bind_group_release(const struct CanvasGPUBindGroup *bind_group);
2882
2917
 
2918
+ char *canvas_native_webgpu_bind_group_layout_get_label(const struct CanvasGPUBindGroupLayout *bind_group_layout);
2919
+
2883
2920
  void canvas_native_webgpu_bind_group_layout_reference(const struct CanvasGPUBindGroupLayout *bind_group_layout);
2884
2921
 
2885
2922
  void canvas_native_webgpu_bind_group_layout_release(const struct CanvasGPUBindGroupLayout *bind_group_layout);
2886
2923
 
2924
+ char *canvas_native_webgpu_buffer_get_label(const struct CanvasGPUBuffer *buffer);
2925
+
2887
2926
  void canvas_native_webgpu_buffer_reference(const struct CanvasGPUBuffer *buffer);
2888
2927
 
2889
2928
  void canvas_native_webgpu_buffer_release(const struct CanvasGPUBuffer *buffer);
@@ -2904,7 +2943,7 @@ void canvas_native_webgpu_buffer_map_async(const struct CanvasGPUBuffer *buffer,
2904
2943
  enum GPUMapMode mode,
2905
2944
  int64_t offset,
2906
2945
  int64_t size,
2907
- void (*callback)(char*, void*),
2946
+ void (*callback)(enum CanvasGPUErrorType, char*, void*),
2908
2947
  void *callback_data);
2909
2948
 
2910
2949
  #if defined(TARGET_OS_ANDROID)
@@ -2914,6 +2953,11 @@ const struct CanvasGPUCanvasContext *canvas_native_webgpu_context_create(struct
2914
2953
  uint32_t height);
2915
2954
  #endif
2916
2955
 
2956
+ void canvas_native_webgpu_context_resize(struct CanvasGPUCanvasContext *context,
2957
+ void *window,
2958
+ uint32_t width,
2959
+ uint32_t height);
2960
+
2917
2961
  #if (defined(TARGET_OS_IOS) || defined(TARGET_OS_MACOS))
2918
2962
  const struct CanvasGPUCanvasContext *canvas_native_webgpu_context_create(const struct CanvasWebGPUInstance *instance,
2919
2963
  void *view,
@@ -2928,6 +2972,13 @@ const struct CanvasGPUCanvasContext *canvas_native_webgpu_context_create_uiview(
2928
2972
  uint32_t height);
2929
2973
  #endif
2930
2974
 
2975
+ #if defined(TARGET_OS_IOS)
2976
+ void canvas_native_webgpu_context_resize_uiview(const struct CanvasGPUCanvasContext *context,
2977
+ void *view,
2978
+ uint32_t width,
2979
+ uint32_t height);
2980
+ #endif
2981
+
2931
2982
  #if defined(TARGET_OS_MACOS)
2932
2983
  const struct CanvasGPUCanvasContext *canvas_native_webgpu_context_create_nsview(const struct CanvasWebGPUInstance *instance,
2933
2984
  void *view,
@@ -2935,13 +2986,18 @@ const struct CanvasGPUCanvasContext *canvas_native_webgpu_context_create_nsview(
2935
2986
  uint32_t height);
2936
2987
  #endif
2937
2988
 
2989
+ #if defined(TARGET_OS_MACOS)
2990
+ void canvas_native_webgpu_context_resize_nsview(const struct CanvasGPUCanvasContext *context,
2991
+ void *view,
2992
+ uint32_t width,
2993
+ uint32_t height);
2994
+ #endif
2995
+
2938
2996
  void canvas_native_webgpu_context_configure(const struct CanvasGPUCanvasContext *context,
2939
2997
  const struct CanvasGPUDevice *device,
2940
2998
  const struct CanvasGPUSurfaceConfiguration *config);
2941
2999
 
2942
- void canvas_native_webgpu_context_unconfigure(const struct CanvasGPUCanvasContext *context,
2943
- struct CanvasGPUDevice *device,
2944
- const struct CanvasGPUSurfaceConfiguration *config);
3000
+ void canvas_native_webgpu_context_unconfigure(const struct CanvasGPUCanvasContext *context);
2945
3001
 
2946
3002
  const struct CanvasGPUTexture *canvas_native_webgpu_context_get_current_texture(const struct CanvasGPUCanvasContext *context);
2947
3003
 
@@ -2955,10 +3011,14 @@ void canvas_native_webgpu_context_reference(const struct CanvasGPUCanvasContext
2955
3011
 
2956
3012
  void canvas_native_webgpu_context_release(const struct CanvasGPUCanvasContext *context);
2957
3013
 
3014
+ char *canvas_native_webgpu_command_buffer_get_label(const struct CanvasGPUCommandBuffer *command_buffer);
3015
+
2958
3016
  void canvas_native_webgpu_command_buffer_reference(const struct CanvasGPUCommandBuffer *command_buffer);
2959
3017
 
2960
3018
  void canvas_native_webgpu_command_buffer_release(const struct CanvasGPUCommandBuffer *command_buffer);
2961
3019
 
3020
+ char *canvas_native_webgpu_command_encoder_get_label(const struct CanvasGPUCommandEncoder *command_encoder);
3021
+
2962
3022
  void canvas_native_webgpu_command_encoder_reference(const struct CanvasGPUCommandEncoder *command_encoder);
2963
3023
 
2964
3024
  void canvas_native_webgpu_command_encoder_release(const struct CanvasGPUCommandEncoder *command_encoder);
@@ -3028,6 +3088,8 @@ void canvas_native_webgpu_command_encoder_write_timestamp(const struct CanvasGPU
3028
3088
  const struct CanvasGPUQuerySet *query_set,
3029
3089
  uint32_t query_index);
3030
3090
 
3091
+ char *canvas_native_webgpu_compute_pass_encoder_get_label(const struct CanvasGPUComputePassEncoder *compute_pass);
3092
+
3031
3093
  void canvas_native_webgpu_compute_pass_encoder_reference(const struct CanvasGPUComputePassEncoder *compute_pass);
3032
3094
 
3033
3095
  void canvas_native_webgpu_compute_pass_encoder_release(const struct CanvasGPUComputePassEncoder *compute_pass);
@@ -3062,6 +3124,8 @@ void canvas_native_webgpu_compute_pass_encoder_set_bind_group(const struct Canva
3062
3124
  void canvas_native_webgpu_compute_pass_encoder_set_pipeline(const struct CanvasGPUComputePassEncoder *compute_pass,
3063
3125
  const struct CanvasGPUComputePipeline *pipeline);
3064
3126
 
3127
+ char *canvas_native_webgpu_compute_pipeline_get_label(const struct CanvasGPUComputePipeline *pipeline);
3128
+
3065
3129
  void canvas_native_webgpu_compute_pipeline_reference(const struct CanvasGPUComputePipeline *pipeline);
3066
3130
 
3067
3131
  void canvas_native_webgpu_compute_pipeline_release(const struct CanvasGPUComputePipeline *pipeline);
@@ -3069,6 +3133,8 @@ void canvas_native_webgpu_compute_pipeline_release(const struct CanvasGPUCompute
3069
3133
  const struct CanvasGPUBindGroupLayout *canvas_native_webgpu_compute_pipeline_get_bind_group_layout(const struct CanvasGPUComputePipeline *pipeline,
3070
3134
  uint32_t index);
3071
3135
 
3136
+ char *canvas_native_webgpu_device_get_label(const struct CanvasGPUDevice *device);
3137
+
3072
3138
  struct StringBuffer *canvas_native_webgpu_device_get_features(const struct CanvasGPUDevice *device);
3073
3139
 
3074
3140
  struct CanvasGPUSupportedLimits *canvas_native_webgpu_device_get_limits(const struct CanvasGPUDevice *device);
@@ -3177,6 +3243,8 @@ const struct CanvasGPUTexture *canvas_native_webgpu_device_create_texture(const
3177
3243
  const struct CanvasGPUSampler *canvas_native_webgpu_device_create_sampler(const struct CanvasGPUDevice *device,
3178
3244
  const struct CanvasCreateSamplerDescriptor *descriptor);
3179
3245
 
3246
+ char *canvas_native_webgpu_pipeline_layout_get_label(const struct CanvasGPUPipelineLayout *pipeline_layout);
3247
+
3180
3248
  void canvas_native_webgpu_pipeline_layout_reference(const struct CanvasGPUPipelineLayout *pipeline_layout);
3181
3249
 
3182
3250
  void canvas_native_webgpu_pipeline_layout_release(const struct CanvasGPUPipelineLayout *pipeline_layout);
@@ -3193,10 +3261,17 @@ void canvas_native_webgpu_query_set_reference(const struct CanvasGPUQuerySet *qu
3193
3261
 
3194
3262
  void canvas_native_webgpu_query_set_release(const struct CanvasGPUQuerySet *query_set);
3195
3263
 
3264
+ char *canvas_native_webgpu_queue_get_label(const struct CanvasGPUQueue *queue);
3265
+
3196
3266
  void canvas_native_webgpu_queue_reference(const struct CanvasGPUQueue *queue);
3197
3267
 
3198
3268
  void canvas_native_webgpu_queue_release(const struct CanvasGPUQueue *queue);
3199
3269
 
3270
+ void canvas_native_webgpu_queue_copy_image_asset_to_texture(const struct CanvasGPUQueue *queue,
3271
+ const struct CanvasImageCopyImageAsset *source,
3272
+ const struct CanvasImageCopyTexture *destination,
3273
+ const struct CanvasExtent3d *size);
3274
+
3200
3275
  void canvas_native_webgpu_queue_copy_external_image_to_texture(const struct CanvasGPUQueue *queue,
3201
3276
  const struct CanvasImageCopyExternalImage *source,
3202
3277
  const struct CanvasImageCopyTexture *destination,
@@ -3225,10 +3300,14 @@ void canvas_native_webgpu_queue_write_texture(const struct CanvasGPUQueue *queue
3225
3300
  const uint8_t *buf,
3226
3301
  uintptr_t buf_size);
3227
3302
 
3303
+ char *canvas_native_webgpu_render_bundle_get_label(const struct CanvasGPURenderBundle *bundle);
3304
+
3228
3305
  void canvas_native_webgpu_render_bundle_reference(const struct CanvasGPURenderBundle *bundle);
3229
3306
 
3230
3307
  void canvas_native_webgpu_render_bundle_release(const struct CanvasGPURenderBundle *bundle);
3231
3308
 
3309
+ char *canvas_native_webgpu_render_bundle_encoder_get_label(const struct CanvasGPURenderBundleEncoder *render_bundle);
3310
+
3232
3311
  void canvas_native_webgpu_render_bundle_encoder_draw(const struct CanvasGPURenderBundleEncoder *render_bundle,
3233
3312
  uint32_t vertex_count,
3234
3313
  uint32_t instance_count,
@@ -3288,6 +3367,8 @@ void canvas_native_webgpu_render_bundle_encoder_reference(const struct CanvasGPU
3288
3367
 
3289
3368
  void canvas_native_webgpu_render_bundle_encoder_release(const struct CanvasGPURenderBundleEncoder *render_bundle);
3290
3369
 
3370
+ char *canvas_native_webgpu_render_pass_encoder_get_label(const struct CanvasGPURenderPassEncoder *render_pass);
3371
+
3291
3372
  void canvas_native_webgpu_render_pass_encoder_begin_occlusion_query(const struct CanvasGPURenderPassEncoder *render_pass,
3292
3373
  uint32_t query_index);
3293
3374
 
@@ -3379,13 +3460,19 @@ void canvas_native_webgpu_render_pipeline_reference(const struct CanvasGPURender
3379
3460
 
3380
3461
  void canvas_native_webgpu_render_pipeline_release(const struct CanvasGPURenderPipeline *pipeline);
3381
3462
 
3463
+ char *canvas_native_webgpu_render_pipeline_get_label(const struct CanvasGPURenderPipeline *pipeline);
3464
+
3382
3465
  const struct CanvasGPUBindGroupLayout *canvas_native_webgpu_render_pipeline_get_bind_group_layout(const struct CanvasGPURenderPipeline *pipeline,
3383
3466
  uint32_t index);
3384
3467
 
3468
+ char *canvas_native_webgpu_sampler_get_label(const struct CanvasGPUSampler *sampler);
3469
+
3385
3470
  void canvas_native_webgpu_sampler_reference(const struct CanvasGPUSampler *sampler);
3386
3471
 
3387
3472
  void canvas_native_webgpu_sampler_release(const struct CanvasGPUSampler *sampler);
3388
3473
 
3474
+ char *canvas_native_webgpu_shader_module_get_label(const struct CanvasGPUShaderModule *shader_module);
3475
+
3389
3476
  void canvas_native_webgpu_shader_module_reference(const struct CanvasGPUShaderModule *shader_module);
3390
3477
 
3391
3478
  void canvas_native_webgpu_shader_module_release(const struct CanvasGPUShaderModule *shader_module);
@@ -3394,6 +3481,12 @@ struct CanvasGPUSupportedLimits *canvas_native_webgpu_create_limits(void);
3394
3481
 
3395
3482
  void canvas_native_webgpu_limits_release(struct CanvasGPUSupportedLimits *limits);
3396
3483
 
3484
+ enum SurfaceGetCurrentTextureStatus canvas_native_webgpu_texture_get_status(const struct CanvasGPUTexture *texture);
3485
+
3486
+ bool canvas_native_webgpu_texture_get_suboptimal(const struct CanvasGPUTexture *texture);
3487
+
3488
+ char *canvas_native_webgpu_texture_get_label(const struct CanvasGPUTexture *texture);
3489
+
3397
3490
  void canvas_native_webgpu_texture_reference(const struct CanvasGPUTexture *texture);
3398
3491
 
3399
3492
  void canvas_native_webgpu_texture_release(const struct CanvasGPUTexture *texture);
@@ -3413,14 +3506,14 @@ struct CanvasGPUTextureFormat canvas_native_webgpu_texture_get_format(const stru
3413
3506
 
3414
3507
  uint32_t canvas_native_webgpu_texture_get_usage(const struct CanvasGPUTexture *texture);
3415
3508
 
3416
- char *canvas_native_webgpu_texture_get_label(const struct CanvasGPUTexture *_texture);
3417
-
3418
3509
  uint32_t canvas_native_webgpu_texture_get_mip_level_count(const struct CanvasGPUTexture *texture);
3419
3510
 
3420
3511
  uint32_t canvas_native_webgpu_texture_get_sample_count(const struct CanvasGPUTexture *texture);
3421
3512
 
3422
3513
  void canvas_native_webgpu_texture_destroy(const struct CanvasGPUTexture *texture);
3423
3514
 
3515
+ char *canvas_native_webgpu_texture_view_get_label(const struct CanvasGPUTextureView *texture_view);
3516
+
3424
3517
  void canvas_native_webgpu_texture_view_reference(const struct CanvasGPUTextureView *texture_view);
3425
3518
 
3426
3519
  void canvas_native_webgpu_texture_view_release(const struct CanvasGPUTextureView *texture_view);
@@ -3481,15 +3574,19 @@ bool canvas_native_helper_read_file_has_error(const struct FileHelper *file);
3481
3574
 
3482
3575
  struct U8Buffer *canvas_native_helper_read_file_get_data(struct FileHelper *file);
3483
3576
 
3577
+ struct U8Buffer *canvas_native_helper_read_file_take_data(struct FileHelper *file);
3578
+
3484
3579
  const char *canvas_native_helper_read_file_get_error(const struct FileHelper *file);
3485
3580
 
3486
- int64_t canvas_native_image_asset_get_addr(struct ImageAsset *asset);
3581
+ int64_t canvas_native_image_asset_get_addr(const struct ImageAsset *asset);
3582
+
3583
+ void canvas_native_image_asset_close(const struct ImageAsset *asset);
3487
3584
 
3488
- struct ImageAsset *canvas_native_image_asset_create(void);
3585
+ const struct ImageAsset *canvas_native_image_asset_create(void);
3489
3586
 
3490
- struct ImageAsset *canvas_native_image_asset_reference(struct ImageAsset *asset);
3587
+ const struct ImageAsset *canvas_native_image_asset_reference(const struct ImageAsset *asset);
3491
3588
 
3492
- void canvas_native_image_asset_release(struct ImageAsset *asset);
3589
+ void canvas_native_image_asset_release(const struct ImageAsset *asset);
3493
3590
 
3494
3591
  bool canvas_native_image_asset_load_from_fd(const struct ImageAsset *asset, int fd);
3495
3592
 
@@ -3511,8 +3608,6 @@ const char *canvas_native_image_asset_get_error(const struct ImageAsset *asset);
3511
3608
 
3512
3609
  bool canvas_native_image_asset_has_error(const struct ImageAsset *asset);
3513
3610
 
3514
- struct U8Buffer *canvas_native_image_asset_get_data(const struct ImageAsset *asset);
3515
-
3516
3611
  void canvas_native_text_decoder_release(struct TextDecoder *value);
3517
3612
 
3518
3613
  struct TextDecoder *canvas_native_text_decoder_create(const char *decoding);
@@ -4326,7 +4421,7 @@ void canvas_native_webgl_tex_image2d_image_asset(int32_t target,
4326
4421
  int32_t internalformat,
4327
4422
  int32_t format,
4328
4423
  int32_t image_type,
4329
- struct ImageAsset *image_asset,
4424
+ const struct ImageAsset *image_asset,
4330
4425
  struct WebGLState *state);
4331
4426
 
4332
4427
  void canvas_native_webgl_tex_parameterf(uint32_t target,
@@ -4345,7 +4440,7 @@ void canvas_native_webgl_tex_sub_image2d_asset(uint32_t target,
4345
4440
  int32_t yoffset,
4346
4441
  uint32_t format,
4347
4442
  int32_t image_type,
4348
- struct ImageAsset *asset,
4443
+ const struct ImageAsset *asset,
4349
4444
  struct WebGLState *state);
4350
4445
 
4351
4446
  void canvas_native_webgl_tex_sub_image2d_canvas2d(uint32_t target,
@@ -5086,4 +5181,72 @@ void canvas_native_webgl2_vertex_attrib_i4uiv(uint32_t index,
5086
5181
  uintptr_t size,
5087
5182
  struct WebGLState *state);
5088
5183
 
5184
+ void canvas_native_webgl2_tex_image2d_image_asset(int32_t target,
5185
+ int32_t level,
5186
+ int32_t internalformat,
5187
+ uint32_t width,
5188
+ uint32_t height,
5189
+ int32_t border,
5190
+ int32_t format,
5191
+ int32_t type_,
5192
+ const struct ImageAsset *image_asset,
5193
+ struct WebGLState *state);
5194
+
5195
+ void canvas_native_webgl2_tex_image2d_src_data_offset(int32_t target,
5196
+ int32_t level,
5197
+ int32_t internalformat,
5198
+ uint32_t width,
5199
+ uint32_t height,
5200
+ int32_t border,
5201
+ int32_t format,
5202
+ int32_t type_,
5203
+ const uint8_t *src_data,
5204
+ uintptr_t src_data_size,
5205
+ uint64_t offset,
5206
+ struct WebGLState *state);
5207
+
5208
+ void canvas_native_webgl2_tex_image2d_offset(int32_t target,
5209
+ int32_t level,
5210
+ int32_t internalformat,
5211
+ uint32_t width,
5212
+ uint32_t height,
5213
+ int32_t border,
5214
+ int32_t format,
5215
+ int32_t type_,
5216
+ uint64_t offset,
5217
+ struct WebGLState *state);
5218
+
5219
+ void canvas_native_webgl2_tex_image2d_webgl(int32_t target,
5220
+ int32_t level,
5221
+ int32_t internalformat,
5222
+ uint32_t width,
5223
+ uint32_t height,
5224
+ int32_t border,
5225
+ int32_t format,
5226
+ int32_t type_,
5227
+ struct WebGLState *webgl,
5228
+ struct WebGLState *state);
5229
+
5230
+ void canvas_native_webgl2_tex_image2d_canvas2d(int32_t target,
5231
+ int32_t level,
5232
+ int32_t internalformat,
5233
+ uint32_t width,
5234
+ uint32_t height,
5235
+ int32_t border,
5236
+ int32_t format,
5237
+ int32_t type_,
5238
+ struct CanvasRenderingContext2D *canvas,
5239
+ struct WebGLState *state);
5240
+
5241
+ void canvas_native_webgl2_tex_image2d_image_data(int32_t target,
5242
+ int32_t level,
5243
+ int32_t internalformat,
5244
+ uint32_t width,
5245
+ uint32_t height,
5246
+ int32_t border,
5247
+ int32_t format,
5248
+ int32_t type_,
5249
+ const struct ImageData *image_data,
5250
+ struct WebGLState *state);
5251
+
5089
5252
  #endif /* CANVAS_C_H */