@shopify/react-native-skia 0.1.190 → 0.1.192

Sign up to get free protection for your applications and to get access to all the features.
Files changed (357) hide show
  1. package/cpp/api/JsiSkColorFilter.h +2 -17
  2. package/cpp/api/JsiSkContourMeasure.h +3 -17
  3. package/cpp/api/JsiSkContourMeasureIter.h +3 -18
  4. package/cpp/api/JsiSkData.h +1 -18
  5. package/cpp/api/JsiSkFont.h +4 -14
  6. package/cpp/api/JsiSkHostObjects.h +85 -10
  7. package/cpp/api/JsiSkImage.h +1 -12
  8. package/cpp/api/JsiSkImageFilter.h +1 -17
  9. package/cpp/api/JsiSkMaskFilter.h +1 -17
  10. package/cpp/api/JsiSkMatrix.h +3 -6
  11. package/cpp/api/JsiSkPaint.h +3 -15
  12. package/cpp/api/JsiSkPath.h +2 -15
  13. package/cpp/api/JsiSkPathEffect.h +2 -17
  14. package/cpp/api/JsiSkPicture.h +4 -18
  15. package/cpp/api/JsiSkPictureRecorder.h +4 -1
  16. package/cpp/api/JsiSkPoint.h +6 -1
  17. package/cpp/api/JsiSkRRect.h +6 -1
  18. package/cpp/api/JsiSkRSXform.h +4 -6
  19. package/cpp/api/JsiSkRect.h +6 -2
  20. package/cpp/api/JsiSkRuntimeEffect.h +4 -7
  21. package/cpp/api/JsiSkRuntimeShaderBuilder.h +2 -10
  22. package/cpp/api/JsiSkSVG.h +1 -10
  23. package/cpp/api/JsiSkShader.h +2 -16
  24. package/cpp/api/JsiSkSurface.h +3 -16
  25. package/cpp/api/JsiSkTextBlob.h +2 -18
  26. package/cpp/api/JsiSkTypeface.h +1 -22
  27. package/cpp/api/JsiSkVertices.h +3 -17
  28. package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +24 -3
  29. package/cpp/rnskia/dom/nodes/JsiPathNode.h +11 -11
  30. package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -2
  31. package/cpp/rnskia/values/RNSkValue.h +1 -1
  32. package/lib/commonjs/Platform/Platform.web.js +1 -1
  33. package/lib/commonjs/Platform/Platform.web.js.map +1 -1
  34. package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +7 -2
  35. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +29 -7
  36. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
  37. package/lib/commonjs/dom/nodes/drawings/PathNode.js +6 -2
  38. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
  39. package/lib/commonjs/dom/types/Drawings.d.ts +7 -2
  40. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  41. package/lib/commonjs/renderer/Canvas.js +17 -1
  42. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  43. package/lib/commonjs/renderer/processors/math/Math.d.ts +1 -0
  44. package/lib/commonjs/renderer/processors/math/Math.js +9 -1
  45. package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
  46. package/lib/commonjs/skia/core/Data.d.ts +2 -2
  47. package/lib/commonjs/skia/core/Data.js.map +1 -1
  48. package/lib/commonjs/skia/types/Data/Data.d.ts +2 -2
  49. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  50. package/lib/commonjs/skia/types/Image/Image.d.ts +2 -2
  51. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  52. package/lib/commonjs/skia/types/JsiInstance.d.ts +4 -4
  53. package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
  54. package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -2
  55. package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
  56. package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -2
  57. package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
  58. package/lib/commonjs/skia/web/Host.d.ts +1 -0
  59. package/lib/commonjs/skia/web/Host.js +2 -0
  60. package/lib/commonjs/skia/web/Host.js.map +1 -1
  61. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -0
  62. package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -0
  63. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  64. package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +1 -0
  65. package/lib/commonjs/skia/web/JsiSkColorFilter.js +6 -0
  66. package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
  67. package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +1 -0
  68. package/lib/commonjs/skia/web/JsiSkContourMeasure.js +6 -0
  69. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
  70. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  71. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +6 -0
  72. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  73. package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
  74. package/lib/commonjs/skia/web/JsiSkData.js +4 -2
  75. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
  76. package/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -0
  77. package/lib/commonjs/skia/web/JsiSkFont.js +6 -0
  78. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  79. package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -1
  80. package/lib/commonjs/skia/web/JsiSkImage.js +6 -4
  81. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  82. package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +1 -0
  83. package/lib/commonjs/skia/web/JsiSkImageFilter.js +6 -0
  84. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
  85. package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +1 -0
  86. package/lib/commonjs/skia/web/JsiSkMaskFilter.js +6 -0
  87. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
  88. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -0
  89. package/lib/commonjs/skia/web/JsiSkMatrix.js +5 -0
  90. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  91. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  92. package/lib/commonjs/skia/web/JsiSkPaint.js +6 -0
  93. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  94. package/lib/commonjs/skia/web/JsiSkPath.d.ts +1 -0
  95. package/lib/commonjs/skia/web/JsiSkPath.js +6 -0
  96. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  97. package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +1 -0
  98. package/lib/commonjs/skia/web/JsiSkPathEffect.js +6 -0
  99. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
  100. package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -0
  101. package/lib/commonjs/skia/web/JsiSkPicture.js +6 -1
  102. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  103. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  104. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +6 -0
  105. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  106. package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -0
  107. package/lib/commonjs/skia/web/JsiSkPoint.js +5 -0
  108. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  109. package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -0
  110. package/lib/commonjs/skia/web/JsiSkRRect.js +5 -0
  111. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  112. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -0
  113. package/lib/commonjs/skia/web/JsiSkRSXform.js +5 -0
  114. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  115. package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -0
  116. package/lib/commonjs/skia/web/JsiSkRect.js +5 -0
  117. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  118. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  119. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -0
  120. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  121. package/lib/commonjs/skia/web/JsiSkShader.d.ts +1 -0
  122. package/lib/commonjs/skia/web/JsiSkShader.js +6 -0
  123. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
  124. package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -0
  125. package/lib/commonjs/skia/web/JsiSkSurface.js +6 -0
  126. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  127. package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +1 -0
  128. package/lib/commonjs/skia/web/JsiSkTextBlob.js +6 -0
  129. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
  130. package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +1 -1
  131. package/lib/commonjs/skia/web/JsiSkTypeface.js +6 -4
  132. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
  133. package/lib/commonjs/skia/web/JsiSkVertices.d.ts +1 -0
  134. package/lib/commonjs/skia/web/JsiSkVertices.js +6 -0
  135. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
  136. package/lib/commonjs/values/hooks/useComputedValue.js +1 -1
  137. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  138. package/lib/commonjs/values/types.d.ts +1 -1
  139. package/lib/commonjs/values/types.js.map +1 -1
  140. package/lib/commonjs/values/web/RNSkComputedValue.d.ts +1 -1
  141. package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
  142. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  143. package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +1 -1
  144. package/lib/commonjs/values/web/RNSkReadonlyValue.js +1 -1
  145. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  146. package/lib/commonjs/views/SkiaBaseWebView.js +9 -4
  147. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
  148. package/lib/commonjs/views/SkiaDomView.web.js +14 -4
  149. package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
  150. package/lib/commonjs/views/types.d.ts +2 -1
  151. package/lib/commonjs/views/types.js.map +1 -1
  152. package/lib/module/Platform/Platform.web.js +1 -1
  153. package/lib/module/Platform/Platform.web.js.map +1 -1
  154. package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +7 -2
  155. package/lib/module/dom/nodes/drawings/ImageSVG.js +29 -6
  156. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
  157. package/lib/module/dom/nodes/drawings/PathNode.js +5 -2
  158. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
  159. package/lib/module/dom/types/Drawings.d.ts +7 -2
  160. package/lib/module/dom/types/Drawings.js.map +1 -1
  161. package/lib/module/renderer/Canvas.js +15 -1
  162. package/lib/module/renderer/Canvas.js.map +1 -1
  163. package/lib/module/renderer/processors/math/Math.d.ts +1 -0
  164. package/lib/module/renderer/processors/math/Math.js +5 -0
  165. package/lib/module/renderer/processors/math/Math.js.map +1 -1
  166. package/lib/module/skia/core/Data.d.ts +2 -2
  167. package/lib/module/skia/core/Data.js.map +1 -1
  168. package/lib/module/skia/types/Data/Data.d.ts +2 -2
  169. package/lib/module/skia/types/Data/Data.js.map +1 -1
  170. package/lib/module/skia/types/Image/Image.d.ts +2 -2
  171. package/lib/module/skia/types/Image/Image.js.map +1 -1
  172. package/lib/module/skia/types/JsiInstance.d.ts +4 -4
  173. package/lib/module/skia/types/JsiInstance.js.map +1 -1
  174. package/lib/module/skia/types/SVG/SVG.d.ts +2 -2
  175. package/lib/module/skia/types/SVG/SVG.js.map +1 -1
  176. package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -2
  177. package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
  178. package/lib/module/skia/web/Host.d.ts +1 -0
  179. package/lib/module/skia/web/Host.js +2 -0
  180. package/lib/module/skia/web/Host.js.map +1 -1
  181. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
  182. package/lib/module/skia/web/JsiSkCanvas.js +6 -0
  183. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  184. package/lib/module/skia/web/JsiSkColorFilter.d.ts +1 -0
  185. package/lib/module/skia/web/JsiSkColorFilter.js +6 -0
  186. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  187. package/lib/module/skia/web/JsiSkContourMeasure.d.ts +1 -0
  188. package/lib/module/skia/web/JsiSkContourMeasure.js +6 -0
  189. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  190. package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  191. package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -0
  192. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  193. package/lib/module/skia/web/JsiSkData.d.ts +1 -1
  194. package/lib/module/skia/web/JsiSkData.js +4 -2
  195. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  196. package/lib/module/skia/web/JsiSkFont.d.ts +1 -0
  197. package/lib/module/skia/web/JsiSkFont.js +6 -0
  198. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  199. package/lib/module/skia/web/JsiSkImage.d.ts +1 -1
  200. package/lib/module/skia/web/JsiSkImage.js +6 -4
  201. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  202. package/lib/module/skia/web/JsiSkImageFilter.d.ts +1 -0
  203. package/lib/module/skia/web/JsiSkImageFilter.js +6 -0
  204. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  205. package/lib/module/skia/web/JsiSkMaskFilter.d.ts +1 -0
  206. package/lib/module/skia/web/JsiSkMaskFilter.js +6 -0
  207. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  208. package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -0
  209. package/lib/module/skia/web/JsiSkMatrix.js +5 -0
  210. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  211. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  212. package/lib/module/skia/web/JsiSkPaint.js +6 -0
  213. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  214. package/lib/module/skia/web/JsiSkPath.d.ts +1 -0
  215. package/lib/module/skia/web/JsiSkPath.js +6 -0
  216. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  217. package/lib/module/skia/web/JsiSkPathEffect.d.ts +1 -0
  218. package/lib/module/skia/web/JsiSkPathEffect.js +6 -0
  219. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  220. package/lib/module/skia/web/JsiSkPicture.d.ts +1 -0
  221. package/lib/module/skia/web/JsiSkPicture.js +6 -0
  222. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  223. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  224. package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -0
  225. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  226. package/lib/module/skia/web/JsiSkPoint.d.ts +1 -0
  227. package/lib/module/skia/web/JsiSkPoint.js +5 -0
  228. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  229. package/lib/module/skia/web/JsiSkRRect.d.ts +1 -0
  230. package/lib/module/skia/web/JsiSkRRect.js +5 -0
  231. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  232. package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -0
  233. package/lib/module/skia/web/JsiSkRSXform.js +5 -0
  234. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  235. package/lib/module/skia/web/JsiSkRect.d.ts +1 -0
  236. package/lib/module/skia/web/JsiSkRect.js +5 -0
  237. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  238. package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  239. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -0
  240. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  241. package/lib/module/skia/web/JsiSkShader.d.ts +1 -0
  242. package/lib/module/skia/web/JsiSkShader.js +6 -0
  243. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  244. package/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
  245. package/lib/module/skia/web/JsiSkSurface.js +6 -0
  246. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  247. package/lib/module/skia/web/JsiSkTextBlob.d.ts +1 -0
  248. package/lib/module/skia/web/JsiSkTextBlob.js +6 -0
  249. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  250. package/lib/module/skia/web/JsiSkTypeface.d.ts +1 -1
  251. package/lib/module/skia/web/JsiSkTypeface.js +6 -4
  252. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  253. package/lib/module/skia/web/JsiSkVertices.d.ts +1 -0
  254. package/lib/module/skia/web/JsiSkVertices.js +6 -0
  255. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  256. package/lib/module/values/hooks/useComputedValue.js +1 -1
  257. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  258. package/lib/module/values/types.d.ts +1 -1
  259. package/lib/module/values/types.js.map +1 -1
  260. package/lib/module/values/web/RNSkComputedValue.d.ts +1 -1
  261. package/lib/module/values/web/RNSkComputedValue.js +1 -1
  262. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  263. package/lib/module/values/web/RNSkReadonlyValue.d.ts +1 -1
  264. package/lib/module/values/web/RNSkReadonlyValue.js +1 -1
  265. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  266. package/lib/module/views/SkiaBaseWebView.js +9 -4
  267. package/lib/module/views/SkiaBaseWebView.js.map +1 -1
  268. package/lib/module/views/SkiaDomView.web.js +13 -4
  269. package/lib/module/views/SkiaDomView.web.js.map +1 -1
  270. package/lib/module/views/types.d.ts +2 -1
  271. package/lib/module/views/types.js.map +1 -1
  272. package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +7 -2
  273. package/lib/typescript/src/dom/types/Drawings.d.ts +7 -2
  274. package/lib/typescript/src/renderer/processors/math/Math.d.ts +1 -0
  275. package/lib/typescript/src/skia/core/Data.d.ts +2 -2
  276. package/lib/typescript/src/skia/types/Data/Data.d.ts +2 -2
  277. package/lib/typescript/src/skia/types/Image/Image.d.ts +2 -2
  278. package/lib/typescript/src/skia/types/JsiInstance.d.ts +4 -4
  279. package/lib/typescript/src/skia/types/SVG/SVG.d.ts +2 -2
  280. package/lib/typescript/src/skia/types/Typeface/Typeface.d.ts +2 -2
  281. package/lib/typescript/src/skia/web/Host.d.ts +1 -0
  282. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -0
  283. package/lib/typescript/src/skia/web/JsiSkColorFilter.d.ts +1 -0
  284. package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +1 -0
  285. package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  286. package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
  287. package/lib/typescript/src/skia/web/JsiSkFont.d.ts +1 -0
  288. package/lib/typescript/src/skia/web/JsiSkImage.d.ts +1 -1
  289. package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +1 -0
  290. package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +1 -0
  291. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -0
  292. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  293. package/lib/typescript/src/skia/web/JsiSkPath.d.ts +1 -0
  294. package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +1 -0
  295. package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -0
  296. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  297. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -0
  298. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -0
  299. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -0
  300. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -0
  301. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  302. package/lib/typescript/src/skia/web/JsiSkShader.d.ts +1 -0
  303. package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
  304. package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +1 -0
  305. package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +1 -1
  306. package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +1 -0
  307. package/lib/typescript/src/values/types.d.ts +1 -1
  308. package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -1
  309. package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -1
  310. package/lib/typescript/src/views/types.d.ts +2 -1
  311. package/package.json +4 -1
  312. package/scripts/install-npm.js +2 -3
  313. package/src/Platform/Platform.web.tsx +1 -1
  314. package/src/dom/nodes/drawings/ImageSVG.ts +17 -6
  315. package/src/dom/nodes/drawings/PathNode.ts +10 -1
  316. package/src/dom/types/Drawings.ts +7 -2
  317. package/src/renderer/Canvas.tsx +21 -1
  318. package/src/renderer/processors/math/Math.ts +5 -0
  319. package/src/skia/core/Data.ts +3 -3
  320. package/src/skia/types/Data/Data.ts +2 -2
  321. package/src/skia/types/Image/Image.ts +2 -2
  322. package/src/skia/types/JsiInstance.ts +4 -4
  323. package/src/skia/types/SVG/SVG.ts +2 -2
  324. package/src/skia/types/Typeface/Typeface.ts +2 -2
  325. package/src/skia/web/Host.ts +2 -0
  326. package/src/skia/web/JsiSkCanvas.ts +4 -0
  327. package/src/skia/web/JsiSkColorFilter.ts +4 -0
  328. package/src/skia/web/JsiSkContourMeasure.ts +4 -0
  329. package/src/skia/web/JsiSkContourMeasureIter.ts +4 -0
  330. package/src/skia/web/JsiSkData.ts +3 -3
  331. package/src/skia/web/JsiSkFont.ts +4 -0
  332. package/src/skia/web/JsiSkImage.ts +2 -2
  333. package/src/skia/web/JsiSkImageFilter.ts +4 -0
  334. package/src/skia/web/JsiSkMaskFilter.ts +4 -0
  335. package/src/skia/web/JsiSkMatrix.ts +4 -0
  336. package/src/skia/web/JsiSkPaint.ts +4 -0
  337. package/src/skia/web/JsiSkPath.ts +4 -0
  338. package/src/skia/web/JsiSkPathEffect.ts +4 -0
  339. package/src/skia/web/JsiSkPicture.ts +4 -0
  340. package/src/skia/web/JsiSkPictureRecorder.ts +4 -0
  341. package/src/skia/web/JsiSkPoint.ts +4 -0
  342. package/src/skia/web/JsiSkRRect.ts +4 -0
  343. package/src/skia/web/JsiSkRSXform.ts +4 -0
  344. package/src/skia/web/JsiSkRect.ts +4 -0
  345. package/src/skia/web/JsiSkRuntimeEffect.ts +4 -0
  346. package/src/skia/web/JsiSkShader.ts +4 -0
  347. package/src/skia/web/JsiSkSurface.ts +4 -0
  348. package/src/skia/web/JsiSkTextBlob.ts +4 -0
  349. package/src/skia/web/JsiSkTypeface.ts +2 -2
  350. package/src/skia/web/JsiSkVertices.ts +4 -0
  351. package/src/values/hooks/useComputedValue.ts +1 -1
  352. package/src/values/types.ts +1 -1
  353. package/src/values/web/RNSkComputedValue.ts +1 -1
  354. package/src/values/web/RNSkReadonlyValue.ts +1 -1
  355. package/src/views/SkiaBaseWebView.tsx +9 -4
  356. package/src/views/SkiaDomView.web.tsx +6 -1
  357. package/src/views/types.ts +2 -1
