@nativescript/canvas 2.0.0-alpha.20 → 2.0.0-alpha.22

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 (234) hide show
  1. package/Canvas/common.d.ts +2 -0
  2. package/Canvas/common.js +6 -0
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +0 -2
  5. package/Canvas/index.android.js +8 -24
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.d.ts +7 -0
  8. package/Canvas/index.ios.d.ts +0 -2
  9. package/Canvas/index.ios.js +7 -26
  10. package/Canvas/index.ios.js.map +1 -1
  11. package/Canvas2D/CanvasGradient/index.d.ts +1 -3
  12. package/Canvas2D/CanvasGradient/index.js +1 -10
  13. package/Canvas2D/CanvasGradient/index.js.map +1 -1
  14. package/Canvas2D/CanvasPattern/index.d.ts +1 -3
  15. package/Canvas2D/CanvasPattern/index.js +1 -10
  16. package/Canvas2D/CanvasPattern/index.js.map +1 -1
  17. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +0 -2
  18. package/Canvas2D/CanvasRenderingContext2D/index.js +120 -138
  19. package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
  20. package/Canvas2D/DOMMatrix/index.js +3 -3
  21. package/Canvas2D/DOMMatrix/index.js.map +1 -1
  22. package/Canvas2D/ImageData/index.js +5 -5
  23. package/Canvas2D/ImageData/index.js.map +1 -1
  24. package/Canvas2D/Path2D/index.d.ts +0 -2
  25. package/Canvas2D/Path2D/index.js +34 -39
  26. package/Canvas2D/Path2D/index.js.map +1 -1
  27. package/ImageAsset/index.d.ts +2 -2
  28. package/ImageAsset/index.js +33 -37
  29. package/ImageAsset/index.js.map +1 -1
  30. package/ImageBitmap/index.d.ts +0 -2
  31. package/ImageBitmap/index.js +23 -29
  32. package/ImageBitmap/index.js.map +1 -1
  33. package/SVG/SVG.js +1 -1
  34. package/TextDecoder/index.d.ts +0 -2
  35. package/TextDecoder/index.js +3 -12
  36. package/TextDecoder/index.js.map +1 -1
  37. package/TextEncoder/index.d.ts +0 -2
  38. package/TextEncoder/index.js +4 -13
  39. package/TextEncoder/index.js.map +1 -1
  40. package/WebGL/WebGLExtensions/index.d.ts +0 -9
  41. package/WebGL/WebGLExtensions/index.js +17 -74
  42. package/WebGL/WebGLExtensions/index.js.map +1 -1
  43. package/WebGL/WebGLRenderingContext/common.d.ts +0 -2
  44. package/WebGL/WebGLRenderingContext/common.js +0 -10
  45. package/WebGL/WebGLRenderingContext/common.js.map +1 -1
  46. package/WebGL/WebGLRenderingContext/index.js +159 -298
  47. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  48. package/WebGL2/WebGL2RenderingContext/index.js +107 -195
  49. package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
  50. package/angular/esm2020/index.mjs +5 -5
  51. package/angular/fesm2015/nativescript-canvas-angular.mjs +4 -4
  52. package/angular/fesm2015/nativescript-canvas-angular.mjs.map +1 -1
  53. package/angular/fesm2020/nativescript-canvas-angular.mjs +4 -4
  54. package/angular/fesm2020/nativescript-canvas-angular.mjs.map +1 -1
  55. package/index.js.map +1 -1
  56. package/package.json +1 -1
  57. package/platforms/android/canvas-release.aar +0 -0
  58. package/platforms/android/include.gradle +15 -0
  59. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  60. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +87 -57
  61. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +10 -0
  62. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +142 -0
  63. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2589 -110
  64. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  65. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  66. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +1174 -89
  67. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +2 -2
  68. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  69. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +2 -2
  70. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  71. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  72. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +174 -114
  73. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +10 -0
  74. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +142 -0
  75. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2589 -110
  76. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  77. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  78. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  79. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +1174 -89
  80. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +2 -2
  81. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  82. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -2
  83. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1174 -89
  84. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +2 -2
  85. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  86. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +2 -2
  87. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +42 -31
  88. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  89. package/platforms/ios/Podfile +3 -0
  90. package/platforms/ios/build.xcconfig +3 -3
  91. package/platforms/ios/src/CanvasModule.h +0 -2
  92. package/platforms/ios/src/CanvasModule.mm +4 -4
  93. package/platforms/ios/src/NSOperationQueueWrapper.h +11 -0
  94. package/platforms/ios/src/NSOperationQueueWrapper.mm +74 -0
  95. package/platforms/ios/src/cpp/Caches.cpp +35 -0
  96. package/platforms/ios/src/cpp/Caches.h +186 -0
  97. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +1582 -0
  98. package/platforms/ios/src/cpp/CanvasJSIModule.h +7 -34
  99. package/platforms/ios/src/cpp/Common.h +30 -0
  100. package/platforms/ios/src/cpp/ConcurrentMap.h +54 -0
  101. package/platforms/ios/src/cpp/Helpers.h +304 -38
  102. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +802 -0
  103. package/platforms/ios/src/cpp/ImageAssetImpl.h +44 -12
  104. package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +189 -0
  105. package/platforms/ios/src/cpp/ImageBitmapImpl.h +22 -16
  106. package/platforms/ios/src/cpp/JSICallback.h +61 -5
  107. package/platforms/ios/src/cpp/JSIReadFileCallback.h +86 -6
  108. package/platforms/ios/src/cpp/JSIRuntime.cpp +21 -0
  109. package/platforms/ios/src/cpp/JSIRuntime.h +7 -0
  110. package/platforms/ios/src/cpp/OneByteStringResource.cpp +25 -0
  111. package/platforms/ios/src/cpp/OneByteStringResource.h +21 -0
  112. package/platforms/ios/src/cpp/RafImpl.cpp +8 -0
  113. package/platforms/ios/src/cpp/RafImpl.h +11 -8
  114. package/platforms/ios/src/cpp/TextDecoderImpl.cpp +188 -0
  115. package/platforms/ios/src/cpp/TextDecoderImpl.h +20 -14
  116. package/platforms/ios/src/cpp/TextEncoderImpl.cpp +139 -0
  117. package/platforms/ios/src/cpp/TextEncoderImpl.h +20 -11
  118. package/platforms/ios/src/cpp/canvas2d/CanvasGradient.cpp +71 -0
  119. package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +27 -13
  120. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +89 -0
  121. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +26 -13
  122. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +2391 -0
  123. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +264 -21
  124. package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +203 -0
  125. package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +26 -12
  126. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +800 -0
  127. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +172 -13
  128. package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +449 -0
  129. package/platforms/ios/src/cpp/canvas2d/Path2D.h +41 -12
  130. package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.cpp +253 -0
  131. package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +50 -12
  132. package/platforms/ios/src/cpp/gl.h +57 -7
  133. package/platforms/ios/src/cpp/gl3stub.c +425 -0
  134. package/platforms/ios/src/cpp/gl3stub.h +665 -0
  135. package/platforms/ios/src/cpp/gles3jni.h +37 -0
  136. package/platforms/ios/src/cpp/include/robin_hood.h +2544 -0
  137. package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp +93 -0
  138. package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +33 -13
  139. package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +41 -6
  140. package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +46 -10
  141. package/platforms/ios/src/cpp/webgl/WebGLProgram.h +40 -5
  142. package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +40 -6
  143. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +6457 -0
  144. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +261 -390
  145. package/platforms/ios/src/cpp/webgl/{WebGLRenderingContextBase.mm → WebGLRenderingContextBase.cpp} +17 -16
  146. package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.h +15 -36
  147. package/platforms/ios/src/cpp/webgl/WebGLShader.h +40 -6
  148. package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.cpp +50 -0
  149. package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +66 -11
  150. package/platforms/ios/src/cpp/webgl/WebGLTexture.h +40 -6
  151. package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +44 -8
  152. package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp +126 -0
  153. package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +25 -12
  154. package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp +35 -0
  155. package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +25 -5
  156. package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp +41 -0
  157. package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +25 -5
  158. package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp +323 -0
  159. package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +47 -13
  160. package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +49 -6
  161. package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +37 -15
  162. package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +47 -6
  163. package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +49 -6
  164. package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +36 -15
  165. package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +44 -6
  166. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +38 -15
  167. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +37 -16
  168. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +41 -6
  169. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +40 -16
  170. package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.cpp +102 -0
  171. package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +69 -14
  172. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +51 -8
  173. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +49 -6
  174. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +49 -8
  175. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +76 -6
  176. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +57 -6
  177. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +53 -6
  178. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +59 -6
  179. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +46 -6
  180. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp +43 -0
  181. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +126 -14
  182. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.cpp +32 -0
  183. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +61 -12
  184. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +4380 -0
  185. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +139 -343
  186. package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +40 -4
  187. package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +42 -3
  188. package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +44 -11
  189. package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +42 -4
  190. package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +43 -4
  191. package/platforms/ios/src/module.modulemap +1 -0
  192. package/platforms/ios/src/cpp/CanvasJSIModule.mm +0 -1105
  193. package/platforms/ios/src/cpp/ImageAssetImpl.mm +0 -417
  194. package/platforms/ios/src/cpp/ImageBitmapImpl.mm +0 -126
  195. package/platforms/ios/src/cpp/RafImpl.mm +0 -10
  196. package/platforms/ios/src/cpp/TextDecoderImpl.mm +0 -97
  197. package/platforms/ios/src/cpp/TextEncoderImpl.mm +0 -60
  198. package/platforms/ios/src/cpp/VecMutableBuffer.h +0 -46
  199. package/platforms/ios/src/cpp/canvas-cxx/src/lib.rs.cc +0 -6156
  200. package/platforms/ios/src/cpp/canvas-cxx/src/lib.rs.h +0 -2867
  201. package/platforms/ios/src/cpp/canvas2d/CanvasGradient.mm +0 -42
  202. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.mm +0 -49
  203. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.mm +0 -1972
  204. package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.mm +0 -68
  205. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.mm +0 -149
  206. package/platforms/ios/src/cpp/canvas2d/Path2D.mm +0 -335
  207. package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.mm +0 -68
  208. package/platforms/ios/src/cpp/rust/cxx.cc +0 -793
  209. package/platforms/ios/src/cpp/rust/cxx.h +0 -1111
  210. package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.mm +0 -39
  211. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.mm +0 -5958
  212. package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.mm +0 -40
  213. package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.mm +0 -108
  214. package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.mm +0 -28
  215. package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.mm +0 -42
  216. package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.mm +0 -295
  217. package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.mm +0 -40
  218. package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.mm +0 -37
  219. package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.mm +0 -28
  220. package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.mm +0 -31
  221. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.mm +0 -28
  222. package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.mm +0 -127
  223. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.mm +0 -45
  224. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.mm +0 -45
  225. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.mm +0 -31
  226. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.mm +0 -70
  227. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.mm +0 -47
  228. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.mm +0 -46
  229. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.mm +0 -49
  230. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.mm +0 -30
  231. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.mm +0 -177
  232. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.mm +0 -64
  233. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.mm +0 -4551
  234. /package/platforms/ios/src/cpp/{OnRafCallback.mm → OnRafCallback.cpp} +0 -0
