@nativescript/canvas 0.9.22-v6 → 1.0.0-alpha.10

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 (376) hide show
  1. package/Canvas/common.d.ts +17 -24
  2. package/Canvas/common.js +207 -182
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +8 -6
  5. package/Canvas/index.android.js +155 -156
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.ios.d.ts +10 -7
  8. package/Canvas/index.ios.js +141 -153
  9. package/Canvas/index.ios.js.map +1 -1
  10. package/Canvas2D/CanvasGradient/CanvasGradient.android.d.ts +2 -2
  11. package/Canvas2D/CanvasGradient/CanvasGradient.android.js +13 -23
  12. package/Canvas2D/CanvasGradient/CanvasGradient.android.js.map +1 -1
  13. package/Canvas2D/CanvasGradient/CanvasGradient.d.ts +1 -1
  14. package/Canvas2D/CanvasGradient/CanvasGradient.ios.d.ts +1 -1
  15. package/Canvas2D/CanvasGradient/CanvasGradient.ios.js +13 -23
  16. package/Canvas2D/CanvasGradient/CanvasGradient.ios.js.map +1 -1
  17. package/Canvas2D/CanvasGradient/common.d.ts +1 -1
  18. package/Canvas2D/CanvasGradient/common.js +2 -8
  19. package/Canvas2D/CanvasGradient/common.js.map +1 -1
  20. package/Canvas2D/CanvasGradient/index.js +2 -7
  21. package/Canvas2D/CanvasGradient/index.js.map +1 -1
  22. package/Canvas2D/CanvasPattern/CanvasPattern.android.js +8 -14
  23. package/Canvas2D/CanvasPattern/CanvasPattern.android.js.map +1 -1
  24. package/Canvas2D/CanvasPattern/CanvasPattern.ios.js +7 -12
  25. package/Canvas2D/CanvasPattern/CanvasPattern.ios.js.map +1 -1
  26. package/Canvas2D/CanvasPattern/common.d.ts +1 -1
  27. package/Canvas2D/CanvasPattern/common.js +6 -14
  28. package/Canvas2D/CanvasPattern/common.js.map +1 -1
  29. package/Canvas2D/CanvasPattern/index.js +2 -7
  30. package/Canvas2D/CanvasPattern/index.js.map +1 -1
  31. package/Canvas2D/CanvasRenderingContext2D/common.d.ts +21 -21
  32. package/Canvas2D/CanvasRenderingContext2D/common.js +9 -21
  33. package/Canvas2D/CanvasRenderingContext2D/common.js.map +1 -1
  34. package/Canvas2D/CanvasRenderingContext2D/index.android.d.ts +40 -21
  35. package/Canvas2D/CanvasRenderingContext2D/index.android.js +602 -638
  36. package/Canvas2D/CanvasRenderingContext2D/index.android.js.map +1 -1
  37. package/Canvas2D/CanvasRenderingContext2D/index.ios.d.ts +40 -21
  38. package/Canvas2D/CanvasRenderingContext2D/index.ios.js +621 -737
  39. package/Canvas2D/CanvasRenderingContext2D/index.ios.js.map +1 -1
  40. package/Canvas2D/DOMMatrix/DOMMatrix.android.d.ts +44 -22
  41. package/Canvas2D/DOMMatrix/DOMMatrix.android.js +141 -231
  42. package/Canvas2D/DOMMatrix/DOMMatrix.android.js.map +1 -1
  43. package/Canvas2D/DOMMatrix/DOMMatrix.d.ts +1 -1
  44. package/Canvas2D/DOMMatrix/DOMMatrix.ios.d.ts +44 -22
  45. package/Canvas2D/DOMMatrix/DOMMatrix.ios.js +141 -225
  46. package/Canvas2D/DOMMatrix/DOMMatrix.ios.js.map +1 -1
  47. package/Canvas2D/DOMMatrix/common.d.ts +23 -7
  48. package/Canvas2D/DOMMatrix/common.js +6 -14
  49. package/Canvas2D/DOMMatrix/common.js.map +1 -1
  50. package/Canvas2D/DOMMatrix/index.js +2 -7
  51. package/Canvas2D/DOMMatrix/index.js.map +1 -1
  52. package/Canvas2D/ImageData/ImageData.android.d.ts +4 -0
  53. package/Canvas2D/ImageData/ImageData.android.js +41 -16
  54. package/Canvas2D/ImageData/ImageData.android.js.map +1 -1
  55. package/Canvas2D/ImageData/ImageData.ios.d.ts +4 -0
  56. package/Canvas2D/ImageData/ImageData.ios.js +41 -16
  57. package/Canvas2D/ImageData/ImageData.ios.js.map +1 -1
  58. package/Canvas2D/ImageData/common.d.ts +5 -5
  59. package/Canvas2D/ImageData/common.js +6 -17
  60. package/Canvas2D/ImageData/common.js.map +1 -1
  61. package/Canvas2D/ImageData/index.js +2 -7
  62. package/Canvas2D/ImageData/index.js.map +1 -1
  63. package/Canvas2D/Path2D/Path2D.android.js +26 -35
  64. package/Canvas2D/Path2D/Path2D.android.js.map +1 -1
  65. package/Canvas2D/Path2D/Path2D.ios.js +26 -35
  66. package/Canvas2D/Path2D/Path2D.ios.js.map +1 -1
  67. package/Canvas2D/Path2D/common.d.ts +1 -1
  68. package/Canvas2D/Path2D/common.js +6 -14
  69. package/Canvas2D/Path2D/common.js.map +1 -1
  70. package/Canvas2D/Path2D/index.js +2 -7
  71. package/Canvas2D/Path2D/index.js.map +1 -1
  72. package/Canvas2D/TextMetrics/TextMetrics.android.d.ts +13 -14
  73. package/Canvas2D/TextMetrics/TextMetrics.android.js +41 -94
  74. package/Canvas2D/TextMetrics/TextMetrics.android.js.map +1 -1
  75. package/Canvas2D/TextMetrics/TextMetrics.d.ts +1 -12
  76. package/Canvas2D/TextMetrics/TextMetrics.ios.d.ts +12 -12
  77. package/Canvas2D/TextMetrics/TextMetrics.ios.js +41 -94
  78. package/Canvas2D/TextMetrics/TextMetrics.ios.js.map +1 -1
  79. package/Canvas2D/TextMetrics/common.d.ts +14 -2
  80. package/Canvas2D/TextMetrics/common.js +6 -14
  81. package/Canvas2D/TextMetrics/common.js.map +1 -1
  82. package/Canvas2D/TextMetrics/index.js +2 -7
  83. package/Canvas2D/TextMetrics/index.js.map +1 -1
  84. package/Canvas2D/index.js +6 -11
  85. package/Canvas2D/index.js.map +1 -1
  86. package/ImageAsset/ImageAsset.android.d.ts +4 -4
  87. package/ImageAsset/ImageAsset.android.js +79 -101
  88. package/ImageAsset/ImageAsset.android.js.map +1 -1
  89. package/ImageAsset/ImageAsset.d.ts +1 -1
  90. package/ImageAsset/ImageAsset.ios.d.ts +5 -4
  91. package/ImageAsset/ImageAsset.ios.js +82 -107
  92. package/ImageAsset/ImageAsset.ios.js.map +1 -1
  93. package/ImageAsset/common.d.ts +1 -1
  94. package/ImageAsset/common.js +8 -16
  95. package/ImageAsset/common.js.map +1 -1
  96. package/ImageAsset/index.js +2 -7
  97. package/ImageAsset/index.js.map +1 -1
  98. package/ImageBitmap/common.d.ts +8 -0
  99. package/ImageBitmap/common.js +9 -0
  100. package/ImageBitmap/common.js.map +1 -0
  101. package/ImageBitmap/index.android.d.ts +12 -0
  102. package/ImageBitmap/index.android.js +332 -0
  103. package/ImageBitmap/index.android.js.map +1 -0
  104. package/ImageBitmap/index.ios.d.ts +12 -0
  105. package/ImageBitmap/index.ios.js +283 -0
  106. package/ImageBitmap/index.ios.js.map +1 -0
  107. package/README.md +26 -27
  108. package/SVG/Circle.d.ts +3 -3
  109. package/SVG/Circle.js +16 -89
  110. package/SVG/Circle.js.map +1 -1
  111. package/SVG/ClipPath.d.ts +1 -0
  112. package/SVG/ClipPath.js +7 -10
  113. package/SVG/ClipPath.js.map +1 -1
  114. package/SVG/Defs.d.ts +1 -4
  115. package/SVG/Defs.js +7 -18
  116. package/SVG/Defs.js.map +1 -1
  117. package/SVG/Ellipse.d.ts +1 -2
  118. package/SVG/Ellipse.js +16 -43
  119. package/SVG/Ellipse.js.map +1 -1
  120. package/SVG/G.d.ts +1 -7
  121. package/SVG/G.js +7 -64
  122. package/SVG/G.js.map +1 -1
  123. package/SVG/Image.d.ts +5 -4
  124. package/SVG/Image.js +28 -74
  125. package/SVG/Image.js.map +1 -1
  126. package/SVG/Line.d.ts +1 -1
  127. package/SVG/Line.js +16 -39
  128. package/SVG/Line.js.map +1 -1
  129. package/SVG/LinearGradient.d.ts +1 -4
  130. package/SVG/LinearGradient.js +11 -54
  131. package/SVG/LinearGradient.js.map +1 -1
  132. package/SVG/Path.d.ts +2 -2
  133. package/SVG/Path.js +10 -81
  134. package/SVG/Path.js.map +1 -1
  135. package/SVG/Pattern.d.ts +1 -9
  136. package/SVG/Pattern.js +7 -89
  137. package/SVG/Pattern.js.map +1 -1
  138. package/SVG/Polygon.d.ts +2 -2
  139. package/SVG/Polygon.js +10 -63
  140. package/SVG/Polygon.js.map +1 -1
  141. package/SVG/Polyline.d.ts +1 -1
  142. package/SVG/Polyline.js +10 -64
  143. package/SVG/Polyline.js.map +1 -1
  144. package/SVG/Rect.d.ts +1 -1
  145. package/SVG/Rect.js +11 -74
  146. package/SVG/Rect.js.map +1 -1
  147. package/SVG/SVG.d.ts +23 -9
  148. package/SVG/SVG.js +162 -55
  149. package/SVG/SVG.js.map +1 -1
  150. package/SVG/SVGItem.d.ts +2 -19
  151. package/SVG/SVGItem.js +6 -191
  152. package/SVG/SVGItem.js.map +1 -1
  153. package/SVG/Stop.d.ts +1 -2
  154. package/SVG/Stop.js +7 -32
  155. package/SVG/Stop.js.map +1 -1
  156. package/SVG/Symbol.d.ts +1 -4
  157. package/SVG/Symbol.js +7 -18
  158. package/SVG/Symbol.js.map +1 -1
  159. package/SVG/Text.d.ts +6 -5
  160. package/SVG/Text.js +18 -19
  161. package/SVG/Text.js.map +1 -1
  162. package/SVG/Use.d.ts +1 -10
  163. package/SVG/Use.js +7 -96
  164. package/SVG/Use.js.map +1 -1
  165. package/SVG/index.js +18 -40
  166. package/SVG/index.js.map +1 -1
  167. package/TextDecoder/TextDecoder.android.d.ts +2 -1
  168. package/TextDecoder/TextDecoder.android.js +39 -40
  169. package/TextDecoder/TextDecoder.android.js.map +1 -1
  170. package/TextDecoder/TextDecoder.ios.d.ts +1 -1
  171. package/TextDecoder/TextDecoder.ios.js +23 -36
  172. package/TextDecoder/TextDecoder.ios.js.map +1 -1
  173. package/TextDecoder/common.d.ts +4 -4
  174. package/TextDecoder/common.js +6 -17
  175. package/TextDecoder/common.js.map +1 -1
  176. package/TextDecoder/index.js +2 -7
  177. package/TextDecoder/index.js.map +1 -1
  178. package/TextEncoder/TextEncoder.android.d.ts +1 -1
  179. package/TextEncoder/TextEncoder.android.js +11 -21
  180. package/TextEncoder/TextEncoder.android.js.map +1 -1
  181. package/TextEncoder/TextEncoder.ios.d.ts +1 -1
  182. package/TextEncoder/TextEncoder.ios.js +11 -21
  183. package/TextEncoder/TextEncoder.ios.js.map +1 -1
  184. package/TextEncoder/common.d.ts +4 -4
  185. package/TextEncoder/common.js +6 -17
  186. package/TextEncoder/common.js.map +1 -1
  187. package/TextEncoder/index.js +2 -7
  188. package/TextEncoder/index.js.map +1 -1
  189. package/WebGL/WebGLActiveInfo.js +8 -10
  190. package/WebGL/WebGLActiveInfo.js.map +1 -1
  191. package/WebGL/WebGLBuffer.d.ts +1 -1
  192. package/WebGL/WebGLBuffer.js +11 -17
  193. package/WebGL/WebGLBuffer.js.map +1 -1
  194. package/WebGL/WebGLExtensions/index.android.js +137 -190
  195. package/WebGL/WebGLExtensions/index.android.js.map +1 -1
  196. package/WebGL/WebGLExtensions/index.ios.js +110 -163
  197. package/WebGL/WebGLExtensions/index.ios.js.map +1 -1
  198. package/WebGL/WebGLFramebuffer.d.ts +1 -1
  199. package/WebGL/WebGLFramebuffer.js +11 -17
  200. package/WebGL/WebGLFramebuffer.js.map +1 -1
  201. package/WebGL/WebGLProgram.d.ts +1 -1
  202. package/WebGL/WebGLProgram.js +11 -17
  203. package/WebGL/WebGLProgram.js.map +1 -1
  204. package/WebGL/WebGLRenderbuffer.d.ts +1 -1
  205. package/WebGL/WebGLRenderbuffer.js +11 -17
  206. package/WebGL/WebGLRenderbuffer.js.map +1 -1
  207. package/WebGL/WebGLRenderingContext/common.d.ts +301 -301
  208. package/WebGL/WebGLRenderingContext/common.js +940 -2140
  209. package/WebGL/WebGLRenderingContext/common.js.map +1 -1
  210. package/WebGL/WebGLRenderingContext/index.android.d.ts +10 -5
  211. package/WebGL/WebGLRenderingContext/index.android.js +1014 -587
  212. package/WebGL/WebGLRenderingContext/index.android.js.map +1 -1
  213. package/WebGL/WebGLRenderingContext/index.d.ts +2 -0
  214. package/WebGL/WebGLRenderingContext/index.ios.d.ts +3 -3
  215. package/WebGL/WebGLRenderingContext/index.ios.js +502 -573
  216. package/WebGL/WebGLRenderingContext/index.ios.js.map +1 -1
  217. package/WebGL/WebGLShader.d.ts +1 -1
  218. package/WebGL/WebGLShader.js +11 -17
  219. package/WebGL/WebGLShader.js.map +1 -1
  220. package/WebGL/WebGLShaderPrecisionFormat.js +8 -10
  221. package/WebGL/WebGLShaderPrecisionFormat.js.map +1 -1
  222. package/WebGL/WebGLTexture.d.ts +1 -1
  223. package/WebGL/WebGLTexture.js +11 -17
  224. package/WebGL/WebGLTexture.js.map +1 -1
  225. package/WebGL/WebGLUniformLocation.d.ts +1 -1
  226. package/WebGL/WebGLUniformLocation.js +11 -17
  227. package/WebGL/WebGLUniformLocation.js.map +1 -1
  228. package/WebGL/index.js +9 -14
  229. package/WebGL/index.js.map +1 -1
  230. package/WebGL2/WebGL2RenderingContext/common.d.ts +265 -265
  231. package/WebGL2/WebGL2RenderingContext/common.js +817 -1885
  232. package/WebGL2/WebGL2RenderingContext/common.js.map +1 -1
  233. package/WebGL2/WebGL2RenderingContext/index.android.d.ts +4 -1
  234. package/WebGL2/WebGL2RenderingContext/index.android.js +359 -293
  235. package/WebGL2/WebGL2RenderingContext/index.android.js.map +1 -1
  236. package/WebGL2/WebGL2RenderingContext/index.ios.d.ts +3 -1
  237. package/WebGL2/WebGL2RenderingContext/index.ios.js +289 -260
  238. package/WebGL2/WebGL2RenderingContext/index.ios.js.map +1 -1
  239. package/WebGL2/WebGLQuery.d.ts +1 -1
  240. package/WebGL2/WebGLQuery.js +11 -17
  241. package/WebGL2/WebGLQuery.js.map +1 -1
  242. package/WebGL2/WebGLSampler.d.ts +1 -1
  243. package/WebGL2/WebGLSampler.js +11 -17
  244. package/WebGL2/WebGLSampler.js.map +1 -1
  245. package/WebGL2/WebGLSync.d.ts +1 -1
  246. package/WebGL2/WebGLSync.js +11 -17
  247. package/WebGL2/WebGLSync.js.map +1 -1
  248. package/WebGL2/WebGLTransformFeedback.d.ts +1 -1
  249. package/WebGL2/WebGLTransformFeedback.js +11 -17
  250. package/WebGL2/WebGLTransformFeedback.js.map +1 -1
  251. package/WebGL2/WebGLVertexArrayObject.d.ts +1 -1
  252. package/WebGL2/WebGLVertexArrayObject.js +11 -17
  253. package/WebGL2/WebGLVertexArrayObject.js.map +1 -1
  254. package/WebGL2/index.js +5 -10
  255. package/WebGL2/index.js.map +1 -1
  256. package/angular/bundles/nativescript-canvas-angular.umd.js +29 -0
  257. package/angular/bundles/nativescript-canvas-angular.umd.js.map +1 -0
  258. package/angular/esm2015/index.js +12 -0
  259. package/angular/esm2015/nativescript-canvas-angular.js +5 -0
  260. package/angular/fesm2015/nativescript-canvas-angular.js +19 -0
  261. package/angular/fesm2015/nativescript-canvas-angular.js.map +1 -0
  262. package/angular/nativescript-canvas-angular.d.ts +4 -0
  263. package/angular/nativescript-canvas-angular.metadata.json +1 -0
  264. package/angular/package.json +14 -0
  265. package/common.js +4 -12
  266. package/common.js.map +1 -1
  267. package/index.d.ts +2 -2
  268. package/index.js +56 -28
  269. package/index.js.map +1 -1
  270. package/package.json +10 -6
  271. package/platforms/android/include.gradle +22 -1
  272. package/platforms/ios/Podfile +2 -4
  273. package/react/index.js +2 -4
  274. package/react/index.js.map +1 -1
  275. package/svelte/index.js +2 -4
  276. package/svelte/index.js.map +1 -1
  277. package/utils.d.ts +4 -0
  278. package/utils.js +46 -22
  279. package/utils.js.map +1 -1
  280. package/vue/index.d.ts +4 -0
  281. package/vue/index.js +6 -0
  282. package/vue/index.js.map +1 -0
  283. package/Canvas/common.metadata.json +0 -1
  284. package/Canvas/index.android.metadata.json +0 -1
  285. package/Canvas/index.ios.metadata.json +0 -1
  286. package/Canvas2D/CanvasGradient/CanvasGradient.android.metadata.json +0 -1
  287. package/Canvas2D/CanvasGradient/CanvasGradient.ios.metadata.json +0 -1
  288. package/Canvas2D/CanvasGradient/common.metadata.json +0 -1
  289. package/Canvas2D/CanvasGradient/index.metadata.json +0 -1
  290. package/Canvas2D/CanvasPattern/CanvasPattern.android.metadata.json +0 -1
  291. package/Canvas2D/CanvasPattern/CanvasPattern.ios.metadata.json +0 -1
  292. package/Canvas2D/CanvasPattern/common.metadata.json +0 -1
  293. package/Canvas2D/CanvasPattern/index.metadata.json +0 -1
  294. package/Canvas2D/CanvasRenderingContext2D/common.metadata.json +0 -1
  295. package/Canvas2D/CanvasRenderingContext2D/index.android.metadata.json +0 -1
  296. package/Canvas2D/CanvasRenderingContext2D/index.ios.metadata.json +0 -1
  297. package/Canvas2D/DOMMatrix/DOMMatrix.android.metadata.json +0 -1
  298. package/Canvas2D/DOMMatrix/DOMMatrix.ios.metadata.json +0 -1
  299. package/Canvas2D/DOMMatrix/common.metadata.json +0 -1
  300. package/Canvas2D/DOMMatrix/index.metadata.json +0 -1
  301. package/Canvas2D/ImageData/ImageData.android.metadata.json +0 -1
  302. package/Canvas2D/ImageData/ImageData.ios.metadata.json +0 -1
  303. package/Canvas2D/ImageData/common.metadata.json +0 -1
  304. package/Canvas2D/ImageData/index.metadata.json +0 -1
  305. package/Canvas2D/Path2D/Path2D.android.metadata.json +0 -1
  306. package/Canvas2D/Path2D/Path2D.ios.metadata.json +0 -1
  307. package/Canvas2D/Path2D/common.metadata.json +0 -1
  308. package/Canvas2D/Path2D/index.metadata.json +0 -1
  309. package/Canvas2D/TextMetrics/TextMetrics.android.metadata.json +0 -1
  310. package/Canvas2D/TextMetrics/TextMetrics.ios.metadata.json +0 -1
  311. package/Canvas2D/TextMetrics/common.metadata.json +0 -1
  312. package/Canvas2D/TextMetrics/index.metadata.json +0 -1
  313. package/Canvas2D/index.metadata.json +0 -1
  314. package/ImageAsset/ImageAsset.android.metadata.json +0 -1
  315. package/ImageAsset/ImageAsset.ios.metadata.json +0 -1
  316. package/ImageAsset/common.metadata.json +0 -1
  317. package/ImageAsset/index.metadata.json +0 -1
  318. package/SVG/Circle.metadata.json +0 -1
  319. package/SVG/ClipPath.metadata.json +0 -1
  320. package/SVG/Defs.metadata.json +0 -1
  321. package/SVG/Ellipse.metadata.json +0 -1
  322. package/SVG/G.metadata.json +0 -1
  323. package/SVG/Image.metadata.json +0 -1
  324. package/SVG/Line.metadata.json +0 -1
  325. package/SVG/LinearGradient.metadata.json +0 -1
  326. package/SVG/Path.metadata.json +0 -1
  327. package/SVG/Pattern.metadata.json +0 -1
  328. package/SVG/Polygon.metadata.json +0 -1
  329. package/SVG/Polyline.metadata.json +0 -1
  330. package/SVG/Rect.metadata.json +0 -1
  331. package/SVG/SVG.metadata.json +0 -1
  332. package/SVG/SVGItem.metadata.json +0 -1
  333. package/SVG/Stop.metadata.json +0 -1
  334. package/SVG/Symbol.metadata.json +0 -1
  335. package/SVG/Text.metadata.json +0 -1
  336. package/SVG/Use.metadata.json +0 -1
  337. package/SVG/index.metadata.json +0 -1
  338. package/TextDecoder/TextDecoder.android.metadata.json +0 -1
  339. package/TextDecoder/TextDecoder.ios.metadata.json +0 -1
  340. package/TextDecoder/common.metadata.json +0 -1
  341. package/TextDecoder/index.metadata.json +0 -1
  342. package/TextEncoder/TextEncoder.android.metadata.json +0 -1
  343. package/TextEncoder/TextEncoder.ios.metadata.json +0 -1
  344. package/TextEncoder/common.metadata.json +0 -1
  345. package/TextEncoder/index.metadata.json +0 -1
  346. package/WebGL/WebGLActiveInfo.metadata.json +0 -1
  347. package/WebGL/WebGLBuffer.metadata.json +0 -1
  348. package/WebGL/WebGLExtensions/index.android.metadata.json +0 -1
  349. package/WebGL/WebGLExtensions/index.ios.metadata.json +0 -1
  350. package/WebGL/WebGLFramebuffer.metadata.json +0 -1
  351. package/WebGL/WebGLProgram.metadata.json +0 -1
  352. package/WebGL/WebGLRenderbuffer.metadata.json +0 -1
  353. package/WebGL/WebGLRenderingContext/common.metadata.json +0 -1
  354. package/WebGL/WebGLRenderingContext/index.android.metadata.json +0 -1
  355. package/WebGL/WebGLRenderingContext/index.ios.metadata.json +0 -1
  356. package/WebGL/WebGLShader.metadata.json +0 -1
  357. package/WebGL/WebGLShaderPrecisionFormat.metadata.json +0 -1
  358. package/WebGL/WebGLTexture.metadata.json +0 -1
  359. package/WebGL/WebGLUniformLocation.metadata.json +0 -1
  360. package/WebGL/index.metadata.json +0 -1
  361. package/WebGL2/WebGL2RenderingContext/common.metadata.json +0 -1
  362. package/WebGL2/WebGL2RenderingContext/index.android.metadata.json +0 -1
  363. package/WebGL2/WebGL2RenderingContext/index.ios.metadata.json +0 -1
  364. package/WebGL2/WebGLQuery.metadata.json +0 -1
  365. package/WebGL2/WebGLSampler.metadata.json +0 -1
  366. package/WebGL2/WebGLSync.metadata.json +0 -1
  367. package/WebGL2/WebGLTransformFeedback.metadata.json +0 -1
  368. package/WebGL2/WebGLVertexArrayObject.metadata.json +0 -1
  369. package/WebGL2/index.metadata.json +0 -1
  370. package/angular/index.js +0 -19
  371. package/angular/index.js.map +0 -1
  372. package/angular/index.metadata.json +0 -1
  373. package/common.metadata.json +0 -1
  374. package/index.metadata.json +0 -1
  375. package/react/index.metadata.json +0 -1
  376. package/utils.metadata.json +0 -1