@@ -23,23 +23,8 @@ public:
23
23
  : JsiSkWrappingSkPtrHostObject<SkColorFilter>(std::move(context),
24
24
  std::move(colorFilter)) {}
25
25
 
26
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
27
- JSI_PROPERTY_GET(__typename__) {
28
- return jsi::String::createFromUtf8(runtime, "ColorFilter");
29
- }
30
-
31
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkColorFilter,
32
- __typename__))
33
-
34
- /**
35
- Returns the underlying object from a host object of this type
36
- */
37
- static sk_sp<SkColorFilter> fromValue(jsi::Runtime &runtime,
38
- const jsi::Value &obj) {
39
- return obj.asObject(runtime)
40
- .asHostObject<JsiSkColorFilter>(runtime)
41
- ->getObject();
42
- }
26
+ EXPORT_JSI_API_TYPENAME(JsiSkColorFilter, "ColorFilter")
27
+ JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkColorFilter, dispose))
43
28
  };
44
29
 
45
30
  } // namespace RNSkia
@@ -68,26 +68,12 @@ public:
68
68
  return JsiSkPath::toValue(runtime, getContext(), std::move(path));
69
69
  }
70
70
 
71
- JSI_PROPERTY_GET(__typename__) {
72
- return jsi::String::createFromUtf8(runtime, "ContourMeasure");
73
- }
74
-
75
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkContourMeasure,
76
- __typename__))
71
+ EXPORT_JSI_API_TYPENAME(JsiSkContourMeasure, "ContourMeasure")
77
72
 