@@ -6,18 +6,13 @@
6
6
  #pragma process_pending_includes
7
7
 
8
8
  #include <vector>
9
- #include "rust/cxx.h"
10
9
 
11
- #include "canvas2d/CanvasRenderingContext2DImpl.h"
10
+ #include "CanvasRenderingContext2DImpl.h"
12
11
  #include "RafImpl.h"
13
-
14
- #include "canvas-cxx/src/lib.rs.h"
15
- #import <NativeScript/JSIRuntime.h>
16
- #include "VecMutableBuffer.h"
17
12
  #include <cmath>
18
13
  #include "Helpers.h"
19
- #include "webgl/WebGLRenderingContextBase.h"
20
- #include "webgl/WebGLRenderingContext.h"
14
+ #include "WebGLRenderingContextBase.h"
15
+ #include "WebGLRenderingContext.h"
21
16
  #include "WebGLQuery.h"
22
17
  #include "WebGLSampler.h"
23
18
  #include "WebGLSyncImpl.h"
@@ -26,406 +21,207 @@
26
21
  #include "gl.h"
27
22
 
28
23
 
29
- using namespace facebook;
30
- using namespace org::nativescript::canvas;
31
-
32
- class JSI_EXPORT WebGL2RenderingContext : public WebGLRenderingContext {
24
+ class WebGL2RenderingContext : public WebGLRenderingContext {
33
25
  public:
34
26
 
35
- WebGL2RenderingContext(rust::Box<WebGLState> state);
27
+ WebGL2RenderingContext(WebGLState* state);
36
28
 
37
- WebGL2RenderingContext(rust::Box<WebGLState> state, WebGLRenderingVersion version);
29
+ WebGL2RenderingContext(WebGLState* state, WebGLRenderingVersion version);
38
30
 
39
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) override;
31
+ static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
40
32
 
41
- jsi::Value get(jsi::Runtime &, const jsi::PropNameID &name) override;
33
+ static v8::Local<v8::Object>
34
+ NewInstance(v8::Isolate *isolate, WebGL2RenderingContext *renderingContext) {
35
+ auto context = isolate->GetCurrentContext();
36
+ v8::EscapableHandleScope scope(isolate);
37
+ auto object = WebGL2RenderingContext::GetCtor(isolate)->GetFunction(
38
+ context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
39
+ SetNativeType(isolate, object, NativeType::WebGLRenderingContextBase);
40
+ auto ext = v8::External::New(isolate, renderingContext);
41
+ object->SetInternalField(0, ext);
42
+ return scope.Escape(object);
43
+ }
42
44
 
43
- static inline jsi::Value GetProperty(const std::string &methodName) {
44
- if (methodName == "READ_BUFFER") { return {0x0C02}; }
45
+ static WebGL2RenderingContext *GetPointer(const v8::Local<v8::Object> &object);
45
46
 
46
- if (methodName == "UNPACK_ROW_LENGTH") { return {0x0CF2}; }
47
+ static void SetConstants(v8::Isolate *isolate, const v8::Local<v8::ObjectTemplate> &tmpl);
47
48
 
48
- if (methodName == "UNPACK_SKIP_ROWS") { return {0x0CF3}; }
49
+ static void
50
+ SetProps(v8::Isolate *isolate, const v8::Local<v8::ObjectTemplate> &webgl2RenderingContextTpl);
49
51
 
50
- if (methodName == "UNPACK_SKIP_PIXELS") { return {0x0CF4}; }
52
+ static void SetMethods(v8::Isolate *isolate,
53
+ const v8::Local<v8::ObjectTemplate> &tmpl);
51
54
 
52
- if (methodName == "PACK_ROW_LENGTH") { return {0x0D02}; }
55
+ static void BeginQuery(const v8::FunctionCallbackInfo<v8::Value> &args);
53
56
 
54
- if (methodName == "PACK_SKIP_ROWS") { return {0x0D03}; }
57
+ static void BeginTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args);
55
58
 
56
- if (methodName == "PACK_SKIP_PIXELS") { return {0x0D04}; }
59
+ static void BindBufferBase(const v8::FunctionCallbackInfo<v8::Value> &args);
57
60
 
58
- if (methodName == "TEXTURE_BINDING_3D") { return {0x806A}; }
61
+ static void BindBufferRange(const v8::FunctionCallbackInfo<v8::Value> &args);
59
62
 
60
- if (methodName == "UNPACK_SKIP_IMAGES") { return {0x806D}; }
63
+ static void BindSampler(const v8::FunctionCallbackInfo<v8::Value> &args);
61
64
 
62
- if (methodName == "UNPACK_IMAGE_HEIGHT") { return {0x806E}; }
65
+ static void BindTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args);
63
66
 
64
- if (methodName == "MAX_3D_TEXTURE_SIZE") { return {0x8073}; }
67
+ static void BindVertexArray(const v8::FunctionCallbackInfo<v8::Value> &args);
65
68
 
66
- if (methodName == "MAX_ELEMENTS_VERTICES") { return {0x80E8}; }
69
+ static void BlitFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
67
70
 
68
- if (methodName == "MAX_ELEMENTS_INDICES") { return {0x80E9}; }
71
+ static void ClearBufferfi(const v8::FunctionCallbackInfo<v8::Value> &args);
69
72
 
70
- if (methodName == "MAX_TEXTURE_LOD_BIAS") { return {0x84FD}; }
73
+ static void ClearBufferfv(const v8::FunctionCallbackInfo<v8::Value> &args);
71
74
 
72
- if (methodName == "MAX_FRAGMENT_UNIFORM_COMPONENTS") { return {0x8B49}; }
75
+ static void ClearBufferiv(const v8::FunctionCallbackInfo<v8::Value> &args);
73
76
 
74
- if (methodName == "MAX_VERTEX_UNIFORM_COMPONENTS") { return {0x8B4A}; }
77
+ static void ClearBufferuiv(const v8::FunctionCallbackInfo<v8::Value> &args);
75
78
 
76
- if (methodName == "MAX_ARRAY_TEXTURE_LAYERS") { return {0x88FF}; }
79
+ static void ClientWaitSync(const v8::FunctionCallbackInfo<v8::Value> &args);
77
80
 
78
- if (methodName == "MIN_PROGRAM_TEXEL_OFFSET") { return {0x8904}; }
81
+ static void CompressedTexSubImage3D(const v8::FunctionCallbackInfo<v8::Value> &args);
79
82
 
80
- if (methodName == "MAX_PROGRAM_TEXEL_OFFSET") { return {0x8905}; }
83
+ static void CopyBufferSubData(const v8::FunctionCallbackInfo<v8::Value> &args);
81
84
 
82
- if (methodName == "MAX_VARYING_COMPONENTS") { return {0x8B4B}; }
85
+ static void CopyTexSubImage3D(const v8::FunctionCallbackInfo<v8::Value> &args);
83
86
 
84
- if (methodName == "FRAGMENT_SHADER_DERIVATIVE_HINT") { return {0x8B8B}; }
87
+ static void CreateQuery(const v8::FunctionCallbackInfo<v8::Value> &args);
85
88
 
86
- if (methodName == "RASTERIZER_DISCARD") { return {0x8C89}; }
89
+ static void CreateSampler(const v8::FunctionCallbackInfo<v8::Value> &args);
87
90
 
88
- if (methodName == "VERTEX_ARRAY_BINDING") { return {0x85B5}; }
89
- if (methodName == "MAX_VERTEX_OUTPUT_COMPONENTS") { return {0x9122}; }
90
- if (methodName == "MAX_FRAGMENT_INPUT_COMPONENTS") { return {0x9125}; }
91
- if (methodName == "MAX_SERVER_WAIT_TIMEOUT") { return {0x9111}; }
92
- if (methodName == "MAX_ELEMENT_INDEX") { return {0x8D6B}; }
91
+ static void CreateTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args);
93
92
 