@@ -1,91 +1,87 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var WebGLQuery_1 = require("../WebGLQuery");
4
- var WebGLSampler_1 = require("../WebGLSampler");
5
- var WebGLTransformFeedback_1 = require("../WebGLTransformFeedback");
6
- var WebGLVertexArrayObject_1 = require("../WebGLVertexArrayObject");
7
- var WebGLActiveInfo_1 = require("../../WebGL/WebGLActiveInfo");
8
- var WebGLBuffer_1 = require("../../WebGL/WebGLBuffer");
9
- var core_1 = require("@nativescript/core");
10
- var ImageAsset_1 = require("../../ImageAsset");
11
- var common_1 = require("./common");
12
- var Canvas_1 = require("../../Canvas");
13
- var WebGL2RenderingContext = /** @class */ (function (_super) {
14
- __extends(WebGL2RenderingContext, _super);
15
- function WebGL2RenderingContext(context) {
16
- return _super.call(this, context) || this;
17
- }
18
- WebGL2RenderingContext.prototype.beginQuery = function (target, query) {
1
+ import { WebGLQuery } from '../WebGLQuery';
2
+ import { WebGLSampler } from '../WebGLSampler';
3
+ import { WebGLTransformFeedback } from '../WebGLTransformFeedback';
4
+ import { WebGLVertexArrayObject } from '../WebGLVertexArrayObject';
5
+ import { WebGLFramebuffer } from '../../WebGL/WebGLFramebuffer';
6
+ import { WebGLActiveInfo } from '../../WebGL/WebGLActiveInfo';
7
+ import { WebGLBuffer } from '../../WebGL/WebGLBuffer';
8
+ import { ImageSource } from '@nativescript/core';
9
+ import { ImageAsset } from '../../ImageAsset';
10
+ import { WebGL2RenderingContextBase } from "./common";
11
+ import { Canvas } from '../../Canvas';
12
+ import { ImageBitmap } from '../../ImageBitmap';
13
+ export class WebGL2RenderingContext extends WebGL2RenderingContextBase {
14
+ constructor(context) {
15
+ super(context);
16
+ }
17
+ beginQuery(target, query) {
19
18
  this._glCheckError('beginQuery');
20
- var value = query ? query.native : 0;
19
+ const value = query ? query.native : 0;
21
20
  this.native.beginQuery(target, value);
22
- };
23
- WebGL2RenderingContext.prototype.beginTransformFeedback = function (primitiveMode) {
21
+ }
22
+ beginTransformFeedback(primitiveMode) {
24
23
  this._glCheckError('beginTransformFeedback');
25
24
  this.native.beginTransformFeedback(primitiveMode);
26
- };
27
- WebGL2RenderingContext.prototype.bindBufferBase = function (target, index, buffer) {
25
+ }
26
+ bindBufferBase(target, index, buffer) {
28
27
  this._glCheckError('bindBufferBase');
29
- var value = buffer ? buffer.native : 0;
28
+ const value = buffer ? buffer.native : 0;
30
29
  this.native.bindBufferBase(target, index, value);
31
- };
32
- WebGL2RenderingContext.prototype.bindBufferRange = function (target, index, buffer, offset, size) {
30
+ }
31
+ bindBufferRange(target, index, buffer, offset, size) {
33
32
  this._glCheckError('bindBufferRange');
34
- var value = buffer ? buffer.native : 0;
33
+ const value = buffer ? buffer.native : 0;
35
34
  this.native.bindBufferRange(target, index, value, offset, size);
36
- };
37
- WebGL2RenderingContext.prototype.bindSampler = function (unit, sampler) {
35
+ }
36
+ bindSampler(unit, sampler) {
38
37
  this._glCheckError('bindSampler');
39
- var value = sampler ? sampler.native : 0;
38
+ const value = sampler ? sampler.native : 0;
40
39
  this.native.bindSampler(unit, value);
41
- };
42
- WebGL2RenderingContext.prototype.bindTransformFeedback = function (target, transformFeedback) {
40
+ }
41
+ bindTransformFeedback(target, transformFeedback) {
43
42
  this._glCheckError('bindTransformFeedback');
44
- var value = transformFeedback ? transformFeedback.native : 0;
43
+ const value = transformFeedback ? transformFeedback.native : 0;
45
44
  this.native.bindTransformFeedback(target, value);
46
- };
47
- WebGL2RenderingContext.prototype.bindVertexArray = function (vertexArray) {
45
+ }
46
+ bindVertexArray(vertexArray) {
48
47
  this._glCheckError('bindVertexArray');
49
- var value = vertexArray ? vertexArray.native : 0;
48
+ const value = vertexArray ? vertexArray.native : 0;
50
49
  this.native.bindVertexArray(value);
51
- };
52
- WebGL2RenderingContext.prototype.blitFramebuffer = function (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) {
50
+ }
51
+ blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) {
53
52
  this._glCheckError('blitFramebuffer');
54
53
  this.native.blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
55
- };
56
- WebGL2RenderingContext.prototype.clearBufferfi = function (buffer, drawbuffer, depth, stencil) {
54
+ }
55
+ clearBufferfi(buffer, drawbuffer, depth, stencil) {
57
56
  this._glCheckError('clearBufferfi');
58
57
  this.native.clearBufferfi(buffer.native, drawbuffer, depth, stencil);
59
- };
60
- WebGL2RenderingContext.prototype.clearBufferfv = function (buffer, drawbuffer, values) {
58
+ }
59
+ clearBufferfv(buffer, drawbuffer, values) {
61
60
  this._glCheckError('clearBufferfv');
62
- this.native.clearBufferfv(buffer.native, drawbuffer, Array.from(values));
63
- };
64
- WebGL2RenderingContext.prototype.clearBufferiv = function (buffer, drawbuffer, values) {
65
- this._glCheckError('clearBufferiv');
66
- if (values instanceof Int32Array) {
67
- this.native.clearBufferiv(buffer.native, drawbuffer, Array.from(values));
61
+ if (!(values instanceof Float32Array)) {
62
+ values = new Float32Array(values);
68
63
  }
69
- else {
70
- this.native.clearBufferiv(buffer.native, drawbuffer, values);
64
+ this.native.clearBufferfvOffset(buffer.native, drawbuffer, values, values.byteOffset);
65
+ }
66
+ clearBufferiv(buffer, drawbuffer, values) {
67
+ this._glCheckError('clearBufferiv');
68
+ if (!(values instanceof Int32Array)) {
69
+ values = new Int32Array(values);
71
70
  }
72
- };
73
- WebGL2RenderingContext.prototype.clearBufferuiv = function (buffer, drawbuffer, values) {
71
+ this.native.clearBufferivOffset(buffer.native, drawbuffer, values, values.byteOffset);
72
+ }
73
+ clearBufferuiv(buffer, drawbuffer, values) {
74
74
  this._glCheckError('clearBufferuiv');
75
- if (values instanceof Uint32Array) {
76
- this.native.clearBufferuiv(buffer.native, drawbuffer, Array.from(values));
77
- }
78
- else {
79
- this.native.clearBufferuiv(buffer.native, drawbuffer, values);
75
+ if (!(values instanceof Uint32Array)) {
76
+ values = new Uint32Array(values);
80
77
  }
81
- };
82
- WebGL2RenderingContext.prototype.clientWaitSync = function (sync, flags, timeout) {
78
+ this.native.clearBufferuivOffset(buffer.native, drawbuffer, values, values.byteOffset);
79
+ }
80
+ clientWaitSync(sync, flags, timeout) {
83
81
  this._glCheckError('clientWaitSync');
84
82
  return this.native.clientWaitSync(sync.native, flags, timeout);
85
- };
86
- WebGL2RenderingContext.prototype.compressedTexSubImage3D = function (target, level, xoffset, yoffset, zoffset, width, height, depth, format, srcData, srcOffset, srcLengthOverride) {
87
- if (srcOffset === void 0) { srcOffset = 0; }
88
- if (srcLengthOverride === void 0) { srcLengthOverride = 0; }
83
+ }
84
+ compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, srcData, srcOffset = 0, srcLengthOverride = 0) {
89
85
  this._glCheckError('compressedTexSubImage3D');
90
86
  if (typeof srcOffset === 'number') {
91
87
  this.native.compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, srcData, srcOffset);
@@ -119,234 +115,258 @@ var WebGL2RenderingContext = /** @class */ (function (_super) {
119
115
  this.native.compressedTexSubImage3DF64(target, level, xoffset, yoffset, zoffset, width, height, depth, format, Array.from(srcData), srcOffset, srcLengthOverride);
120
116
  }
121
117
  }
122
- };
118
+ }
123
119
  /* Transform feedback */
124
120
  /* Framebuffers and renderbuffers */
125
- WebGL2RenderingContext.prototype.copyBufferSubData = function (readTarget, writeTarget, readOffset, writeOffset, size) {
121
+ copyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size) {
126
122
  this._glCheckError('copyBufferSubData');
127
123
  this.native.copyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
128
- };
129
- WebGL2RenderingContext.prototype.copyTexSubImage3D = function (target, level, xoffset, yoffset, zoffset, x, y, width, height) {
124
+ }
125
+ copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height) {
130
126
  this._glCheckError('copyTexSubImage3D');
131
127
  this.native.copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
132
- };
133
- WebGL2RenderingContext.prototype.createQuery = function () {
128
+ }
129
+ createQuery() {
134
130
  this._glCheckError('createQuery');
135
- return new WebGLQuery_1.WebGLQuery(this.native.createQuery());
136
- };
137
- WebGL2RenderingContext.prototype.createSampler = function () {
131
+ return new WebGLQuery(this.native.createQuery());
132
+ }
133
+ createSampler() {
138
134
  this._glCheckError('createSampler');
139
- return new WebGLSampler_1.WebGLSampler(this.native.createSampler());
140
- };
141
- WebGL2RenderingContext.prototype.createTransformFeedback = function () {
135
+ return new WebGLSampler(this.native.createSampler());
136
+ }
137
+ createTransformFeedback() {
142
138
  this._glCheckError('createTransformFeedback');
143
- return new WebGLTransformFeedback_1.WebGLTransformFeedback(this.native.createTransformFeedback());
144
- };
145
- WebGL2RenderingContext.prototype.createVertexArray = function () {
139
+ return new WebGLTransformFeedback(this.native.createTransformFeedback());
140
+ }
141
+ createVertexArray() {
146
142
  this._glCheckError('createVertexArray');
147
- return new WebGLVertexArrayObject_1.WebGLVertexArrayObject(this.native.createVertexArray());
148
- };
149
- WebGL2RenderingContext.prototype.deleteQuery = function (query) {
143
+ return new WebGLVertexArrayObject(this.native.createVertexArray());
144
+ }
145
+ deleteQuery(query) {
150
146
  this._glCheckError('deleteQueryWithQuery');
151
147
  this.native.deleteQuery(query.native);
152
- };
153
- WebGL2RenderingContext.prototype.deleteSampler = function (sampler) {
148
+ }
149
+ deleteSampler(sampler) {
154
150
  this._glCheckError('deleteSamplerWithSampler');
155
151
  this.native.deleteSampler(sampler.native);
156
- };
157
- WebGL2RenderingContext.prototype.deleteSync = function (sync) {
152
+ }
153
+ deleteSync(sync) {
158
154
  this._glCheckError('deleteSyncWithSync');
159
155
  this.native.deleteSync(sync.native);
160
- };
161
- WebGL2RenderingContext.prototype.deleteTransformFeedback = function (transformFeedback) {
156
+ }
157
+ deleteTransformFeedback(transformFeedback) {
162
158
  this._glCheckError('deleteTransformFeedback');
163
159
  this.native.deleteTransformFeedback(transformFeedback.native);
164
- };
165
- WebGL2RenderingContext.prototype.deleteVertexArray = function (vertexArray) {
160
+ }
161
+ deleteVertexArray(vertexArray) {
166
162
  this._glCheckError('deleteVertexArray');
167
163
  this.native.deleteVertexArray(vertexArray.native);
168
- };
169
- WebGL2RenderingContext.prototype.drawArraysInstanced = function (mode, first, count, instanceCount) {
164
+ }
165
+ drawArraysInstanced(mode, first, count, instanceCount) {
170
166
  this._glCheckError('drawArraysInstanced');
171
167
  this.native.drawArraysInstanced(mode, first, count, instanceCount);
172
- };
173
- WebGL2RenderingContext.prototype.drawBuffers = function (buffers) {
168
+ }
169
+ drawBuffers(buffers) {
174
170
  this._glCheckError('drawBuffers');
175
171
  this.native.drawBuffers(buffers);
176
- };
177
- WebGL2RenderingContext.prototype.drawElementsInstanced = function (mode, count, type, offset, instanceCount) {
172
+ }
173
+ drawElementsInstanced(mode, count, type, offset, instanceCount) {
178
174
  this._glCheckError('drawElementsInstanced');
179
175
  this.native.drawElementsInstanced(mode, count, type, offset, instanceCount);
180
- };
181
- WebGL2RenderingContext.prototype.drawRangeElements = function (mode, start, end, count, type, offset) {
176
+ }
177
+ drawRangeElements(mode, start, end, count, type, offset) {
182
178
  this._glCheckError('drawRangeElements');
183
179
  this.native.drawRangeElements(mode, start, end, count, type, offset);
184
- };
185
- WebGL2RenderingContext.prototype.endQuery = function (target) {
180
+ }
181
+ endQuery(target) {
186
182
  this._glCheckError('endQuery');
187
183
  this.native.endQuery(target);
188
- };
189
- WebGL2RenderingContext.prototype.endTransformFeedback = function () {
184
+ }
185
+ endTransformFeedback() {
190
186
  this._glCheckError('endTransformFeedback');
191
187
  this.native.endTransformFeedback();
192
- };
193
- WebGL2RenderingContext.prototype.fenceSync = function (condition, flags) {
188
+ }
189
+ fenceSync(condition, flags) {
194
190
  this._glCheckError('fenceSync');
195
191
  this.native.fenceSync(condition, flags);
196
- };
197
- WebGL2RenderingContext.prototype.framebufferTextureLayer = function (target, attachment, texture, level, layer) {
192
+ }
193
+ framebufferTextureLayer(target, attachment, texture, level, layer) {
198
194
  this._glCheckError('framebufferTextureLayer');
199
195
  this.native.framebufferTextureLayer(target, attachment, texture.native, level, layer);
200
- };
196
+ }
201
197
  /* Framebuffers and renderbuffers */
202
198
  /* Uniforms */
203
- WebGL2RenderingContext.prototype.getActiveUniformBlockName = function (program, uniformBlockIndex) {
199
+ getActiveUniformBlockName(program, uniformBlockIndex) {
204
200
  this._glCheckError('getActiveUniformBlockName');
205
201
  return this.native.getActiveUniformBlockName(program.native, uniformBlockIndex);
206
- };
207
- WebGL2RenderingContext.prototype.getActiveUniformBlockParameter = function (program, uniformBlockIndex, pname) {
202
+ }
203
+ getActiveUniformBlockParameter(program, uniformBlockIndex, pname) {
208
204
  this._glCheckError('getActiveUniformBlockParameter');
209
- var param = this.native.getActiveUniformBlockParameter(program.native, uniformBlockIndex, pname);
205
+ const param = this.native.getActiveUniformBlockParameter(program.native, uniformBlockIndex, pname);
210
206
  if (pname === this.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) {
211
207
  return new Uint32Array(this.getJSArray(param));
212
208
  }
213
209
  return param;
214
- };
215
- WebGL2RenderingContext.prototype.getActiveUniforms = function (program, uniformIndices, pname) {
210
+ }
211
+ getActiveUniforms(program, uniformIndices, pname) {
216
212
  this._glCheckError('getActiveUniforms');
217
213
  return this.getJSArray(this.native.getActiveUniforms(program.native, uniformIndices, pname));
218
- };
219
- WebGL2RenderingContext.prototype.getBufferSubData = function (target, srcByteOffset, dstData, dstOffset, length) {
220
- if (dstOffset === void 0) { dstOffset = 0; }
221
- if (length === void 0) { length = 0; }
214
+ }
215
+ getBufferSubData(target, srcByteOffset, dstData, dstOffset = 0, length = 0) {
222
216
  this._glCheckError('getBufferSubData');
223
217
  if (dstData instanceof ArrayBuffer) {
224
- this.native.getBufferSubData(target, srcByteOffset, NSData.dataWithData(dstData), dstOffset, length);
218
+ this.native.getBufferSubDataSize(target, srcByteOffset, dstData, dstData.byteLength, dstOffset, length);
225
219
  }
226
- };
227
- WebGL2RenderingContext.prototype.getFragDataLocation = function (program, name) {
220
+ }
221
+ getFragDataLocation(program, name) {
228
222
  this._glCheckError('getFragDataLocation');
229
- var result = this.native.getFragDataLocation(program.native, name);
223
+ const result = this.native.getFragDataLocation(program.native, name);
230
224
  return result !== -1 ? result : null;
231
- };
232
- WebGL2RenderingContext.prototype.getIndexedParameter = function (target, index) {
225
+ }
226
+ getIndexedParameter(target, index) {
233
227
  this._glCheckError('getIndexedParameter');
234
- var param = this.native.getIndexedParameter(target, index);
228
+ const param = this.native.getIndexedParameter(target, index);
235
229
  if (target === this.TRANSFORM_FEEDBACK_BUFFER_BINDING || target === this.UNIFORM_BUFFER_BINDING) {
236
- return new WebGLBuffer_1.WebGLBuffer(param);
230
+ return new WebGLBuffer(param);
237
231
  }
238
232
  return param;
239
- };
240
- WebGL2RenderingContext.prototype.getInternalformatParameter = function (target, internalformat, pname) {
233
+ }
234
+ getInternalformatParameter(target, internalformat, pname) {
241
235
  this._glCheckError('getInternalformatParameter');
242
- var param = this.native.getInternalformatParameter(target, internalformat, pname);
236
+ const param = this.native.getInternalformatParameter(target, internalformat, pname);
243
237
  if (pname === this.SAMPLES) {
244
238
  return new Int32Array(this.getJSArray(param));
245
239
  }
246
240
  return param;
247
- };
248
- WebGL2RenderingContext.prototype.getQueryParameter = function (query, pname) {
241
+ }
242
+ getQueryParameter(query, pname) {
249
243
  this._glCheckError('getQueryParameter');
250
- var result = this.native.getQueryParameter(query.native, pname);
244
+ const result = this.native.getQueryParameter(query.native, pname);
251
245
  if (result === 0) {
252
246
  return null;
253
247
  }
254
248
  return result;
255
- };
256
- WebGL2RenderingContext.prototype.getQuery = function (target, pname) {
249
+ }
250
+ //@ts-ignore
251
+ getParameter(pname) {
252
+ this._glCheckError('getParameter');
253
+ this._checkArgs('getParameter', arguments);
254
+ const value = this.native.getParameter(pname);
255
+ switch (pname) {
256
+ case this.COPY_READ_BUFFER_BINDING:
257
+ case this.COPY_WRITE_BUFFER_BINDING:
258
+ if (value) {
259
+ new WebGLBuffer(value);
260
+ }
261
+ return null;
262
+ case this.DRAW_FRAMEBUFFER_BINDING:
263
+ if (value) {
264
+ return new WebGLFramebuffer(value);
265
+ }
266
+ return null;
267
+ default:
268
+ return super.getParameter(pname);
269
+ }
270
+ }
271
+ getQuery(target, pname) {
257
272
  this._glCheckError('getQuery');
258
- var query = this.native.getQuery(target, pname);
273
+ const query = this.native.getQuery(target, pname);
259
274
  if (query) {
260
- return new WebGLQuery_1.WebGLQuery(query);
275
+ return new WebGLQuery(query);
261
276
  }
262
277
  return null;
263
- };
264
- WebGL2RenderingContext.prototype.getSamplerParameter = function (sampler, pname) {
278
+ }
279
+ getSamplerParameter(sampler, pname) {
265
280
  this._glCheckError('getSamplerParameter');
266
281
  return this.native.getSamplerParameter(sampler.native, pname);
267
- };
268
- WebGL2RenderingContext.prototype.getSyncParameter = function (sync, pname) {
282
+ }
283
+ getSyncParameter(sync, pname) {
269
284
  this._glCheckError('getSyncParameter');
270
285
  return this.native.getSyncParameter(sync.native, pname);
271
- };
272
- WebGL2RenderingContext.prototype.getTransformFeedbackVarying = function (program, index) {
286
+ }
287
+ getTransformFeedbackVarying(program, index) {
273
288
  this._glCheckError('getTransformFeedbackVarying');
274
- var info = this.native.getTransformFeedbackVarying(program.native, index);
289
+ const info = this.native.getTransformFeedbackVarying(program.native, index);
275
290
  if (info) {
276
- return new WebGLActiveInfo_1.WebGLActiveInfo(info.name, info.size, info.size);
291
+ return new WebGLActiveInfo(info.name, info.size, info.size);
277
292
  }
278
293
  return null;
279
- };
280
- WebGL2RenderingContext.prototype.getUniformBlockIndex = function (program, uniformBlockName) {
294
+ }
295
+ getUniformBlockIndex(program, uniformBlockName) {
281
296
  this._glCheckError('getUniformBlockIndex');
282
297
  return this.native.getUniformBlockIndex(program.native, uniformBlockName);
283
- };
284
- WebGL2RenderingContext.prototype.getUniformIndices = function (program, uniformNames) {
298
+ }
299
+ getUniformIndices(program, uniformNames) {
285
300
  this._glCheckError('getUniformIndices');
286
301
  return this.getJSArray(this.native.getUniformIndices(program.native, uniformNames));
287
- };
288
- WebGL2RenderingContext.prototype.invalidateFramebuffer = function (target, attachments) {
302
+ }
303
+ invalidateFramebuffer(target, attachments) {
289
304
  this._glCheckError('invalidateFramebuffer');
290
305
  this.native.invalidateFramebuffer(target, attachments);
291
- };
292
- WebGL2RenderingContext.prototype.invalidateSubFramebuffer = function (target, attachments, x, y, width, height) {
306
+ }
307
+ invalidateSubFramebuffer(target, attachments, x, y, width, height) {
293
308
  this._glCheckError('invalidateSubFramebuffer');
294
309
  this.native.invalidateSubFramebuffer(target, attachments, x, y, width, height);
295
- };
296
- WebGL2RenderingContext.prototype.isQuery = function (query) {
310
+ }
311
+ isQuery(query) {
297
312
  this._glCheckError('isQuery');
298
313
  return this.native.isQuery(query.native);
299
- };
300
- WebGL2RenderingContext.prototype.isSampler = function (sampler) {
314
+ }
315
+ isSampler(sampler) {
301
316
  this._glCheckError('isSampler');
302
317
  return this.native.isSampler(sampler.native);
303
- };
304
- WebGL2RenderingContext.prototype.isSync = function (sync) {
318
+ }
319
+ isSync(sync) {
305
320
  this._glCheckError('isSync');
306
321
  return this.native.isSync(sync.native);
307
- };
308
- WebGL2RenderingContext.prototype.isTransformFeedback = function (transformFeedback) {
322
+ }
323
+ isTransformFeedback(transformFeedback) {
309
324
  this._glCheckError('isTransformFeedback');
310
325
  return this.native.isTransformFeedback(transformFeedback.native);
311
- };
312
- WebGL2RenderingContext.prototype.isVertexArray = function (vertexArray) {
326
+ }
327
+ isVertexArray(vertexArray) {
313
328
  this._glCheckError('isVertexArray');
314
329
  return this.native.isVertexArray(vertexArray.native);
315
- };
316
- WebGL2RenderingContext.prototype.pauseTransformFeedback = function () {
330
+ }
331
+ pauseTransformFeedback() {
317
332
  this._glCheckError('pauseTransformFeedback');
318
333
  this.native.pauseTransformFeedback();
319
- };
320
- WebGL2RenderingContext.prototype.readBuffer = function (src) {
334
+ }
335
+ readBuffer(src) {
321
336
  this._glCheckError('readBuffer');
322
337
  this.native.readBuffer(src);
323
- };
324
- WebGL2RenderingContext.prototype.renderbufferStorageMultisample = function (target, samples, internalFormat, width, height) {
338
+ }
339
+ renderbufferStorageMultisample(target, samples, internalFormat, width, height) {
325
340
  this._glCheckError('renderbufferStorageMultisample');
326
341
  this.native.renderbufferStorageMultisample(target, samples, internalFormat, width, height);
327
- };
328
- WebGL2RenderingContext.prototype.resumeTransformFeedback = function () {
342
+ }
343
+ resumeTransformFeedback() {
329
344
  this._glCheckError('resumeTransformFeedback');
330
345
  this.native.resumeTransformFeedback();
331
- };
332
- WebGL2RenderingContext.prototype.samplerParameterf = function (sampler, pname, param) {
346
+ }
347
+ samplerParameterf(sampler, pname, param) {
333
348
  this._glCheckError('samplerParameterf');
334
349
  this.native.samplerParameterf(sampler.native, pname, param);
335
- };
350
+ }
336
351
  /* Uniforms */
337
352
  /* Sync objects */
338
- WebGL2RenderingContext.prototype.samplerParameteri = function (sampler, pname, param) {
353
+ samplerParameteri(sampler, pname, param) {
339
354
  this._glCheckError('samplerParameteri');
340
355
  this.native.samplerParameteri(sampler.native, pname, param);
341
- };
342
- WebGL2RenderingContext.prototype.texImage3D = function (target, level, internalformat, width, height, depth, border, format, type, source, srcOffset) {
343
- if (srcOffset === void 0) { srcOffset = 0; }
356
+ }
357
+ texImage3D(target, level, internalformat, width, height, depth, border, format, type, source, srcOffset = 0) {
344
358
  this._glCheckError('texImage3D');
345
359
  if (typeof source === 'number') {
346
360
  this.native.texImage3DOffset(target, level, internalformat, width, height, depth, border, format, type, source);
347
361
  }
348
362
  else if (source instanceof ArrayBuffer) {
349
- this.native.texImage3DU8(target, level, internalformat, width, height, depth, border, format, type, source, srcOffset);
363
+ const data = NSData.dataWithData(source);
364
+ if (data) {
365
+ this.native.texImage3DData(target, level, internalformat, width, height, depth, border, format, type, data, srcOffset);
366
+ }
367
+ else {
368
+ this.native.texImage3DU8(target, level, internalformat, width, height, depth, border, format, type, source, srcOffset);
369
+ }
350
370
  }
351
371
  else if (source && source.buffer) {
352
372
  if (source instanceof Int8Array) {
@@ -377,51 +397,59 @@ var WebGL2RenderingContext = /** @class */ (function (_super) {
377
397
  else if (source instanceof UIImage) {
378
398
  this.native.texImage3DSource(target, level, internalformat, width, height, depth, border, format, type, source);
379
399
  }
380
- else if (source instanceof core_1.ImageSource) {
400
+ else if (source instanceof ImageSource) {
381
401
  this.native.texImage3DSource(target, level, internalformat, width, height, depth, border, format, type, source.ios);
382
402
  }
383
- else if (source instanceof ImageAsset_1.ImageAsset) {
403
+ else if (source instanceof ImageAsset) {
384
404
  this.native.texImage3DAsset(target, level, internalformat, width, height, depth, border, format, type, source.native);
385
405
  }
406
+ else if (source instanceof ImageBitmap) {
407
+ this.native.texImage3DBitmap(target, level, internalformat, width, height, depth, border, format, type, source.native);
408
+ }
386
409
  else if (source &&
387
410
  typeof source.tagName === 'string' &&
388
411
  (source.tagName === 'IMG' || source.tagName === 'IMAGE')) {
389
- if (source._imageSource instanceof core_1.ImageSource) {
412
+ if (source._imageSource instanceof ImageSource) {
390
413
  this.native.texImage3DSource(target, level, internalformat, width, height, depth, border, format, type, source._imageSource.ios);
391
414
  }
392
415
  else if (source._image instanceof UIImage) {
393
416
  this.native.texImage3DSource(target, level, internalformat, width, height, depth, border, format, type, source._image);
394
417
  }
395
- else if (source._asset instanceof ImageAsset_1.ImageAsset) {
418
+ else if (source._asset instanceof ImageAsset) {
396
419
  this.native.texImage3DAsset(target, level, internalformat, width, height, depth, border, format, type, source._asset.native);
397
420
  }
398
421
  else if (typeof source.src === 'string') {
399
- var result = core_1.ImageSource.fromFileSync(source.src);
422
+ const result = ImageSource.fromFileSync(source.src);
400
423
  this.native.texImage3DSource(target, level, internalformat, width, height, depth, border, format, type, result ? result.ios : null);
401
424
  }
402
425
  }
403
426
  else if (source &&
404
427
  typeof source.tagName === 'string' &&
405
- source.tagName === 'CANVAS' && source._canvas instanceof Canvas_1.Canvas) {
428
+ source.tagName === 'CANVAS' && source._canvas instanceof Canvas) {
406
429
  this.native.texImage3DSource(target, level, internalformat, width, height, depth, border, format, type, source._canvas.ios);
407
430
  }
408
- };
409
- WebGL2RenderingContext.prototype.texStorage2D = function (target, levels, internalformat, width, height) {
431
+ }
432
+ texStorage2D(target, levels, internalformat, width, height) {
410
433
  this._glCheckError('texStorage2D');
411
434
  this.native.texStorage2D(target, levels, internalformat, width, height);
412
- };
413
- WebGL2RenderingContext.prototype.texStorage3D = function (target, levels, internalformat, width, height, depth) {
435
+ }
436
+ texStorage3D(target, levels, internalformat, width, height, depth) {
414
437
  this._glCheckError('texStorage3D');
415
438
  this.native.texStorage3D(target, levels, internalformat, width, height, depth);
416
- };
417
- WebGL2RenderingContext.prototype.texSubImage3D = function (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData, srcOffset) {
418
- if (srcOffset === void 0) { srcOffset = 0; }
439
+ }
440
+ texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData, srcOffset = 0) {
419
441
  this._glCheckError('texSubImage3D');
420
442
  if (typeof srcData === 'number') {
421
443
  this.native.texSubImage3DOffset(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData);
422
444
  }
423
445
  else if (srcData instanceof ArrayBuffer) {
424
- this.native.texSubImage3DU8(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData, srcOffset);
446
+ const data = NSData.dataWithData(srcData);
447
+ if (data) {
448
+ this.native.texSubImage3DData(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data, srcOffset);
449
+ }
450
+ else {
451
+ this.native.texSubImage3DU8(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData, srcOffset);
452
+ }
425
453
  }
426
454
  else if (srcData && srcData.buffer) {
427
455
  if (srcData instanceof Int8Array) {
@@ -452,128 +480,129 @@ var WebGL2RenderingContext = /** @class */ (function (_super) {
452
480
  else if (srcData instanceof UIImage) {
453
481
  this.native.texSubImage3DSrcData(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData);
454
482
  }
455
- else if (srcData instanceof core_1.ImageSource) {
483
+ else if (srcData instanceof ImageSource) {
456
484
  this.native.texSubImage3DSrcData(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData.ios);
457
485
  }
458
- else if (srcData instanceof ImageAsset_1.ImageAsset) {
486
+ else if (srcData instanceof ImageAsset) {
459
487
  this.native.texSubImage3DAsset(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData.native);
460
488
  }
489
+ else if (srcData instanceof ImageBitmap) {
490
+ this.native.texSubImage3DBitmap(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData.native);
491
+ }
461
492
  else if (srcData &&
462
493
  typeof srcData.tagName === 'string' &&
463
494
  (srcData.tagName === 'IMG' || srcData.tagName === 'IMAGE')) {
464
- if (srcData._imageSource instanceof core_1.ImageSource) {
495
+ if (srcData._imageSource instanceof ImageSource) {
465
496
  this.native.texSubImage3DSrcData(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData._imageSource.ios);
466
497
  }
467
498
  else if (srcData._image instanceof UIImage) {
468
499
  this.native.texSubImage3DSrcData(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData._image);
469
500
  }
470
- else if (srcData._asset instanceof ImageAsset_1.ImageAsset) {
501
+ else if (srcData._asset instanceof ImageAsset) {
471
502
  this.native.texSubImage3DAsset(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData._asset.native);
472
503
  }
473
504
  else if (typeof srcData.src === 'string') {
474
- var result = core_1.ImageSource.fromFileSync(srcData.src);
505
+ const result = ImageSource.fromFileSync(srcData.src);
475
506
  this.native.texSubImage3DSrcData(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, result ? result.ios : null);
476
507
  }
477
508
  }
478
509
  else if (srcData &&
479
510
  typeof srcData.tagName === 'string' &&
480
- srcData.tagName === 'CANVAS' && srcData._canvas instanceof Canvas_1.Canvas) {
511
+ srcData.tagName === 'CANVAS' && srcData._canvas instanceof Canvas) {
481
512
  this.native.texSubImage3DAsset(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData._canvas.ios);
482
513
  }
483
- };
484
- WebGL2RenderingContext.prototype.transformFeedbackVaryings = function (program, varyings, bufferMode) {
514
+ }
515
+ transformFeedbackVaryings(program, varyings, bufferMode) {
485
516
  this._glCheckError('transformFeedbackVaryings');
486
517
  this.native.transformFeedbackVaryings(program.native, varyings, bufferMode);
487
- };
488
- WebGL2RenderingContext.prototype.uniform1ui = function (location, v0) {
518
+ }
519
+ uniform1ui(location, v0) {
489
520
  this._glCheckError('uniform1ui');
490
521
  this.native.uniform1ui(location, v0);
491
- };
492
- WebGL2RenderingContext.prototype.uniform1uiv = function (location, data) {
522
+ }
523
+ uniform1uiv(location, data) {
493
524
  this._glCheckError('uniform1uiv');
494
- this.native.uniform1uiv(location, Array.from(data));
495
- };
496
- WebGL2RenderingContext.prototype.uniform2ui = function (location, v0, v1) {
525
+ this.native.uniform1uivOffset(location, data, data.length, data.byteOffset);
526
+ }
527
+ uniform2ui(location, v0, v1) {
497
528
  this._glCheckError('uniform2ui');
498
529
  this.native.uniform2ui(location, v0, v1);
499
- };
500
- WebGL2RenderingContext.prototype.uniform2uiv = function (location, data) {
530
+ }
531
+ uniform2uiv(location, data) {
501
532
  this._glCheckError('uniform2uiv');
502
- this.native.uniform2uiv(location, Array.from(data));
503
- };
533
+ this.native.uniform2uivOffset(location, data, data.length, data.byteOffset);
534
+ }
504
535
  /* Sync objects */
505
536
  /* Miscellaneous constants */
506
- WebGL2RenderingContext.prototype.uniform3ui = function (location, v0, v1, v2) {
537
+ uniform3ui(location, v0, v1, v2) {
507
538
  this._glCheckError('uniform3ui');
508
539
  this.native.uniform3ui(location, v0, v1, v2);
509
- };
510
- WebGL2RenderingContext.prototype.uniform3uiv = function (location, data) {
540
+ }
541
+ uniform3uiv(location, data) {
511
542
  this._glCheckError('uniform3uiv');
512
- this.native.uniform3uiv(location, Array.from(data));
513
- };
514
- WebGL2RenderingContext.prototype.uniform4ui = function (location, v0, v1, v2, v3) {
543
+ this.native.uniform3uivOffset(location, data, data.length, data.byteOffset);
544
+ }
545
+ uniform4ui(location, v0, v1, v2, v3) {
515
546
  this._glCheckError('uniform4ui');
516
547
  this.native.uniform4ui(location, v0, v1, v2, v3);
517
- };
518
- WebGL2RenderingContext.prototype.uniform4uiv = function (location, data) {
548
+ }
549
+ uniform4uiv(location, data) {
519
550
  this._glCheckError('uniform4uiv');
520
- this.native.uniform4uiv(location, Array.from(data));
521
- };
522
- WebGL2RenderingContext.prototype.uniformBlockBinding = function (program, uniformBlockIndex, uniformBlockBinding) {
551
+ this.native.uniform4uivOffset(location, data, data.length, data.byteOffset);
552
+ }
553
+ uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding) {
523
554
  this._glCheckError('uniformBlockBinding');
524
555
  this.native.uniformBlockBinding(program.native, uniformBlockIndex, uniformBlockBinding);
525
- };
526
- WebGL2RenderingContext.prototype.uniformMatrix2x3fv = function (location, transpose, data) {
556
+ }
557
+ uniformMatrix2x3fv(location, transpose, data) {
527
558
  this._glCheckError('uniformMatrix2x3fv');
528
- this.native.uniformMatrix2x3fv(location.native, transpose, Array.from(data));
529
- };
530
- WebGL2RenderingContext.prototype.uniformMatrix2x4fv = function (location, transpose, data) {
559
+ this.native.uniformMatrix2x3fvOffset(location.native, transpose, data, data.length, data.byteOffset);
560
+ }
561
+ uniformMatrix2x4fv(location, transpose, data) {
531
562
  this._glCheckError('uniformMatrix2x4fv');
532
- this.native.uniformMatrix2x4fv(location.native, transpose, Array.from(data));
533
- };
534
- WebGL2RenderingContext.prototype.uniformMatrix3x2fv = function (location, transpose, data) {
563
+ this.native.uniformMatrix2x4fvOffset(location.native, transpose, data, data.length, data.byteOffset);
564
+ }
565
+ uniformMatrix3x2fv(location, transpose, data) {
535
566
  this._glCheckError('uniformMatrix3x2fv');
536
- this.native.uniformMatrix3x2fv(location.native, transpose, Array.from(data));
537
- };
538
- WebGL2RenderingContext.prototype.uniformMatrix3x4fv = function (location, transpose, data) {
567
+ this.native.uniformMatrix3x2fvOffset(location.native, transpose, data, data.length, data.byteOffset);
568
+ }
569
+ uniformMatrix3x4fv(location, transpose, data) {
539
570
  this._glCheckError('uniformMatrix3x4fv');
540
- this.native.uniformMatrix3x4fv(location.native, transpose, Array.from(data));
541
- };
542
- WebGL2RenderingContext.prototype.uniformMatrix4x2fv = function (location, transpose, data) {
571
+ this.native.uniformMatrix3x4fvOffset(location.native, transpose, data, data.length, data.byteOffset);
572
+ }
573
+ uniformMatrix4x2fv(location, transpose, data) {
543
574
  this._glCheckError('uniformMatrix4x2fv');
544
- this.native.uniformMatrix4x2fv(location.native, transpose, Array.from(data));
545
- };
546
- WebGL2RenderingContext.prototype.uniformMatrix4x3fv = function (location, transpose, data) {
575
+ this.native.uniformMatrix4x2fv(location.native, transpose, data, data.length);
576
+ }
577
+ uniformMatrix4x3fv(location, transpose, data) {
547
578
  this._glCheckError('uniformMatrix4x3fv');
548
- this.native.uniformMatrix4x3fv(location.native, transpose, Array.from(data));
549
- };
550
- WebGL2RenderingContext.prototype.vertexAttribDivisor = function (index, divisor) {
579
+ this.native.uniformMatrix4x3fvOffset(location.native, transpose, data, data.length, data.byteOffset);
580
+ }
581
+ vertexAttribDivisor(index, divisor) {
551
582
  this._glCheckError('vertexAttribDivisor');
552
583
  this.native.vertexAttribDivisor(index, divisor);
553
- };
554
- WebGL2RenderingContext.prototype.vertexAttribI4i = function (index, v0, v1, v2, v3) {
584
+ }
585
+ vertexAttribI4i(index, v0, v1, v2, v3) {
555
586
  this._glCheckError('vertexAttribI4i');
556
587
  this.native.vertexAttribI4i(index, v0, v1, v2, v3);
557
- };
558
- WebGL2RenderingContext.prototype.vertexAttribI4iv = function (index, value) {
588
+ }
589
+ vertexAttribI4iv(index, value) {
559
590
  this._glCheckError('vertexAttribI4iv');
560
- this.native.vertexAttribI4iv(index, Array.from(value));
561
- };
562
- WebGL2RenderingContext.prototype.vertexAttribI4ui = function (index, v0, v1, v2, v3) {
591
+ if (!(value instanceof Int32Array)) {
592
+ value = new Int32Array(value);
593
+ }
594
+ this.native.vertexAttribI4ivOffset(index, value, value.byteOffset);
595
+ }
596
+ vertexAttribI4ui(index, v0, v1, v2, v3) {
563
597
  this._glCheckError('vertexAttribI4ui');
564
598
  this.native.vertexAttribI4ui(index, v0, v1, v2, v3);
565
- };
566
- WebGL2RenderingContext.prototype.vertexAttribI4uiv = function (index, value) {
599
+ }
600
+ vertexAttribI4uiv(index, value) {
567
601
  this._glCheckError('vertexAttribI4uiv');
568
- this.native.vertexAttribI4uiv(index, Array.from(value));
569
- };
570
- WebGL2RenderingContext.prototype._glCheckError = function (message) {
571
- if (!WebGL2RenderingContext.isDebug) {
572
- return;
573
- }
574
- console.log(message, this.getError());
575
- };
576
- return WebGL2RenderingContext;
577
- }(common_1.WebGL2RenderingContextBase));
578
- exports.WebGL2RenderingContext = WebGL2RenderingContext;
602
+ if (!(value instanceof Uint32Array)) {
603
+ value = new Uint32Array(value);
604
+ }
605
+ this.native.vertexAttribI4uivOffset(index, value, value.byteOffset);
606
+ }
607
+ }
579
608
  //# sourceMappingURL=index.ios.js.map