78
73
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkContourMeasure, getPosTan),
79
74
  JSI_EXPORT_FUNC(JsiSkContourMeasure, length),
80
75
  JSI_EXPORT_FUNC(JsiSkContourMeasure, isClosed),
81
- JSI_EXPORT_FUNC(JsiSkContourMeasure, getSegment))
82
-
83
- /**
84
- Returns the underlying object from a host object of this type
85
- */
86
- static sk_sp<SkContourMeasure> fromValue(jsi::Runtime &runtime,
87
- const jsi::Value &obj) {
88
- return obj.asObject(runtime)
89
- .asHostObject<JsiSkContourMeasure>(runtime)
90
- ->getObject();
91
- }
76
+ JSI_EXPORT_FUNC(JsiSkContourMeasure, getSegment),
77
+ JSI_EXPORT_FUNC(JsiSkContourMeasure, dispose))
92
78
  };
93
79
  } // namespace RNSkia
@@ -29,14 +29,6 @@ public:
29
29
  std::move(context), std::make_shared<SkContourMeasureIter>(
30
30
  path, forceClosed, resScale)) {}
31
31
 
32
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
33
- JSI_PROPERTY_GET(__typename__) {
34
- return jsi::String::createFromUtf8(runtime, "ContourMeasureIter");
35
- }
36
-
37
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkContourMeasureIter,
38
- __typename__), )
39
-
40
32
  JSI_HOST_FUNCTION(next) {
41
33
  auto next = getObject()->next();
42
34
  if (next == nullptr) {
@@ -48,17 +40,10 @@ public:
48
40
  return jsi::Object::createFromHostObject(runtime, std::move(nextObject));
49
41
  }
50
42
 
51
- JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkContourMeasureIter, next))
43
+ EXPORT_JSI_API_TYPENAME(JsiSkContourMeasureIter, "ContourMeasureIter")
52
44
 
