@nativescript/canvas 2.0.0-beta.9 → 2.0.0-webgpu.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/Canvas/common.d.ts +24 -17
  2. package/Canvas/common.js +133 -66
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +5 -7
  5. package/Canvas/index.android.js +62 -133
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.d.ts +4 -1
  8. package/Canvas/index.ios.d.ts +4 -5
  9. package/Canvas/index.ios.js +73 -82
  10. package/Canvas/index.ios.js.map +1 -1
  11. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -1
  12. package/Canvas2D/CanvasRenderingContext2D/index.js +8 -11
  13. package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
  14. package/Canvas2D/DOMMatrix/index.d.ts +14 -0
  15. package/Canvas2D/DOMMatrix/index.js +62 -0
  16. package/Canvas2D/DOMMatrix/index.js.map +1 -1
  17. package/Canvas2D/ImageData/index.js +4 -6
  18. package/Canvas2D/ImageData/index.js.map +1 -1
  19. package/ImageAsset/index.d.ts +1 -0
  20. package/ImageAsset/index.js +49 -0
  21. package/ImageAsset/index.js.map +1 -1
  22. package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
  23. package/WebGL/WebGLRenderingContext/index.js +86 -32
  24. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  25. package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
  26. package/WebGL2/WebGL2RenderingContext/index.js +2 -3
  27. package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
  28. package/WebGPU/Constants.d.ts +36 -0
  29. package/WebGPU/Constants.js +42 -0
  30. package/WebGPU/Constants.js.map +1 -0
  31. package/WebGPU/Errors.d.ts +18 -0
  32. package/WebGPU/Errors.js +21 -0
  33. package/WebGPU/Errors.js.map +1 -0
  34. package/WebGPU/GPU.d.ts +13 -0
  35. package/WebGPU/GPU.js +35 -0
  36. package/WebGPU/GPU.js.map +1 -0
  37. package/WebGPU/GPUAdapter.d.ts +23 -0
  38. package/WebGPU/GPUAdapter.js +62 -0
  39. package/WebGPU/GPUAdapter.js.map +1 -0
  40. package/WebGPU/GPUAdapterInfo.d.ts +9 -0
  41. package/WebGPU/GPUAdapterInfo.js +24 -0
  42. package/WebGPU/GPUAdapterInfo.js.map +1 -0
  43. package/WebGPU/GPUBindGroup.d.ts +5 -0
  44. package/WebGPU/GPUBindGroup.js +12 -0
  45. package/WebGPU/GPUBindGroup.js.map +1 -0
  46. package/WebGPU/GPUBindGroupLayout.d.ts +5 -0
  47. package/WebGPU/GPUBindGroupLayout.js +12 -0
  48. package/WebGPU/GPUBindGroupLayout.js.map +1 -0
  49. package/WebGPU/GPUBuffer.d.ts +15 -0
  50. package/WebGPU/GPUBuffer.js +54 -0
  51. package/WebGPU/GPUBuffer.js.map +1 -0
  52. package/WebGPU/GPUCanvasContext.d.ts +35 -0
  53. package/WebGPU/GPUCanvasContext.js +76 -0
  54. package/WebGPU/GPUCanvasContext.js.map +1 -0
  55. package/WebGPU/GPUCommandBuffer.d.ts +5 -0
  56. package/WebGPU/GPUCommandBuffer.js +12 -0
  57. package/WebGPU/GPUCommandBuffer.js.map +1 -0
  58. package/WebGPU/GPUCommandEncoder.d.ts +41 -0
  59. package/WebGPU/GPUCommandEncoder.js +110 -0
  60. package/WebGPU/GPUCommandEncoder.js.map +1 -0
  61. package/WebGPU/GPUComputePassEncoder.d.ts +16 -0
  62. package/WebGPU/GPUComputePassEncoder.js +50 -0
  63. package/WebGPU/GPUComputePassEncoder.js.map +1 -0
  64. package/WebGPU/GPUComputePipeline.d.ts +7 -0
  65. package/WebGPU/GPUComputePipeline.js +16 -0
  66. package/WebGPU/GPUComputePipeline.js.map +1 -0
  67. package/WebGPU/GPUDevice.d.ts +173 -0
  68. package/WebGPU/GPUDevice.js +356 -0
  69. package/WebGPU/GPUDevice.js.map +1 -0
  70. package/WebGPU/GPUDeviceLostInfo.d.ts +1 -0
  71. package/WebGPU/GPUDeviceLostInfo.js +10 -0
  72. package/WebGPU/GPUDeviceLostInfo.js.map +1 -0
  73. package/WebGPU/GPUExternalTexture.d.ts +5 -0
  74. package/WebGPU/GPUExternalTexture.js +12 -0
  75. package/WebGPU/GPUExternalTexture.js.map +1 -0
  76. package/WebGPU/GPUPipelineLayout.d.ts +5 -0
  77. package/WebGPU/GPUPipelineLayout.js +12 -0
  78. package/WebGPU/GPUPipelineLayout.js.map +1 -0
  79. package/WebGPU/GPUQuerySet.d.ts +5 -0
  80. package/WebGPU/GPUQuerySet.js +12 -0
  81. package/WebGPU/GPUQuerySet.js.map +1 -0
  82. package/WebGPU/GPUQueue.d.ts +14 -0
  83. package/WebGPU/GPUQueue.js +77 -0
  84. package/WebGPU/GPUQueue.js.map +1 -0
  85. package/WebGPU/GPURenderBundle.d.ts +5 -0
  86. package/WebGPU/GPURenderBundle.js +12 -0
  87. package/WebGPU/GPURenderBundle.js.map +1 -0
  88. package/WebGPU/GPURenderBundleEncoder.d.ts +20 -0
  89. package/WebGPU/GPURenderBundleEncoder.js +61 -0
  90. package/WebGPU/GPURenderBundleEncoder.js.map +1 -0
  91. package/WebGPU/GPURenderPassEncoder.d.ts +29 -0
  92. package/WebGPU/GPURenderPassEncoder.js +94 -0
  93. package/WebGPU/GPURenderPassEncoder.js.map +1 -0
  94. package/WebGPU/GPURenderPipeline.d.ts +7 -0
  95. package/WebGPU/GPURenderPipeline.js +16 -0
  96. package/WebGPU/GPURenderPipeline.js.map +1 -0
  97. package/WebGPU/GPUSampler.d.ts +5 -0
  98. package/WebGPU/GPUSampler.js +12 -0
  99. package/WebGPU/GPUSampler.js.map +1 -0
  100. package/WebGPU/GPUShaderModule.d.ts +6 -0
  101. package/WebGPU/GPUShaderModule.js +15 -0
  102. package/WebGPU/GPUShaderModule.js.map +1 -0
  103. package/WebGPU/GPUTexture.d.ts +17 -0
  104. package/WebGPU/GPUTexture.js +44 -0
  105. package/WebGPU/GPUTexture.js.map +1 -0
  106. package/WebGPU/GPUTextureView.d.ts +5 -0
  107. package/WebGPU/GPUTextureView.js +12 -0
  108. package/WebGPU/GPUTextureView.js.map +1 -0
  109. package/WebGPU/Interfaces.d.ts +155 -0
  110. package/WebGPU/Interfaces.js +2 -0
  111. package/WebGPU/Interfaces.js.map +1 -0
  112. package/WebGPU/Types.d.ts +39 -0
  113. package/WebGPU/Types.js +2 -0
  114. package/WebGPU/Types.js.map +1 -0
  115. package/WebGPU/Utils.d.ts +1 -0
  116. package/WebGPU/Utils.js +75 -0
  117. package/WebGPU/Utils.js.map +1 -0
  118. package/WebGPU/index.d.ts +28 -0
  119. package/WebGPU/index.js +29 -0
  120. package/WebGPU/index.js.map +1 -0
  121. package/common.d.ts +0 -3
  122. package/common.js +1 -5
  123. package/common.js.map +1 -1
  124. package/index.d.ts +1 -1
  125. package/index.js +22 -1
  126. package/index.js.map +1 -1
  127. package/package.json +1 -4
  128. package/platforms/android/canvas-release.aar +0 -0
  129. package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
  130. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  131. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +23 -23
  132. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +41 -8
  133. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2318 -103
  134. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  135. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  136. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +1563 -3729
  137. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +27 -34
  138. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  139. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +27 -34
  140. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  141. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +602 -663
  142. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  143. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +46 -46
  144. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +41 -8
  145. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2318 -103
  146. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  147. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  148. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  149. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +1563 -3729
  150. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +27 -34
  151. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  152. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +27 -34
  153. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1563 -3729
  154. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +27 -34
  155. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  156. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +27 -34
  157. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +31 -31
  158. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  159. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +604 -662
  160. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +638 -641
  161. package/platforms/ios/build.xcconfig +3 -1
  162. package/platforms/ios/src/cpp/Caches.h +69 -1
  163. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +320 -395
  164. package/platforms/ios/src/cpp/CanvasJSIModule.h +7 -1
  165. package/platforms/ios/src/cpp/Helpers.h +43 -8
  166. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +35 -37
  167. package/platforms/ios/src/cpp/ImageAssetImpl.h +14 -10
  168. package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +2 -2
  169. package/platforms/ios/src/cpp/ImageBitmapImpl.h +1 -1
  170. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +0 -10
  171. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +41 -4
  172. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +409 -3
  173. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +27 -0
  174. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +131 -149
  175. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1766 -1659
  176. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +302 -0
  177. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +63 -0
  178. package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +174 -0
  179. package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +58 -0
  180. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +53 -0
  181. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +45 -0
  182. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +53 -0
  183. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +45 -0
  184. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +229 -0
  185. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +59 -0
  186. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +317 -0
  187. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +55 -0
  188. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +54 -0
  189. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +45 -0
  190. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1222 -0
  191. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +69 -0
  192. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +260 -0
  193. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +62 -0
  194. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +84 -0
  195. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +49 -0
  196. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +2750 -0
  197. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +95 -0
  198. package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +186 -0
  199. package/platforms/ios/src/cpp/webgpu/GPUImpl.h +55 -0
  200. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +54 -0
  201. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +46 -0
  202. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +137 -0
  203. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +55 -0
  204. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +521 -0
  205. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +56 -0
  206. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +469 -0
  207. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +71 -0
  208. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +53 -0
  209. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +45 -0
  210. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +623 -0
  211. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +85 -0
  212. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +84 -0
  213. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +49 -0
  214. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +53 -0
  215. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +45 -0
  216. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +56 -0
  217. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +45 -0
  218. package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +1304 -0
  219. package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +288 -0
  220. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +360 -0
  221. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +75 -0
  222. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +53 -0
  223. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +45 -0
  224. package/platforms/ios/src/cpp/webgpu/GPUUtils.h +245 -0
  225. package/SVG/Circle.d.ts +0 -11
  226. package/SVG/Circle.js +0 -21
  227. package/SVG/Circle.js.map +0 -1
  228. package/SVG/ClipPath.d.ts +0 -4
  229. package/SVG/ClipPath.js +0 -9
  230. package/SVG/ClipPath.js.map +0 -1
  231. package/SVG/Defs.d.ts +0 -4
  232. package/SVG/Defs.js +0 -9
  233. package/SVG/Defs.js.map +0 -1
  234. package/SVG/Ellipse.d.ts +0 -13
  235. package/SVG/Ellipse.js +0 -26
  236. package/SVG/Ellipse.js.map +0 -1
  237. package/SVG/G.d.ts +0 -7
  238. package/SVG/G.js +0 -9
  239. package/SVG/G.js.map +0 -1
  240. package/SVG/Image.d.ts +0 -11
  241. package/SVG/Image.js +0 -40
  242. package/SVG/Image.js.map +0 -1
  243. package/SVG/Line.d.ts +0 -13
  244. package/SVG/Line.js +0 -26
  245. package/SVG/Line.js.map +0 -1
  246. package/SVG/LinearGradient.d.ts +0 -10
  247. package/SVG/LinearGradient.js +0 -13
  248. package/SVG/LinearGradient.js.map +0 -1
  249. package/SVG/Path.d.ts +0 -7
  250. package/SVG/Path.js +0 -14
  251. package/SVG/Path.js.map +0 -1
  252. package/SVG/Pattern.d.ts +0 -4
  253. package/SVG/Pattern.js +0 -9
  254. package/SVG/Pattern.js.map +0 -1
  255. package/SVG/Polygon.d.ts +0 -7
  256. package/SVG/Polygon.js +0 -14
  257. package/SVG/Polygon.js.map +0 -1
  258. package/SVG/Polyline.d.ts +0 -7
  259. package/SVG/Polyline.js +0 -14
  260. package/SVG/Polyline.js.map +0 -1
  261. package/SVG/Rect.d.ts +0 -8
  262. package/SVG/Rect.js +0 -13
  263. package/SVG/Rect.js.map +0 -1
  264. package/SVG/SVG.d.ts +0 -32
  265. package/SVG/SVG.js +0 -204
  266. package/SVG/SVG.js.map +0 -1
  267. package/SVG/SVGItem.d.ts +0 -5
  268. package/SVG/SVGItem.js +0 -8
  269. package/SVG/SVGItem.js.map +0 -1
  270. package/SVG/Stop.d.ts +0 -5
  271. package/SVG/Stop.js +0 -9
  272. package/SVG/Stop.js.map +0 -1
  273. package/SVG/Symbol.d.ts +0 -4
  274. package/SVG/Symbol.js +0 -9
  275. package/SVG/Symbol.js.map +0 -1
  276. package/SVG/Text.d.ts +0 -14
  277. package/SVG/Text.js +0 -26
  278. package/SVG/Text.js.map +0 -1
  279. package/SVG/Use.d.ts +0 -4
  280. package/SVG/Use.js +0 -9
  281. package/SVG/Use.js.map +0 -1
  282. package/SVG/index.d.ts +0 -18
  283. package/SVG/index.js +0 -19
  284. package/SVG/index.js.map +0 -1
  285. package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
  286. package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
  287. package/platforms/ios/src/cpp/URLImpl.cpp +0 -464
  288. package/platforms/ios/src/cpp/URLImpl.h +0 -121