94
- if (methodName == "RED") { return {0x1903}; }
95
- if (methodName == "RGB8") { return {0x8051}; }
96
- if (methodName == "RGBA8") { return {0x8058}; }
97
- if (methodName == "RGB10_A2") { return {0x8059}; }
98
- if (methodName == "TEXTURE_3D") { return {0x806F}; }
93
+ static void CreateVertexArray(const v8::FunctionCallbackInfo<v8::Value> &args);
99
94
 
100
- if (methodName == "TEXTURE_WRAP_R") { return {0x8072}; }
101
- if (methodName == "TEXTURE_MIN_LOD") { return {0x813A}; }
102
- if (methodName == "TEXTURE_MAX_LOD") { return {0x813B}; }
103
- if (methodName == "TEXTURE_BASE_LEVEL") { return {0x813C}; }
104
- if (methodName == "TEXTURE_MAX_LEVEL") { return {0x813D}; }
95
+ static void DeleteQuery(const v8::FunctionCallbackInfo<v8::Value> &args);
105
96
 
97
+ static void DeleteSampler(const v8::FunctionCallbackInfo<v8::Value> &args);
106
98
 
107
- if (methodName == "TEXTURE_COMPARE_MODE") { return {0x884C}; }
108
- if (methodName == "TEXTURE_COMPARE_FUNC") { return {0x884D}; }
109
- if (methodName == "SRGB") { return {0x8C40}; }
110
- if (methodName == "SRGB8") { return {0x8C41}; }
111
- if (methodName == "SRGB8_ALPHA8") { return {0x8C43}; }
99
+ static void DeleteSync(const v8::FunctionCallbackInfo<v8::Value> &args);
112
100
 