53
- /**
54
- Returns the underlying object from a host object of this type
55
- */
56
- static std::shared_ptr<SkContourMeasureIter>
57
- fromValue(jsi::Runtime &runtime, const jsi::Value &obj) {
58
- return obj.asObject(runtime)
59
- .asHostObject<JsiSkContourMeasureIter>(runtime)
60
- ->getObject();
61
- }
45
+ JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkContourMeasureIter, next),
46
+ JSI_EXPORT_FUNC(JsiSkContourMeasureIter, dispose))
62
47
 
63
48
  /**
64
49
  * Creates the function for construction a new instance of the
@@ -24,24 +24,7 @@ public:
24
24
  JsiSkData(std::shared_ptr<RNSkPlatformContext> context, sk_sp<SkData> asset)
25
25
  : JsiSkWrappingSkPtrHostObject(std::move(context), std::move(asset)) {}
26
26
 
27
- JSI_PROPERTY_GET(__typename__) {
28
- return jsi::String::createFromUtf8(runtime, "Data");
29
- }
30
-
31
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkData, __typename__))
32
-
33
- JSI_HOST_FUNCTION(dispose) {
34
- setObject(nullptr);
35
- return jsi::Value::undefined();
36
- }
37
-
27
+ EXPORT_JSI_API_TYPENAME(JsiSkData, "Data")
38
28
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkData, dispose))
39
-
40
- /**
41
- Returns the underlying object from a host object of this type
42
- */
43
- static sk_sp<SkData> fromValue(jsi::Runtime &runtime, const jsi::Value &obj) {
44
- return obj.asObject(runtime).asHostObject<JsiSkData>(runtime)->getObject();
45
- }
46
29
  };
47
30
  } // namespace RNSkia
@@ -28,11 +28,6 @@ namespace jsi = facebook::jsi;
28
28
 