@@ -700,7 +700,7 @@ v8::Local<v8::Value> WebGLRenderingContext::GetParameterInternal(v8::Isolate *is
700
700
  }
701
701
  return scope.Escape(v8::Integer::New(isolate, value));
702
702
  }
703
- case (uint32_t) GLConstants::UNPACK_COLORSPACE_CONVERSION_WEBGL:
703
+ case (uint32_t) GLConstants::GLConstantsUnpackColorSpaceConversionWebGL:
704
704
  return scope.Escape(v8::Integer::New(isolate,
705
705
  canvas_native_webgl_state_get_unpack_colorspace_conversion_webgl(
706
706
  this->GetState())));
@@ -729,10 +729,10 @@ v8::Local<v8::Value> WebGLRenderingContext::GetParameterInternal(v8::Isolate *is
729
729
 
730
730
  return scope.Escape(v8::Float32Array::New(arraybuffer, 0, size));
731
731
  }
732
- case (uint32_t) GLConstants::UNPACK_FLIP_Y_WEBGL:
732
+ case (uint32_t) GLConstants::GLConstantsUnPackFlipYWebGL:
733
733
  return scope.Escape(v8::Boolean::New(isolate, canvas_native_webgl_state_get_flip_y(
734
734
  this->GetState())));
735
- case (uint32_t) GLConstants::UNPACK_PREMULTIPLY_ALPHA_WEBGL:
735
+ case (uint32_t) GLConstants::GLConstantsUnpackPremultiplyAlphaWebGL:
736
736
  return scope.Escape(v8::Boolean::New(isolate,
737
737
  canvas_native_webgl_state_get_premultiplied_alpha(
738
738
  this->GetState())));