113
- if (methodName == "COMPARE_REF_TO_TEXTURE") { return {0x884E}; }
114
- if (methodName == "RGBA32F") { return {0x8814}; }
115
- if (methodName == "RGB32F") { return {0x8815}; }
116
- if (methodName == "RGBA16F") { return {0x881A}; }
117
- if (methodName == "RGB16F") { return {0x881B}; }
101
+ static void DeleteTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args);
118
102
 
119
- if (methodName == "TEXTURE_2D_ARRAY") { return {0x8C1A}; }
120
- if (methodName == "TEXTURE_BINDING_2D_ARRAY") { return {0x8C1D}; }
121
- if (methodName == "R11F_G11F_B10F") { return {0x8C3A}; }
122
- if (methodName == "RGB9_E5") { return {0x8C3D}; }
123
- if (methodName == "RGBA32UI") { return {0x8D70}; }
103
+ static void DeleteVertexArray(const v8::FunctionCallbackInfo<v8::Value> &args);
124
104
 
105
+ static void DrawArraysInstanced(const v8::FunctionCallbackInfo<v8::Value> &args);
125
106
 
126
- if (methodName == "RGB32UI") { return {0x8D71}; }
127
- if (methodName == "RGBA16UI") { return {0x8D76}; }
128
- if (methodName == "RGB16UI") { return {0x8D77}; }
129
- if (methodName == "RGBA8UI") { return {0x8D7C}; }
130
- if (methodName == "RGB8UI") { return {0x8D7D}; }
107
+ static void DrawBuffers(const v8::FunctionCallbackInfo<v8::Value> &args);
131
108
 
109
+ static void DrawElementsInstanced(const v8::FunctionCallbackInfo<v8::Value> &args);
132
110
 
133
- if (methodName == "RGBA32I") { return {0x8D82}; }
134
- if (methodName == "RGB32I") { return {0x8D83}; }
135
- if (methodName == "RGBA16I") { return {0x8D88}; }
136
- if (methodName == "RGB16I") { return {0x8D89}; }
137
- if (methodName == "RGBA8I") { return {0x8D8E}; }
111
+ static void DrawRangeElements(const v8::FunctionCallbackInfo<v8::Value> &args);
138
112
 
113
+ static void EndQuery(const v8::FunctionCallbackInfo<v8::Value> &args);
139
114
 
140
- if (methodName == "RGB8I") { return {0x8D8F}; }
141
- if (methodName == "RED_INTEGER") { return {0x8D94}; }
142
- if (methodName == "RGB_INTEGER") { return {0x8D98}; }
143
- if (methodName == "RGBA_INTEGER") { return {0x8D99}; }
144
- if (methodName == "R8") { return {0x8229}; }
115
+ static void EndTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args);
145
116
 
117
+ static void FenceSync(const v8::FunctionCallbackInfo<v8::Value> &args);
146
118
 
147
- if (methodName == "RG8") { return {0x822B}; }
148
- if (methodName == "R16F") { return {0x822D}; }
149
- if (methodName == "R32F") { return {0x822E}; }
150
- if (methodName == "RG16F") { return {0x822F}; }
151
- if (methodName == "RG32F") { return {0x8230}; }
119
+ static void FramebufferTextureLayer(const v8::FunctionCallbackInfo<v8::Value> &args);
152
120
 
121
+ static void GetActiveUniformBlockName(const v8::FunctionCallbackInfo<v8::Value> &args);
153
122
 
154
- if (methodName == "R8I") { return {0x8231}; }
155
- if (methodName == "R8UI") { return {0x8232}; }
156
- if (methodName == "R16I") { return {0x8233}; }
157
- if (methodName == "R16UI") { return {0x8234}; }
158
- if (methodName == "R32I") { return {0x8235}; }
123
+ static void GetActiveUniformBlockParameter(const v8::FunctionCallbackInfo<v8::Value> &args);
159
124
 
125
+ static void GetActiveUniforms(const v8::FunctionCallbackInfo<v8::Value> &args);
160
126
 