29
29
  class JsiSkFont : public JsiSkWrappingSharedPtrHostObject<SkFont> {
30
30
  public:
31
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
32
- JSI_PROPERTY_GET(__typename__) {
33
- return jsi::String::createFromUtf8(runtime, "Font");
34
- }
35
-
36
31
  JSI_HOST_FUNCTION(getGlyphWidths) {
37
32
  auto jsiGlyphs = arguments[0].asObject(runtime).asArray(runtime);
38
33
  std::vector<SkGlyphID> glyphs;
@@ -244,6 +239,8 @@ public:
244
239
  return jsi::Value::undefined();
245
240
  }
246
241
 
242
+ EXPORT_JSI_API_TYPENAME(JsiSkFont, "Font")
243
+
247
244
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkFont, getSize),
248
245
  JSI_EXPORT_FUNC(JsiSkFont, getMetrics),
249
246
  JSI_EXPORT_FUNC(JsiSkFont, getGlyphIDs),
@@ -262,20 +259,13 @@ public:
262
259
  JSI_EXPORT_FUNC(JsiSkFont, setSubpixel),
263
260
  JSI_EXPORT_FUNC(JsiSkFont, setTypeface),
264
261
  JSI_EXPORT_FUNC(JsiSkFont, getGlyphWidths),
265
- JSI_EXPORT_FUNC(JsiSkFont, getTextWidth))
262
+ JSI_EXPORT_FUNC(JsiSkFont, getTextWidth),
263
+ JSI_EXPORT_FUNC(JsiSkFont, dispose))
266
264
 
267
265
  JsiSkFont(std::shared_ptr<RNSkPlatformContext> context, const SkFont &font)
268
266
  : JsiSkWrappingSharedPtrHostObject(std::move(context),
269
267
  std::make_shared<SkFont>(font)) {}
270
268
 
271
- /**
272
- Returns the underlying object from a host object of this type
273
- */
274
- static std::shared_ptr<SkFont> fromValue(jsi::Runtime &runtime,
275
- const jsi::Value &obj) {
276
- return obj.asObject(runtime).asHostObject<JsiSkFont>(runtime)->getObject();
277
- }
278
-
279
269
  /**
280
270
  * Creates the function for construction a new instance of the SkFont
281
271
  * wrapper
@@ -11,7 +11,8 @@ namespace RNSkia {
11
11
  namespace jsi = facebook::jsi;
12
12
 
13
13
  /**
14
- * Base class for jsi host objects
14
+ * Base class for jsi host objects - these are all implemented as JsiHostObjects
15
+ * and has a pointer to the platform context.
15
16
  */
16
17
  class JsiSkHostObject : public RNJsi::JsiHostObject {
17
18
  public:
@@ -32,6 +33,15 @@ private:
32
33
  std::shared_ptr<RNSkPlatformContext> _context;
33
34
  };
34
35
 
36
+ #define JSI_API_TYPENAME(A) \
37
+ JSI_PROPERTY_GET(__typename__) { \
38
+ return jsi::String::createFromUtf8(runtime, #A); \
39
+ }
40
+
41
+ #define EXPORT_JSI_API_TYPENAME(CLASS, TYPENAME) \
42
+ JSI_API_TYPENAME(TYPENAME) \
43
+ JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(CLASS, __typename__))
44
+
35
45
  template <typename T> class JsiSkWrappingHostObject : public JsiSkHostObject {
36
46
  public:
37
47
  /**
@@ -39,32 +49,65 @@ public:
39
49
  * @param context Platform context
40
50
  */
41
51
  JsiSkWrappingHostObject(std::shared_ptr<RNSkPlatformContext> context,
42
- T &&object)
52
+ T object)
43
53
  : JsiSkHostObject(std::move(context)), _object(std::move(object)) {}
44
54
 
45
- JsiSkWrappingHostObject(std::shared_ptr<RNSkPlatformContext> context,
46
- const T &object)
47
- : JsiSkHostObject(std::move(context)), _object(object) {}
48
-
49
55
  /**
50
56
  * Returns the underlying object exposed by this host object. This object
51
57
  * should be wrapped in a shared pointer of some kind
52
58
  * @return Underlying object
53
59
  */
54
- T &getObject() { return _object; }
55
- const T &getObject() const { return _object; }
60
+ T getObject() { return _object; }
61
+ const T getObject() const { return _object; }
56
62
 
57
63
  /**
58
64
  Updates the inner object with a new version of the object.
59
65
  */
60
- void setObject(T &object) { _object = object; }
61
- void setObject(const T &object) { _object = object; }
66
+ void setObject(T object) { _object = object; }
67
+
68
+ /**
69
+ Dispose function that can be exposed to JS by using the JSI_API_TYPENAME
70
+ macro
71
+ */
72
+ JSI_HOST_FUNCTION(dispose) {
73
+ safeDispose();
74
+ return jsi::Value::undefined();
75
+ }
76
+
77
+ protected:
78
+ /**
79
+ Override to implement disposale of allocated resources like smart pointers
80
+ etc. This method will only be called once for each instance of this class.
81
+ */
82
+ virtual void releaseResources() = 0;
83
+
84
+ /**
85
+ Throws a runtime error if this method is called after the object has been
86
+ disposed.
87
+ */
88
+ void ensureNotDisposed() {
89
+ if (_isDisposed) {
90
+ throw std::runtime_error("API Object accessed after it was disposed");
91
+ }
92
+ }
62
93
 
63
94
  private:
95
+ void safeDispose() {
96
+ if (!_isDisposed) {
97
+ _isDisposed = true;
98
+ releaseResources();
99
+ }
100
+ }
101
+
64
102
  /**
65
103
  * Wrapped object
66
104
  */
67
105
  T _object;
106
+
107
+ /**
108
+ Resource disposed flag
109
+ */
110
+ std::atomic<bool> _isDisposed = {false};
68
111
  };
69
112
 
70
113
  template <typename T>
@@ -75,6 +118,22 @@ public:
75
118
  std::shared_ptr<T> object)
