@shopify/react-native-skia 2.10.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/android/CMakeLists.txt +7 -41
  2. package/android/build.gradle +33 -0
  3. package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
  4. package/cpp/api/JsiNativeBuffer.h +14 -20
  5. package/cpp/api/JsiSkAnimatedImage.h +13 -16
  6. package/cpp/api/JsiSkAnimatedImageFactory.h +9 -7
  7. package/cpp/api/JsiSkApi.h +94 -90
  8. package/cpp/api/JsiSkCanvas.h +108 -251
  9. package/cpp/api/JsiSkColorFilterFactory.h +45 -63
  10. package/cpp/api/JsiSkContourMeasure.h +19 -29
  11. package/cpp/api/JsiSkContourMeasureIter.h +6 -6
  12. package/cpp/api/JsiSkConverters.h +410 -0
  13. package/cpp/api/JsiSkDataFactory.h +9 -15
  14. package/cpp/api/JsiSkFont.h +99 -180
  15. package/cpp/api/JsiSkFontMgr.h +19 -21
  16. package/cpp/api/JsiSkFontMgrFactory.h +4 -5
  17. package/cpp/api/JsiSkImage.h +66 -66
  18. package/cpp/api/JsiSkImageFactory.h +66 -63
  19. package/cpp/api/JsiSkImageFilterFactory.h +354 -608
  20. package/cpp/api/JsiSkImageInfo.h +10 -13
  21. package/cpp/api/JsiSkMaskFilterFactory.h +8 -11
  22. package/cpp/api/JsiSkMatrix.h +36 -73
  23. package/cpp/api/JsiSkNativeObjects.h +60 -92
  24. package/cpp/api/JsiSkPaint.h +73 -131
  25. package/cpp/api/JsiSkParagraph.h +36 -53
  26. package/cpp/api/JsiSkParagraphBuilder.h +36 -64
  27. package/cpp/api/JsiSkParagraphBuilderFactory.h +11 -16
  28. package/cpp/api/JsiSkPath.h +216 -349
  29. package/cpp/api/JsiSkPathBuilder.h +133 -269
  30. package/cpp/api/JsiSkPathBuilderFactory.h +11 -11
  31. package/cpp/api/JsiSkPathEffectFactory.h +52 -72
  32. package/cpp/api/JsiSkPathFactory.h +129 -195
  33. package/cpp/api/JsiSkPicture.h +12 -18
  34. package/cpp/api/JsiSkPictureRecorder.h +14 -15
  35. package/cpp/api/JsiSkPoint.h +4 -4
  36. package/cpp/api/JsiSkRRect.h +7 -8
  37. package/cpp/api/JsiSkRSXform.h +10 -23
  38. package/cpp/api/JsiSkRect.h +23 -31
  39. package/cpp/api/JsiSkRuntimeEffect.h +67 -83
  40. package/cpp/api/JsiSkRuntimeEffectFactory.h +6 -10
  41. package/cpp/api/JsiSkRuntimeShaderBuilder.h +5 -14
  42. package/cpp/api/JsiSkSVG.h +4 -4
  43. package/cpp/api/JsiSkShaderFactory.h +153 -225
  44. package/cpp/api/JsiSkSkottie.h +104 -126
  45. package/cpp/api/JsiSkSurface.h +11 -14
  46. package/cpp/api/JsiSkSurfaceFactory.h +6 -7
  47. package/cpp/api/JsiSkTextBlobFactory.h +31 -54
  48. package/cpp/api/JsiSkTypeface.h +8 -12
  49. package/cpp/api/JsiSkTypefaceFactory.h +9 -7
  50. package/cpp/api/JsiSkTypefaceFontProvider.h +22 -23
  51. package/cpp/api/JsiSkTypefaceFontProviderFactory.h +5 -6
  52. package/cpp/api/JsiSkVertices.h +6 -8
  53. package/cpp/api/JsiSkiaContext.h +10 -11
  54. package/cpp/api/JsiVideo.h +31 -71
  55. package/cpp/jsi/JSIConverter.h +0 -31
  56. package/cpp/jsi/NativeObject.h +11 -6
  57. package/cpp/rnskia/RNDawnContext.h +18 -2
  58. package/cpp/rnskia/RNDawnInterop.cpp +19 -0
  59. package/cpp/rnskia/RNDawnUtils.h +18 -1
  60. package/cpp/rnskia/RNSkManager.cpp +5 -162
  61. package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkaroundsAutogen.h +2 -0
  62. package/lib/commonjs/mock/index.js +0 -1
  63. package/lib/commonjs/mock/index.js.map +1 -1
  64. package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +15 -6
  65. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  66. package/lib/commonjs/skia/types/Skia.d.ts +5 -15
  67. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  68. package/lib/commonjs/skia/types/index.d.ts +0 -1
  69. package/lib/commonjs/skia/types/index.js +0 -11
  70. package/lib/commonjs/skia/types/index.js.map +1 -1
  71. package/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +2 -2
  72. package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
  73. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  74. package/lib/commonjs/skia/web/JsiSkia.js +1 -4
  75. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  76. package/lib/commonjs/views/index.d.ts +0 -1
  77. package/lib/commonjs/views/index.js +0 -11
  78. package/lib/commonjs/views/index.js.map +1 -1
  79. package/lib/module/mock/index.js +0 -1
  80. package/lib/module/mock/index.js.map +1 -1
  81. package/lib/module/skia/types/Image/ImageFactory.d.ts +15 -6
  82. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  83. package/lib/module/skia/types/Skia.d.ts +5 -15
  84. package/lib/module/skia/types/Skia.js.map +1 -1
  85. package/lib/module/skia/types/index.d.ts +0 -1
  86. package/lib/module/skia/types/index.js +0 -1
  87. package/lib/module/skia/types/index.js.map +1 -1
  88. package/lib/module/skia/web/JsiSkImageFactory.d.ts +2 -2
  89. package/lib/module/skia/web/JsiSkImageFactory.js +2 -2
  90. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  91. package/lib/module/skia/web/JsiSkia.js +1 -4
  92. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  93. package/lib/module/views/index.d.ts +0 -1
  94. package/lib/module/views/index.js +0 -1
  95. package/lib/module/views/index.js.map +1 -1
  96. package/lib/typescript/lib/commonjs/mock/index.d.ts +0 -1
  97. package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +2 -2
  98. package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +1 -2
  99. package/lib/typescript/lib/module/mock/index.d.ts +0 -2
  100. package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -2
  101. package/lib/typescript/lib/module/skia/types/index.d.ts +0 -1
  102. package/lib/typescript/lib/module/skia/web/JsiSkImageFactory.d.ts +2 -2
  103. package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +1 -2
  104. package/lib/typescript/lib/module/views/index.d.ts +0 -1
  105. package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +15 -6
  106. package/lib/typescript/src/skia/types/Skia.d.ts +5 -15
  107. package/lib/typescript/src/skia/types/index.d.ts +0 -1
  108. package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +2 -2
  109. package/lib/typescript/src/views/index.d.ts +0 -1
  110. package/package.json +3 -4
  111. package/react-native-skia.podspec +38 -4
  112. package/src/mock/index.ts +0 -1
  113. package/src/skia/types/Image/ImageFactory.ts +15 -6
  114. package/src/skia/types/Skia.ts +5 -15
  115. package/src/skia/types/index.ts +0 -1
  116. package/src/skia/web/JsiSkImageFactory.ts +3 -3
  117. package/src/skia/web/JsiSkia.ts +2 -5
  118. package/src/views/index.ts +0 -1
  119. package/android/cpp/jni/JniWebGPUView.cpp +0 -112
  120. package/android/cpp/rnskia-android/SkiaPlatformContext.h +0 -26
  121. package/android/src/main/java/com/shopify/reactnative/skia/WebGPUSurfaceView.java +0 -43
  122. package/android/src/main/java/com/shopify/reactnative/skia/WebGPUTextureView.java +0 -50
  123. package/android/src/main/java/com/shopify/reactnative/skia/WebGPUView.java +0 -98
  124. package/android/src/main/java/com/shopify/reactnative/skia/WebGPUViewAPI.java +0 -19
  125. package/android/src/main/java/com/shopify/reactnative/skia/WebGPUViewManager.java +0 -58
  126. package/apple/RNWebGPUAppleNativeBuffer.mm +0 -33
  127. package/apple/SkiaPlatformContext.h +0 -20
  128. package/apple/SkiaPlatformContext.mm +0 -21
  129. package/apple/SkiaWebGPUView.mm +0 -81
  130. package/apple/WebGPUMetalView.mm +0 -136
  131. package/cpp/rnwgpu/ArrayBuffer.h +0 -116
  132. package/cpp/rnwgpu/Canvas.h +0 -52
  133. package/cpp/rnwgpu/PlatformContext.h +0 -18
  134. package/cpp/rnwgpu/SurfaceRegistry.h +0 -605
  135. package/cpp/rnwgpu/api/AppleNativeBuffer.h +0 -22
  136. package/cpp/rnwgpu/api/Convertors.h +0 -783
  137. package/cpp/rnwgpu/api/External.h +0 -12
  138. package/cpp/rnwgpu/api/GPU.cpp +0 -162
  139. package/cpp/rnwgpu/api/GPU.h +0 -60
  140. package/cpp/rnwgpu/api/GPUAdapter.cpp +0 -239
  141. package/cpp/rnwgpu/api/GPUAdapter.h +0 -60
  142. package/cpp/rnwgpu/api/GPUAdapterInfo.h +0 -57
  143. package/cpp/rnwgpu/api/GPUBindGroup.cpp +0 -3
  144. package/cpp/rnwgpu/api/GPUBindGroup.h +0 -51
  145. package/cpp/rnwgpu/api/GPUBindGroupLayout.h +0 -52
  146. package/cpp/rnwgpu/api/GPUBuffer.cpp +0 -107
  147. package/cpp/rnwgpu/api/GPUBuffer.h +0 -88
  148. package/cpp/rnwgpu/api/GPUCanvasContext.cpp +0 -75
  149. package/cpp/rnwgpu/api/GPUCanvasContext.h +0 -70
  150. package/cpp/rnwgpu/api/GPUCommandBuffer.h +0 -45
  151. package/cpp/rnwgpu/api/GPUCommandEncoder.cpp +0 -179
  152. package/cpp/rnwgpu/api/GPUCommandEncoder.h +0 -111
  153. package/cpp/rnwgpu/api/GPUCompilationInfo.h +0 -79
  154. package/cpp/rnwgpu/api/GPUCompilationMessage.h +0 -36
  155. package/cpp/rnwgpu/api/GPUComputePassEncoder.cpp +0 -60
  156. package/cpp/rnwgpu/api/GPUComputePassEncoder.h +0 -85
  157. package/cpp/rnwgpu/api/GPUComputePipeline.cpp +0 -12
  158. package/cpp/rnwgpu/api/GPUComputePipeline.h +0 -60
  159. package/cpp/rnwgpu/api/GPUDevice.cpp +0 -613
  160. package/cpp/rnwgpu/api/GPUDevice.h +0 -258
  161. package/cpp/rnwgpu/api/GPUDeviceLostInfo.cpp +0 -7
  162. package/cpp/rnwgpu/api/GPUDeviceLostInfo.h +0 -40
  163. package/cpp/rnwgpu/api/GPUError.h +0 -35
  164. package/cpp/rnwgpu/api/GPUExtent3D.h +0 -66
  165. package/cpp/rnwgpu/api/GPUExternalTexture.cpp +0 -139
  166. package/cpp/rnwgpu/api/GPUExternalTexture.h +0 -95
  167. package/cpp/rnwgpu/api/GPUFeatures.h +0 -203
  168. package/cpp/rnwgpu/api/GPUInternalError.h +0 -31
  169. package/cpp/rnwgpu/api/GPUOrigin2D.h +0 -55
  170. package/cpp/rnwgpu/api/GPUOrigin3D.h +0 -62
  171. package/cpp/rnwgpu/api/GPUOutOfMemoryError.h +0 -33
  172. package/cpp/rnwgpu/api/GPUPipelineLayout.h +0 -45
  173. package/cpp/rnwgpu/api/GPUQuerySet.cpp +0 -11
  174. package/cpp/rnwgpu/api/GPUQuerySet.h +0 -73
  175. package/cpp/rnwgpu/api/GPUQueue.cpp +0 -179
  176. package/cpp/rnwgpu/api/GPUQueue.h +0 -84
  177. package/cpp/rnwgpu/api/GPURenderBundle.h +0 -44
  178. package/cpp/rnwgpu/api/GPURenderBundleEncoder.cpp +0 -131
  179. package/cpp/rnwgpu/api/GPURenderBundleEncoder.h +0 -110
  180. package/cpp/rnwgpu/api/GPURenderPassEncoder.cpp +0 -165
  181. package/cpp/rnwgpu/api/GPURenderPassEncoder.h +0 -130
  182. package/cpp/rnwgpu/api/GPURenderPipeline.cpp +0 -13
  183. package/cpp/rnwgpu/api/GPURenderPipeline.h +0 -61
  184. package/cpp/rnwgpu/api/GPUSampler.h +0 -44
  185. package/cpp/rnwgpu/api/GPUShaderModule.cpp +0 -56
  186. package/cpp/rnwgpu/api/GPUShaderModule.h +0 -66
  187. package/cpp/rnwgpu/api/GPUSharedFence.cpp +0 -80
  188. package/cpp/rnwgpu/api/GPUSharedFence.h +0 -53
  189. package/cpp/rnwgpu/api/GPUSharedTextureMemory.cpp +0 -135
  190. package/cpp/rnwgpu/api/GPUSharedTextureMemory.h +0 -75
  191. package/cpp/rnwgpu/api/GPUSupportedLimits.cpp +0 -129
  192. package/cpp/rnwgpu/api/GPUSupportedLimits.h +0 -131
  193. package/cpp/rnwgpu/api/GPUTexture.cpp +0 -47
  194. package/cpp/rnwgpu/api/GPUTexture.h +0 -162
  195. package/cpp/rnwgpu/api/GPUTextureView.h +0 -44
  196. package/cpp/rnwgpu/api/GPUUncapturedErrorEvent.h +0 -60
  197. package/cpp/rnwgpu/api/GPUValidationError.h +0 -32
  198. package/cpp/rnwgpu/api/ImageBitmap.h +0 -62
  199. package/cpp/rnwgpu/api/NativeBufferUtils.h +0 -87
  200. package/cpp/rnwgpu/api/RNWebGPU.h +0 -82
  201. package/cpp/rnwgpu/api/WebGPUConstants.h +0 -36
  202. package/cpp/rnwgpu/api/descriptors/GPUBindGroupDescriptor.h +0 -64
  203. package/cpp/rnwgpu/api/descriptors/GPUBindGroupEntry.h +0 -78
  204. package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutDescriptor.h +0 -56
  205. package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutEntry.h +0 -97
  206. package/cpp/rnwgpu/api/descriptors/GPUBlendComponent.h +0 -57
  207. package/cpp/rnwgpu/api/descriptors/GPUBlendState.h +0 -52
  208. package/cpp/rnwgpu/api/descriptors/GPUBufferBinding.h +0 -56
  209. package/cpp/rnwgpu/api/descriptors/GPUBufferBindingLayout.h +0 -56
  210. package/cpp/rnwgpu/api/descriptors/GPUBufferDescriptor.h +0 -59
  211. package/cpp/rnwgpu/api/descriptors/GPUBufferUsage.h +0 -39
  212. package/cpp/rnwgpu/api/descriptors/GPUCanvasConfiguration.h +0 -76
  213. package/cpp/rnwgpu/api/descriptors/GPUColor.h +0 -66
  214. package/cpp/rnwgpu/api/descriptors/GPUColorTargetState.h +0 -58
  215. package/cpp/rnwgpu/api/descriptors/GPUColorWrite.h +0 -29
  216. package/cpp/rnwgpu/api/descriptors/GPUCommandBufferDescriptor.h +0 -45
  217. package/cpp/rnwgpu/api/descriptors/GPUCommandEncoderDescriptor.h +0 -45
  218. package/cpp/rnwgpu/api/descriptors/GPUComputePassDescriptor.h +0 -56
  219. package/cpp/rnwgpu/api/descriptors/GPUComputePassTimestampWrites.h +0 -58
  220. package/cpp/rnwgpu/api/descriptors/GPUComputePipelineDescriptor.h +0 -67
  221. package/cpp/rnwgpu/api/descriptors/GPUDawnTogglesDescriptor.h +0 -56
  222. package/cpp/rnwgpu/api/descriptors/GPUDepthStencilState.h +0 -103
  223. package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +0 -109
  224. package/cpp/rnwgpu/api/descriptors/GPUExternalTextureBindingLayout.h +0 -38
  225. package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +0 -90
  226. package/cpp/rnwgpu/api/descriptors/GPUFragmentState.h +0 -73
  227. package/cpp/rnwgpu/api/descriptors/GPUImageCopyBuffer.h +0 -62
  228. package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +0 -63
  229. package/cpp/rnwgpu/api/descriptors/GPUImageCopyTexture.h +0 -65
  230. package/cpp/rnwgpu/api/descriptors/GPUImageCopyTextureTagged.h +0 -81
  231. package/cpp/rnwgpu/api/descriptors/GPUImageDataLayout.h +0 -54
  232. package/cpp/rnwgpu/api/descriptors/GPUMapMode.h +0 -22
  233. package/cpp/rnwgpu/api/descriptors/GPUMultisampleState.h +0 -54
  234. package/cpp/rnwgpu/api/descriptors/GPUPipelineLayoutDescriptor.h +0 -57
  235. package/cpp/rnwgpu/api/descriptors/GPUPrimitiveState.h +0 -69
  236. package/cpp/rnwgpu/api/descriptors/GPUProgrammableStage.h +0 -61
  237. package/cpp/rnwgpu/api/descriptors/GPUQuerySetDescriptor.h +0 -55
  238. package/cpp/rnwgpu/api/descriptors/GPUQueueDescriptor.h +0 -43
  239. package/cpp/rnwgpu/api/descriptors/GPURenderBundleDescriptor.h +0 -45
  240. package/cpp/rnwgpu/api/descriptors/GPURenderBundleEncoderDescriptor.h +0 -80
  241. package/cpp/rnwgpu/api/descriptors/GPURenderPassColorAttachment.h +0 -81
  242. package/cpp/rnwgpu/api/descriptors/GPURenderPassDepthStencilAttachment.h +0 -101
  243. package/cpp/rnwgpu/api/descriptors/GPURenderPassDescriptor.h +0 -92
  244. package/cpp/rnwgpu/api/descriptors/GPURenderPassTimestampWrites.h +0 -58
  245. package/cpp/rnwgpu/api/descriptors/GPURenderPipelineDescriptor.h +0 -103
  246. package/cpp/rnwgpu/api/descriptors/GPURequestAdapterOptions.h +0 -51
  247. package/cpp/rnwgpu/api/descriptors/GPUSamplerBindingLayout.h +0 -45
  248. package/cpp/rnwgpu/api/descriptors/GPUSamplerDescriptor.h +0 -110
  249. package/cpp/rnwgpu/api/descriptors/GPUShaderModuleCompilationHint.h +0 -60
  250. package/cpp/rnwgpu/api/descriptors/GPUShaderModuleDescriptor.h +0 -62
  251. package/cpp/rnwgpu/api/descriptors/GPUShaderStage.h +0 -25
  252. package/cpp/rnwgpu/api/descriptors/GPUSharedFenceDescriptor.h +0 -58
  253. package/cpp/rnwgpu/api/descriptors/GPUSharedFenceState.h +0 -51
  254. package/cpp/rnwgpu/api/descriptors/GPUSharedTextureMemoryDescriptor.h +0 -73
  255. package/cpp/rnwgpu/api/descriptors/GPUStencilFaceState.h +0 -64
  256. package/cpp/rnwgpu/api/descriptors/GPUStorageTextureBindingLayout.h +0 -59
  257. package/cpp/rnwgpu/api/descriptors/GPUTextureBindingLayout.h +0 -59
  258. package/cpp/rnwgpu/api/descriptors/GPUTextureDescriptor.h +0 -91
  259. package/cpp/rnwgpu/api/descriptors/GPUTextureUsage.h +0 -29
  260. package/cpp/rnwgpu/api/descriptors/GPUTextureViewDescriptor.h +0 -91
  261. package/cpp/rnwgpu/api/descriptors/GPUUncapturedErrorEventInit.h +0 -64
  262. package/cpp/rnwgpu/api/descriptors/GPUVertexAttribute.h +0 -53
  263. package/cpp/rnwgpu/api/descriptors/GPUVertexBufferLayout.h +0 -62
  264. package/cpp/rnwgpu/api/descriptors/GPUVertexState.h +0 -73
  265. package/cpp/rnwgpu/api/descriptors/Unions.h +0 -1969
  266. package/cpp/rnwgpu/async/AsyncTaskHandle.cpp +0 -213
  267. package/cpp/rnwgpu/async/AsyncTaskHandle.h +0 -58
  268. package/cpp/rnwgpu/async/RuntimeContext.cpp +0 -199
  269. package/cpp/rnwgpu/async/RuntimeContext.h +0 -134
  270. package/lib/commonjs/skia/types/WebGPU.d.ts +0 -184
  271. package/lib/commonjs/skia/types/WebGPU.js +0 -105
  272. package/lib/commonjs/skia/types/WebGPU.js.map +0 -1
  273. package/lib/commonjs/specs/WebGPUViewNativeComponent.d.ts +0 -8
  274. package/lib/commonjs/specs/WebGPUViewNativeComponent.js +0 -10
  275. package/lib/commonjs/specs/WebGPUViewNativeComponent.js.map +0 -1
  276. package/lib/commonjs/specs/WebGPUViewNativeComponent.web.d.ts +0 -8
  277. package/lib/commonjs/specs/WebGPUViewNativeComponent.web.js +0 -103
  278. package/lib/commonjs/specs/WebGPUViewNativeComponent.web.js.map +0 -1
  279. package/lib/commonjs/specs/utils.d.ts +0 -1
  280. package/lib/commonjs/specs/utils.js +0 -11
  281. package/lib/commonjs/specs/utils.js.map +0 -1
  282. package/lib/commonjs/views/WebGPUCanvas.d.ts +0 -33
  283. package/lib/commonjs/views/WebGPUCanvas.js +0 -79
  284. package/lib/commonjs/views/WebGPUCanvas.js.map +0 -1
  285. package/lib/commonjs/views/WebGPUCanvas.web.d.ts +0 -23
  286. package/lib/commonjs/views/WebGPUCanvas.web.js +0 -20
  287. package/lib/commonjs/views/WebGPUCanvas.web.js.map +0 -1
  288. package/lib/module/skia/types/WebGPU.d.ts +0 -184
  289. package/lib/module/skia/types/WebGPU.js +0 -99
  290. package/lib/module/skia/types/WebGPU.js.map +0 -1
  291. package/lib/module/specs/WebGPUViewNativeComponent.d.ts +0 -8
  292. package/lib/module/specs/WebGPUViewNativeComponent.js +0 -4
  293. package/lib/module/specs/WebGPUViewNativeComponent.js.map +0 -1
  294. package/lib/module/specs/WebGPUViewNativeComponent.web.d.ts +0 -8
  295. package/lib/module/specs/WebGPUViewNativeComponent.web.js +0 -96
  296. package/lib/module/specs/WebGPUViewNativeComponent.web.js.map +0 -1
  297. package/lib/module/specs/utils.d.ts +0 -1
  298. package/lib/module/specs/utils.js +0 -5
  299. package/lib/module/specs/utils.js.map +0 -1
  300. package/lib/module/views/WebGPUCanvas.d.ts +0 -33
  301. package/lib/module/views/WebGPUCanvas.js +0 -70
  302. package/lib/module/views/WebGPUCanvas.js.map +0 -1
  303. package/lib/module/views/WebGPUCanvas.web.d.ts +0 -23
  304. package/lib/module/views/WebGPUCanvas.web.js +0 -12
  305. package/lib/module/views/WebGPUCanvas.web.js.map +0 -1
  306. package/lib/typescript/lib/commonjs/skia/types/WebGPU.d.ts +0 -2
  307. package/lib/typescript/lib/commonjs/specs/WebGPUViewNativeComponent.d.ts +0 -4
  308. package/lib/typescript/lib/commonjs/specs/WebGPUViewNativeComponent.web.d.ts +0 -3
  309. package/lib/typescript/lib/commonjs/specs/utils.d.ts +0 -2
  310. package/lib/typescript/lib/commonjs/views/WebGPUCanvas.d.ts +0 -6
  311. package/lib/typescript/lib/commonjs/views/WebGPUCanvas.web.d.ts +0 -6
  312. package/lib/typescript/lib/module/skia/types/WebGPU.d.ts +0 -31
  313. package/lib/typescript/lib/module/specs/WebGPUViewNativeComponent.d.ts +0 -2
  314. package/lib/typescript/lib/module/specs/WebGPUViewNativeComponent.web.d.ts +0 -2
  315. package/lib/typescript/lib/module/specs/utils.d.ts +0 -1
  316. package/lib/typescript/lib/module/views/WebGPUCanvas.d.ts +0 -7
  317. package/lib/typescript/lib/module/views/WebGPUCanvas.web.d.ts +0 -8
  318. package/lib/typescript/src/skia/types/WebGPU.d.ts +0 -184
  319. package/lib/typescript/src/specs/WebGPUViewNativeComponent.d.ts +0 -8
  320. package/lib/typescript/src/specs/WebGPUViewNativeComponent.web.d.ts +0 -8
  321. package/lib/typescript/src/specs/utils.d.ts +0 -1
  322. package/lib/typescript/src/views/WebGPUCanvas.d.ts +0 -33
  323. package/lib/typescript/src/views/WebGPUCanvas.web.d.ts +0 -23
  324. package/src/skia/types/WebGPU.ts +0 -226
  325. package/src/specs/WebGPUViewNativeComponent.ts +0 -11
  326. package/src/specs/WebGPUViewNativeComponent.web.ts +0 -110
  327. package/src/specs/utils.ts +0 -4
  328. package/src/views/WebGPUCanvas.tsx +0 -125
  329. package/src/views/WebGPUCanvas.web.tsx +0 -36