161
- if (methodName == "R32UI") { return {0x8236}; }
162
- if (methodName == "RG8I") { return {0x8237}; }
163
- if (methodName == "RG8UI") { return {0x8238}; }
164
- if (methodName == "RG16I") { return {0x8239}; }
165
- if (methodName == "RG16UI") { return {0x823A}; }
166
-
167
- if (methodName == "RG32I") { return {0x823B}; }
168
- if (methodName == "RG32UI") { return {0x823C}; }
169
- if (methodName == "R8_SNORM") { return {0x8F94}; }
170
- if (methodName == "RG8_SNORM") { return {0x8F95}; }
171
- if (methodName == "RGB8_SNORM") { return {0x8F96}; }
172
-
173
-
174
- if (methodName == "RGBA8_SNORM") { return {0x8F97}; }
175
- if (methodName == "RGB10_A2UI") { return {0x906F}; }
176
- if (methodName == "TEXTURE_IMMUTABLE_FORMAT") { return {0x912F}; }
177
- if (methodName == "TEXTURE_IMMUTABLE_LEVELS") { return {0x82DF}; }
178
- if (methodName == "UNSIGNED_INT_2_10_10_10_REV") { return {0x8368}; }
179
-
180
-
181
- if (methodName == "UNSIGNED_INT_10F_11F_11F_REV") { return {0x8C3B}; }
182
- if (methodName == "UNSIGNED_INT_5_9_9_9_REV") { return {0x8C3E}; }
183
- if (methodName == "FLOAT_32_UNSIGNED_INT_24_8_REV") { return {0x8DAD}; }
184
- if (methodName == "UNSIGNED_INT_24_8") { return {0x84FA}; }
185
- if (methodName == "HALF_FLOAT") { return {0x140B}; }
186
-
187
-
188
- if (methodName == "RG") { return {0x8227}; }
189
- if (methodName == "RG_INTEGER") { return {0x8228}; }
190
- if (methodName == "INT_2_10_10_10_REV") { return {0x8D9F}; }
191
- if (methodName == "QUERY_RESULT_AVAILABLE") { return {0x8865}; }
192
- if (methodName == "QUERY_RESULT") { return {0x8866}; }
193
-
194
-
195
- if (methodName == "CURRENT_QUERY") { return {0x8867}; }
196
- if (methodName == "ANY_SAMPLES_PASSED") { return {0x8C2F}; }
197
- if (methodName == "ANY_SAMPLES_PASSED_CONSERVATIVE") { return {0x8D6A}; }
198
- if (methodName == "MAX_DRAW_BUFFERS") { return {0x8824}; }
199
-
200
- if (methodName == "DRAW_BUFFER0") { return {0x8825}; }
201
- if (methodName == "DRAW_BUFFER1") { return {0x8826}; }
202
- if (methodName == "DRAW_BUFFER2") { return {0x8827}; }
203
- if (methodName == "DRAW_BUFFER3") { return {0x8828}; }
204
- if (methodName == "DRAW_BUFFER4") { return {0x8829}; }
205
- if (methodName == "DRAW_BUFFER5") { return {0x882A}; }
206
- if (methodName == "DRAW_BUFFER6") { return {0x882B}; }
207
- if (methodName == "DRAW_BUFFER7") { return {0x882C}; }
208
- if (methodName == "DRAW_BUFFER8") { return {0x882D}; }
209
- if (methodName == "DRAW_BUFFER9") { return {0x882E}; }
210
- if (methodName == "DRAW_BUFFER10") { return {0x882F}; }
211
-
212
- /* Getting GL parameter information */
213
-
214
- /* Textures */
215
-
216
- if (methodName == "DRAW_BUFFER11") { return {0x8830}; }
217
- if (methodName == "DRAW_BUFFER12") { return {0x8831}; }
218
- if (methodName == "DRAW_BUFFER13") { return {0x8832}; }
219
- if (methodName == "DRAW_BUFFER14") { return {0x8833}; }
220
- if (methodName == "DRAW_BUFFER15") { return {0x8834}; }
221
-
222
- if (methodName == "MAX_COLOR_ATTACHMENTS") { return {0x8CDF}; }
223
- if (methodName == "COLOR_ATTACHMENT1") { return {0x8CE1}; }
224
- if (methodName == "COLOR_ATTACHMENT2") { return {0x8CE2}; }
225
- if (methodName == "COLOR_ATTACHMENT3") { return {0x8CE3}; }
226
- if (methodName == "COLOR_ATTACHMENT4") { return {0x8CE4}; }
227
- if (methodName == "COLOR_ATTACHMENT5") { return {0x8CE5}; }
228
- if (methodName == "COLOR_ATTACHMENT6") { return {0x8CE6}; }
229
- if (methodName == "COLOR_ATTACHMENT7") { return {0x8CE7}; }
230
- if (methodName == "COLOR_ATTACHMENT8") { return {0x8CE8}; }
231
- if (methodName == "COLOR_ATTACHMENT9") { return {0x8CE9}; }
232
- if (methodName == "COLOR_ATTACHMENT10") { return {0x8CEA}; }
233
- if (methodName == "COLOR_ATTACHMENT11") { return {0x8CEB}; }
234
- if (methodName == "COLOR_ATTACHMENT12") { return {0x8CEC}; }
235
- if (methodName == "COLOR_ATTACHMENT13") { return {0x8CED}; }
236
- if (methodName == "COLOR_ATTACHMENT14") { return {0x8CEE}; }
237
- if (methodName == "COLOR_ATTACHMENT15") { return {0x8CEF}; }
238
-
239
- if (methodName == "SAMPLER_3D") { return {0x8B5F}; }
240
- if (methodName == "SAMPLER_2D_SHADOW") { return {0x8B62}; }
241
- if (methodName == "SAMPLER_2D_ARRAY") { return {0x8DC1}; }
242
- if (methodName == "SAMPLER_2D_ARRAY_SHADOW") { return {0x8DC4}; }
243
- if (methodName == "SAMPLER_CUBE_SHADOW") { return {0x8DC5}; }
244
-
245
- if (methodName == "INT_SAMPLER_2D") { return {0x8DCA}; }
246
- if (methodName == "INT_SAMPLER_3D") { return {0x8DCB}; }
247
- if (methodName == "INT_SAMPLER_CUBE") { return {0x8DCC}; }
248
- if (methodName == "INT_SAMPLER_2D_ARRAY") { return {0x8DCF}; }
249
- if (methodName == "UNSIGNED_INT_SAMPLER_2D") { return {0x8DD2}; }
250
-
251
- if (methodName == "UNSIGNED_INT_SAMPLER_3D") { return {0x8DD3}; }
252
- if (methodName == "UNSIGNED_INT_SAMPLER_CUBE") { return {0x8DD4}; }
253
- if (methodName == "UNSIGNED_INT_SAMPLER_2D_ARRAY") { return {0x8DD7}; }
254
- if (methodName == "MAX_SAMPLES") { return {0x8D57}; }
255
- if (methodName == "SAMPLER_BINDING") { return {0x8919}; }
256
-
257
- if (methodName == "PIXEL_PACK_BUFFER") { return {0x88EB}; }
258
- if (methodName == "PIXEL_UNPACK_BUFFER") { return {0x88EC}; }
259
- if (methodName == "PIXEL_PACK_BUFFER_BINDING") { return {0x88ED}; }
260
- if (methodName == "PIXEL_UNPACK_BUFFER_BINDING") { return {0x88EF}; }
261
- if (methodName == "COPY_READ_BUFFER") { return {0x8F36}; }
262
-
263
- if (methodName == "COPY_WRITE_BUFFER") { return {0x8F37}; }
264
- if (methodName == "COPY_READ_BUFFER_BINDING") { return {0x8F36}; }
265
- if (methodName == "COPY_WRITE_BUFFER_BINDING") { return {0x8F37}; }
266
- if (methodName == "FLOAT_MAT2x3") { return {0x8B65}; }
267
- if (methodName == "FLOAT_MAT2x4") { return {0x8B66}; }
268
-
269
- if (methodName == "FLOAT_MAT3x2") { return {0x8B67}; }
270
- if (methodName == "FLOAT_MAT3x4") { return {0x8B68}; }
271
- if (methodName == "FLOAT_MAT4x2") { return {0x8B69}; }
272
- if (methodName == "FLOAT_MAT4x3") { return {0x8B6A}; }
273
- if (methodName == "UNSIGNED_INT_VEC2") { return {0x8DC6}; }
274
-
275
- if (methodName == "UNSIGNED_INT_VEC3") { return {0x8DC7}; }
276
- if (methodName == "UNSIGNED_INT_VEC4") { return {0x8DC8}; }
277
- if (methodName == "UNSIGNED_NORMALIZED") { return {0x8C17}; }
278
- if (methodName == "SIGNED_NORMALIZED") { return {0x8F9C}; }
279
-
280
- /* Vertex attributes */
281
-
282
- if (methodName == "VERTEX_ATTRIB_ARRAY_INTEGER") { return {0x88FD}; }
283
- if (methodName == "VERTEX_ATTRIB_ARRAY_DIVISOR") { return {0x88FE}; }
284
- if (methodName == "TRANSFORM_FEEDBACK_BUFFER_MODE") { return {0x8C7F}; }
285
- if (methodName == "MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS") { return {0x8C80}; }
286
- if (methodName == "TRANSFORM_FEEDBACK_VARYINGS") { return {0x8C83}; }
287
-
288
- if (methodName == "TRANSFORM_FEEDBACK_BUFFER_START") { return {0x8C84}; }
289
- if (methodName == "TRANSFORM_FEEDBACK_BUFFER_SIZE") { return {0x8C85}; }
290
- if (methodName == "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN") { return {0x8C88}; }
291
- if (methodName == "MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS") { return {0x8C8A}; }
292
-
293
- /* Textures */
294
-
295
- /* Pixel types */
296
-
297
- if (methodName == "MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS") { return {0x8C8B}; }
298
- if (methodName == "INTERLEAVED_ATTRIBS") { return {0x8C8C}; }
299
- if (methodName == "SEPARATE_ATTRIBS") { return {0x8C8D}; }
300
- if (methodName == "TRANSFORM_FEEDBACK_BUFFER") { return {0x8C8E}; }
301
- if (methodName == "TRANSFORM_FEEDBACK_BUFFER_BINDING") { return {0x8C8F}; }
302
-
303
- if (methodName == "TRANSFORM_FEEDBACK") { return {0x8E22}; }
304
- if (methodName == "TRANSFORM_FEEDBACK_PAUSED") { return {0x8E23}; }
305
- if (methodName == "TRANSFORM_FEEDBACK_ACTIVE") { return {0x8E24}; }
306
- if (methodName == "TRANSFORM_FEEDBACK_BINDING") { return {0x8E25}; }
307
-
308
- /* Pixel types */
309
-
310
- /* Queries */
311
-
312
- if (methodName == "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING") { return {0x8210}; }
313
- if (methodName == "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE") { return {0x8211}; }
314
- if (methodName == "FRAMEBUFFER_ATTACHMENT_RED_SIZE") { return {0x8212}; }
315
- if (methodName == "FRAMEBUFFER_ATTACHMENT_GREEN_SIZE") { return {0x8213}; }
316
- if (methodName == "FRAMEBUFFER_ATTACHMENT_BLUE_SIZE") { return {0x8214}; }
317
-
318
- /* Queries */
319
-
320
- /* Draw buffers */
321
-
322
- if (methodName == "FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE") { return {0x8215}; }
323
- if (methodName == "FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE") { return {0x8216}; }
324
- if (methodName == "FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE") { return {0x8217}; }
325
- if (methodName == "FRAMEBUFFER_DEFAULT") { return {0x8218}; }
326
- if (methodName == "DEPTH_STENCIL_ATTACHMENT") { return {0x821A}; }
327
-
328
- if (methodName == "DEPTH_STENCIL") { return {0x84F9}; }
329
- if (methodName == "DEPTH24_STENCIL8") { return {0x88F0}; }
330
- if (methodName == "DRAW_FRAMEBUFFER_BINDING") { return {0x8CA6}; }
331
- if (methodName == "READ_FRAMEBUFFER") { return {0x8CA8}; }
332
- if (methodName == "DRAW_FRAMEBUFFER") { return {0x8CA9}; }
333
-
334
- if (methodName == "READ_FRAMEBUFFER_BINDING") { return {0x8CAA}; }
335
- if (methodName == "RENDERBUFFER_SAMPLES") { return {0x8CAB}; }
336
- if (methodName == "FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER") { return {0x8CD4}; }
337
- if (methodName == "FRAMEBUFFER_INCOMPLETE_MULTISAMPLE") { return {0x8D56}; }
338
- if (methodName == "UNIFORM_BUFFER") { return {0x8A11}; }
339
-
340
- if (methodName == "UNIFORM_BUFFER_BINDING") { return {0x8A28}; }
341
- if (methodName == "UNIFORM_BUFFER_START") { return {0x8A29}; }
342
- if (methodName == "UNIFORM_BUFFER_SIZE") { return {0x8A2A}; }
343
- if (methodName == "MAX_VERTEX_UNIFORM_BLOCKS") { return {0x8A2B}; }
344
- if (methodName == "MAX_FRAGMENT_UNIFORM_BLOCKS") { return {0x8A2D}; }
345
-
346
- if (methodName == "MAX_COMBINED_UNIFORM_BLOCKS") { return {0x8A2E}; }
347
- if (methodName == "MAX_UNIFORM_BUFFER_BINDINGS") { return {0x8A2F}; }
348
- if (methodName == "MAX_UNIFORM_BLOCK_SIZE") { return {0x8A30}; }
349
- if (methodName == "MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS") { return {0x8A31}; }
350
- if (methodName == "MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS") { return {0x8A33}; }
351
-
352
- if (methodName == "UNIFORM_BUFFER_OFFSET_ALIGNMENT") { return {0x8A34}; }
353
- if (methodName == "ACTIVE_UNIFORM_BLOCKS") { return {0x8A36}; }
354
- if (methodName == "UNIFORM_TYPE") { return {0x8A37}; }
355
- if (methodName == "UNIFORM_SIZE") { return {0x8A38}; }
356
- if (methodName == "UNIFORM_BLOCK_INDEX") { return {0x8A3A}; }
357
-
358
- if (methodName == "UNIFORM_OFFSET") { return {0x8A3B}; }
359
- if (methodName == "UNIFORM_ARRAY_STRIDE") { return {0x8A3C}; }
360
- if (methodName == "UNIFORM_MATRIX_STRIDE") { return {0x8A3D}; }
127
+ static void GetBufferSubData(const v8::FunctionCallbackInfo<v8::Value> &args);
361
128
 