76
119
  : JsiSkWrappingHostObject<std::shared_ptr<T>>(std::move(context),
77
120
  std::move(object)) {}
121
+
122
+ /**
123
+ Returns the underlying object from a host object of this type
124
+ */
125
+ static std::shared_ptr<T> fromValue(jsi::Runtime &runtime,
126
+ const jsi::Value &obj) {
127
+ return std::static_pointer_cast<JsiSkWrappingSharedPtrHostObject>(
128
+ obj.asObject(runtime).asHostObject(runtime))
129
+ ->getObject();
130
+ }
131
+
132
+ protected:
133
+ void releaseResources() override {
134
+ // Clear internally allocated objects
135
+ this->setObject(nullptr);
136
+ }
78
137
  };
79
138
 
80
139
  template <typename T>
@@ -84,5 +143,21 @@ public:
84
143
  sk_sp<T> object)
85
144
  : JsiSkWrappingHostObject<sk_sp<T>>(std::move(context),
86
145
  std::move(object)) {}
146
+
147
+ /**
148
+ Returns the underlying object from a host object of this type
149
+ */
150
+ static sk_sp<T> fromValue(jsi::Runtime &runtime, const jsi::Value &obj) {
151
+ return std::static_pointer_cast<JsiSkWrappingSkPtrHostObject>(
152
+ obj.asObject(runtime).asHostObject(runtime))
153
+ ->getObject();
154
+ }
155
+
156
+ protected:
157
+ void releaseResources() override {
158
+ // Clear internally allocated objects
159
+ this->setObject(nullptr);
160
+ }
87
161
  };
162
+
88
163
  } // namespace RNSkia
@@ -110,10 +110,7 @@ public:
110
110
  runtime, std::make_shared<JsiSkImage>(getContext(), std::move(image)));
111
111
  }
112
112
 
113
- JSI_HOST_FUNCTION(dispose) {
114
- setObject(nullptr);
115
- return jsi::Value::undefined();
116
- }
113
+ EXPORT_JSI_API_TYPENAME(JsiSkImage, "Image")
117
114
 
118
115
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkImage, width),
119
116
  JSI_EXPORT_FUNC(JsiSkImage, height),
@@ -128,14 +125,6 @@ public:
128
125
  const sk_sp<SkImage> image)
129
126
  : JsiSkWrappingSkPtrHostObject<SkImage>(std::move(context),
130
127
  std::move(image)) {}
131
-
132
- /**
133
- Returns the underlying object from a host object of this type
134
- */
135
- static sk_sp<SkImage> fromValue(jsi::Runtime &runtime,
136
- const jsi::Value &obj) {
137
- return obj.asObject(runtime).asHostObject<JsiSkImage>(runtime)->getObject();
138
- }
139
128
  };
140
129
 
141
130
  } // namespace RNSkia
@@ -25,23 +25,7 @@ public:
25
25
  : JsiSkWrappingSkPtrHostObject<SkImageFilter>(std::move(context),
26
26
  std::move(imageFilter)) {}
27
27
 
28
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
29
- JSI_PROPERTY_GET(__typename__) {
30
- return jsi::String::createFromUtf8(runtime, "ImageFilter");
31
- }
32
-
33
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkImageFilter,
34
- __typename__))
35
-
36
- /**
37
- Returns the underlying object from a host object of this type
38
- */
39
- static sk_sp<SkImageFilter> fromValue(jsi::Runtime &runtime,
40
- const jsi::Value &obj) {
41
- return obj.asObject(runtime)
42
- .asHostObject<JsiSkImageFilter>(runtime)
43
- ->getObject();
44
- }
28
+ EXPORT_JSI_API_TYPENAME(JsiSkImageFilter, "ImageFilter")
45
29
  };
46
30
 
47
31
  } // namespace RNSkia
@@ -25,23 +25,7 @@ public:
25
25
  : JsiSkWrappingSkPtrHostObject<SkMaskFilter>(std::move(context),
26
26
  std::move(maskFilter)) {}
27
27
 
28
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
29
- JSI_PROPERTY_GET(__typename__) {
30
- return jsi::String::createFromUtf8(runtime, "MaskFilter");
31
- }
32
-
33
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkMaskFilter,
34
- __typename__))
35
-
36
- /**
37
- Returns the underlying object from a host object of this type
38
- */
39
- static sk_sp<SkMaskFilter> fromValue(jsi::Runtime &runtime,
40
- const jsi::Value &obj) {
41
- return obj.asObject(runtime)
42
- .asHostObject<JsiSkMaskFilter>(runtime)
43
- ->getObject();
44
- }
28
+ EXPORT_JSI_API_TYPENAME(JsiSkMaskFilter, "MaskFilter")
45
29
  };
46
30
 
47
31
  } // namespace RNSkia
@@ -40,10 +40,6 @@ public:
40
40
  pers0, pers1, pers2);
41
41
  }
42
42
 
43
- JSI_PROPERTY_GET(__typename__) {
44
- return jsi::String::createFromUtf8(runtime, "Matrix");
45
- }
46
-
47
43
  JSI_HOST_FUNCTION(concat) {
48
44
  auto m3 = JsiSkMatrix::fromValue(runtime, arguments[0]);
49
45
  getObject()->preConcat(*m3);
@@ -90,7 +86,7 @@ public:
90
86
  return values;
91
87
  }
92
88
 
93
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkMatrix, __typename__))
89
+ EXPORT_JSI_API_TYPENAME(JsiSkMatrix, "Matrix")
94
90
 
95
91
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkMatrix, concat),
96
92
  JSI_EXPORT_FUNC(JsiSkMatrix, translate),
@@ -98,7 +94,8 @@ public:
98
94
  JSI_EXPORT_FUNC(JsiSkMatrix, skew),
99
95
  JSI_EXPORT_FUNC(JsiSkMatrix, rotate),
100
96
  JSI_EXPORT_FUNC(JsiSkMatrix, identity),
101
- JSI_EXPORT_FUNC(JsiSkMatrix, get), )
97
+ JSI_EXPORT_FUNC(JsiSkMatrix, get),
98
+ JSI_EXPORT_FUNC(JsiSkMatrix, dispose))
102
99
 
