@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,237 +1,168 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var common_1 = require("./common");
4
- var WebGLShader_1 = require("../WebGLShader");
5
- var WebGLFramebuffer_1 = require("../WebGLFramebuffer");
6
- var WebGLTexture_1 = require("../WebGLTexture");
7
- var WebGLProgram_1 = require("../WebGLProgram");
8
- var WebGLUniformLocation_1 = require("../WebGLUniformLocation");
9
- var WebGLActiveInfo_1 = require("../WebGLActiveInfo");
10
- var WebGLRenderbuffer_1 = require("../WebGLRenderbuffer");
11
- var WebGLShaderPrecisionFormat_1 = require("../WebGLShaderPrecisionFormat");
12
- var WebGLBuffer_1 = require("../WebGLBuffer");
13
- var core_1 = require("@nativescript/core");
14
- var WebGLExtensions_1 = require("../WebGLExtensions");
15
- var ImageAsset_1 = require("../../ImageAsset");
16
- var Canvas_1 = require("../../Canvas");
17
- var utils_1 = require("../../utils");
18
- var WebGLRenderingContext = /** @class */ (function (_super) {
19
- __extends(WebGLRenderingContext, _super);
20
- function WebGLRenderingContext(context) {
21
- var _this = _super.call(this, context) || this;
22
- _this.context = context;
23
- return _this;
24
- }
25
- Object.defineProperty(WebGLRenderingContext.prototype, "native", {
26
- get: function () {
27
- return this.context;
28
- },
29
- enumerable: true,
30
- configurable: true
31
- });
32
- Object.defineProperty(WebGLRenderingContext.prototype, "drawingBufferHeight", {
33
- get: function () {
34
- return this.context.drawingBufferHeight;
35
- },
36
- enumerable: true,
37
- configurable: true
38
- });
39
- Object.defineProperty(WebGLRenderingContext.prototype, "drawingBufferWidth", {
40
- get: function () {
41
- return this.context.drawingBufferWidth;
42
- },
43
- enumerable: true,
44
- configurable: true
45
- });
46
- WebGLRenderingContext.prototype.activeTexture = function (texture) {
1
+ import { WebGLRenderingContextBase } from './common';
2
+ import { WebGLShader } from '../WebGLShader';
3
+ import { WebGLFramebuffer } from '../WebGLFramebuffer';
4
+ import { WebGLTexture } from '../WebGLTexture';
5
+ import { WebGLProgram } from '../WebGLProgram';
6
+ import { WebGLUniformLocation } from '../WebGLUniformLocation';
7
+ import { WebGLActiveInfo } from '../WebGLActiveInfo';
8
+ import { WebGLRenderbuffer } from '../WebGLRenderbuffer';
9
+ import { WebGLShaderPrecisionFormat } from '../WebGLShaderPrecisionFormat';
10
+ import { WebGLBuffer } from '../WebGLBuffer';
11
+ import { ImageSource } from '@nativescript/core';
12
+ import { ANGLE_instanced_arrays, EXT_blend_minmax, EXT_color_buffer_float, EXT_color_buffer_half_float, EXT_shader_texture_lod, EXT_sRGB, EXT_texture_filter_anisotropic, OES_element_index_uint, OES_fbo_render_mipmap, OES_standard_derivatives, OES_texture_float, OES_texture_float_linear, OES_texture_half_float, OES_texture_half_float_linear, OES_vertex_array_object, WEBGL_color_buffer_float, WEBGL_compressed_texture_etc, WEBGL_compressed_texture_etc1, WEBGL_compressed_texture_pvrtc, WEBGL_depth_texture, WEBGL_draw_buffers, WEBGL_lose_context } from '../WebGLExtensions';
13
+ import { ImageAsset } from '../../ImageAsset';
14
+ import { Canvas } from '../../Canvas';
15
+ import { Utils } from '../../utils';
16
+ import { ImageBitmap } from '../../ImageBitmap';
17
+ export class WebGLRenderingContext extends WebGLRenderingContextBase {
18
+ constructor(context) {
19
+ super(context);
20
+ this.context = context;
21
+ }
22
+ get native() {
23
+ return this.context;
24
+ }
25
+ get drawingBufferHeight() {
26
+ return this.context.drawingBufferHeight;
27
+ }
28
+ get drawingBufferWidth() {
29
+ return this.context.drawingBufferWidth;
30
+ }
31
+ activeTexture(texture) {
47
32
  this._glCheckError('activeTexture');
48
33
  this._checkArgs('activeTexture', arguments);
49
34
  this.context.activeTexture(texture);
50
- };
51
- WebGLRenderingContext.prototype.attachShader = function (program, shader) {
52
- var value = program ? program.native : 0;
53
- var value2 = shader ? shader.native : 0;
35
+ }
36
+ attachShader(program, shader) {
37
+ const value = program ? program.native : 0;
38
+ const value2 = shader ? shader.native : 0;
54
39
  this._glCheckError('attachShader');
55
40
  this._checkArgs('attachShader', arguments);
56
41
  this.context.attachShader(value, value2);
57
- };
58
- WebGLRenderingContext.prototype.bindAttribLocation = function (program, index, name) {
42
+ }
43
+ bindAttribLocation(program, index, name) {
59
44
  this._glCheckError('bindAttribLocation');
60
45
  this._checkArgs('bindAttribLocation', arguments);
61
- var value = program ? program.native : 0;
46
+ const value = program ? program.native : 0;
62
47
  this.context.bindAttribLocation(value, index, name);
63
- };
64
- WebGLRenderingContext.prototype.bindBuffer = function (target, buffer) {
48
+ }
49
+ bindBuffer(target, buffer) {
65
50
  this._glCheckError('bindBuffer');
66
51
  this._checkArgs('bindBuffer', arguments);
67
- var value = buffer ? buffer.native : 0;
52
+ const value = buffer ? buffer.native : 0;
68
53
  this.context.bindBuffer(target, value);
69
- };
70
- WebGLRenderingContext.prototype.bindFramebuffer = function (target, framebuffer) {
54
+ }
55
+ bindFramebuffer(target, framebuffer) {
71
56
  this._glCheckError('bindFramebuffer');
72
57
  this._checkArgs('bindFramebuffer', arguments);
73
- var value = framebuffer ? framebuffer.native : 0;
58
+ const value = framebuffer ? framebuffer.native : 0;
74
59
  this.context.bindFramebuffer(target, value);
75
- };
76
- WebGLRenderingContext.prototype.bindRenderbuffer = function (target, renderbuffer) {
60
+ }
61
+ bindRenderbuffer(target, renderbuffer) {
77
62
  this._glCheckError('bindRenderbuffer');
78
63
  this._checkArgs('bindRenderbuffer', arguments);
79
- var value = renderbuffer ? renderbuffer.native : 0;
64
+ const value = renderbuffer ? renderbuffer.native : 0;
80
65
  this.context.bindRenderbuffer(target, value);
81
- };
82
- WebGLRenderingContext.prototype.bindTexture = function (target, texture) {
66
+ }
67
+ bindTexture(target, texture) {
83
68
  this._glCheckError('bindTexture');
84
69
  this._checkArgs('bindTexture', arguments);
85
- var value = texture ? texture.native : 0;
70
+ const value = texture ? texture.native : 0;
86
71
  this.context.bindTexture(target, value);
87
- };
88
- WebGLRenderingContext.prototype.blendColor = function (red, green, blue, alpha) {
72
+ }
73
+ blendColor(red, green, blue, alpha) {
89
74
  this._glCheckError('blendColor');
90
75
  this._checkArgs('blendColor', arguments);
91
76
  this.context.blendColor(red, green, blue, alpha);
92
- };
93
- WebGLRenderingContext.prototype.blendEquationSeparate = function (modeRGB, modeAlpha) {
77
+ }
78
+ blendEquationSeparate(modeRGB, modeAlpha) {
94
79
  this._glCheckError('blendEquationSeparate');
95
80
  this._checkArgs('blendEquationSeparate', arguments);
96
81
  this.context.blendEquationSeparate(modeRGB, modeAlpha);
97
- };
98
- WebGLRenderingContext.prototype.blendEquation = function (mode) {
82
+ }
83
+ blendEquation(mode) {
99
84
  this._glCheckError('blendEquation');
100
85
  this._checkArgs('blendEquation', arguments);
101
86
  this.context.blendEquation(mode);
102
- };
103
- WebGLRenderingContext.prototype.blendFuncSeparate = function (srcRGB, dstRGB, srcAlpha, dstAlpha) {
104
- if (srcRGB === void 0) { srcRGB = this.ONE; }
105
- if (dstRGB === void 0) { dstRGB = this.ZERO; }
106
- if (srcAlpha === void 0) { srcAlpha = this.ONE; }
107
- if (dstAlpha === void 0) { dstAlpha = this.ZERO; }
87
+ }
88
+ blendFuncSeparate(srcRGB = this.ONE, dstRGB = this.ZERO, srcAlpha = this.ONE, dstAlpha = this.ZERO) {
108
89
  this._glCheckError('blendFuncSeparate');
109
90
  this._checkArgs('blendFuncSeparate', arguments);
110
91
  this.context.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
111
- };
112
- WebGLRenderingContext.prototype.blendFunc = function (sfactor, dfactor) {
113
- if (sfactor === void 0) { sfactor = this.ONE; }
114
- if (dfactor === void 0) { dfactor = this.ZERO; }
92
+ }
93
+ blendFunc(sfactor = this.ONE, dfactor = this.ZERO) {
115
94
  this._glCheckError('blendFunc');
116
95
  this._checkArgs('blendFunc', arguments);
117
96
  this.context.blendFunc(sfactor, dfactor);
118
- };
119
- WebGLRenderingContext.prototype.bufferData = function (target, srcData, usage) {
97
+ }
98
+ bufferData(target, srcData, usage) {
120
99
  this._glCheckError('bufferData');
121
100
  this._checkArgs('bufferData', arguments);
122
101
  if (typeof srcData === 'number') {
123
102
  this.context.bufferDataSize(target, srcData, usage);
124
103
  }
125
104
  else if (srcData instanceof ArrayBuffer) {
126
- // Array.from(srcData as any) bug
127
- var array = new Uint8Array(srcData);
128
- var data = Array.from(array);
129
- this.context.bufferDataU8(target, data, usage);
130
- }
131
- else if (srcData && srcData.buffer instanceof ArrayBuffer) {
132
- if (srcData instanceof Int8Array) {
133
- this.context.bufferDataI8(target, Array.from(srcData), usage);
134
- }
135
- else if (srcData instanceof Uint8Array || srcData instanceof Uint8ClampedArray) {
136
- this.context.bufferDataU8(target, Array.from(srcData), usage);
137
- }
138
- else if (srcData instanceof Int16Array) {
139
- this.context.bufferDataI16(target, Array.from(srcData), usage);
140
- }
141
- else if (srcData instanceof Uint16Array) {
142
- this.context.bufferDataU16(target, Array.from(srcData), usage);
143
- }
144
- else if (srcData instanceof Int32Array) {
145
- this.context.bufferDataI32(target, Array.from(srcData), usage);
146
- }
147
- else if (srcData instanceof Uint32Array) {
148
- this.context.bufferDataU32(target, Array.from(srcData), usage);
149
- }
150
- else if (srcData instanceof Float32Array) {
151
- this.context.bufferDataF32(target, Array.from(srcData), usage);
152
- }
153
- else if (srcData instanceof Float64Array) {
154
- this.context.bufferDataF64(target, Array.from(srcData), usage);
155
- }
105
+ this.context.bufferDataSrcDataSize(target, srcData, srcData.byteLength, usage);
106
+ }
107
+ else if (Utils.isTypedArray(srcData)) {
108
+ this.context.bufferDataSrcDataSizeOffset(target, srcData, srcData.byteLength, usage, srcData.byteOffset);
156
109
  }
157
110
  else {
158
111
  this.context.bufferDataSrcData(target, srcData, usage);
159
112
  }
160
- };
161
- WebGLRenderingContext.prototype.bufferSubData = function (target, offset, srcData) {
113
+ }
114
+ bufferSubData(target, offset, srcData) {
162
115
  this._glCheckError('bufferSubData');
163
116
  this._checkArgs('bufferSubData', arguments);
164
- if (srcData instanceof Int8Array) {
165
- this.context.bufferSubDataI8(target, offset, Array.from(srcData));
166
- }
167
- else if (srcData instanceof ArrayBuffer) {
168
- var array = new Uint8Array(srcData);
169
- this.context.bufferSubDataU8(target, offset, Array.from(array));
170
- }
171
- else if (srcData instanceof Uint8Array || srcData instanceof Uint8ClampedArray) {
172
- this.context.bufferSubDataU8(target, offset, Array.from(srcData));
173
- }
174
- else if (srcData instanceof Int16Array) {
175
- this.context.bufferSubDataI16(target, offset, Array.from(srcData));
117
+ if (Utils.isTypedArray(srcData)) {
118
+ this.context.bufferSubDataSrcDataSizeOs(target, offset, srcData, srcData.byteLength, srcData.byteOffset);
176
119
  }
177
- else if (srcData instanceof Uint16Array) {
178
- this.context.bufferSubDataU16(target, offset, Array.from(srcData));
179
- }
180
- else if (srcData instanceof Int32Array) {
181
- this.context.bufferSubDataI32(target, offset, Array.from(srcData));
182
- }
183
- else if (srcData instanceof Uint32Array) {
184
- this.context.bufferSubDataU32(target, offset, Array.from(srcData));
185
- }
186
- else if (srcData instanceof Float32Array) {
187
- this.context.bufferSubDataF32(target, offset, Array.from(srcData));
188
- }
189
- else if (srcData instanceof Float64Array) {
190
- this.context.bufferSubDataF64(target, offset, Array.from(srcData));
120
+ else {
121
+ this.context.bufferSubDataSrcDataSize(target, offset, srcData, srcData.byteLength);
191
122
  }
192
- };
193
- WebGLRenderingContext.prototype.checkFramebufferStatus = function (target) {
123
+ }
124
+ checkFramebufferStatus(target) {
194
125
  this._glCheckError('checkFramebufferStatus');
195
126
  this._checkArgs('checkFramebufferStatus', arguments);
196
127
  return this.context.checkFramebufferStatus(target);
197
- };
198
- WebGLRenderingContext.prototype.clearColor = function (red, green, blue, alpha) {
128
+ }
129
+ clearColor(red, green, blue, alpha) {
199
130
  this._glCheckError('clearColor');
200
131
  this._checkArgs('clearColor', arguments);
201
132
  this.context.clearColor(red, green, blue, alpha);
202
- };
203
- WebGLRenderingContext.prototype.clearDepth = function (depth) {
133
+ }
134
+ clearDepth(depth) {
204
135
  this._glCheckError('clearDepth');
205
136
  this._checkArgs('clearDepth', arguments);
206
137
  this.context.clearDepth(depth);
207
- };
208
- WebGLRenderingContext.prototype.clearStencil = function (stencil) {
138
+ }
139
+ clearStencil(stencil) {
209
140
  this._glCheckError('clearStencil');
210
141
  this._checkArgs('clearStencil', arguments);
211
142
  this.context.clearStencil(stencil);
212
- };
213
- WebGLRenderingContext.prototype.clear = function (mask) {
143
+ }
144
+ clear(mask) {
214
145
  this._glCheckError('clear');
215
146
  this._checkArgs('clear', arguments);
216
147
  this.context.clear(mask);
217
148
  this._glCheckError('after clear');
218
- };
219
- WebGLRenderingContext.prototype.colorMask = function (red, green, blue, alpha) {
149
+ }
150
+ colorMask(red, green, blue, alpha) {
220
151
  this._glCheckError('colorMask');
221
152
  this._checkArgs('colorMask', arguments);
222
153
  this.context.colorMask(red, green, blue, alpha);
223
- };
224
- WebGLRenderingContext.prototype.commit = function () {
154
+ }
155
+ commit() {
225
156
  // NOOP
226
157
  this.context.commit();
227
- };
228
- WebGLRenderingContext.prototype.compileShader = function (shader) {
158
+ }
159
+ compileShader(shader) {
229
160
  this._glCheckError('compileShader');
230
161
  this._checkArgs('compileShader', arguments);
231
- var value = shader ? shader.native : 0;
162
+ const value = shader ? shader.native : 0;
232
163
  this.context.compileShader(value);
233
- };
234
- WebGLRenderingContext.prototype.compressedTexImage2D = function (target, level, internalformat, width, height, border, pixels) {
164
+ }
165
+ compressedTexImage2D(target, level, internalformat, width, height, border, pixels) {
235
166
  this._glCheckError('compressedTexImage2D');
236
167
  this._checkArgs('compressedTexImage2D', arguments);
237
168
  if ((pixels && pixels.buffer instanceof ArrayBuffer) || pixels instanceof ArrayBuffer) {
@@ -240,326 +171,326 @@ var WebGLRenderingContext = /** @class */ (function (_super) {
240
171
  else {
241
172
  this.context.compressedTexImage2D(target, level, internalformat, width, height, border, pixels);
242
173
  }
243
- };
244
- WebGLRenderingContext.prototype.compressedTexSubImage2D = function (target, level, xoffset, yoffset, width, height, format, pixels) {
174
+ }
175
+ compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, pixels) {
245
176
  this._glCheckError('compressedTexSubImage2D');
246
177
  this._checkArgs('compressedTexSubImage2D', arguments);
247
178
  if ((pixels && pixels.buffer instanceof ArrayBuffer) || pixels instanceof ArrayBuffer) {
248
179
  this.context.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, NSData.dataWithData(pixels));
249
180
  }
250
- };
251
- WebGLRenderingContext.prototype.copyTexImage2D = function (target, level, internalformat, x, y, width, height, border) {
181
+ }
182
+ copyTexImage2D(target, level, internalformat, x, y, width, height, border) {
252
183
  this._glCheckError('copyTexImage2D');
253
184
  this._checkArgs('copyTexImage2D', arguments);
254
185
  this.context.copyTexImage2D(target, level, internalformat, x, y, width, height, border);
255
- };
256
- WebGLRenderingContext.prototype.copyTexSubImage2D = function (target, level, xoffset, yoffset, x, y, width, height) {
186
+ }
187
+ copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height) {
257
188
  this._glCheckError('copyTexSubImage2D');
258
189
  this._checkArgs('copyTexSubImage2D', arguments);
259
190
  this.context.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
260
- };
261
- WebGLRenderingContext.prototype.createBuffer = function () {
191
+ }
192
+ createBuffer() {
262
193
  this._glCheckError('createBuffer');
263
194
  this._checkArgs('createBuffer', arguments);
264
- var id = this.context.createBuffer();
265
- return new WebGLBuffer_1.WebGLBuffer(id);
266
- };
267
- WebGLRenderingContext.prototype.createFramebuffer = function () {
195
+ const id = this.context.createBuffer();
196
+ return new WebGLBuffer(id);
197
+ }
198
+ createFramebuffer() {
268
199
  this._glCheckError('createFramebuffer');
269
200
  this._checkArgs('createFramebuffer', arguments);
270
- return new WebGLFramebuffer_1.WebGLFramebuffer(this.context.createFramebuffer());
271
- };
272
- WebGLRenderingContext.prototype.createProgram = function () {
201
+ return new WebGLFramebuffer(this.context.createFramebuffer());
202
+ }
203
+ createProgram() {
273
204
  this._glCheckError('createProgram');
274
205
  this._checkArgs('createProgram', arguments);
275
- return new WebGLProgram_1.WebGLProgram(this.context.createProgram());
276
- };
277
- WebGLRenderingContext.prototype.createRenderbuffer = function () {
206
+ return new WebGLProgram(this.context.createProgram());
207
+ }
208
+ createRenderbuffer() {
278
209
  this._glCheckError('createRenderbuffer');
279
210
  this._checkArgs('createRenderbuffer', arguments);
280
- return new WebGLRenderbuffer_1.WebGLRenderbuffer(this.context.createRenderbuffer());
281
- };
282
- WebGLRenderingContext.prototype.createShader = function (type) {
211
+ return new WebGLRenderbuffer(this.context.createRenderbuffer());
212
+ }
213
+ createShader(type) {
283
214
  this._glCheckError('createShader');
284
215
  this._checkArgs('createShader', arguments);
285
- return new WebGLShader_1.WebGLShader(this.context.createShader(type));
286
- };
287
- WebGLRenderingContext.prototype.createTexture = function () {
216
+ return new WebGLShader(this.context.createShader(type));
217
+ }
218
+ createTexture() {
288
219
  this._glCheckError('createTexture');
289
220
  this._checkArgs('createTexture', arguments);
290
- var id = this.context.createTexture();
291
- return new WebGLTexture_1.WebGLTexture(id);
292
- };
293
- WebGLRenderingContext.prototype.cullFace = function (mode) {
221
+ const id = this.context.createTexture();
222
+ return new WebGLTexture(id);
223
+ }
224
+ cullFace(mode) {
294
225
  this._glCheckError('cullFace');
295
226
  this._checkArgs('cullFace', arguments);
296
227
  this.context.cullFace(mode);
297
- };
298
- WebGLRenderingContext.prototype.deleteBuffer = function (buffer) {
228
+ }
229
+ deleteBuffer(buffer) {
299
230
  this._glCheckError('deleteBuffer');
300
231
  this._checkArgs('deleteBuffer', arguments);
301
- var value = buffer ? buffer.native : 0;
232
+ const value = buffer ? buffer.native : 0;
302
233
  this.context.deleteBuffer(value);
303
- };
304
- WebGLRenderingContext.prototype.deleteFramebuffer = function (frameBuffer) {
234
+ }
235
+ deleteFramebuffer(frameBuffer) {
305
236
  this._glCheckError('deleteFramebuffer');
306
237
  this._checkArgs('deleteFramebuffer', arguments);
307
- var value = frameBuffer ? frameBuffer.native : 0;
238
+ const value = frameBuffer ? frameBuffer.native : 0;
308
239
  this.context.deleteFramebuffer(value);
309
- };
310
- WebGLRenderingContext.prototype.deleteProgram = function (program) {
240
+ }
241
+ deleteProgram(program) {
311
242
  this._glCheckError('deleteProgram');
312
243
  this._checkArgs('deleteProgram', arguments);
313
- var value = program ? program.native : 0;
244
+ const value = program ? program.native : 0;
314
245
  this.context.deleteProgram(value);
315
- };
316
- WebGLRenderingContext.prototype.deleteRenderbuffer = function (renderBuffer) {
246
+ }
247
+ deleteRenderbuffer(renderBuffer) {
317
248
  this._glCheckError('deleteRenderbuffer');
318
249
  this._checkArgs('deleteRenderbuffer', arguments);
319
- var value = renderBuffer ? renderBuffer.native : 0;
250
+ const value = renderBuffer ? renderBuffer.native : 0;
320
251
  this.context.deleteRenderbuffer(value);
321
- };
322
- WebGLRenderingContext.prototype.deleteShader = function (shader) {
252
+ }
253
+ deleteShader(shader) {
323
254
  this._glCheckError('deleteShader');
324
255
  this._checkArgs('deleteShader', arguments);
325
- var value = shader ? shader.native : 0;
256
+ const value = shader ? shader.native : 0;
326
257
  this.context.deleteShader(value);
327
- };
328
- WebGLRenderingContext.prototype.deleteTexture = function (texture) {
258
+ }
259
+ deleteTexture(texture) {
329
260
  this._glCheckError('deleteTexture');
330
261
  this._checkArgs('deleteTexture', arguments);
331
- var value = texture ? texture.native : 0;
262
+ const value = texture ? texture.native : 0;
332
263
  this.context.deleteTexture(value);
333
- };
334
- WebGLRenderingContext.prototype.depthFunc = function (func) {
264
+ }
265
+ depthFunc(func) {
335
266
  this._glCheckError('depthFunc');
336
267
  this._checkArgs('depthFunc', arguments);
337
268
  this.context.depthFunc(func);
338
- };
339
- WebGLRenderingContext.prototype.depthMask = function (flag) {
269
+ }
270
+ depthMask(flag) {
340
271
  this._glCheckError('depthMask');
341
272
  this._checkArgs('depthMask', arguments);
342
273
  this.context.depthMask(flag);
343
- };
344
- WebGLRenderingContext.prototype.depthRange = function (zNear, zFar) {
274
+ }
275
+ depthRange(zNear, zFar) {
345
276
  this._glCheckError('depthRange');
346
277
  this._checkArgs('depthRange', arguments);
347
278
  this.context.depthRange(zNear, zFar);
348
- };
349
- WebGLRenderingContext.prototype.detachShader = function (program, shader) {
279
+ }
280
+ detachShader(program, shader) {
350
281
  this._glCheckError('detachShader');
351
282
  this._checkArgs('detachShader', arguments);
352
- var value = program ? program.native : 0;
353
- var value2 = shader ? shader.native : 0;
283
+ const value = program ? program.native : 0;
284
+ const value2 = shader ? shader.native : 0;
354
285
  this.context.detachShader(value, value2);
355
- };
356
- WebGLRenderingContext.prototype.disableVertexAttribArray = function (index) {
286
+ }
287
+ disableVertexAttribArray(index) {
357
288
  this._checkArgs('disableVertexAttribArray', arguments);
358
289
  this._glCheckError('disableVertexAttribArray');
359
290
  this.context.disableVertexAttribArray(index);
360
- };
361
- WebGLRenderingContext.prototype.disable = function (cap) {
291
+ }
292
+ disable(cap) {
362
293
  this._glCheckError('disable');
363
294
  this._checkArgs('disable', arguments);
364
295
  this.context.disable(cap);
365
- };
366
- WebGLRenderingContext.prototype.drawArrays = function (mode, first, count) {
296
+ }
297
+ drawArrays(mode, first, count) {
367
298
  this._glCheckError('drawArrays');
368
299
  this._checkArgs('drawArrays', arguments);
369
300
  this.context.drawArrays(mode, first, count);
370
- };
371
- WebGLRenderingContext.prototype.drawElements = function (mode, count, type, offset) {
301
+ }
302
+ drawElements(mode, count, type, offset) {
372
303
  this._glCheckError('drawElements');
373
304
  this._checkArgs('drawElements', arguments);
374
305
  this.context.drawElements(mode, count, type, offset);
375
- };
376
- WebGLRenderingContext.prototype.enableVertexAttribArray = function (index) {
306
+ }
307
+ enableVertexAttribArray(index) {
377
308
  this._glCheckError('enableVertexAttribArray');
378
309
  this._checkArgs('enableVertexAttribArray', arguments);
379
310
  this.context.enableVertexAttribArray(index);
380
- };
381
- WebGLRenderingContext.prototype.enable = function (cap) {
311
+ }
312
+ enable(cap) {
382
313
  this._glCheckError('enable');
383
314
  this._checkArgs('enable', arguments);
384
315
  this.context.enable(cap);
385
- };
386
- WebGLRenderingContext.prototype.finish = function () {
316
+ }
317
+ finish() {
387
318
  this._glCheckError('finish');
388
319
  this._checkArgs('finish', arguments);
389
320
  this.context.finish();
390
- };
391
- WebGLRenderingContext.prototype.flush = function () {
321
+ }
322
+ flush() {
392
323
  this._glCheckError('flush');
393
324
  this._checkArgs('flush', arguments);
394
325
  this.context.flush();
395
- };
396
- WebGLRenderingContext.prototype.framebufferRenderbuffer = function (target, attachment, renderbuffertarget, renderbuffer) {
326
+ }
327
+ framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer) {
397
328
  this._glCheckError('framebufferRenderbuffer');
398
329
  this._checkArgs('framebufferRenderbuffer', arguments);
399
- var value = renderbuffer ? renderbuffer.native : 0;
330
+ const value = renderbuffer ? renderbuffer.native : 0;
400
331
  this.context.framebufferRenderbuffer(target, attachment, renderbuffertarget, value);
401
- };
402
- WebGLRenderingContext.prototype.framebufferTexture2D = function (target, attachment, textarget, texture, level) {
332
+ }
333
+ framebufferTexture2D(target, attachment, textarget, texture, level) {
403
334
  this._glCheckError('framebufferTexture2D');
404
335
  this._checkArgs('framebufferTexture2D', arguments);
405
- var value = texture ? texture.native : 0;
336
+ const value = texture ? texture.native : 0;
406
337
  this.context.framebufferTexture2D(target, attachment, textarget, value, level);
407
- };
408
- WebGLRenderingContext.prototype.frontFace = function (mode) {
338
+ }
339
+ frontFace(mode) {
409
340
  this._glCheckError('frontFace');
410
341
  this._checkArgs('frontFace', arguments);
411
342
  this.context.frontFace(mode);
412
- };
413
- WebGLRenderingContext.prototype.generateMipmap = function (target) {
343
+ }
344
+ generateMipmap(target) {
414
345
  this._glCheckError('generateMipmap');
415
346
  this._checkArgs('generateMipmap', arguments);
416
347
  this.context.generateMipmap(target);
417
- };
418
- WebGLRenderingContext.prototype.getActiveAttrib = function (program, index) {
348
+ }
349
+ getActiveAttrib(program, index) {
419
350
  this._glCheckError('getActiveAttrib');
420
351
  this._checkArgs('getActiveAttrib', arguments);
421
- var value = program ? program.native : 0;
422
- var attrib = this.context.getActiveAttrib(value, index);
423
- return new WebGLActiveInfo_1.WebGLActiveInfo(attrib.name, attrib.size, attrib.type);
424
- };
425
- WebGLRenderingContext.prototype.getActiveUniform = function (program, index) {
352
+ const value = program ? program.native : 0;
353
+ const attrib = this.context.getActiveAttrib(value, index);
354
+ return new WebGLActiveInfo(attrib.name, attrib.size, attrib.type);
355
+ }
356
+ getActiveUniform(program, index) {
426
357
  this._glCheckError('getActiveUniform');
427
358
  this._checkArgs('getActiveUniform', arguments);
428
- var value = program ? program.native : 0;
429
- var uniform = this.context.getActiveUniform(value, index);
430
- return new WebGLActiveInfo_1.WebGLActiveInfo(uniform.name, uniform.size, uniform.type);
431
- };
432
- WebGLRenderingContext.prototype.getAttachedShaders = function (program) {
359
+ const value = program ? program.native : 0;
360
+ const uniform = this.context.getActiveUniform(value, index);
361
+ return new WebGLActiveInfo(uniform.name, uniform.size, uniform.type);
362
+ }
363
+ getAttachedShaders(program) {
433
364
  this._glCheckError('getAttachedShaders');
434
365
  this._checkArgs('getAttachedShaders', arguments);
435
- var value = program ? program.native : 0;
436
- var shaders = this.context.getAttachedShaders(value);
437
- var length = shaders.count;
438
- var attachedShaders = [];
439
- for (var i = 0; i < length; i++) {
440
- attachedShaders.push(new WebGLShader_1.WebGLShader(shaders.objectAtIndex(i)));
366
+ const value = program ? program.native : 0;
367
+ const shaders = this.context.getAttachedShaders(value);
368
+ const length = shaders.count;
369
+ const attachedShaders = [];
370
+ for (let i = 0; i < length; i++) {
371
+ attachedShaders.push(new WebGLShader(shaders.objectAtIndex(i)));
441
372
  }
442
373
  return attachedShaders;
443
- };
444
- WebGLRenderingContext.prototype.getAttribLocation = function (program, name) {
374
+ }
375
+ getAttribLocation(program, name) {
445
376
  this._glCheckError('getAttribLocation');
446
377
  this._checkArgs('getAttribLocation', arguments);
447
- var value = program ? program.native : 0;
378
+ const value = program ? program.native : 0;
448
379
  return this.context.getAttribLocation(value, name);
449
- };
450
- WebGLRenderingContext.prototype.getBufferParameter = function (target, pname) {
380
+ }
381
+ getBufferParameter(target, pname) {
451
382
  this._glCheckError('getBufferParameter');
452
383
  this._checkArgs('getBufferParameter', arguments);
453
384
  return this.context.getBufferParameter(target, pname);
454
- };
455
- WebGLRenderingContext.prototype.getContextAttributes = function () {
385
+ }
386
+ getContextAttributes() {
456
387
  this._glCheckError('getContextAttributes');
457
388
  this._checkArgs('getContextAttributes', arguments);
458
- var attributes = this.context.getContextAttributes();
389
+ const attributes = this.context.getContextAttributes();
459
390
  if (!attributes) {
460
391
  return null;
461
392
  }
462
- var keys = attributes.allKeys;
463
- var length = keys.count;
464
- var contextAttributes = {};
465
- for (var i = 0; i < length; i++) {
466
- var key = keys.objectAtIndex(i);
393
+ const keys = attributes.allKeys;
394
+ const length = keys.count;
395
+ const contextAttributes = {};
396
+ for (let i = 0; i < length; i++) {
397
+ const key = keys.objectAtIndex(i);
467
398
  contextAttributes[key] = attributes.objectForKey(key);
468
399
  }
469
400
  contextAttributes['stencil'] = true;
470
401
  return contextAttributes;
471
- };
472
- WebGLRenderingContext.prototype.getError = function () {
402
+ }
403
+ getError() {
473
404
  return this.context.getError();
474
- };
475
- WebGLRenderingContext.prototype.getExtension = function (name) {
405
+ }
406
+ getExtension(name) {
476
407
  this._checkArgs('getExtension', arguments);
477
408
  this._glCheckError('getExtension');
478
- var ext = this.context.getExtension(name);
409
+ const ext = this.context.getExtension(name);
479
410
  if (ext instanceof TNS_ANGLE_instanced_arrays) {
480
- return new WebGLExtensions_1.ANGLE_instanced_arrays(ext);
411
+ return new ANGLE_instanced_arrays(ext);
481
412
  }
482
413
  else if (ext instanceof TNS_EXT_blend_minmax) {
483
- return new WebGLExtensions_1.EXT_blend_minmax(ext);
414
+ return new EXT_blend_minmax(ext);
484
415
  }
485
416
  else if (ext instanceof TNS_EXT_color_buffer_float) {
486
- return new WebGLExtensions_1.EXT_color_buffer_float(ext);
417
+ return new EXT_color_buffer_float(ext);
487
418
  }
488
419
  else if (ext instanceof TNS_EXT_color_buffer_half_float) {
489
- return new WebGLExtensions_1.EXT_color_buffer_half_float(ext);
420
+ return new EXT_color_buffer_half_float(ext);
490
421
  }
491
422
  else if (ext instanceof TNS_EXT_sRGB) {
492
- return new WebGLExtensions_1.EXT_sRGB(ext);
423
+ return new EXT_sRGB(ext);
493
424
  }
494
425
  else if (ext instanceof TNS_EXT_shader_texture_lod) {
495
- return new WebGLExtensions_1.EXT_shader_texture_lod(ext);
426
+ return new EXT_shader_texture_lod(ext);
496
427
  }
497
428
  else if (ext instanceof TNS_EXT_texture_filter_anisotropic) {
498
- return new WebGLExtensions_1.EXT_texture_filter_anisotropic(ext);
429
+ return new EXT_texture_filter_anisotropic(ext);
499
430
  }
500
431
  else if (ext instanceof TNS_OES_element_index_uint) {
501
- return new WebGLExtensions_1.OES_element_index_uint(ext);
432
+ return new OES_element_index_uint(ext);
502
433
  }
503
434
  else if (ext instanceof TNS_OES_fbo_render_mipmap) {
504
- return new WebGLExtensions_1.OES_fbo_render_mipmap(ext);
435
+ return new OES_fbo_render_mipmap(ext);
505
436
  }
506
437
  else if (ext instanceof TNS_OES_standard_derivatives) {
507
- return new WebGLExtensions_1.OES_standard_derivatives(ext);
438
+ return new OES_standard_derivatives(ext);
508
439
  }
509
440
  else if (ext instanceof TNS_OES_texture_float) {
510
- return new WebGLExtensions_1.OES_texture_float(ext);
441
+ return new OES_texture_float(ext);
511
442
  }
512
443
  else if (ext instanceof TNS_OES_texture_float_linear) {
513
- return new WebGLExtensions_1.OES_texture_float_linear(ext);
444
+ return new OES_texture_float_linear(ext);
514
445
  }
515
446
  else if (ext instanceof TNS_OES_texture_half_float) {
516
- return new WebGLExtensions_1.OES_texture_half_float(ext);
447
+ return new OES_texture_half_float(ext);
517
448
  }
518
449
  else if (ext instanceof TNS_OES_texture_half_float_linear) {
519
- return new WebGLExtensions_1.OES_texture_half_float_linear(ext);
450
+ return new OES_texture_half_float_linear(ext);
520
451
  }
521
452
  else if (ext instanceof TNS_OES_vertex_array_object) {
522
- return new WebGLExtensions_1.OES_vertex_array_object(ext);
453
+ return new OES_vertex_array_object(ext);
523
454
  }
524
455
  else if (ext instanceof TNS_WEBGL_color_buffer_float) {
525
- return new WebGLExtensions_1.WEBGL_color_buffer_float(ext);
456
+ return new WEBGL_color_buffer_float(ext);
526
457
  }
527
458
  else if (ext instanceof TNS_WEBGL_compressed_texture_etc) {
528
- return new WebGLExtensions_1.WEBGL_compressed_texture_etc(ext);
459
+ return new WEBGL_compressed_texture_etc(ext);
529
460
  }
530
461
  else if (ext instanceof TNS_WEBGL_compressed_texture_etc1) {
531
- return new WebGLExtensions_1.WEBGL_compressed_texture_etc1(ext);
462
+ return new WEBGL_compressed_texture_etc1(ext);
532
463
  }
533
464
  else if (ext instanceof TNS_WEBGL_compressed_texture_pvrtc) {
534
- return new WebGLExtensions_1.WEBGL_compressed_texture_pvrtc(ext);
465
+ return new WEBGL_compressed_texture_pvrtc(ext);
535
466
  }
536
467
  else if (ext instanceof TNS_WEBGL_depth_texture) {
537
- return new WebGLExtensions_1.WEBGL_depth_texture(ext);
468
+ return new WEBGL_depth_texture(ext);
538
469
  }
539
470
  else if (ext instanceof TNS_WEBGL_lose_context) {
540
- return new WebGLExtensions_1.WEBGL_lose_context(ext);
471
+ return new WEBGL_lose_context(ext);
541
472
  }
542
473
  else if (ext instanceof TNS_WEBGL_draw_buffers) {
543
- return new WebGLExtensions_1.WEBGL_draw_buffers(ext);
474
+ return new WEBGL_draw_buffers(ext);
544
475
  }
545
476
  return null;
546
- };
547
- WebGLRenderingContext.prototype.getFramebufferAttachmentParameter = function (target, attachment, pname) {
477
+ }
478
+ getFramebufferAttachmentParameter(target, attachment, pname) {
548
479
  this._glCheckError('getFramebufferAttachmentParameter');
549
480
  this._checkArgs('getFramebufferAttachmentParameter', arguments);
550
- var param = this.context.getFramebufferAttachmentParameter(target, attachment, pname);
481
+ const param = this.context.getFramebufferAttachmentParameter(target, attachment, pname);
551
482
  if (param.isRenderbuffer) {
552
- return new WebGLRenderbuffer_1.WebGLRenderbuffer(param.value);
483
+ return new WebGLRenderbuffer(param.value);
553
484
  }
554
485
  else if (param.isTexture) {
555
- return new WebGLTexture_1.WebGLTexture(param.value);
486
+ return new WebGLTexture(param.value);
556
487
  }
557
488
  return param.value;
558
- };
559
- WebGLRenderingContext.prototype.getParameter = function (pname) {
489
+ }
490
+ getParameter(pname) {
560
491
  this._glCheckError('getParameter');
561
492
  this._checkArgs('getParameter', arguments);
562
- var value = this.context.getParameter(pname);
493
+ const value = this.context.getParameter(pname);
563
494
  switch (pname) {
564
495
  case this.COLOR_WRITEMASK:
565
496
  case this.COLOR_CLEAR_VALUE:
@@ -567,122 +498,131 @@ var WebGLRenderingContext = /** @class */ (function (_super) {
567
498
  case this.ALIASED_LINE_WIDTH_RANGE:
568
499
  case this.ALIASED_POINT_SIZE_RANGE:
569
500
  case this.DEPTH_RANGE:
570
- return new Float32Array(utils_1.Utils.toJSArray(value));
501
+ return new Float32Array(Utils.toJSArray(value));
571
502
  case this.ARRAY_BUFFER_BINDING:
572
503
  case this.ELEMENT_ARRAY_BUFFER_BINDING:
573
- return new WebGLBuffer_1.WebGLBuffer(value);
504
+ if (value) {
505
+ return new WebGLBuffer(value);
506
+ }
507
+ return null;
574
508
  case this.CURRENT_PROGRAM:
575
- return new WebGLProgram_1.WebGLProgram(value);
509
+ if (value) {
510
+ return new WebGLProgram(value);
511
+ }
512
+ return null;
576
513
  case this.COMPRESSED_TEXTURE_FORMATS:
577
- return new Uint32Array(utils_1.Utils.toJSArray(value));
514
+ return new Uint32Array(Utils.toJSArray(value));
578
515
  case this.RENDERBUFFER_BINDING:
579
- return new WebGLRenderbuffer_1.WebGLRenderbuffer(value);
516
+ if (value) {
517
+ return new WebGLRenderbuffer(value);
518
+ }
519
+ return null;
580
520
  case this.FRAMEBUFFER_BINDING:
581
521
  if (value) {
582
- return new WebGLFramebuffer_1.WebGLFramebuffer(value);
522
+ return new WebGLFramebuffer(value);
583
523
  }
584
524
  return null;
585
525
  case this.VIEWPORT:
586
526
  case this.SCISSOR_BOX:
587
527
  case this.MAX_VIEWPORT_DIMS:
588
- return new Int32Array(utils_1.Utils.toJSArray(value));
528
+ return new Int32Array(Utils.toJSArray(value));
589
529
  case this.TEXTURE_BINDING_CUBE_MAP:
590
530
  case this.TEXTURE_BINDING_2D:
591
531
  if (value) {
592
- return new WebGLTexture_1.WebGLTexture(value);
532
+ return new WebGLTexture(value);
593
533
  }
594
534
  return null;
595
535
  case this.VERSION:
596
- var isMetal = false;
536
+ let isMetal = false;
597
537
  if (this._canvas && this._canvas.useMetal) {
598
538
  isMetal = true;
599
539
  }
600
540
  if (this._type === 'webgl2') {
601
- return "WebGL 2.0 (" + (isMetal ? 'Metal' : 'OpenGL ES 3.0') + " NativeScript)";
541
+ return `WebGL 2.0 (${isMetal ? 'Metal' : 'OpenGL ES 3.0'} NativeScript)`;
602
542
  }
603
543
  else {
604
- return "WebGL 1.0 (" + (isMetal ? 'Metal' : 'OpenGL ES 3.0') + " NativeScript)";
544
+ return `WebGL 1.0 (${isMetal ? 'Metal' : 'OpenGL ES 3.0'} NativeScript)`;
605
545
  }
606
546
  default:
607
547
  return value;
608
548
  }
609
- };
610
- WebGLRenderingContext.prototype.getProgramInfoLog = function (program) {
549
+ }
550
+ getProgramInfoLog(program) {
611
551
  this._glCheckError('getProgramInfoLog');
612
552
  this._checkArgs('getProgramInfoLog', arguments);
613
- var value = program ? program.native : 0;
553
+ const value = program ? program.native : 0;
614
554
  return this.context.getProgramInfoLog(value);
615
- };
616
- WebGLRenderingContext.prototype.getProgramParameter = function (program, pname) {
555
+ }
556
+ getProgramParameter(program, pname) {
617
557
  this._glCheckError('getProgramParameter');
618
558
  this._checkArgs('getProgramParameter', arguments);
619
- var value = program ? program.native : 0;
559
+ const value = program ? program.native : 0;
620
560
  return this.context.getProgramParameter(value, pname);
621
- };
622
- WebGLRenderingContext.prototype.getRenderbufferParameter = function (target, pname) {
561
+ }
562
+ getRenderbufferParameter(target, pname) {
623
563
  this._glCheckError('getRenderbufferParameter');
624
564
  this._checkArgs('getRenderbufferParameter', arguments);
625
565
  return this.context.getRenderbufferParameter(target, pname);
626
- };
627
- WebGLRenderingContext.prototype.getShaderInfoLog = function (shader) {
566
+ }
567
+ getShaderInfoLog(shader) {
628
568
  this._glCheckError('getShaderInfoLog');
629
569
  this._checkArgs('getShaderInfoLog', arguments);
630
- var value = shader ? shader.native : 0;
570
+ const value = shader ? shader.native : 0;
631
571
  return this.context.getShaderInfoLog(value);
632
- };
633
- WebGLRenderingContext.prototype.getShaderParameter = function (shader, pname) {
572
+ }
573
+ getShaderParameter(shader, pname) {
634
574
  this._glCheckError('getShaderParameter');
635
575
  this._checkArgs('getShaderParameter', arguments);
636
- var value = shader ? shader.native : 0;
576
+ const value = shader ? shader.native : 0;
637
577
  return this.context.getShaderParameter(value, pname);
638
- };
639
- WebGLRenderingContext.prototype.getShaderPrecisionFormat = function (shaderType, precisionType) {
578
+ }
579
+ getShaderPrecisionFormat(shaderType, precisionType) {
640
580
  this._glCheckError('getShaderPrecisionFormat');
641
581
  this._checkArgs('getShaderPrecisionFormat', arguments);
642
- var precision = this.context.getShaderPrecisionFormat(shaderType, precisionType);
643
- return new WebGLShaderPrecisionFormat_1.WebGLShaderPrecisionFormat(precision.rangeMin, precision.rangeMax, precision.precision);
644
- };
645
- WebGLRenderingContext.prototype.getShaderSource = function (shader) {
582
+ const precision = this.context.getShaderPrecisionFormat(shaderType, precisionType);
583
+ return new WebGLShaderPrecisionFormat(precision.rangeMin, precision.rangeMax, precision.precision);
584
+ }
585
+ getShaderSource(shader) {
646
586
  this._glCheckError('getShaderSource');
647
587
  this._checkArgs('getShaderSource', arguments);
648
- var value = shader ? shader.native : 0;
588
+ const value = shader ? shader.native : 0;
649
589
  return this.context.getShaderSource(value);
650
- };
651
- WebGLRenderingContext.prototype.getSupportedExtensions = function () {
590
+ }
591
+ getSupportedExtensions() {
652
592
  this._glCheckError('getSupportedExtensions');
653
593
  this._checkArgs('getSupportedExtensions', arguments);
654
- var extensions = this.context.getSupportedExtensions();
655
- var array = [];
656
- var length = extensions.count;
657
- for (var i = 0; i < length; i++) {
594
+ const extensions = this.context.getSupportedExtensions();
595
+ const array = [];
596
+ const length = extensions.count;
597
+ for (let i = 0; i < length; i++) {
658
598
  array.push(extensions.objectAtIndex(i));
659
599
  }
660
600
  return array;
661
- };
662
- WebGLRenderingContext.prototype.getTexParameter = function (target, pname) {
601
+ }
602
+ getTexParameter(target, pname) {
663
603
  this._glCheckError('getTexParameter');
664
604
  this._checkArgs('getTexParameter', arguments);
665
605
  return this.context.getTexParameter(target, pname);
666
- };
667
- WebGLRenderingContext.prototype.getUniformLocation = function (program, name) {
606
+ }
607
+ getUniformLocation(program, name) {
668
608
  this._glCheckError('getUniformLocation');
669
609
  this._checkArgs('getUniformLocation', arguments);
670
- var value = program ? program.native : 0;
671
- var id = this.context.getUniformLocation(value, name);
610
+ const value = program ? program.native : 0;
611
+ const id = this.context.getUniformLocation(value, name);
672
612
  if (id === -1) {
673
613
  return null;
674
614
  }
675
- return new WebGLUniformLocation_1.WebGLUniformLocation(id);
676
- };
677
- WebGLRenderingContext.prototype.getUniform = function (program, location) {
615
+ return new WebGLUniformLocation(id);
616
+ }
617
+ getUniform(program, location) {
678
618
  this._glCheckError('getUniform');
679
619
  this._checkArgs('getUniform', arguments);
680
- var value = program ? program.native : 0;
681
- var value2 = location ? location.native : 0;
682
- var type = interop.alloc(interop.sizeof(interop.types.uint32));
620
+ const value = program ? program.native : 0;
621
+ const value2 = location ? location.native : 0;
622
+ const type = interop.alloc(interop.sizeof(interop.types.uint32));
683
623
  glGetActiveUniform(value, value2, 0, null, null, type, null);
684
- var result = this.context.getUniform(value, value2);
685
- var ref = new interop.Reference(interop.types.uint32, type);
624
+ const result = this.context.getUniform(value, value2);
625
+ const ref = new interop.Reference(interop.types.uint32, type);
686
626
  switch (ref.value) {
687
627
  case this.FLOAT_VEC2:
688
628
  case this.FLOAT_VEC3:
@@ -690,96 +630,96 @@ var WebGLRenderingContext = /** @class */ (function (_super) {
690
630
  case this.FLOAT_MAT2:
691
631
  case this.FLOAT_MAT3:
692
632
  case this.FLOAT_MAT4:
693
- return new Float32Array(utils_1.Utils.toJSArray(result));
633
+ return new Float32Array(Utils.toJSArray(result));
694
634
  case this.INT_VEC2:
695
635
  case this.INT_VEC3:
696
636
  case this.INT_VEC4:
697
- return new Int32Array(utils_1.Utils.toJSArray(result));
637
+ return new Int32Array(Utils.toJSArray(result));
698
638
  default:
699
639
  break;
700
640
  }
701
641
  if (result instanceof NSArray || Array.isArray(result)) {
702
- return utils_1.Utils.toJSArray(result);
642
+ return Utils.toJSArray(result);
703
643
  }
704
644
  return result;
705
- };
706
- WebGLRenderingContext.prototype.getVertexAttribOffset = function (index, pname) {
645
+ }
646
+ getVertexAttribOffset(index, pname) {
707
647
  this._glCheckError('getVertexAttribOffset');
708
648
  this._checkArgs('getVertexAttribOffset', arguments);
709
649
  return this.context.getVertexAttribOffset(index, pname);
710
- };
711
- WebGLRenderingContext.prototype.getVertexAttrib = function (index, pname) {
650
+ }
651
+ getVertexAttrib(index, pname) {
712
652
  this._glCheckError('getVertexAttrib');
713
653
  this._checkArgs('getVertexAttrib', arguments);
714
- var value = this.context.getVertexAttrib(index, pname);
654
+ const value = this.context.getVertexAttrib(index, pname);
715
655
  if (pname === this.CURRENT_VERTEX_ATTRIB) {
716
- return new Float32Array(utils_1.Utils.toJSArray(value));
656
+ return new Float32Array(Utils.toJSArray(value));
717
657
  }
718
658
  return value;
719
- };
720
- WebGLRenderingContext.prototype.hint = function (target, mode) {
659
+ }
660
+ hint(target, mode) {
721
661
  this._glCheckError('hint');
722
662
  this._checkArgs('hint', arguments);
723
663
  this.context.hint(target, mode);
724
- };
725
- WebGLRenderingContext.prototype.isBuffer = function (buffer) {
664
+ }
665
+ isBuffer(buffer) {
726
666
  this._glCheckError('isBuffer');
727
667
  this._checkArgs('isBuffer', arguments);
728
- var value = buffer ? buffer.native : 0;
668
+ const value = buffer ? buffer.native : 0;
729
669
  return this.context.isBuffer(value);
730
- };
731
- WebGLRenderingContext.prototype.isContextLost = function () {
670
+ }
671
+ isContextLost() {
732
672
  this._glCheckError('isContextLost');
733
673
  this._checkArgs('isContextLost', arguments);
734
674
  return this.context.isContextLost();
735
- };
736
- WebGLRenderingContext.prototype.isEnabled = function (cap) {
675
+ }
676
+ isEnabled(cap) {
737
677
  this._glCheckError('isEnabled');
738
678
  this._checkArgs('isEnabled', arguments);
739
679
  return this.context.isEnabled(cap);
740
- };
741
- WebGLRenderingContext.prototype.isFramebuffer = function (framebuffer) {
680
+ }
681
+ isFramebuffer(framebuffer) {
742
682
  this._glCheckError('isFramebuffer');
743
683
  this._checkArgs('isFramebuffer', arguments);
744
- var value = framebuffer ? framebuffer.native : 0;
684
+ const value = framebuffer ? framebuffer.native : 0;
745
685
  return this.context.isFramebuffer(value);
746
- };
747
- WebGLRenderingContext.prototype.isProgram = function (program) {
686
+ }
687
+ isProgram(program) {
748
688
  this._glCheckError('isProgram');
749
689
  this._checkArgs('isProgram', arguments);
750
- var value = program ? program.native : 0;
690
+ const value = program ? program.native : 0;
751
691
  return this.context.isProgram(value);
752
- };
753
- WebGLRenderingContext.prototype.isRenderbuffer = function (renderbuffer) {
692
+ }
693
+ isRenderbuffer(renderbuffer) {
754
694
  this._glCheckError('isRenderbuffer');
755
695
  this._checkArgs('isRenderbuffer', arguments);
756
- var value = renderbuffer ? renderbuffer.native : 0;
696
+ const value = renderbuffer ? renderbuffer.native : 0;
757
697
  return this.context.isRenderbuffer(value);
758
- };
759
- WebGLRenderingContext.prototype.isShader = function (shader) {
698
+ }
699
+ isShader(shader) {
760
700
  this._glCheckError('isShader');
761
701
  this._checkArgs('isShader', arguments);
762
- var value = shader ? shader.native : 0;
702
+ const value = shader ? shader.native : 0;
763
703
  return this.context.isShader(value);
764
- };
765
- WebGLRenderingContext.prototype.isTexture = function (texture) {
704
+ }
705
+ isTexture(texture) {
766
706
  this._glCheckError('isTexture');
767
707
  this._checkArgs('isTexture', arguments);
768
- var value = texture ? texture.native : 0;
708
+ const value = texture ? texture.native : 0;
769
709
  return this.context.isTexture(value);
770
- };
771
- WebGLRenderingContext.prototype.lineWidth = function (width) {
710
+ }
711
+ lineWidth(width) {
772
712
  this._glCheckError('lineWidth');
773
713
  this._checkArgs('lineWidth', arguments);
774
714
  this.context.lineWidth(width);
775
- };
776
- WebGLRenderingContext.prototype.linkProgram = function (program) {
715
+ }
716
+ linkProgram(program) {
777
717
  this._glCheckError('linkProgram');
778
718
  this._checkArgs('linkProgram', arguments);
779
- var value = program ? program.native : 0;
719
+ const value = program ? program.native : 0;
780
720
  this.context.linkProgram(value);
781
- };
782
- WebGLRenderingContext.prototype.pixelStorei = function (pname, param) {
721
+ }
722
+ pixelStorei(pname, param) {
783
723
  this._glCheckError('pixelStorei');
784
724
  this._checkArgs('pixelStorei', arguments);
785
725
  // this.context.pixelStoreiWithPnameParam(pname, param);
@@ -798,20 +738,23 @@ var WebGLRenderingContext = /** @class */ (function (_super) {
798
738
  else {
799
739
  this.context.pixelStorei(pname, param);
800
740
  }
801
- };
802
- WebGLRenderingContext.prototype.polygonOffset = function (factor, units) {
741
+ }
742
+ polygonOffset(factor, units) {
803
743
  this._glCheckError('polygonOffset');
804
744
  this._checkArgs('polygonOffset', arguments);
805
745
  this.context.polygonOffset(factor, units);
806
- };
807
- WebGLRenderingContext.prototype.readPixels = function (x, y, width, height, format, type, pixels) {
746
+ }
747
+ readPixels(x, y, width, height, format, type, pixels) {
808
748
  this._glCheckError('readPixels');
809
749
  this._checkArgs('readPixels', arguments);
810
- if ((pixels && pixels.buffer instanceof ArrayBuffer) || pixels instanceof ArrayBuffer) {
811
- this.context.readPixels(x, y, width, height, format, type, NSData.dataWithData(pixels));
750
+ if (Utils.isTypedArray(pixels)) {
751
+ this.context.readPixelsOffset(x, y, width, height, format, type, pixels, pixels.byteOffset);
752
+ }
753
+ else if (pixels instanceof ArrayBuffer) {
754
+ this.context.readPixels(x, y, width, height, format, type, pixels);
812
755
  }
813
- };
814
- WebGLRenderingContext.prototype.renderbufferStorage = function (target, internalFormat, width, height) {
756
+ }
757
+ renderbufferStorage(target, internalFormat, width, height) {
815
758
  this._glCheckError('renderbufferStorage');
816
759
  this._checkArgs('renderbufferStorage', arguments);
817
760
  if (internalFormat === this.DEPTH_STENCIL) {
@@ -821,54 +764,54 @@ var WebGLRenderingContext = /** @class */ (function (_super) {
821
764
  internalFormat = 0x88f0;
822
765
  }
823
766
  this.context.renderbufferStorage(target, internalFormat, width, height);
824
- };
825
- WebGLRenderingContext.prototype.sampleCoverage = function (value, invert) {
767
+ }
768
+ sampleCoverage(value, invert) {
826
769
  this._glCheckError('sampleCoverage');
827
770
  this._checkArgs('sampleCoverage', arguments);
828
771
  this.context.sampleCoverage(value, invert);
829
- };
830
- WebGLRenderingContext.prototype.scissor = function (x, y, width, height) {
772
+ }
773
+ scissor(x, y, width, height) {
831
774
  this._glCheckError('scissor');
832
775
  this._checkArgs('scissor', arguments);
833
776
  this.context.scissor(x, y, width, height);
834
- };
835
- WebGLRenderingContext.prototype.shaderSource = function (shader, source) {
777
+ }
778
+ shaderSource(shader, source) {
836
779
  this._glCheckError('shaderSource');
837
780
  this._checkArgs('shaderSource', arguments);
838
- var value = shader ? shader.native : 0;
781
+ const value = shader ? shader.native : 0;
839
782
  this.context.shaderSource(value, source);
840
- };
841
- WebGLRenderingContext.prototype.stencilFuncSeparate = function (face, func, ref, mask) {
783
+ }
784
+ stencilFuncSeparate(face, func, ref, mask) {
842
785
  this._glCheckError('stencilFuncSeparate');
843
786
  this._checkArgs('stencilFuncSeparate', arguments);
844
787
  this.context.stencilFuncSeparate(face, func, ref, mask);
845
- };
846
- WebGLRenderingContext.prototype.stencilFunc = function (func, ref, mask) {
788
+ }
789
+ stencilFunc(func, ref, mask) {
847
790
  this._glCheckError('stencilFunc');
848
791
  this._checkArgs('stencilFunc', arguments);
849
792
  this.context.stencilFunc(func, ref, mask);
850
- };
851
- WebGLRenderingContext.prototype.stencilMaskSeparate = function (face, mask) {
793
+ }
794
+ stencilMaskSeparate(face, mask) {
852
795
  this._glCheckError('stencilMaskSeparate');
853
796
  this._checkArgs('stencilMaskSeparate', arguments);
854
797
  this.context.stencilMaskSeparate(face, mask);
855
- };
856
- WebGLRenderingContext.prototype.stencilMask = function (mask) {
798
+ }
799
+ stencilMask(mask) {
857
800
  this._glCheckError('stencilMask');
858
801
  this._checkArgs('stencilMask', arguments);
859
802
  this.context.stencilMask(mask);
860
- };
861
- WebGLRenderingContext.prototype.stencilOpSeparate = function (face, fail, zfail, zpass) {
803
+ }
804
+ stencilOpSeparate(face, fail, zfail, zpass) {
862
805
  this._glCheckError('stencilOpSeparate');
863
806
  this._checkArgs('stencilOpSeparate', arguments);
864
807
  this.context.stencilOpSeparate(face, fail, zfail, zpass);
865
- };
866
- WebGLRenderingContext.prototype.stencilOp = function (fail, zfail, zpass) {
808
+ }
809
+ stencilOp(fail, zfail, zpass) {
867
810
  this._glCheckError('stencilOp');
868
811
  this._checkArgs('stencilOp', arguments);
869
812
  this.context.stencilOp(fail, zfail, zpass);
870
- };
871
- WebGLRenderingContext.prototype.texImage2D = function (target, level, internalformat, width, height, border, format, type, pixels) {
813
+ }
814
+ texImage2D(target, level, internalformat, width, height, border, format, type, pixels) {
872
815
  this._glCheckError('texImage2D');
873
816
  this._checkArgs('texImage2D', arguments);
874
817
  /* TODO */
@@ -876,60 +819,51 @@ var WebGLRenderingContext = /** @class */ (function (_super) {
876
819
  // this.enable(this.BLEND);
877
820
  /* TODO */
878
821
  if (arguments.length === 9) {
879
- if ((pixels && pixels.buffer) || pixels instanceof ArrayBuffer) {
880
- if (pixels instanceof ArrayBuffer) {
881
- var array = new Uint8Array(pixels);
882
- this.context.texImage2DU8(target, level, internalformat, width, height, border, format, type, Array.from(array));
883
- }
884
- else if (pixels instanceof Uint8Array || pixels instanceof Uint8ClampedArray) {
885
- this.context.texImage2DU8(target, level, internalformat, width, height, border, format, type, Array.from(pixels));
886
- }
887
- else if (pixels instanceof Uint16Array) {
888
- this.context.texImage2DU16(target, level, internalformat, width, height, border, format, type, Array.from(pixels));
889
- }
890
- else if (pixels instanceof Uint32Array) {
891
- this.context.texImage2DU32(target, level, internalformat, width, height, border, format, type, Array.from(pixels));
892
- }
893
- else if (pixels instanceof Float32Array) {
894
- this.context.texImage2DF32(target, level, internalformat, width, height, border, format, type, Array.from(pixels));
895
- }
822
+ if (pixels instanceof ArrayBuffer) {
823
+ this.context.texImage2DPixelsSize(target, level, internalformat, width, height, border, format, type, pixels, pixels.byteLength);
824
+ }
825
+ else if (Utils.isTypedArray(pixels)) {
826
+ this.context.texImage2DPixelsSizeOffset(target, level, internalformat, width, height, border, format, type, pixels, pixels.byteLength, pixels.byteOffset);
896
827
  }
897
828
  else {
898
829
  this.context.texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
899
830
  }
900
831
  }
901
832
  else if (arguments.length === 6) {
902
- if (border && typeof border.tagName === 'string' && (border.tagName === 'VID' || border.tagName === 'VIDEO') && typeof border._video && typeof border._video.getCurrentFrame === 'function') {
833
+ if (border && typeof border.tagName === 'string' && (border.tagName === 'VID' || border.tagName === 'VIDEO') && border._video && typeof border._video.getCurrentFrame === 'function') {
903
834
  border._video.getCurrentFrame(this.context, this, target, level, internalformat, width, height);
904
835
  }
905
836
  else if (border && typeof border.getCurrentFrame === 'function') {
906
837
  border.getCurrentFrame(this.context, this, target, level, internalformat, width, height);
907
838
  }
908
- else if (border instanceof ImageAsset_1.ImageAsset) {
839
+ else if (border instanceof ImageAsset) {
909
840
  this.context.texImage2DAsset(target, level, internalformat, width, height, border.native);
910
841
  }
911
- else if (border instanceof core_1.ImageSource) {
842
+ else if (border instanceof ImageBitmap || (border === null || border === void 0 ? void 0 : border.native) instanceof TNSImageBitmap) {
843
+ this.context.texImage2DBitmap(target, level, internalformat, width, height, border.native);
844
+ }
845
+ else if (border instanceof ImageSource) {
912
846
  this.context.texImage2DPixels(target, level, internalformat, width, height, border.ios);
913
847
  }
914
848
  else if (border instanceof UIImage) {
915
849
  this.context.texImage2DPixels(target, level, internalformat, width, height, border);
916
850
  }
917
851
  else if (border && typeof border.tagName === 'string' && (border.tagName === 'IMG' || border.tagName === 'IMAGE')) {
918
- if (border._asset instanceof ImageAsset_1.ImageAsset) {
852
+ if (border._asset instanceof ImageAsset) {
919
853
  this.context.texImage2DAsset(target, level, internalformat, width, height, border._asset.native);
920
854
  }
921
- else if (border._imageSource instanceof core_1.ImageSource) {
855
+ else if (border._imageSource instanceof ImageSource) {
922
856
  this.context.texImage2DPixels(target, level, internalformat, width, height, border._imageSource.ios);
923
857
  }
924
858
  else if (border._image instanceof UIImage) {
925
859
  this.context.texImage2DPixels(target, level, internalformat, width, height, border._image);
926
860
  }
927
861
  else if (typeof border.src === 'string') {
928
- var asset = core_1.ImageSource.fromFileSync(border.src);
862
+ const asset = ImageSource.fromFileSync(border.src);
929
863
  this.context.texImage2DPixels(target, level, internalformat, width, height, asset.ios);
930
864
  }
931
865
  }
932
- else if (border && typeof border.tagName === 'string' && border.tagName === 'CANVAS' && border._canvas instanceof Canvas_1.Canvas) {
866
+ else if (border && typeof border.tagName === 'string' && border.tagName === 'CANVAS' && border._canvas instanceof Canvas) {
933
867
  this.context.texImage2DCanvas(target, level, internalformat, width, height, border._canvas.ios);
934
868
  }
935
869
  else {
@@ -938,289 +872,286 @@ var WebGLRenderingContext = /** @class */ (function (_super) {
938
872
  }
939
873
  // this.blendFunc(this.SRC_ALPHA, this.ZERO);
940
874
  // this.disable(this.BLEND);
941
- };
942
- WebGLRenderingContext.prototype.texParameterf = function (target, pname, param) {
875
+ }
876
+ texParameterf(target, pname, param) {
943
877
  this._glCheckError('texParameterf');
944
878
  this._checkArgs('texParameterf', arguments);
945
879
  this.context.texParameterf(target, pname, param);
946
- };
947
- WebGLRenderingContext.prototype.texParameteri = function (target, pname, param) {
880
+ }
881
+ texParameteri(target, pname, param) {
948
882
  this._glCheckError('texParameteri');
949
883
  this._checkArgs('texParameteri', arguments);
950
884
  this.context.texParameteri(target, pname, param);
951
- };
952
- WebGLRenderingContext.prototype.texSubImage2D = function (target, level, xoffset, yoffset, width, height, format, type, pixels) {
885
+ }
886
+ texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels) {
953
887
  this._glCheckError('texSubImage2D');
954
888
  this._checkArgs('texSubImage2D', arguments);
955
889
  if (arguments.length === 9) {
956
- if ((pixels && pixels.buffer) || pixels instanceof ArrayBuffer) {
957
- if (pixels instanceof ArrayBuffer) {
958
- var array = new Uint8Array(pixels);
959
- this.context.texSubImage2DU8(target, level, xoffset, yoffset, width, height, format, type, Array.from(array));
960
- }
961
- else if (pixels instanceof Uint8Array || pixels instanceof Uint8ClampedArray) {
962
- this.context.texSubImage2DU8(target, level, xoffset, yoffset, width, height, format, type, Array.from(pixels));
963
- }
964
- else if (pixels instanceof Uint16Array) {
965
- this.context.texSubImage2DU16(target, level, xoffset, yoffset, width, height, format, type, Array.from(pixels));
966
- }
967
- else if (pixels instanceof Float32Array) {
968
- this.context.texSubImage2DF32(target, level, xoffset, yoffset, width, height, format, type, Array.from(pixels));
969
- }
890
+ if (pixels instanceof ArrayBuffer) {
891
+ this.context.texSubImage2DPixelsSize(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.byteLength);
892
+ }
893
+ else if (Utils.isTypedArray(pixels)) {
894
+ this.context.texSubImage2DPixelsSizeOffset(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.byteLength, pixels.byteOffset);
970
895
  }
971
896
  else {
972
897
  this.context.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
973
898
  }
974
899
  }
975
900
  else if (arguments.length === 7) {
976
- if (format instanceof ImageAsset_1.ImageAsset) {
901
+ if (format instanceof ImageAsset) {
977
902
  this.context.texSubImage2DAsset(target, level, xoffset, yoffset, width, height, format.native);
978
903
  }
904
+ if (format instanceof ImageBitmap || (format === null || format === void 0 ? void 0 : format.native) instanceof TNSImageBitmap) {
905
+ this.context.texSubImage2DBitmap(target, level, xoffset, yoffset, width, height, format.native);
906
+ }
979
907
  else if (format instanceof UIImage) {
980
908
  this.context.texSubImage2DPixels(target, level, xoffset, yoffset, width, height, format);
981
909
  }
982
- else if (format instanceof core_1.ImageSource) {
910
+ else if (format instanceof ImageSource) {
983
911
  this.context.texSubImage2DPixels(target, level, xoffset, yoffset, width, height, format.ios);
984
912
  }
985
913
  else if (format && typeof format.tagName === 'string' && (format.tagName === 'IMG' || format.tagName === 'IMAGE')) {
986
- if (format._imageSource instanceof core_1.ImageSource) {
914
+ if (format._imageSource instanceof ImageSource) {
987
915
  this.context.texSubImage2DPixels(target, level, xoffset, yoffset, width, height, format._imageSource.ios);
988
916
  }
989
917
  else if (format._image instanceof UIImage) {
990
918
  this.context.texSubImage2DPixels(target, level, xoffset, yoffset, width, height, format._image);
991
919
  }
992
- else if (format._asset instanceof ImageAsset_1.ImageAsset) {
920
+ else if (format._asset instanceof ImageAsset) {
993
921
  this.context.texSubImage2DAsset(target, level, xoffset, yoffset, width, height, format._asset.native);
994
922
  }
995
923
  else if (typeof format.src === 'string') {
996
- var result = core_1.ImageSource.fromFileSync(format.src);
924
+ const result = ImageSource.fromFileSync(format.src);
997
925
  this.context.texSubImage2DPixels(target, level, xoffset, yoffset, width, height, result ? result.ios : null);
998
926
  }
999
927
  }
1000
- else if (format && typeof format.tagName === 'string' && format.tagName === 'CANVAS' && format._canvas instanceof Canvas_1.Canvas) {
928
+ else if (format && typeof format.tagName === 'string' && format.tagName === 'CANVAS' && format._canvas instanceof Canvas) {
1001
929
  this.context.texSubImage2DCanvas(target, level, xoffset, yoffset, width, height, format._canvas.ios);
1002
930
  }
1003
931
  else {
1004
932
  this.context.texSubImage2D(target, level, xoffset, yoffset, width, height, format);
1005
933
  }
1006
934
  }
1007
- };
1008
- WebGLRenderingContext.prototype.uniform1f = function (location, v0) {
935
+ }
936
+ uniform1f(location, v0) {
1009
937
  this._glCheckError('uniform1f');
1010
938
  this._checkArgs('uniform1f', arguments);
1011
939
  this.context.uniform1f(location.native, v0);
1012
- };
1013
- WebGLRenderingContext.prototype.uniform1iv = function (location, value) {
940
+ }
941
+ uniform1iv(location, value) {
1014
942
  this._glCheckError('uniform1iv');
1015
943
  this._checkArgs('uniform1iv', arguments);
1016
944
  if (!(value instanceof Int32Array)) {
1017
945
  value = new Int32Array(value);
1018
946
  }
1019
- this.context.uniform1iv(location.native, Array.from(value));
1020
- };
1021
- WebGLRenderingContext.prototype.uniform1fv = function (location, value) {
947
+ this.context.uniform1ivOffset(location.native, value, value.length, value.byteOffset);
948
+ }
949
+ uniform1fv(location, value) {
1022
950
  this._glCheckError('uniform1fv');
1023
951
  this._checkArgs('uniform1fv', arguments);
1024
952
  if (!(value instanceof Float32Array)) {
1025
953
  value = new Float32Array(value);
1026
954
  }
1027
- this.context.uniform1fv(location.native, Array.from(value));
1028
- };
1029
- WebGLRenderingContext.prototype.uniform1i = function (location, v0) {
955
+ this.context.uniform1fvOffset(location.native, value, value.length, value.byteOffset);
956
+ }
957
+ uniform1i(location, v0) {
1030
958
  this._glCheckError('uniform1i');
1031
959
  this._checkArgs('uniform1i', arguments);
1032
960
  this.context.uniform1i(location.native, v0);
1033
- };
1034
- WebGLRenderingContext.prototype.uniform2f = function (location, v0, v1) {
961
+ }
962
+ uniform2f(location, v0, v1) {
1035
963
  this._glCheckError('uniform2f');
1036
964
  this._checkArgs('uniform2f', arguments);
1037
965
  this.context.uniform2f(location.native, v0, v1);
1038
- };
1039
- WebGLRenderingContext.prototype.uniform2iv = function (location, value) {
966
+ }
967
+ uniform2iv(location, value) {
1040
968
  this._glCheckError('uniform2iv');
1041
969
  this._checkArgs('uniform2iv', arguments);
1042
970
  if (!(value instanceof Int32Array)) {
1043
971
  value = new Int32Array(value);
1044
972
  }
1045
- this.context.uniform2iv(location.native, Array.from(value));
1046
- };
1047
- WebGLRenderingContext.prototype.uniform2fv = function (location, value) {
973
+ this.context.uniform2ivOffset(location.native, value, value.length, value.byteOffset);
974
+ }
975
+ uniform2fv(location, value) {
1048
976
  this._glCheckError('uniform2fv');
1049
977
  this._checkArgs('uniform2fv', arguments);
1050
978
  if (!(value instanceof Float32Array)) {
1051
979
  value = new Float32Array(value);
1052
980
  }
1053
- this.context.uniform2fv(location.native, Array.from(value));
1054
- };
1055
- WebGLRenderingContext.prototype.uniform2i = function (location, v0, v1) {
981
+ this.context.uniform2fvOffset(location.native, value, value.length, value.byteOffset);
982
+ }
983
+ uniform2i(location, v0, v1) {
1056
984
  this._glCheckError('uniform2i');
1057
985
  this._checkArgs('uniform2i', arguments);
1058
986
  this.context.uniform2i(location.native, v0, v1);
1059
- };
1060
- WebGLRenderingContext.prototype.uniform3f = function (location, v0, v1, v2) {
987
+ }
988
+ uniform3f(location, v0, v1, v2) {
1061
989
  this._glCheckError('uniform3f');
1062
990
  this._checkArgs('uniform3f', arguments);
1063
991
  this.context.uniform3f(location.native, v0, v1, v2);
1064
- };
1065
- WebGLRenderingContext.prototype.uniform3iv = function (location, value) {
992
+ }
993
+ uniform3iv(location, value) {
1066
994
  this._glCheckError('uniform3iv');
1067
995
  this._checkArgs('uniform3iv', arguments);
1068
996
  if (!(value instanceof Int32Array)) {
1069
997
  value = new Int32Array(value);
1070
998
  }
1071
- this.context.uniform3iv(location.native, Array.from(value));
1072
- };
1073
- WebGLRenderingContext.prototype.uniform3fv = function (location, value) {
999
+ this.context.uniform3ivOffset(location.native, value, value.length, value.byteOffset);
1000
+ }
1001
+ uniform3fv(location, value) {
1074
1002
  this._glCheckError('uniform3fv');
1075
1003
  this._checkArgs('uniform3fv', arguments);
1076
1004
  if (!(value instanceof Float32Array)) {
1077
1005
  value = new Float32Array(value);
1078
1006
  }
1079
- this.context.uniform3fv(location.native, Array.from(value));
1080
- };
1081
- WebGLRenderingContext.prototype.uniform3i = function (location, v0, v1, v2) {
1007
+ this.context.uniform3fvOffset(location.native, value, value.length, value.byteOffset);
1008
+ }
1009
+ uniform3i(location, v0, v1, v2) {
1082
1010
  this._glCheckError('uniform3i');
1083
1011
  this._checkArgs('uniform3i', arguments);
1084
1012
  this.context.uniform3i(location.native, v0, v1, v2);
1085
- };
1086
- WebGLRenderingContext.prototype.uniform4f = function (location, v0, v1, v2, v3) {
1013
+ }
1014
+ uniform4f(location, v0, v1, v2, v3) {
1087
1015
  this._glCheckError('uniform4f');
1088
1016
  this._checkArgs('uniform4f', arguments);
1089
1017
  this.context.uniform4f(location.native, v0, v1, v2, v3);
1090
- };
1091
- WebGLRenderingContext.prototype.uniform4iv = function (location, value) {
1018
+ }
1019
+ uniform4iv(location, value) {
1092
1020
  this._glCheckError('uniform4iv');
1093
1021
  this._checkArgs('uniform4iv', arguments);
1094
1022
  if (!(value instanceof Int32Array)) {
1095
1023
  value = new Int32Array(value);
1096
1024
  }
1097
- this.context.uniform4iv(location.native, Array.from(value));
1098
- };
1099
- WebGLRenderingContext.prototype.uniform4fv = function (location, value) {
1025
+ this.context.uniform4ivOffset(location.native, value, value.length, value.byteOffset);
1026
+ }
1027
+ uniform4fv(location, value) {
1100
1028
  this._glCheckError('uniform4fv');
1101
1029
  this._checkArgs('uniform4fv', arguments);
1102
1030
  if (!(value instanceof Float32Array)) {
1103
1031
  value = new Float32Array(value);
1104
1032
  }
1105
- this.context.uniform4fv(location.native, Array.from(value));
1106
- };
1107
- WebGLRenderingContext.prototype.uniform4i = function (location, v0, v1, v2, v3) {
1033
+ this.context.uniform4fvOffset(location.native, value, value.length, value.byteOffset);
1034
+ }
1035
+ uniform4i(location, v0, v1, v2, v3) {
1108
1036
  this._glCheckError('uniform4i');
1109
1037
  this._checkArgs('uniform4i', arguments);
1110
1038
  this.context.uniform4i(location.native, v0, v1, v2, v3);
1111
- };
1112
- WebGLRenderingContext.prototype.uniformMatrix2fv = function (location, transpose, value) {
1039
+ }
1040
+ uniformMatrix2fv(location, transpose, value) {
1113
1041
  this._glCheckError('uniformMatrix2fv');
1114
1042
  this._checkArgs('uniformMatrix2fv', arguments);
1115
1043
  if (!(value instanceof Float32Array)) {
1116
1044
  value = new Float32Array(value);
1117
1045
  }
1118
- this.context.uniformMatrix2fv(location.native, transpose, Array.from(value));
1119
- };
1120
- WebGLRenderingContext.prototype.uniformMatrix3fv = function (location, transpose, value) {
1046
+ this.context.uniformMatrix2fvOffset(location.native, transpose, value, value.length, value.byteOffset);
1047
+ }
1048
+ uniformMatrix3fv(location, transpose, value) {
1121
1049
  this._glCheckError('uniformMatrix3fv');
1122
1050
  this._checkArgs('uniformMatrix3fv', arguments);
1123
1051
  if (!(value instanceof Float32Array)) {
1124
1052
  value = new Float32Array(value);
1125
1053
  }
1126
- this.context.uniformMatrix3fv(location.native, transpose, Array.from(value));
1127
- };
1128
- WebGLRenderingContext.prototype.uniformMatrix4fv = function (location, transpose, value) {
1054
+ this.context.uniformMatrix3fvOffset(location.native, transpose, value, value.length, value.byteOffset);
1055
+ }
1056
+ uniformMatrix4fv(location, transpose, value) {
1129
1057
  this._glCheckError('uniformMatrix4fv');
1130
1058
  this._checkArgs('uniformMatrix4fv', arguments);
1131
1059
  if (!(value instanceof Float32Array)) {
1132
1060
  value = new Float32Array(value);
1133
1061
  }
1134
- this.context.uniformMatrix4fv(location.native, transpose, Array.from(value));
1135
- };
1136
- WebGLRenderingContext.prototype.useProgram = function (program) {
1062
+ this.context.uniformMatrix4fvOffset(location.native, transpose, value, value.length, value.byteOffset);
1063
+ }
1064
+ useProgram(program) {
1137
1065
  this._glCheckError('useProgram');
1138
1066
  this._checkArgs('useProgram', arguments);
1139
- var value = program ? program.native : 0;
1067
+ const value = program ? program.native : 0;
1140
1068
  this.context.useProgram(value);
1141
- };
1142
- WebGLRenderingContext.prototype.validateProgram = function (program) {
1069
+ }
1070
+ validateProgram(program) {
1143
1071
  this._glCheckError('validateProgram');
1144
1072
  this._checkArgs('validateProgram', arguments);
1145
- var value = program ? program.native : 0;
1073
+ const value = program ? program.native : 0;
1146
1074
  this.context.validateProgram(value);
1147
- };
1148
- WebGLRenderingContext.prototype.vertexAttrib1f = function (index, v0) {
1075
+ }
1076
+ vertexAttrib1f(index, v0) {
1149
1077
  this._glCheckError('vertexAttrib1f');
1150
1078
  this._checkArgs('vertexAttrib1f', arguments);
1151
1079
  this.context.vertexAttrib1f(index, v0);
1152
- };
1153
- WebGLRenderingContext.prototype.vertexAttrib1fv = function (index, value) {
1080
+ }
1081
+ vertexAttrib1fv(index, value) {
1154
1082
  this._glCheckError('vertexAttrib1fv');
1155
1083
  this._checkArgs('vertexAttrib1fv', arguments);
1156
1084
  if (!(value instanceof Float32Array)) {
1157
1085
  value = new Float32Array(value);
1158
1086
  }
1159
- this.context.vertexAttrib1fv(index, Array.from(value));
1160
- };
1161
- WebGLRenderingContext.prototype.vertexAttrib2f = function (index, v0, v1) {
1087
+ this.context.vertexAttrib1fvOffset(index, value, value.byteOffset);
1088
+ }
1089
+ vertexAttrib2f(index, v0, v1) {
1162
1090
  this._glCheckError('vertexAttrib2f');
1163
1091
  this._checkArgs('vertexAttrib2f', arguments);
1164
1092
  this.context.vertexAttrib2f(index, v0, v1);
1165
- };
1166
- WebGLRenderingContext.prototype.vertexAttrib2fv = function (index, value) {
1093
+ }
1094
+ vertexAttrib2fv(index, value) {
1167
1095
  this._glCheckError('vertexAttrib2fv');
1168
1096
  this._checkArgs('vertexAttrib2fv', arguments);
1169
- this.context.vertexAttrib2fv(index, Array.from(value));
1170
- };
1171
- WebGLRenderingContext.prototype.vertexAttrib3f = function (index, v0, v1, v2) {
1097
+ if (!(value instanceof Float32Array)) {
1098
+ value = new Float32Array(value);
1099
+ }
1100
+ this.context.vertexAttrib2fvOffset(index, value, value.byteOffset);
1101
+ }
1102
+ vertexAttrib3f(index, v0, v1, v2) {
1172
1103
  this._glCheckError('vertexAttrib3f');
1173
1104
  this._checkArgs('vertexAttrib3f', arguments);
1174
1105
  this.context.vertexAttrib3f(index, v0, v1, v2);
1175
- };
1176
- WebGLRenderingContext.prototype.vertexAttrib3fv = function (index, value) {
1106
+ }
1107
+ vertexAttrib3fv(index, value) {
1177
1108
  this._glCheckError('vertexAttrib3fv');
1178
1109
  this._checkArgs('vertexAttrib3fv', arguments);
1179
1110
  if (!(value instanceof Float32Array)) {
1180
1111
  value = new Float32Array(value);
1181
1112
  }
1182
- this.context.vertexAttrib3fv(index, Array.from(value));
1183
- };
1184
- WebGLRenderingContext.prototype.vertexAttrib4f = function (index, v0, v1, v2, v3) {
1113
+ this.context.vertexAttrib3fvOffset(index, value, value.byteOffset);
1114
+ }
1115
+ vertexAttrib4f(index, v0, v1, v2, v3) {
1185
1116
  this._glCheckError('vertexAttrib4f');
1186
1117
  this._checkArgs('vertexAttrib4f', arguments);
1187
1118
  this.context.vertexAttrib4f(index, v0, v1, v2, v3);
1188
- };
1189
- WebGLRenderingContext.prototype.vertexAttrib4fv = function (index, value) {
1119
+ }
1120
+ vertexAttrib4fv(index, value) {
1190
1121
  this._glCheckError('vertexAttrib4fv');
1191
1122
  this._checkArgs('vertexAttrib4fv', arguments);
1192
1123
  if (!(value instanceof Float32Array)) {
1193
1124
  value = new Float32Array(value);
1194
1125
  }
1195
- this.context.vertexAttrib4fv(index, Array.from(value));
1196
- };
1197
- WebGLRenderingContext.prototype.vertexAttribPointer = function (index, size, type, normalized, stride, offset) {
1126
+ this.context.vertexAttrib4fvOffset(index, value, value.byteOffset);
1127
+ }
1128
+ vertexAttribPointer(index, size, type, normalized, stride, offset) {
1198
1129
  this._glCheckError('vertexAttribPointer');
1199
1130
  this._checkArgs('vertexAttribPointer', arguments);
1200
1131
  this.context.vertexAttribPointer(index, size, type, normalized, stride, offset);
1201
- };
1202
- WebGLRenderingContext.prototype.viewport = function (x, y, width, height) {
1132
+ }
1133
+ viewport(x, y, width, height) {
1203
1134
  this._glCheckError('viewport');
1204
1135
  this._checkArgs('viewport', arguments);
1205
1136
  this.context.viewport(x, y, width, height);
1206
- };
1207
- WebGLRenderingContext.prototype.getJSArray = function (value) {
1208
- var count = value.count;
1209
- var array = [];
1210
- for (var i = 0; i < count; i++) {
1137
+ }
1138
+ getJSArray(value) {
1139
+ const count = value.count;
1140
+ const array = [];
1141
+ for (let i = 0; i < count; i++) {
1211
1142
  array.push(value.objectAtIndex(i));
1212
1143
  }
1213
1144
  return array;
1214
- };
1215
- WebGLRenderingContext.prototype._glCheckError = function (message) {
1145
+ }
1146
+ _glCheckError(message) {
1216
1147
  if (!WebGLRenderingContext.isDebug) {
1217
1148
  return;
1218
1149
  }
1219
1150
  if (WebGLRenderingContext.filter === 'both' || WebGLRenderingContext.filter === 'error') {
1220
1151
  console.log(message, this.getError());
1221
1152
  }
1222
- };
1223
- WebGLRenderingContext.prototype._checkArgs = function (message, args) {
1153
+ }
1154
+ _checkArgs(message, args) {
1224
1155
  if (!WebGLRenderingContext.isDebug) {
1225
1156
  return;
1226
1157
  }
@@ -1229,10 +1160,8 @@ var WebGLRenderingContext = /** @class */ (function (_super) {
1229
1160
  console.dir(args);
1230
1161
  console.log('/**** ', message, ' ****/');
1231
1162
  }
1232
- };
1233
- WebGLRenderingContext.isDebug = false;
1234
- WebGLRenderingContext.filter = 'both';
1235
- return WebGLRenderingContext;
1236
- }(common_1.WebGLRenderingContextBase));
1237
- exports.WebGLRenderingContext = WebGLRenderingContext;
1163
+ }
1164
+ }
1165
+ WebGLRenderingContext.isDebug = false;
1166
+ WebGLRenderingContext.filter = 'both';
1238
1167
  //# sourceMappingURL=index.ios.js.map