@@ -754,7 +754,7 @@ v8::Local<v8::Value> WebGLRenderingContext::GetParameterInternal(v8::Isolate *is
754
754
  auto array = v8::Array::New(isolate, (int) len);
755
755
 
756
756
  for (int j = 0; j < len; ++j) {
757
- array->Set(context, j, v8::Boolean::New(isolate, buf[j] == 1));
757
+ array->Set(context, j, v8::Boolean::New(isolate, buf[j] == 1)).FromJust();
758
758
  }
759
759
  return scope.Escape(array);
760
760
  }
@@ -894,8 +894,6 @@ void WebGLRenderingContext::AttachShader(const v8::FunctionCallbackInfo<v8::Valu
894
894
  return;
895
895
  }
896
896
 
897
- auto isolate = args.GetIsolate();
898
-
899
897
  auto programValue = args[0];
900
898
  auto shaderValue = args[1];
901
899
 
@@ -1200,59 +1198,24 @@ void WebGLRenderingContext::BufferData(const v8::FunctionCallbackInfo<v8::Value>
1200
1198
  auto usage = args[2]->Uint32Value(context).ToChecked();
1201
1199
 
1202
1200
  if (args[1]->IsObject()) {
1203
-
1204
1201
  auto sizeOrBuf = args[1];
1205
1202
  if (sizeOrBuf->IsArrayBufferView()) {
1206
- if (sizeOrBuf->IsUint16Array()) {
1207
- auto buf = sizeOrBuf.As<v8::Uint16Array>();
1208
-
1209
- auto array = buf->Buffer();
1210
- auto offset = buf->ByteOffset();
1211
- auto size = buf->Length();
1212
- auto data_ptr =
1213
- static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
1214
- auto data = static_cast<uint16_t *>((void *) data_ptr);
1215
-
1216
- canvas_native_webgl_buffer_data_u16(
1217
- target,
1218
- data, size,
1219
- usage,
1220
- ptr->GetState()
1221
- );
1222
- } else if (sizeOrBuf->IsFloat32Array()) {
1223
- auto buf = sizeOrBuf.As<v8::Float32Array>();
1224
-
1225
- auto array = buf->Buffer();
1226
- auto offset = buf->ByteOffset();
1227
- auto size = buf->Length();
1228
- auto data_ptr =
1229
- static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
1230
- auto data = static_cast<float *>((void *) data_ptr);
1231
-
1232
- canvas_native_webgl_buffer_data_f32(
1233
- target,
1234
- data, size,
1235
- usage,
1236
- ptr->GetState()
1237
- );
1238
- } else {
1239
- auto buf = sizeOrBuf.As<v8::ArrayBufferView>();
1203
+ auto buf = sizeOrBuf.As<v8::ArrayBufferView>();
1240
1204
 
1241
- auto array = buf->Buffer();
1242
- auto offset = buf->ByteOffset();
1243
- auto size = buf->ByteLength();
1244
- auto data_ptr =
1245
- static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
1246
- auto data = static_cast<uint8_t *>((void *) data_ptr);
1205
+ auto array = buf->Buffer();
1206
+ auto offset = buf->ByteOffset();
1207
+ auto size = buf->ByteLength();
1208
+ auto data_ptr =
1209
+ static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
1210
+ auto data = static_cast<uint8_t *>((void *) data_ptr);
1247
1211
 
1248
1212
 
1249
- canvas_native_webgl_buffer_data(
1250
- target,
1251
- data, size,
1252
- usage,
1253
- ptr->GetState()
1254
- );
1255
- }
1213
+ canvas_native_webgl_buffer_data(
1214
+ target,
1215
+ data, size,
1216
+ usage,
1217
+ ptr->GetState()
1218
+ );
1256
1219
  } else if (sizeOrBuf->IsArrayBuffer()) {
1257
1220
  auto array = sizeOrBuf.As<v8::ArrayBuffer>();
1258
1221
 
@@ -1524,8 +1487,7 @@ void WebGLRenderingContext::CompressedTexImage2D(const v8::FunctionCallbackInfo<
1524
1487
  auto array = buf->Buffer();
1525
1488
  auto offset = buf->ByteOffset();
1526
1489
  auto size = buf->ByteLength();
1527
- auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
1528
- auto data = static_cast<uint8_t *>((void *) data_ptr);
1490
+ auto data = static_cast<const uint8_t *>(array->GetBackingStore()->Data()) + offset;
1529
1491
 
1530
1492
 
1531
1493
  canvas_native_webgl_compressed_tex_image2d(
@@ -1583,8 +1545,7 @@ WebGLRenderingContext::CompressedTexSubImage2D(const v8::FunctionCallbackInfo<v8
1583
1545
  auto array = buf->Buffer();
1584
1546
  auto offset = buf->ByteOffset();
1585
1547
  auto size = array->ByteLength();
1586
- auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
1587
- auto data = static_cast<uint8_t *>((void *) data_ptr);
1548
+ auto data = static_cast<const uint8_t *>(array->GetBackingStore()->Data()) + offset;
1588
1549
 
1589
1550
  canvas_native_webgl_compressed_tex_sub_image2d(
1590
1551
  target,
@@ -1854,9 +1815,6 @@ void WebGLRenderingContext::DeleteBuffer(const v8::FunctionCallbackInfo<v8::Valu
1854
1815
  return;
1855
1816
  }
1856
1817
 
1857
- auto isolate = args.GetIsolate();
1858
-
1859
-
1860
1818
  auto value = args[0];
1861
1819
  auto type = GetNativeType(value);
1862
1820
  if (type == NativeType::WebGLBuffer) {
@@ -1877,8 +1835,6 @@ void WebGLRenderingContext::DeleteFramebuffer(const v8::FunctionCallbackInfo<v8:
1877
1835
  return;
1878
1836
  }
1879
1837
 
1880
- auto isolate = args.GetIsolate();
1881
-
1882
1838
  auto value = args[0];
1883
1839
  auto type = GetNativeType(value);
1884
1840
  if (type == NativeType::WebGLFramebuffer) {
@@ -1899,8 +1855,6 @@ void WebGLRenderingContext::DeleteProgram(const v8::FunctionCallbackInfo<v8::Val
1899
1855
  return;
1900
1856
  }
1901
1857
 
1902
- auto isolate = args.GetIsolate();
1903
-
1904
1858
  auto value = args[0];
1905
1859
  auto type = GetNativeType(value);
1906
1860
 
@@ -1923,8 +1877,6 @@ void WebGLRenderingContext::DeleteRenderbuffer(const v8::FunctionCallbackInfo<v8
1923
1877
  return;
1924
1878
  }
1925
1879
 
1926
- auto isolate = args.GetIsolate();
1927
-
1928
1880
 
1929
1881
  auto value = args[0];
1930
1882
  auto type = GetNativeType(value);
@@ -1948,8 +1900,6 @@ void WebGLRenderingContext::DeleteShader(const v8::FunctionCallbackInfo<v8::Valu
1948
1900
  return;
1949
1901
  }
1950
1902
 
1951
- auto isolate = args.GetIsolate();
1952
-
1953
1903
 
1954
1904
  auto value = args[0];
1955
1905
  auto type = GetNativeType(value);
@@ -1971,8 +1921,6 @@ void WebGLRenderingContext::DeleteTexture(const v8::FunctionCallbackInfo<v8::Val
1971
1921
  return;
1972
1922
  }
1973
1923
 
1974
- auto isolate = args.GetIsolate();
1975
-
1976
1924
 
1977
1925
  auto value = args[0];
1978
1926
  auto type = GetNativeType(value);
@@ -2049,8 +1997,6 @@ void WebGLRenderingContext::DetachShader(const v8::FunctionCallbackInfo<v8::Valu
2049
1997
  return;
2050
1998
  }
2051
1999
 
2052
- auto isolate = args.GetIsolate();
2053
-
2054
2000
 
2055
2001
  auto programValue = args[0];
2056
2002
  auto shaderValue = args[1];
@@ -2398,7 +2344,7 @@ void WebGLRenderingContext::GetAttachedShaders(const v8::FunctionCallbackInfo<v8
2398
2344
  for (int i = 0; i < len; ++i) {
2399
2345
  auto shader = WebGLShader::NewInstance(isolate, new WebGLShader(
2400
2346
  buf[i]));
2401
- array->Set(context, i, shader);
2347
+ array->Set(context, i, shader).FromJust();
2402
2348
  }
2403
2349
  args.GetReturnValue().Set(array);
2404
2350
 
@@ -2484,63 +2430,81 @@ void WebGLRenderingContext::GetContextAttributes(const v8::FunctionCallbackInfo<
2484
2430
  attr);
2485
2431
 
2486
2432
 
2487
- ret->Set(context, ConvertToV8String(isolate, "alpha"), v8::Boolean::New(isolate, alpha));
2433
+ ret->Set(context, ConvertToV8String(isolate, "alpha"),
2434
+ v8::Boolean::New(isolate, alpha)).FromJust();
2488
2435
 
2489
2436
  auto antialias = canvas_native_webgl_context_attribute_get_get_antialias(
2490
2437
  attr);
2491
2438
 
2492
2439
  ret->Set(context, ConvertToV8String(isolate, "antialias"),
2493
- v8::Boolean::New(isolate, antialias));
2440
+ v8::Boolean::New(isolate, antialias)).FromJust();
2494
2441
 
2495
2442
  auto depth = canvas_native_webgl_context_attribute_get_get_depth(
2496
2443
  attr);
2497
2444
 
2498
- ret->Set(context, ConvertToV8String(isolate, "depth"), v8::Boolean::New(isolate, depth));
2445
+ ret->Set(context, ConvertToV8String(isolate, "depth"),
2446
+ v8::Boolean::New(isolate, depth)).FromJust();
2499
2447
 
2500
2448
  auto fail_if_major_performance_caveat = canvas_native_webgl_context_attribute_get_get_fail_if_major_performance_caveat(
2501
2449
  attr);
2502
2450
 
2503
2451
  ret->Set(context,
2504
2452
  ConvertToV8String(isolate, "failIfMajorPerformanceCaveat"),
2505
- v8::Boolean::New(isolate, fail_if_major_performance_caveat));
2453
+ v8::Boolean::New(isolate, fail_if_major_performance_caveat)).FromJust();
2506
2454
 
2507
2455
  auto power_preference = canvas_native_webgl_context_attribute_get_get_power_preference(
2508
2456
  attr);
2509
2457
 
2458
+ std::string powerp;
2459
+ switch (power_preference) {
2460
+ case 0:
2461
+ powerp = std::string("default");
2462
+ break;
2463
+ case 1:
2464
+ powerp = std::string("high-performance");
2465
+ break;
2466
+ case 2:
2467
+ powerp = std::string("low-power");
2468
+ break;
2469
+ default:
2470
+ break;
2471
+ }
2472
+
2510
2473
  ret->Set(context, ConvertToV8String(isolate, "powerPreference"),
2511
- ConvertToV8OneByteString(isolate, (char *) power_preference));
2474
+ ConvertToV8String(isolate, powerp.c_str())).FromJust();
2475
+
2512
2476
 
2513
2477
  auto premultiplied_alpha = canvas_native_webgl_context_attribute_get_get_premultiplied_alpha(
2514
2478
  attr);
2515
2479
 
2516
2480
  ret->Set(context,
2517
2481
  ConvertToV8String(isolate, "premultipliedAlpha"),
2518
- v8::Boolean::New(isolate, premultiplied_alpha));
2482
+ v8::Boolean::New(isolate, premultiplied_alpha)).FromJust();
2519
2483
 
2520
2484
  auto preserve_drawing_buffer = canvas_native_webgl_context_attribute_get_get_preserve_drawing_buffer(
2521
2485
  attr);
2522
2486
 
2523
2487
  ret->Set(context,
2524
2488
  ConvertToV8String(isolate, "preserveDrawingBuffer"),
2525
- v8::Boolean::New(isolate, preserve_drawing_buffer));
2489
+ v8::Boolean::New(isolate, preserve_drawing_buffer)).FromJust();
2526
2490
 
2527
2491
  auto stencil = canvas_native_webgl_context_attribute_get_get_stencil(
2528
2492
  attr);
2529
2493
 
2530
2494
  ret->Set(context, ConvertToV8String(isolate, "stencil"),
2531
- v8::Boolean::New(isolate, stencil));
2495
+ v8::Boolean::New(isolate, stencil)).FromJust();
2532
2496
 
2533
2497
  auto desynchronized = canvas_native_webgl_context_attribute_get_get_desynchronized(
2534
2498
  attr);
2535
2499
 
2536
2500
  ret->Set(context, ConvertToV8String(isolate, "desynchronized"),
2537
- v8::Boolean::New(isolate, desynchronized));
2501
+ v8::Boolean::New(isolate, desynchronized)).FromJust();
2538
2502
 
2539
2503
  auto xr_compatible = canvas_native_webgl_context_attribute_get_get_xr_compatible(
2540
2504
  attr);
2541
2505
 
2542
2506
  ret->Set(context, ConvertToV8String(isolate, "xrCompatible"),
2543
- v8::Boolean::New(isolate, xr_compatible));
2507
+ v8::Boolean::New(isolate, xr_compatible)).FromJust();
2544
2508
 
2545
2509
  canvas_native_context_attributes_destroy(attr);
2546
2510
 
@@ -2595,200 +2559,193 @@ void WebGLRenderingContext::GetExtension(const v8::FunctionCallbackInfo<v8::Valu
2595
2559
  auto type = canvas_native_webgl_context_extension_get_type(
2596
2560
  ext);
2597
2561
  switch (type) {
2598
- case WebGLExtensionType::WebGLExtensionTypeOES_fbo_render_mipmap: {
2562
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_fbo_render_mipmap: {
2599
2563
  auto ret = OES_fbo_render_mipmapImpl::NewInstance(isolate,
2600
2564
  new OES_fbo_render_mipmapImpl());
2601
2565
  args.GetReturnValue().Set(ret);
2602
2566
  canvas_native_webgl_extension_destroy(ext);
2603
2567
  return;
2604
2568
  }
2605
- case WebGLExtensionType::WebGLExtensionTypeEXT_blend_minmax: {
2569
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_blend_minmax: {
2606
2570
  auto ret = EXT_blend_minmaxImpl::NewInstance(isolate, new EXT_blend_minmaxImpl());
2607
2571
  args.GetReturnValue().Set(ret);
2608
2572
  canvas_native_webgl_extension_destroy(ext);
2609
2573
  return;
2610
2574
  }
2611
- case WebGLExtensionType::WebGLExtensionTypeEXT_color_buffer_half_float: {
2575
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_color_buffer_half_float: {
2612
2576
  auto ret = EXT_color_buffer_half_floatImpl::NewInstance(isolate,
2613
2577
  new EXT_color_buffer_half_floatImpl());
2614
2578
  args.GetReturnValue().Set(ret);
2615
2579
  canvas_native_webgl_extension_destroy(ext);
2616
2580
  return;
2617
2581
  }
2618
- case WebGLExtensionType::WebGLExtensionTypeEXT_disjoint_timer_query: {
2582
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_disjoint_timer_query: {
2619
2583
  auto ret = canvas_native_webgl_context_extension_to_ext_disjoint_timer_query(ext);
2620
2584
  auto query = EXT_disjoint_timer_queryImpl::NewInstance(isolate,
2621
2585
  new EXT_disjoint_timer_queryImpl(
2622
2586
  ret));
2623
2587
 
2624
2588
  args.GetReturnValue().Set(query);
2625
- canvas_native_webgl_extension_destroy(ext);
2626
2589
  return;
2627
2590
  }
2628
- case WebGLExtensionType::WebGLExtensionTypeEXT_sRGB: {
2591
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_sRGB: {
2629
2592
  auto ret = EXT_sRGBImpl::NewInstance(isolate, new EXT_sRGBImpl());
2630
2593
  args.GetReturnValue().Set(ret);
2631
2594
  canvas_native_webgl_extension_destroy(ext);
2632
2595
  return;
2633
2596
  }
2634
- case WebGLExtensionType::WebGLExtensionTypeEXT_shader_texture_lod: {
2597
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_shader_texture_lod: {
2635
2598
  auto ret = EXT_shader_texture_lodImpl::NewInstance(isolate,
2636
2599
  new EXT_shader_texture_lodImpl());
2637
2600
  args.GetReturnValue().Set(ret);
2638
2601
  canvas_native_webgl_extension_destroy(ext);
2639
2602
  return;
2640
2603
  }
2641
- case WebGLExtensionType::WebGLExtensionTypeEXT_texture_filter_anisotropic: {
2604
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_texture_filter_anisotropic: {
2642
2605
  auto ret = EXT_texture_filter_anisotropicImpl::NewInstance(isolate,
2643
2606
  new EXT_texture_filter_anisotropicImpl());
2644
2607
  args.GetReturnValue().Set(ret);
2645
2608
  canvas_native_webgl_extension_destroy(ext);
2646
2609
  return;
2647
2610
  }
2648
- case WebGLExtensionType::WebGLExtensionTypeOES_element_index_uint: {
2611
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_element_index_uint: {
2649
2612
  auto ret = OES_element_index_uintImpl::NewInstance(isolate,
2650
2613
  new OES_element_index_uintImpl());
2651
2614
  args.GetReturnValue().Set(ret);
2652
2615
  canvas_native_webgl_extension_destroy(ext);
2653
2616
  return;
2654
2617
  }
2655
- case WebGLExtensionType::WebGLExtensionTypeOES_standard_derivatives: {
2618
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_standard_derivatives: {
2656
2619
  auto ret = OES_standard_derivativesImpl::NewInstance(
2657
2620
  isolate, new OES_standard_derivativesImpl());
2658
2621
  args.GetReturnValue().Set(ret);
2659
2622
  canvas_native_webgl_extension_destroy(ext);
2660
2623
  return;
2661
2624
  }
2662
- case WebGLExtensionType::WebGLExtensionTypeOES_texture_float: {
2625
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_texture_float: {
2663
2626
  auto ret = OES_texture_floatImpl::NewInstance(isolate, new OES_texture_floatImpl());
2664
2627
  args.GetReturnValue().Set(ret);
2665
2628
  canvas_native_webgl_extension_destroy(ext);
2666
2629
  return;
2667
2630
  }
2668
- case WebGLExtensionType::WebGLExtensionTypeOES_texture_float_linear: {
2631
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_texture_float_linear: {
2669
2632
  auto ret = OES_texture_float_linearImpl::NewInstance(isolate,
2670
2633
  new OES_texture_float_linearImpl());
2671
2634
  args.GetReturnValue().Set(ret);
2672
2635
  canvas_native_webgl_extension_destroy(ext);
2673
2636
  return;
2674
2637
  }
2675
- case WebGLExtensionType::WebGLExtensionTypeOES_texture_half_float: {
2638
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_texture_half_float: {
2676
2639
  auto ret = OES_texture_half_floatImpl::NewInstance(isolate,
2677
2640
  new OES_texture_half_floatImpl());
2678
2641
  args.GetReturnValue().Set(ret);
2679
2642
  canvas_native_webgl_extension_destroy(ext);
2680
2643
  return;
2681
2644
  }
2682
- case WebGLExtensionType::WebGLExtensionTypeOES_texture_half_float_linear: {
2645
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_texture_half_float_linear: {
2683
2646
  auto ret = OES_texture_half_float_linearImpl::NewInstance(isolate,
2684
2647
  new OES_texture_half_float_linearImpl());
2685
2648
  args.GetReturnValue().Set(ret);
2686
2649
  canvas_native_webgl_extension_destroy(ext);
2687
2650
  return;
2688
2651
  }
2689
- case WebGLExtensionType::WebGLExtensionTypeOES_vertex_array_object: {
2652
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_vertex_array_object: {
2690
2653
  auto ret = canvas_native_webgl_context_extension_to_oes_vertex_array_object(ext);
2691
2654
  auto array = OES_vertex_array_objectImpl::NewInstance(isolate,
2692
2655
  new OES_vertex_array_objectImpl(
2693
2656
  ret));
2694
2657
  args.GetReturnValue().Set(array);
2695
- canvas_native_webgl_extension_destroy(ext);
2696
2658
  return;
2697
2659
  }
2698
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_color_buffer_float: {
2660
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_color_buffer_float: {
2699
2661
  auto ret = WEBGL_color_buffer_floatImpl::NewInstance(isolate,
2700
2662
  new WEBGL_color_buffer_floatImpl());
2701
2663
  if (ptr->GetVersion() ==
2702
2664
  WebGLRenderingVersion::V2) {
2703
2665
  ret->Set(context, ConvertToV8String(isolate, "ext_name"),
2704
- ConvertToV8String(isolate, "EXT_color_buffer_float"));
2666
+ ConvertToV8String(isolate, "EXT_color_buffer_float")).FromJust();
2705
2667
  }
2706
2668
  args.GetReturnValue().Set(ret);
2707
2669
  canvas_native_webgl_extension_destroy(ext);
2708
2670
  return;
2709
2671
  }
2710
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_compressed_texture_atc: {
2672
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_atc: {
2711
2673
  auto ret = WEBGL_compressed_texture_atcImpl::NewInstance(isolate,
2712
2674
  new WEBGL_compressed_texture_atcImpl());
2713
2675
  args.GetReturnValue().Set(ret);
2714
2676
  canvas_native_webgl_extension_destroy(ext);
2715
2677
  return;
2716
2678
  }
2717
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_compressed_texture_etc1: {
2679
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_etc1: {
2718
2680
  auto ret = WEBGL_compressed_texture_etc1Impl::NewInstance(isolate,
2719
2681
  new WEBGL_compressed_texture_etc1Impl());
2720
2682
  args.GetReturnValue().Set(ret);
2721
2683
  canvas_native_webgl_extension_destroy(ext);
2722
2684
  return;
2723
2685
  }
2724
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_compressed_texture_s3tc: {
2686
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_s3tc: {
2725
2687
  auto ret = WEBGL_compressed_texture_s3tcImpl::NewInstance(isolate,
2726
2688
  new WEBGL_compressed_texture_s3tcImpl());
2727
2689
  args.GetReturnValue().Set(ret);
2728
2690
  canvas_native_webgl_extension_destroy(ext);
2729
2691
  return;
2730
2692
  }
2731
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_compressed_texture_s3tc_srgb: {
2693
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_s3tc_srgb: {
2732
2694
  auto ret = WEBGL_compressed_texture_s3tc_srgbImpl::NewInstance(isolate,
2733
2695
  new WEBGL_compressed_texture_s3tc_srgbImpl());
2734
2696
  args.GetReturnValue().Set(ret);
2735
2697
  canvas_native_webgl_extension_destroy(ext);
2736
2698
  return;
2737
2699
  }
2738
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_compressed_texture_etc: {
2700
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_etc: {
2739
2701
  auto ret = WEBGL_compressed_texture_etcImpl::NewInstance(isolate,
2740
2702
  new WEBGL_compressed_texture_etcImpl());
2741
2703
  args.GetReturnValue().Set(ret);
2742
2704
  canvas_native_webgl_extension_destroy(ext);
2743
2705
  return;
2744
2706
  }
2745
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_compressed_texture_pvrtc: {
2707
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_pvrtc: {
2746
2708
  auto ret = WEBGL_compressed_texture_pvrtcImpl::NewInstance(isolate,
2747
2709
  new WEBGL_compressed_texture_pvrtcImpl());
2748
2710
  args.GetReturnValue().Set(ret);
2749
2711
  canvas_native_webgl_extension_destroy(ext);
2750
2712
  return;
2751
2713
  }
2752
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_lose_context: {
2714
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_lose_context: {
2753
2715
  auto ret = canvas_native_webgl_context_extension_to_lose_context(ext);
2754
2716
  auto ctx = WEBGL_lose_contextImpl::NewInstance(isolate,
2755
2717
  new WEBGL_lose_contextImpl(ret));
2756
2718
 
2757
2719
  args.GetReturnValue().Set(ctx);
2758
-
2759
- canvas_native_webgl_extension_destroy(ext);
2760
2720
  return;
2761
2721
  }
2762
- case WebGLExtensionType::WebGLExtensionTypeANGLE_instanced_arrays: {
2722
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeANGLE_instanced_arrays: {
2763
2723
  auto ret = canvas_native_webgl_context_extension_to_angle_instanced_arrays(ext);
2764
2724
  auto instance = ANGLE_instanced_arraysImpl::NewInstance(isolate,
2765
2725
  new ANGLE_instanced_arraysImpl(
2766
2726
  ret));
2767
2727
 
2768
2728
  args.GetReturnValue().Set(instance);
2769
- canvas_native_webgl_extension_destroy(ext);
2770
2729
  return;
2771
2730
  }
2772
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_depth_texture: {
2731
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_depth_texture: {
2773
2732
  auto ret = WEBGL_depth_textureImpl::NewInstance(isolate, new WEBGL_depth_textureImpl());
2774
2733
  args.GetReturnValue().Set(ret);
2775
2734
  canvas_native_webgl_extension_destroy(ext);
2776
2735
  return;
2777
2736
  }
2778
- case WebGLExtensionType::WebGLExtensionTypeWEBGL_draw_buffers: {
2737
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_draw_buffers: {
2779
2738
  auto ret = canvas_native_webgl_context_extension_to_draw_buffers(ext);
2780
2739
 
2781
2740
  auto buffers = WEBGL_draw_buffersImpl::NewInstance(isolate,
2782
2741
  new WEBGL_draw_buffersImpl(ret));
2783
2742
 
2784
2743
  args.GetReturnValue().Set(buffers);
2785
-
2786
- canvas_native_webgl_extension_destroy(ext);
2787
2744
  return;
2788
2745
 
2789
2746
 
2790
2747
  }
2791
- case WebGLExtensionType::WebGLExtensionTypeNone:
2748
+ case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeNone:
2792
2749
  args.GetReturnValue().SetUndefined();
2793
2750
  canvas_native_webgl_extension_destroy(ext);
2794
2751
  return;
@@ -2846,7 +2803,7 @@ void WebGLRenderingContext::GetFramebufferAttachmentParameter(
2846
2803
  object->Set(context,
2847
2804
  ConvertToV8String(isolate, "isRenderbuffer"),
2848
2805
  v8::Boolean::New(isolate,
2849
- true));
2806
+ true)).FromJust();
2850
2807
  args.GetReturnValue().Set(object);
2851
2808
 
2852
2809
  canvas_native_webgl_framebuffer_attachment_parameter_destroy(ret);
@@ -2906,7 +2863,6 @@ void WebGLRenderingContext::GetProgramInfoLog(const v8::FunctionCallbackInfo<v8:
2906
2863
 
2907
2864
  if (strlen(log) == 0) {
2908
2865
  args.GetReturnValue().SetEmptyString();
2909
- canvas_native_string_destroy((char *) log);
2910
2866
  return;
2911
2867
  }
2912
2868
 
@@ -3015,7 +2971,6 @@ void WebGLRenderingContext::GetShaderInfoLog(const v8::FunctionCallbackInfo<v8::
3015
2971
 
3016
2972
  if (strlen(log) == 0) {
3017
2973
  args.GetReturnValue().SetEmptyString();
3018
- canvas_native_string_destroy((char *) log);
3019
2974
  return;
3020
2975
  }
3021
2976
 
@@ -3131,7 +3086,6 @@ void WebGLRenderingContext::GetShaderSource(const v8::FunctionCallbackInfo<v8::V
3131
3086
 
3132
3087
  if (strlen(source) == 0) {
3133
3088
  args.GetReturnValue().SetEmptyString();
3134
- canvas_native_string_destroy((char *) source);
3135
3089
  return;
3136
3090
  }
3137
3091
 
@@ -3164,7 +3118,8 @@ WebGLRenderingContext::GetSupportedExtensions(const v8::FunctionCallbackInfo<v8:
3164
3118
  for (int i = 0; i < len; ++i) {
3165
3119
  auto item = canvas_native_string_buffer_get_value_at(exts, i);
3166
3120
  if (item != nullptr) {
3167
- array->Set(context, i, ConvertToV8OneByteString(isolate, (char *) item));
3121
+ array->Set(context, i, ConvertToV8OneByteString(isolate, (char *) item)).FromJust();
3122
+ canvas_native_string_destroy(item);
3168
3123
  }
3169
3124
 
3170
3125
  }
@@ -3314,7 +3269,7 @@ WebGLRenderingContext::GetUniform(const v8::FunctionCallbackInfo<v8::Value> &arg
3314
3269
  context, i,
3315
3270
  v8::Boolean::New(isolate,
3316
3271
  item ==
3317
- 1));
3272
+ 1)).FromJust();
3318
3273
  }
3319
3274
  args.GetReturnValue().Set(array);
3320
3275
  canvas_native_webgl_WebGLResult_destroy(val);
@@ -3560,7 +3515,6 @@ WebGLRenderingContext::IsBuffer(const v8::FunctionCallbackInfo<v8::Value> &args)
3560
3515
  return;
3561
3516
  }
3562
3517
 
3563
- auto isolate = args.GetIsolate();
3564
3518
 
3565
3519
  auto value = args[0];
3566
3520
  auto type = GetNativeType(value);
@@ -3619,8 +3573,6 @@ WebGLRenderingContext::IsFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &
3619
3573
  return;
3620
3574
  }
3621
3575
 
3622
- auto isolate = args.GetIsolate();
3623
-
3624
3576
  auto value = args[0];
3625
3577
  auto type = GetNativeType(value);
3626
3578
  if (type == NativeType::WebGLFramebuffer) {
@@ -3642,12 +3594,10 @@ void
3642
3594
  WebGLRenderingContext::IsProgram(const v8::FunctionCallbackInfo<v8::Value> &args) {
3643
3595
  WebGLRenderingContext *ptr = GetPointer(args.This());
3644
3596
  if (ptr == nullptr) {
3645
- args.GetReturnValue().SetNull();
3597
+ args.GetReturnValue().Set(false);
3646
3598
  return;
3647
3599
  }
3648
3600
 
3649
- auto isolate = args.GetIsolate();
3650
-
3651
3601
  auto value = args[0];
3652
3602
  auto type = GetNativeType(value);
3653
3603
  if (type == NativeType::WebGLProgram) {
@@ -3674,8 +3624,6 @@ WebGLRenderingContext::IsRenderbuffer(const v8::FunctionCallbackInfo<v8::Value>
3674
3624
  return;
3675
3625
  }
3676
3626
 
3677
- auto isolate = args.GetIsolate();
3678
-
3679
3627
  auto value = args[0];
3680
3628
  auto type = GetNativeType(value);
3681
3629
  if (type == NativeType::WebGLRenderbuffer) {
@@ -3702,8 +3650,6 @@ WebGLRenderingContext::IsShader(const v8::FunctionCallbackInfo<v8::Value> &args)
3702
3650
  return;
3703
3651
  }
3704
3652
 
3705
- auto isolate = args.GetIsolate();
3706
-
3707
3653
  auto value = args[0];
3708
3654
  auto type = GetNativeType(value);
3709
3655
  if (type == NativeType::WebGLShader) {
@@ -3729,8 +3675,6 @@ WebGLRenderingContext::IsTexture(const v8::FunctionCallbackInfo<v8::Value> &args
3729
3675
  return;
3730
3676
  }
3731
3677
 
3732
- auto isolate = args.GetIsolate();
3733
-
3734
3678
  auto value = args[0];
3735
3679
  auto type = GetNativeType(value);
3736
3680
  if (type == NativeType::WebGLTexture) {
@@ -3773,7 +3717,6 @@ WebGLRenderingContext::LinkProgram(const v8::FunctionCallbackInfo<v8::Value> &ar
3773
3717
  return;
3774
3718
  }
3775
3719
 
3776
- auto isolate = args.GetIsolate();
3777
3720
  auto value = args[0];
3778
3721
  auto type = GetNativeType(value);
3779
3722
  if (type == NativeType::WebGLProgram) {
@@ -4215,7 +4158,6 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo<v8::Value> &arg
4215
4158
  if (image_asset !=
4216
4159
  nullptr) {
4217
4160
 
4218
-
4219
4161
  canvas_native_webgl_tex_image2d_image_asset(
4220
4162
  target,
4221
4163
  level,
@@ -4279,6 +4221,30 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo<v8::Value> &arg
4279
4221
  }
4280
4222
  return;
4281
4223
  }
4224
+ case NativeType::ImageData: {
4225
+ auto image_data = ImageDataImpl::GetPointer(pixels.As<v8::Object>());
4226
+ if (image_data != nullptr) {
4227
+ auto width = canvas_native_image_data_get_width(image_data->GetImageData());
4228
+ auto height = canvas_native_image_data_get_height(image_data->GetImageData());
4229
+ auto buffer = canvas_native_image_data_get_data(image_data->GetImageData());
4230
+ auto size = canvas_native_u8_buffer_get_length(buffer);
4231
+ auto data = canvas_native_u8_buffer_get_bytes(buffer);
4232
+ canvas_native_webgl_tex_image2d(
4233
+ target,
4234
+ level,
4235
+ internalformat,
4236
+ width,
4237
+ height,
4238
+ format,
4239
+ type,
4240
+ GL_RGBA,
4241
+ data,
4242
+ size,
4243
+ ptr->GetState()
4244
+ );
4245
+ }
4246
+
4247
+ }
4282
4248
  default:
4283
4249
  break;
4284
4250
  }
@@ -4348,8 +4314,7 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo<v8::Value> &arg
4348
4314
  auto array = buf->Buffer();
4349
4315
  auto offset = buf->ByteOffset();
4350
4316
  auto size = array->ByteLength();
4351
- auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
4352
- auto data = static_cast<uint8_t *>((void *) data_ptr);
4317
+ auto data = static_cast<const uint8_t *>(array->GetBackingStore()->Data()) + offset;
4353
4318
 
4354
4319
 
4355
4320
  canvas_native_webgl_tex_image2d(
@@ -4538,6 +4503,30 @@ WebGLRenderingContext::TexSubImage2D(const v8::FunctionCallbackInfo<v8::Value> &
4538
4503
  }
4539
4504
  return;
4540
4505
  }
4506
+ case NativeType::ImageData: {
4507
+ auto image_data = ImageDataImpl::GetPointer(pixels.As<v8::Object>());
4508
+ if (image_data != nullptr) {
4509
+ auto width = canvas_native_image_data_get_width(image_data->GetImageData());
4510
+ auto height = canvas_native_image_data_get_height(image_data->GetImageData());
4511
+ auto buffer = canvas_native_image_data_get_data(image_data->GetImageData());
4512
+ auto size = canvas_native_u8_buffer_get_length(buffer);
4513
+ auto data = canvas_native_u8_buffer_get_bytes(buffer);
4514
+ canvas_native_webgl_tex_sub_image2d(
4515
+ target,
4516
+ level,
4517
+ xoffset,
4518
+ yoffset,
4519
+ width,
4520
+ height,
4521
+ format,
4522
+ GL_RGBA,
4523
+ data,
4524
+ size,
4525
+ ptr->GetState()
4526
+ );
4527
+ }
4528
+
4529
+ }
4541
4530
  default:
4542
4531
  break;
4543
4532
  }
@@ -4569,8 +4558,7 @@ WebGLRenderingContext::TexSubImage2D(const v8::FunctionCallbackInfo<v8::Value> &
4569
4558
  auto array = buf->Buffer();
4570
4559
  auto offset = buf->ByteOffset();
4571
4560
  auto size = array->ByteLength();
4572
- auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
4573
- auto data = static_cast<uint8_t *>((void *) data_ptr);
4561
+ auto data = static_cast<const uint8_t *>(array->GetBackingStore()->Data()) + offset;
4574
4562
 
4575
4563
 
4576
4564
  canvas_native_webgl_tex_sub_image2d(
@@ -4717,7 +4705,6 @@ WebGLRenderingContext::VertexAttrib1fv(const v8::FunctionCallbackInfo<v8::Value>
4717
4705
  auto value = args[1];
4718
4706
  if (value->IsFloat32Array()) {
4719
4707
  auto buf = value.As<v8::Float32Array>();
4720
-
4721
4708
  auto array = buf->Buffer();
4722
4709
  auto offset = buf->ByteOffset();
4723
4710
  auto size = buf->Length();
@@ -5705,10 +5692,8 @@ WebGLRenderingContext::UseProgram(const v8::FunctionCallbackInfo<v8::Value> &arg
5705
5692
  return;
5706
5693
  }
5707
5694
 
5708
- auto isolate = args.GetIsolate();
5709
-
5710
5695
  auto value = args[0];
5711
- if (value->IsNull()) {
5696
+ if (value->IsNullOrUndefined()) {
5712
5697
  canvas_native_webgl_use_program(0,
5713
5698
  ptr->GetState());
5714
5699
 
@@ -5735,8 +5720,6 @@ WebGLRenderingContext::ValidateProgram(const v8::FunctionCallbackInfo<v8::Value>
5735
5720
  return;
5736
5721
  }
5737
5722
 
5738
- auto isolate = args.GetIsolate();
5739
-
5740
5723
  auto value = args[0];
5741
5724
  auto type = GetNativeType(value);
5742
5725
  if (type == NativeType::WebGLProgram) {
@@ -6302,7 +6285,6 @@ WebGLRenderingContext::SetMethods(v8::Isolate *isolate, const v8::Local<v8::Obje
6302
6285
  v8::Local<v8::Value>());
6303
6286
 
6304
6287
 
6305
-
6306
6288
  tmpl->SetAccessor(ConvertToV8String(isolate, "continuousRenderMode"), GetContinuousRenderMode,
6307
6289
  SetContinuousRenderMode);
6308
6290