103
100
  /**
104
101
  * Returns the underlying object from a host object of this type
@@ -25,12 +25,7 @@ namespace jsi = facebook::jsi;
25
25
 
26
26
  class JsiSkPaint : public JsiSkWrappingSharedPtrHostObject<SkPaint> {
27
27
  public:
28
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
29
- JSI_PROPERTY_GET(__typename__) {
30
- return jsi::String::createFromUtf8(runtime, "Paint");
31
- }
32
-
33
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPaint, __typename__))
28
+ EXPORT_JSI_API_TYPENAME(JsiSkPaint, "Paint")
34
29
 
35
30
  JSI_HOST_FUNCTION(copy) {
36
31
  const auto *paint = getObject().get();
@@ -183,7 +178,8 @@ public:
183
178
  JSI_EXPORT_FUNC(JsiSkPaint, setStrokeWidth),
184
179
  JSI_EXPORT_FUNC(JsiSkPaint, setStyle),
185
180
  JSI_EXPORT_FUNC(JsiSkPaint, setColor),
186
- JSI_EXPORT_FUNC(JsiSkPaint, setAlphaf))
181
+ JSI_EXPORT_FUNC(JsiSkPaint, setAlphaf),
182
+ JSI_EXPORT_FUNC(JsiSkPaint, dispose))
187
183
 
188
184
  JsiSkPaint(std::shared_ptr<RNSkPlatformContext> context, SkPaint paint)
189
185
  : JsiSkWrappingSharedPtrHostObject<SkPaint>(
@@ -196,14 +192,6 @@ public:
196
192
  setObject(std::make_shared<SkPaint>(std::move(paint)));
197
193
  }
198
194
 
199
- /**
200
- Returns the underlying object from a host object of this type
201
- */
202
- static std::shared_ptr<SkPaint> fromValue(jsi::Runtime &runtime,
203
- const jsi::Value &obj) {
204
- return obj.asObject(runtime).asHostObject<JsiSkPaint>(runtime)->getObject();
205
- }
206
-
207
195
  /**
208
196
  * Creates the function for construction a new instance of the SkPaint
209
197
  * wrapper
@@ -36,11 +36,6 @@ namespace jsi = facebook::jsi;
36
36
  class JsiSkPath : public JsiSkWrappingSharedPtrHostObject<SkPath> {
37
37
 
38
38
  public:
39
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
40
- JSI_PROPERTY_GET(__typename__) {
41
- return jsi::String::createFromUtf8(runtime, "Path");
42
- }
43
-
44
39
  JSI_HOST_FUNCTION(addPath) {
45
40
  auto src = JsiSkPath::fromValue(runtime, arguments[0]);
46
41
  auto matrix =
@@ -526,7 +521,7 @@ public:
526
521
  return cmds;
527
522
  }
528
523
 
529
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPath, __typename__))
524
+ EXPORT_JSI_API_TYPENAME(JsiSkPath, "Path")
530
525
 
531
526
  JSI_EXPORT_FUNCTIONS(
532
527
  JSI_EXPORT_FUNC(JsiSkPath, addPath), JSI_EXPORT_FUNC(JsiSkPath, addArc),
@@ -562,20 +557,12 @@ public:
562
557
  JSI_EXPORT_FUNC(JsiSkPath, op),
563
558
  JSI_EXPORT_FUNC(JsiSkPath, isInterpolatable),
564
559
  JSI_EXPORT_FUNC(JsiSkPath, interpolate),
565
- JSI_EXPORT_FUNC(JsiSkPath, toCmds), )
560
+ JSI_EXPORT_FUNC(JsiSkPath, toCmds), JSI_EXPORT_FUNC(JsiSkPath, dispose))
566
561
 
567
562
  JsiSkPath(std::shared_ptr<RNSkPlatformContext> context, SkPath path)
568
563
  : JsiSkWrappingSharedPtrHostObject<SkPath>(
569
564
  std::move(context), std::make_shared<SkPath>(std::move(path))) {}
570
565
 
571
- /**
572
- Returns the underlying object from a host object of this type
573
- */
574
- static std::shared_ptr<SkPath> fromValue(jsi::Runtime &runtime,
575
- const jsi::Value &obj) {
576
- return obj.asObject(runtime).asHostObject<JsiSkPath>(runtime)->getObject();
577
- }
578
-
579
566
  static jsi::Value toValue(jsi::Runtime &runtime,
580
567
  std::shared_ptr<RNSkPlatformContext> context,
581
568
  const SkPath &path) {
@@ -25,23 +25,8 @@ public:
25
25
  : JsiSkWrappingSkPtrHostObject<SkPathEffect>(std::move(context),
26
26
  std::move(pathEffect)) {}
27
27
 
28
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
29
- JSI_PROPERTY_GET(__typename__) {
30
- return jsi::String::createFromUtf8(runtime, "PathEffect");
31
- }
32
-
33
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPathEffect,
34
- __typename__))
35
-
36
- /**
37
- Returns the underlying object from a host object of this type
38
- */
39
- static sk_sp<SkPathEffect> fromValue(jsi::Runtime &runtime,
40
- const jsi::Value &obj) {
41
- return obj.asObject(runtime)
42
- .asHostObject<JsiSkPathEffect>(runtime)
43
- ->getObject();
44
- }
28
+ EXPORT_JSI_API_TYPENAME(JsiSkPathEffect, "PathEffect")
29
+ JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkColorFilter, dispose))
45
30
  };
46
31
 
47
32
  } // namespace RNSkia
@@ -23,12 +23,6 @@ public:
23
23
  const sk_sp<SkPicture> picture)
24
24
  : JsiSkWrappingSkPtrHostObject<SkPicture>(context, picture) {}
25
25
 