362
- /* Draw buffers */
129
+ static void GetFragDataLocation(const v8::FunctionCallbackInfo<v8::Value> &args);
363
130
 
364
- /* Samplers */
131
+ static void GetIndexedParameter(const v8::FunctionCallbackInfo<v8::Value> &args);
365
132
 
366
- if (methodName == "UNIFORM_IS_ROW_MAJOR") { return {0x8A3E}; }
367
- if (methodName == "UNIFORM_BLOCK_BINDING") { return {0x8A3F}; }
368
- if (methodName == "UNIFORM_BLOCK_DATA_SIZE") { return {0x8A40}; }
369
- if (methodName == "UNIFORM_BLOCK_ACTIVE_UNIFORMS") { return {0x8A42}; }
370
- if (methodName == "UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES") { return {0x8A43}; }
133
+ static void GetInternalformatParameter(const v8::FunctionCallbackInfo<v8::Value> &args);
371
134
 
372
- if (methodName == "UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER") { return {0x8A44}; }
373
- if (methodName == "UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER") { return {0x8A46}; }
374
- if (methodName == "OBJECT_TYPE") { return {0x9112}; }
375
- if (methodName == "SYNC_CONDITION") { return {0x9113}; }
376
- if (methodName == "SYNC_STATUS") { return {0x9114}; }
135
+ static void GetParameter(const v8::FunctionCallbackInfo<v8::Value> &args);
377
136
 
378
- if (methodName == "SYNC_FLAGS") { return {0x9115}; }
379
- if (methodName == "SYNC_FENCE") { return {0x9116}; }
380
- if (methodName == "SYNC_GPU_COMMANDS_COMPLETE") { return {0x9117}; }
381
- if (methodName == "UNSIGNALED") { return {0x9118}; }
382
- if (methodName == "SIGNALED") { return {0x9119}; }
137
+ static void GetQueryParameter(const v8::FunctionCallbackInfo<v8::Value> &args);
383
138
 
384
- /* Samplers */
139
+ static void GetQuery(const v8::FunctionCallbackInfo<v8::Value> &args);
385
140
 
386
- /* Buffers */
141
+ static void GetSamplerParameter(const v8::FunctionCallbackInfo<v8::Value> &args);
387
142
 
388
- if (methodName == "ALREADY_SIGNALED") { return {0x911A}; }
389
- if (methodName == "TIMEOUT_EXPIRED") { return {0x911B}; }
390
- if (methodName == "CONDITION_SATISFIED") { return {0x911C}; }
391
- if (methodName == "WAIT_FAILED") { return {0x911D}; }
392
- if (methodName == "SYNC_FLUSH_COMMANDS_BIT") { return {0x00000001}; }
143
+ static void GetSyncParameter(const v8::FunctionCallbackInfo<v8::Value> &args);
393
144
 
394
- if (methodName == "COLOR") { return {0x1800}; }
395
- if (methodName == "DEPTH") { return {0x1801}; }
396
- if (methodName == "STENCIL") { return {0x1802}; }
145
+ static void GetTransformFeedbackVarying(const v8::FunctionCallbackInfo<v8::Value> &args);
397
146
 
398
- /* Buffers */
147
+ static void GetUniformBlockIndex(const v8::FunctionCallbackInfo<v8::Value> &args);
399
148
 
400
- /* Data types */
149
+ static void GetUniformIndices(const v8::FunctionCallbackInfo<v8::Value> &args);
401
150
 
402
- if (methodName == "MIN") { return {0x8007}; }
403
- if (methodName == "MAX") { return {0x8008}; }
404
- if (methodName == "DEPTH_COMPONENT24") { return {0x81A6}; }
405
- if (methodName == "STREAM_READ") { return {0x88E1}; }
406
- if (methodName == "STREAM_COPY") { return {0x88E2}; }
151
+ static void InvalidateFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
407
152
 
408
- if (methodName == "STATIC_READ") { return {0x88E5}; }
409
- if (methodName == "STATIC_COPY") { return {0x88E6}; }
410
- if (methodName == "DYNAMIC_READ") { return {0x88E9}; }
411
- if (methodName == "DYNAMIC_COPY") { return {0x88EA}; }
412
- if (methodName == "DEPTH_COMPONENT32F") { return {0x8CAC}; }
413
- if (methodName == "DEPTH32F_STENCIL8") { return {0x8CAD}; }
153
+ static void InvalidateSubFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
414
154
 
415
- /* Data types */
155
+ static void IsQuery(const v8::FunctionCallbackInfo<v8::Value> &args);
416
156
 