@@ -70,6 +70,7 @@ if(SK_GRAPHITE)
70
70
  set(BACKEND_SOURCES
71
71
  #TODO: is this source needed to be added?
72
72
  "${PROJECT_SOURCE_DIR}/../cpp/rnskia/RNDawnWindowContext.cpp"
73
+ "${PROJECT_SOURCE_DIR}/../cpp/rnskia/RNDawnInterop.cpp"
73
74
  )
74
75
  else()
75
76
  add_definitions(-DSK_GL -DSK_GANESH)
@@ -114,39 +115,6 @@ add_library(
114
115
  ${BACKEND_SOURCES}
115
116
  )
116
117
 
117
- if(SK_GRAPHITE)
118
- target_sources(${PACKAGE_NAME} PRIVATE
119
- # WebGPU async system
120
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/async/AsyncTaskHandle.cpp"
121
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/async/RuntimeContext.cpp"
122
-
123
- # WebGPU API
124
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPU.cpp"
125
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUAdapter.cpp"
126
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUBindGroup.cpp"
127
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUBuffer.cpp"
128
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUCanvasContext.cpp"
129
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUCommandEncoder.cpp"
130
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUComputePassEncoder.cpp"
131
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUComputePipeline.cpp"
132
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUDevice.cpp"
133
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUDeviceLostInfo.cpp"
134
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUExternalTexture.cpp"
135
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUQuerySet.cpp"
136
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUQueue.cpp"
137
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPURenderBundleEncoder.cpp"
138
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPURenderPassEncoder.cpp"
139
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPURenderPipeline.cpp"
140
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUShaderModule.cpp"
141
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUSharedFence.cpp"
142
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUSharedTextureMemory.cpp"
143
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUSupportedLimits.cpp"
144
- "${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/api/GPUTexture.cpp"
145
-
146
- # WebGPU Canvas JNI bindings
147
- "${PROJECT_SOURCE_DIR}/cpp/jni/JniWebGPUView.cpp"
148
- )
149
- endif()
150
118
 