26
- JSI_PROPERTY_GET(__typename__) {
27
- return jsi::String::createFromUtf8(runtime, "Picture");
28
- }
29
-
30
- JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPicture, __typename__))
31
-
32
26
  JSI_HOST_FUNCTION(makeShader) {
33
27
  auto tmx = (SkTileMode)arguments[0].asNumber();
34
28
  auto tmy = (SkTileMode)arguments[1].asNumber();
@@ -66,18 +60,10 @@ public:
66
60
  return array;
67
61
  }
68
62
 
63
+ EXPORT_JSI_API_TYPENAME(JsiSkPicture, "Picture")
64
+
69
65
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPicture, makeShader),
70
- JSI_EXPORT_FUNC(JsiSkPicture, serialize))
71
-
72
- /**
73
- Returns the underlying object from a host object of this type
74
- */
75
- static sk_sp<SkPicture> fromValue(jsi::Runtime &runtime,
76
- const jsi::Value &obj) {
77
- return obj.asObject(runtime)
78
- .asHostObject<JsiSkPicture>(runtime)
79
- .get()
80
- ->getObject();
81
- }
66
+ JSI_EXPORT_FUNC(JsiSkPicture, serialize),
67
+ JSI_EXPORT_FUNC(JsiSkPicture, dispose))
82
68
  };
83
69
  } // namespace RNSkia
@@ -40,9 +40,12 @@ public:
40
40
  runtime, std::make_shared<JsiSkPicture>(getContext(), picture));
41
41
  }
42
42
 
43
+ EXPORT_JSI_API_TYPENAME(JsiSkPictureRecorder, "PictureRecorder")
44
+
43
45
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPictureRecorder, beginRecording),
44
46
  JSI_EXPORT_FUNC(JsiSkPictureRecorder,
45
- finishRecordingAsPicture))
47
+ finishRecordingAsPicture),
48
+ JSI_EXPORT_FUNC(JsiSkPictureRecorder, dispose))
46
49
 
47
50
  static const jsi::HostFunctionType
48
51
  createCtor(std::shared_ptr<RNSkPlatformContext> context) {
@@ -24,8 +24,13 @@ public:
24
24
 
25
25
  JSI_PROPERTY_GET(y) { return static_cast<double>(getObject()->y()); }
26
26
 
27
+ JSI_API_TYPENAME("Point");
28
+
27
29
  JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPoint, x),
28
- JSI_EXPORT_PROP_GET(JsiSkPoint, y))
30
+ JSI_EXPORT_PROP_GET(JsiSkPoint, y),
31
+ JSI_EXPORT_PROP_GET(JsiSkPoint, __typename__))
32
+
33
+ JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPoint, dispose))
29
34
 
30
35
  JsiSkPoint(std::shared_ptr<RNSkPlatformContext> context, const SkPoint &point)
31
36
  : JsiSkWrappingSharedPtrHostObject<SkPoint>(
@@ -34,9 +34,14 @@ public:
34
34
  std::make_shared<JsiSkRect>(getContext(), getObject()->getBounds()));
35
35
  }
36
36
 
37
+ JSI_API_TYPENAME("RRect");
38
+
37
39
  JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkRRect, rx),
38
40
  JSI_EXPORT_PROP_GET(JsiSkRRect, ry),
39
- JSI_EXPORT_PROP_GET(JsiSkRRect, rect))
41
+ JSI_EXPORT_PROP_GET(JsiSkRRect, rect),
42
+ JSI_EXPORT_PROP_GET(JsiSkRRect, __typename__))
43
+
44
+ JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRRect, dispose))
40
45
 
41
46
  JsiSkRRect(std::shared_ptr<RNSkPlatformContext> context, const SkRRect &rect)
42
47
  : JsiSkWrappingSharedPtrHostObject<SkRRect>(
@@ -25,11 +25,7 @@ public:
25
25
  : JsiSkWrappingSharedPtrHostObject<SkRSXform>(
26
26
  std::move(context), std::make_shared<SkRSXform>(rsxform)) {}
27
27
 
28
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
29
-
30
- JSI_PROPERTY_GET(__typename__) {
31
- return jsi::String::createFromUtf8(runtime, "RSXform");
32
- }
28
+ JSI_API_TYPENAME("RSXform");
33
29
 
34
30
  JSI_PROPERTY_GET(scos) {
35
31
  return jsi::Value(SkScalarToDouble(getObject()->fSCos));
@@ -48,7 +44,9 @@ public:
48
44
  JSI_EXPORT_PROP_GET(JsiSkRSXform, scos),
49
45
  JSI_EXPORT_PROP_GET(JsiSkRSXform, ssin),
50
46
  JSI_EXPORT_PROP_GET(JsiSkRSXform, tx),
51
- JSI_EXPORT_PROP_GET(JsiSkRSXform, ty), )
47
+ JSI_EXPORT_PROP_GET(JsiSkRSXform, ty))
48
+
49
+ JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRSXform, dispose))
52
50
 
53
51
  /**
54
52
  Returns the underlying object from a host object of this type
@@ -33,10 +33,13 @@ public:
33
33
  return static_cast<double>(getObject()->bottom());
34
34
  }
35
35
 
36
+ JSI_API_TYPENAME("Rect");
37
+
36
38
  JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkRect, x),
37
39
  JSI_EXPORT_PROP_GET(JsiSkRect, y),
38
40
  JSI_EXPORT_PROP_GET(JsiSkRect, width),
39
- JSI_EXPORT_PROP_GET(JsiSkRect, height))
41
+ JSI_EXPORT_PROP_GET(JsiSkRect, height),
42
+ JSI_EXPORT_PROP_GET(JsiSkRect, __typename__))
40
43
 
41
44
  JSI_HOST_FUNCTION(setXYWH) {
42
45
  getObject()->setXYWH(arguments[0].asNumber(), arguments[1].asNumber(),
@@ -51,7 +54,8 @@ public:
51
54
  }
52
55
 
53
56
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRect, setXYWH),
54
- JSI_EXPORT_FUNC(JsiSkRect, setLTRB), )
57
+ JSI_EXPORT_FUNC(JsiSkRect, setLTRB),
58
+ JSI_EXPORT_FUNC(JsiSkRect, dispose))
55
59
 
56
60
  /**
57
61
  Constructor