417
- if (methodName == "INVALID_INDEX") { return {(double) 0xFFFFFFFF}; }
418
- if (methodName == "TIMEOUT_IGNORED") { return {-1}; }
157
+ static void IsSampler(const v8::FunctionCallbackInfo<v8::Value> &args);
419
158
 
420
- /* Vertex attributes */
159
+ static void IsSync(const v8::FunctionCallbackInfo<v8::Value> &args);
421
160
 
422
- /* Transform feedback */
161
+ static void IsTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args);
423
162
 
424
- if (methodName == "MAX_CLIENT_WAIT_TIMEOUT_WEBGL") { return {0x9247}; }
163
+ static void IsVertexArray(const v8::FunctionCallbackInfo<v8::Value> &args);
425
164
 
426
- /* Transform feedback */
165
+ static void PauseTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args);
427
166
 
428
- return jsi::Value::undefined();
429
- }
167
+ static void ReadBuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
168
+
169
+ static void RenderbufferStorageMultisample(const v8::FunctionCallbackInfo<v8::Value> &args);
170
+
171
+ static void ResumeTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args);
172
+
173
+ static void SamplerParameterf(const v8::FunctionCallbackInfo<v8::Value> &args);
174
+
175
+ static void SamplerParameteri(const v8::FunctionCallbackInfo<v8::Value> &args);
176
+
177
+ static void TexImage3D(const v8::FunctionCallbackInfo<v8::Value> &args);
178
+
179
+ static void TexStorage2D(const v8::FunctionCallbackInfo<v8::Value> &args);
180
+
181
+ static void TexStorage3D(const v8::FunctionCallbackInfo<v8::Value> &args);
182
+
183
+ static void TexSubImage3D(const v8::FunctionCallbackInfo<v8::Value> &args);
184
+
185
+ static void TransformFeedbackVaryings(const v8::FunctionCallbackInfo<v8::Value> &args);
186
+
187
+ static void Uniform1ui(const v8::FunctionCallbackInfo<v8::Value> &args);
188
+
189
+ static void Uniform1uiv(const v8::FunctionCallbackInfo<v8::Value> &args);
190
+
191
+ static void Uniform2ui(const v8::FunctionCallbackInfo<v8::Value> &args);
192
+
193
+ static void Uniform2uiv(const v8::FunctionCallbackInfo<v8::Value> &args);
194
+
195
+ static void Uniform3ui(const v8::FunctionCallbackInfo<v8::Value> &args);
196
+
197
+ static void Uniform3uiv(const v8::FunctionCallbackInfo<v8::Value> &args);
198
+
199
+ static void Uniform4ui(const v8::FunctionCallbackInfo<v8::Value> &args);
200
+
201
+ static void Uniform4uiv(const v8::FunctionCallbackInfo<v8::Value> &args);
202
+
203
+ static void UniformBlockBinding(const v8::FunctionCallbackInfo<v8::Value> &args);
204
+
205
+ static void UniformMatrix2x3fv(const v8::FunctionCallbackInfo<v8::Value> &args);
206
+
207
+ static void UniformMatrix2x4fv(const v8::FunctionCallbackInfo<v8::Value> &args);
208
+
209
+ static void UniformMatrix3x2fv(const v8::FunctionCallbackInfo<v8::Value> &args);
210
+
211
+ static void UniformMatrix3x4fv(const v8::FunctionCallbackInfo<v8::Value> &args);
212
+
213
+ static void UniformMatrix4x2fv(const v8::FunctionCallbackInfo<v8::Value> &args);
214
+
215
+ static void UniformMatrix4x3fv(const v8::FunctionCallbackInfo<v8::Value> &args);
216
+
217
+ static void VertexAttribDivisor(const v8::FunctionCallbackInfo<v8::Value> &args);
218
+
219
+ static void VertexAttribI4i(const v8::FunctionCallbackInfo<v8::Value> &args);
220
+
221
+ static void VertexAttribI4iv(const v8::FunctionCallbackInfo<v8::Value> &args);
222
+
223
+ static void VertexAttribI4ui(const v8::FunctionCallbackInfo<v8::Value> &args);
224
+
225
+ static void VertexAttribI4uiv(const v8::FunctionCallbackInfo<v8::Value> &args);
430
226
 
431
227
  };
@@ -4,14 +4,50 @@
4
4
 
5
5
  #pragma once
6
6
 
7
- #import <NativeScript/JSIRuntime.h>
7
+ #include "Caches.h"
8
8
 
9
- using namespace facebook;
10
-
11
- class JSI_EXPORT WebGLQuery : public jsi::HostObject {
9
+ class WebGLQuery {
12
10
  public:
13
11
  WebGLQuery(uint32_t query) : query_(query) {}
14
12
 
13
+ static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
14
+ auto cache = Caches::Get(isolate);
15
+ auto ctor = cache->WebGLQueryTmpl.get();
16
+ if (ctor != nullptr) {
17
+ return ctor->Get(isolate);
18
+ }
19
+
20
+ v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
21
+ ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
22
+ ctorTmpl->SetClassName(ConvertToV8String(isolate, "WebGLQuery"));
23
+
24
+ auto tmpl = ctorTmpl->InstanceTemplate();
25
+ tmpl->SetInternalFieldCount(1);
26
+
27
+ cache->WebGLQueryTmpl =
28
+ std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
29
+ return ctorTmpl;
30
+ }
31
+
32
+ static v8::Local<v8::Object> NewInstance(v8::Isolate *isolate, WebGLQuery *query) {
33
+ auto context = isolate->GetCurrentContext();
34
+ v8::EscapableHandleScope scope(isolate);
35
+ auto object = WebGLQuery::GetCtor(isolate)->GetFunction(
36
+ context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
37
+ SetNativeType(isolate, object, NativeType::WebGLQuery);
38
+ auto ext = v8::External::New(isolate, query);
39
+ object->SetInternalField(0, ext);
40
+ return scope.Escape(object);
41
+ }
42
+
43
+ static WebGLQuery *GetPointer(const v8::Local<v8::Object> &object) {
44
+ auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
45
+ if (ptr == nullptr) {
46
+ return nullptr;
47
+ }
48
+ return static_cast<WebGLQuery *>(ptr);
49
+ }
50
+
15
51
  uint32_t GetQuery() {
16
52
  return this->query_;
17
53
  }