151
119
 
152
120
  target_include_directories(
@@ -176,12 +144,8 @@ target_include_directories(
176
144
  ../cpp/rnskia/values
177
145
  ../cpp/utils
178
146
 
179
- # WebGPU bindings
147
+ # Shared JSI infrastructure (cpp/jsi) via prefix-qualified includes
180
148
  ../cpp
181
- ../cpp/rnwgpu
182
- ../cpp/rnwgpu/api
183
- ../cpp/rnwgpu/api/descriptors
184
- ../cpp/rnwgpu/async
185
149
 
186
150
  ${libfbjni_include_DIRS}
187
151
  )
@@ -214,8 +178,10 @@ add_library(jsonreader STATIC IMPORTED)
214
178
  set_property(TARGET jsonreader PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libjsonreader.a")
215
179
 
216
180
  if(SK_GRAPHITE)
217
- add_library(dawn_combined STATIC IMPORTED)
218
- set_property(TARGET dawn_combined PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libdawn_combined.a")
181
+ # Dawn is a shared library, the same artifact react-native-webgpu links, so
182
+ # an app that installs both packages loads exactly one Dawn copy.
183
+ add_library(webgpu_dawn SHARED IMPORTED)
184
+ set_property(TARGET webgpu_dawn PROPERTY IMPORTED_LOCATION "${SKIA_LIBS_PATH}/libwebgpu_dawn.so")
219
185
  endif()
220
186
 
221
187
  find_library(
@@ -390,7 +356,7 @@ endif()
390
356
  if(SK_GRAPHITE)
391
357
  target_link_libraries(${PACKAGE_NAME}
392
358
  ${COMMON_LIBS}
393
- dawn_combined
359
+ webgpu_dawn
394
360
  )
395
361
  else()
396
362
  target_link_libraries(${PACKAGE_NAME}
@@ -88,6 +88,39 @@ def skiaLibsPath = useGraphite
88
88
  : "${resolveNodePackage('react-native-skia-graphite-android', projectDir)}/libs")
89
89
  : "${resolveNodePackage('react-native-skia-android', projectDir)}/libs"
90
90
 
91
+ // Both packages must link the exact same Dawn artifact: compare this
92
+ // Graphite build's Dawn release tag (libs/.dawn-version) with the tag
93
+ // react-native-webgpu declares in its package.json `dawn` field.
94
+ if (useGraphite) {
95
+ def dawnMarker = file("${projectDir}/../libs/.dawn-version")
96
+ def webgpuDir = null
97
+ try {
98
+ webgpuDir = resolveNodePackage('react-native-webgpu', projectDir)
99
+ } catch (Exception ignored) {
100
+ // react-native-webgpu not installed: nothing to check
101
+ }
102
+ if (dawnMarker.exists() && webgpuDir != null) {
103
+ def skiaDawn = dawnMarker.text.trim()
104
+ def webgpuJson = new groovy.json.JsonSlurper().parse(file("${webgpuDir}/package.json"))
105
+ if (webgpuJson.dawn == null) {
106
+ throw new GradleException(
107
+ "react-native-skia: the installed react-native-webgpu " +
108
+ "(${webgpuJson.version}) does not declare a `dawn` field in its " +
109
+ "package.json, so it predates shared-Dawn support and cannot be " +
110
+ "paired with this Graphite build (which links ${skiaDawn}). " +
111
+ "Upgrade react-native-webgpu.")
112
+ }
113
+ def webgpuDawn = "dawn-" + webgpuJson.dawn.toString().replace('/', '-')
114
+ if (skiaDawn != webgpuDawn) {
115
+ throw new GradleException(
116
+ "react-native-skia: Dawn version mismatch. This Graphite build links " +
117
+ "${skiaDawn} but react-native-webgpu links ${webgpuDawn}. " +
118
+ "Align the two packages so the app contains exactly one Dawn.")
119
+ }
120
+ logger.warn("react-native-skia: Dawn versions match (${skiaDawn})")
121
+ }
122
+ }
123
+
91
124
  logger.warn("react-native-skia: SK_GRAPHITE: ${useGraphite}")
92
125
  logger.warn("react-native-skia: Skia libs: ${skiaLibsPath}")
93
126
  logger.warn("react-native-skia: node_modules/ found at: ${nodeModules}")
@@ -43,8 +43,7 @@ public class RNSkiaPackage extends TurboReactPackage {
43
43
  @Override
44
44
  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
45
45
  return Arrays.<ViewManager>asList(
46
- new SkiaPictureViewManager(),
47
- new WebGPUViewManager()
46
+ new SkiaPictureViewManager()
48
47
  );
49
48
  }
50
49
 
@@ -21,36 +21,30 @@ class JsiNativeBufferFactory
21
21
  public:
22
22
  static constexpr const char *CLASS_NAME = "NativeBufferFactory";
23
23
 
24
- JSI_HOST_FUNCTION(MakeFromImage) {
25
- auto image = JsiSkImage::fromValue(runtime, arguments[0]);
24
+ // Native buffer pointers travel as BigInts, which the void* converter
25
+ // produces/consumes.
26
+ void *MakeFromImage(sk_sp<SkImage> image) {
26
27
  image->makeNonTextureImage();
27
28
  uint64_t pointer = getContext()->makeNativeBuffer(image);
28
- return jsi::BigInt::fromUint64(runtime, pointer);
29
+ return reinterpret_cast<void *>(pointer);
29
30
  }
30
31
 
31
- JSI_HOST_FUNCTION(MakeTestBuffer) {
32
- auto width = static_cast<int>(arguments[0].asNumber());
33
- auto height = static_cast<int>(arguments[1].asNumber());
32
+ void *MakeTestBuffer(int width, int height) {
34
33
  uint64_t pointer = getContext()->makeTestNativeBuffer(width, height);
35
- return jsi::BigInt::fromUint64(runtime, pointer);
34
+ return reinterpret_cast<void *>(pointer);
36
35
  }
37
36
 
38
- JSI_HOST_FUNCTION(Release) {
39
-
40
- jsi::BigInt pointer = arguments[0].asBigInt(runtime);
41
- const uintptr_t nativeBufferPointer = pointer.asUint64(runtime);
42
-
43
- getContext()->releaseNativeBuffer(nativeBufferPointer);
44
- return jsi::Value::undefined();
37
+ void Release(void *pointer) {
38
+ getContext()->releaseNativeBuffer(reinterpret_cast<uintptr_t>(pointer));
45
39
  }
46
40
 
47
41
  static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
48
- installHostMethod(runtime, prototype, "Release",
49
- &JsiNativeBufferFactory::Release);
50
- installHostMethod(runtime, prototype, "MakeFromImage",
51
- &JsiNativeBufferFactory::MakeFromImage);
52
- installHostMethod(runtime, prototype, "MakeTestBuffer",
53
- &JsiNativeBufferFactory::MakeTestBuffer);
42
+ installMethod(runtime, prototype, "Release",
43
+ &JsiNativeBufferFactory::Release);
44
+ installMethod(runtime, prototype, "MakeFromImage",
45
+ &JsiNativeBufferFactory::MakeFromImage);
46
+ installMethod(runtime, prototype, "MakeTestBuffer",
47
+ &JsiNativeBufferFactory::MakeTestBuffer);
54
48
  }
55
49
 
56
50
  size_t getMemoryPressure() override { return 1024; }
@@ -35,34 +35,31 @@ public:
35
35
  static constexpr const char *CLASS_NAME = "AnimatedImage";
36
36
 
37
37
  // TODO-API: Properties?
38
- JSI_HOST_FUNCTION(getCurrentFrame) {
38
+ std::shared_ptr<JsiSkImage> getCurrentFrame() {
39
39
  auto image = getObject()->getCurrentFrame();
40
- return makeJsiObject(
41
- runtime, std::make_shared<JsiSkImage>(getContext(), std::move(image)));
40
+ return std::make_shared<JsiSkImage>(getContext(), std::move(image));
42
41
  }
43
42
 
44
- JSI_HOST_FUNCTION(getFrameCount) {
45
- return static_cast<int>(getObject()->getFrameCount());
46
- }
43
+ int getFrameCount() { return static_cast<int>(getObject()->getFrameCount()); }
47
44
 
48
- JSI_HOST_FUNCTION(currentFrameDuration) {
45
+ int currentFrameDuration() {
49
46
  return static_cast<int>(getObject()->currentFrameDuration());
50
47
  }
51
48
 
52
- JSI_HOST_FUNCTION(decodeNextFrame) {
49
+ int decodeNextFrame() {
53
50
  return static_cast<int>(getObject()->decodeNextFrame());
54
51
  }
55
52
 
56
53
  static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
57
54
  installCommon(runtime, prototype);
58
- installHostMethod(runtime, prototype, "getFrameCount",
59
- &JsiSkAnimatedImage::getFrameCount);
60
- installHostMethod(runtime, prototype, "getCurrentFrame",
61
- &JsiSkAnimatedImage::getCurrentFrame);
62
- installHostMethod(runtime, prototype, "currentFrameDuration",
63
- &JsiSkAnimatedImage::currentFrameDuration);
64
- installHostMethod(runtime, prototype, "decodeNextFrame",
65
- &JsiSkAnimatedImage::decodeNextFrame);
55
+ installMethod(runtime, prototype, "getFrameCount",
56
+ &JsiSkAnimatedImage::getFrameCount);
57
+ installMethod(runtime, prototype, "getCurrentFrame",
58
+ &JsiSkAnimatedImage::getCurrentFrame);
59
+ installMethod(runtime, prototype, "currentFrameDuration",
60
+ &JsiSkAnimatedImage::currentFrameDuration);
61
+ installMethod(runtime, prototype, "decodeNextFrame",
62
+ &JsiSkAnimatedImage::decodeNextFrame);
66
63
  }
67
64
 
68
65
  JsiSkAnimatedImage(std::shared_ptr<RNSkPlatformContext> context,
@@ -2,10 +2,12 @@
2
2
 
3
3
  #include <memory>
4
4
  #include <utility>
5
+ #include <variant>
5
6
 
6
7
  #include <jsi/jsi.h>
7
8
 
8
9
  #include "JsiSkAnimatedImage.h"
10
+ #include "JsiSkConverters.h"
9
11
  #include "JsiSkData.h"
10
12
  #include "JsiSkNativeObjects.h"
11
13
  #include "jsi/JsiPromises.h"
@@ -19,22 +21,22 @@ class JsiSkAnimatedImageFactory
19
21
  public:
20
22
  static constexpr const char *CLASS_NAME = "AnimatedImageFactory";
21
23
 
22
- JSI_HOST_FUNCTION(MakeAnimatedImageFromEncoded) {
23
- auto data = JsiSkData::fromValue(runtime, arguments[0]);
24
+ std::variant<std::nullptr_t, std::shared_ptr<JsiSkAnimatedImage>>
25
+ MakeAnimatedImageFromEncoded(sk_sp<SkData> data) {
24
26
  auto codec = SkAndroidCodec::MakeFromData(data);
25
27
  auto image = SkAnimatedImage::Make(std::move(codec));
26
28
  if (image == nullptr) {
27
- return jsi::Value::null();
29
+ return nullptr;
28
30
  }
29
- return makeJsiObject(runtime, std::make_shared<JsiSkAnimatedImage>(
30
- getContext(), std::move(image)));
31
+ return std::make_shared<JsiSkAnimatedImage>(getContext(),
32
+ std::move(image));
31
33
  }
32
34
 
33
35
  size_t getMemoryPressure() override { return 1024; }
34
36
 
35
37
  static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
36
- installHostMethod(runtime, prototype, "MakeAnimatedImageFromEncoded",
37
- &JsiSkAnimatedImageFactory::MakeAnimatedImageFromEncoded);
38
+ installMethod(runtime, prototype, "MakeAnimatedImageFromEncoded",
39
+ &JsiSkAnimatedImageFactory::MakeAnimatedImageFromEncoded);
38
40
  }
39
41
 
40
42
  explicit JsiSkAnimatedImageFactory(
@@ -8,8 +8,6 @@
8
8
 
9
9
  #ifdef SK_GRAPHITE
10
10
  #include "rnskia/RNDawnContext.h"
11
- #include "rnwgpu/api/GPUDevice.h"
12
- #include "rnwgpu/async/RuntimeContext.h"
13
11
  #endif
14
12
 
15
13
  #include "JsiNativeBuffer.h"
@@ -173,88 +171,94 @@ public:
173
171
  JSI_HOST_FUNCTION(Color) {
174
172
  return JsiSkColor::createCtor()(runtime, thisValue, arguments, count);
175
173
  }
176
- JSI_HOST_FUNCTION(Recorder) {
177
- return JsiRecorder::createCtor(getContext())(runtime, thisValue, arguments,
178
- count);
179
- }
180
-
181
- JSI_HOST_FUNCTION(hasDevice) {
182
- #ifdef SK_GRAPHITE
183
- return jsi::Value(true);
184
- #else
185
- return jsi::Value(false);
186
- #endif
187
- }
188
-
189
- JSI_HOST_FUNCTION(getDevice) {
174
+ JSI_HOST_FUNCTION(getNativeDevice) {
190
175
  #ifdef SK_GRAPHITE
176
+ // Raw WGPUDevice pointer of the Graphite device, as a BigInt. Consumed by
177
+ // react-native-webgpu's importDevice(), which AddRefs it; the pointer
178
+ // stays owned by DawnContext and is valid for the process lifetime.
191
179
  auto &dawnContext = DawnContext::getInstance();
192
- // Per-runtime context: async ops on this device resolve on the calling
193
- // runtime's own thread (via its ProcessEvents pump).
194
- auto context = rnwgpu::async::RuntimeContext::getOrCreate(
195
- runtime, dawnContext.getWGPUInstance());
196
- auto device = std::make_shared<rnwgpu::GPUDevice>(
197
- dawnContext.getWGPUDevice(), context, "Skia Device");
198
- return rnwgpu::GPUDevice::create(runtime, device);
180
+ return jsi::BigInt::fromUint64(
181
+ runtime,
182
+ reinterpret_cast<uint64_t>(dawnContext.getWGPUDevice().Get()));
199
183
  #else
200
184
  throw jsi::JSError(runtime,
201
- "getDevice() is only available with the Graphite "
185
+ "getNativeDevice() is only available with the Graphite "
202
186
  "backend. Rebuild with SK_GRAPHITE enabled.");
203
187
  #endif
204
188
  }
205
189
 
190
+ JSI_HOST_FUNCTION(Recorder) {
191
+ return JsiRecorder::createCtor(getContext())(runtime, thisValue, arguments,
192
+ count);
193
+ }
194
+
206
195
  // Factory properties: like the legacy HostObject implementation, each
207
196
  // property access returns a fresh JS wrapper around the shared factory
208
197
  // instance.
209
- JSI_PROPERTY_GET(SVG) { return makeJsiObject(runtime, _svgFactory); }
210
- JSI_PROPERTY_GET(Image) { return makeJsiObject(runtime, _imageFactory); }
211
- JSI_PROPERTY_GET(AnimatedImage) {
212
- return makeJsiObject(runtime, _animatedImageFactory);
198
+ std::shared_ptr<JsiSkSVGFactory> getSVGFactory() { return _svgFactory; }
199
+ std::shared_ptr<JsiSkImageFactory> getImageFactory() {
200
+ return _imageFactory;
201
+ }
202
+ std::shared_ptr<JsiSkAnimatedImageFactory> getAnimatedImageFactory() {
203
+ return _animatedImageFactory;
204
+ }
205
+ std::shared_ptr<JsiSkTypefaceFactory> getTypefaceFactory() {
206
+ return _typefaceFactory;
213
207
  }
214
- JSI_PROPERTY_GET(Typeface) {
215
- return makeJsiObject(runtime, _typefaceFactory);
208
+ std::shared_ptr<JsiSkDataFactory> getDataFactory() { return _dataFactory; }
209
+ std::shared_ptr<JsiSkImageFilterFactory> getImageFilterFactory() {
210
+ return _imageFilterFactory;
216
211
  }
217
- JSI_PROPERTY_GET(Data) { return makeJsiObject(runtime, _dataFactory); }
218
- JSI_PROPERTY_GET(ImageFilter) {
219
- return makeJsiObject(runtime, _imageFilterFactory);
212
+ std::shared_ptr<JsiSkPathEffectFactory> getPathEffectFactory() {
213
+ return _pathEffectFactory;
220
214
  }
221
- JSI_PROPERTY_GET(PathEffect) {
222
- return makeJsiObject(runtime, _pathEffectFactory);
215
+ std::shared_ptr<JsiSkPathFactory> getPathFactory() { return _pathFactory; }
216
+ std::shared_ptr<JsiSkPathBuilderFactory> getPathBuilderFactory() {
217
+ return _pathBuilderFactory;
223
218
  }
224
- JSI_PROPERTY_GET(Path) { return makeJsiObject(runtime, _pathFactory); }
225
- JSI_PROPERTY_GET(PathBuilder) {
226
- return makeJsiObject(runtime, _pathBuilderFactory);
219
+ std::shared_ptr<JsiSkColorFilterFactory> getColorFilterFactory() {
220
+ return _colorFilterFactory;
227
221
  }
228
- JSI_PROPERTY_GET(ColorFilter) {
229
- return makeJsiObject(runtime, _colorFilterFactory);
222
+ std::shared_ptr<JsiSkMaskFilterFactory> getMaskFilterFactory() {
223
+ return _maskFilterFactory;
230
224
  }
231
- JSI_PROPERTY_GET(MaskFilter) {
232
- return makeJsiObject(runtime, _maskFilterFactory);
225
+ std::shared_ptr<JsiSkRuntimeEffectFactory> getRuntimeEffectFactory() {
226
+ return _runtimeEffectFactory;
233
227
  }
234
- JSI_PROPERTY_GET(RuntimeEffect) {
235
- return makeJsiObject(runtime, _runtimeEffectFactory);
228
+ std::shared_ptr<JsiSkShaderFactory> getShaderFactory() {
229
+ return _shaderFactory;
236
230
  }
237
- JSI_PROPERTY_GET(Shader) { return makeJsiObject(runtime, _shaderFactory); }
238
- JSI_PROPERTY_GET(TextBlob) {
239
- return makeJsiObject(runtime, _textBlobFactory);
231
+ std::shared_ptr<JsiSkTextBlobFactory> getTextBlobFactory() {
232
+ return _textBlobFactory;
240
233
  }
241
- JSI_PROPERTY_GET(Surface) { return makeJsiObject(runtime, _surfaceFactory); }
242
- JSI_PROPERTY_GET(Picture) { return makeJsiObject(runtime, _pictureFactory); }
243
- JSI_PROPERTY_GET(FontMgr) { return makeJsiObject(runtime, _fontMgrFactory); }
244
- JSI_PROPERTY_GET(Skottie) { return makeJsiObject(runtime, _skottieFactory); }
245
- JSI_PROPERTY_GET(TypefaceFontProvider) {
246
- return makeJsiObject(runtime, _typefaceFontProviderFactory);
234
+ std::shared_ptr<JsiSkSurfaceFactory> getSurfaceFactory() {
235
+ return _surfaceFactory;
236
+ }
237
+ std::shared_ptr<JsiSkPictureFactory> getPictureFactory() {
238
+ return _pictureFactory;
239
+ }
240
+ std::shared_ptr<JsiSkFontMgrFactory> getFontMgrFactory() {
241
+ return _fontMgrFactory;
242
+ }
243
+ std::shared_ptr<JsiSkottieFactory> getSkottieFactory() {
244
+ return _skottieFactory;
245
+ }
246
+ std::shared_ptr<JsiSkTypefaceFontProviderFactory>
247
+ getTypefaceFontProviderFactory() {
248
+ return _typefaceFontProviderFactory;
247
249
  }
248
- JSI_PROPERTY_GET(ParagraphBuilder) {
249
- return makeJsiObject(runtime, _paragraphBuilderFactory);
250
+ std::shared_ptr<JsiSkParagraphBuilderFactory> getParagraphBuilderFactory() {
251
+ return _paragraphBuilderFactory;
250
252
  }
251
- JSI_PROPERTY_GET(NativeBuffer) {
252
- return makeJsiObject(runtime, _nativeBufferFactory);
253
+ std::shared_ptr<JsiNativeBufferFactory> getNativeBufferFactory() {
254
+ return _nativeBufferFactory;
253
255
  }
254
256
 
255
257
  static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
256
258
  installHostMethod(runtime, prototype, "Video", &JsiSkApi::Video);
257
259
  installHostMethod(runtime, prototype, "Context", &JsiSkApi::Context);
260
+ installHostMethod(runtime, prototype, "getNativeDevice",
261
+ &JsiSkApi::getNativeDevice);
258
262
  installHostMethod(runtime, prototype, "Font", &JsiSkApi::Font);
259
263
  installHostMethod(runtime, prototype, "Paint", &JsiSkApi::Paint);
260
264
  installHostMethod(runtime, prototype, "RSXform", &JsiSkApi::RSXform);
@@ -274,39 +278,39 @@ public:
274
278
  &JsiSkApi::PictureRecorder);
275
279
  installHostMethod(runtime, prototype, "Color", &JsiSkApi::Color);
276
280
  installHostMethod(runtime, prototype, "Recorder", &JsiSkApi::Recorder);
277
- installHostMethod(runtime, prototype, "hasDevice", &JsiSkApi::hasDevice);
278
- installHostMethod(runtime, prototype, "getDevice", &JsiSkApi::getDevice);
279
- installHostGetter(runtime, prototype, "SVG", &JsiSkApi::get_SVG);
280
- installHostGetter(runtime, prototype, "Image", &JsiSkApi::get_Image);
281
- installHostGetter(runtime, prototype, "AnimatedImage",
282
- &JsiSkApi::get_AnimatedImage);
283
- installHostGetter(runtime, prototype, "Typeface", &JsiSkApi::get_Typeface);
284
- installHostGetter(runtime, prototype, "Data", &JsiSkApi::get_Data);
285
- installHostGetter(runtime, prototype, "ImageFilter",
286
- &JsiSkApi::get_ImageFilter);
287
- installHostGetter(runtime, prototype, "PathEffect",
288
- &JsiSkApi::get_PathEffect);
289
- installHostGetter(runtime, prototype, "Path", &JsiSkApi::get_Path);
290
- installHostGetter(runtime, prototype, "PathBuilder",
291
- &JsiSkApi::get_PathBuilder);
292
- installHostGetter(runtime, prototype, "ColorFilter",
293
- &JsiSkApi::get_ColorFilter);
294
- installHostGetter(runtime, prototype, "MaskFilter",
295
- &JsiSkApi::get_MaskFilter);
296
- installHostGetter(runtime, prototype, "RuntimeEffect",
297
- &JsiSkApi::get_RuntimeEffect);
298
- installHostGetter(runtime, prototype, "Shader", &JsiSkApi::get_Shader);
299
- installHostGetter(runtime, prototype, "TextBlob", &JsiSkApi::get_TextBlob);
300
- installHostGetter(runtime, prototype, "Surface", &JsiSkApi::get_Surface);
301
- installHostGetter(runtime, prototype, "Picture", &JsiSkApi::get_Picture);
302
- installHostGetter(runtime, prototype, "FontMgr", &JsiSkApi::get_FontMgr);
303
- installHostGetter(runtime, prototype, "Skottie", &JsiSkApi::get_Skottie);
304
- installHostGetter(runtime, prototype, "TypefaceFontProvider",
305
- &JsiSkApi::get_TypefaceFontProvider);
306
- installHostGetter(runtime, prototype, "ParagraphBuilder",
307
- &JsiSkApi::get_ParagraphBuilder);
308
- installHostGetter(runtime, prototype, "NativeBuffer",
309
- &JsiSkApi::get_NativeBuffer);
281
+ installGetter(runtime, prototype, "SVG", &JsiSkApi::getSVGFactory);
282
+ installGetter(runtime, prototype, "Image", &JsiSkApi::getImageFactory);
283
+ installGetter(runtime, prototype, "AnimatedImage",
284
+ &JsiSkApi::getAnimatedImageFactory);
285
+ installGetter(runtime, prototype, "Typeface",
286
+ &JsiSkApi::getTypefaceFactory);
287
+ installGetter(runtime, prototype, "Data", &JsiSkApi::getDataFactory);
288
+ installGetter(runtime, prototype, "ImageFilter",
289
+ &JsiSkApi::getImageFilterFactory);
290
+ installGetter(runtime, prototype, "PathEffect",
291
+ &JsiSkApi::getPathEffectFactory);
292
+ installGetter(runtime, prototype, "Path", &JsiSkApi::getPathFactory);
293
+ installGetter(runtime, prototype, "PathBuilder",
294
+ &JsiSkApi::getPathBuilderFactory);
295
+ installGetter(runtime, prototype, "ColorFilter",
296
+ &JsiSkApi::getColorFilterFactory);
297
+ installGetter(runtime, prototype, "MaskFilter",
298
+ &JsiSkApi::getMaskFilterFactory);
299
+ installGetter(runtime, prototype, "RuntimeEffect",
300
+ &JsiSkApi::getRuntimeEffectFactory);
301
+ installGetter(runtime, prototype, "Shader", &JsiSkApi::getShaderFactory);
302
+ installGetter(runtime, prototype, "TextBlob",
303
+ &JsiSkApi::getTextBlobFactory);
304
+ installGetter(runtime, prototype, "Surface", &JsiSkApi::getSurfaceFactory);
305
+ installGetter(runtime, prototype, "Picture", &JsiSkApi::getPictureFactory);
306
+ installGetter(runtime, prototype, "FontMgr", &JsiSkApi::getFontMgrFactory);
307
+ installGetter(runtime, prototype, "Skottie", &JsiSkApi::getSkottieFactory);
308
+ installGetter(runtime, prototype, "TypefaceFontProvider",
309
+ &JsiSkApi::getTypefaceFontProviderFactory);
310
+ installGetter(runtime, prototype, "ParagraphBuilder",
311
+ &JsiSkApi::getParagraphBuilderFactory);
312
+ installGetter(runtime, prototype, "NativeBuffer",
313
+ &JsiSkApi::getNativeBufferFactory);
310
314
  }
311
315
 
312
316
  private: