@shopify/react-native-skia 0.1.141 → 0.1.145

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +2 -2
  2. package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +1 -1
  3. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -16
  4. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +2 -2
  5. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +69 -27
  6. package/cpp/api/JsiSkPaint.h +6 -0
  7. package/cpp/api/JsiSkPathFactory.h +1 -1
  8. package/cpp/api/JsiSkPicture.h +7 -1
  9. package/cpp/rnskia/RNSkDrawView.cpp +66 -66
  10. package/cpp/rnskia/RNSkDrawView.h +22 -6
  11. package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
  12. package/cpp/rnskia/values/RNSkComputedValue.h +10 -7
  13. package/cpp/rnskia/values/RNSkReadonlyValue.h +21 -2
  14. package/cpp/rnskia/values/RNSkValue.h +1 -0
  15. package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +1 -1
  16. package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm +2 -2
  17. package/ios/RNSkia-iOS/SkiaDrawView.mm +4 -0
  18. package/lib/commonjs/mock/index.js +3 -1
  19. package/lib/commonjs/mock/index.js.map +1 -1
  20. package/lib/commonjs/renderer/Canvas.js +17 -7
  21. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  22. package/lib/commonjs/renderer/DependencyManager.js +144 -36
  23. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  24. package/lib/commonjs/renderer/HostConfig.js +1 -1
  25. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  26. package/lib/commonjs/renderer/components/Blend.js +20 -5
  27. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  28. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  29. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -1
  30. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  31. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -1
  32. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  33. package/lib/commonjs/renderer/nodes/Declaration.js +2 -3
  34. package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
  35. package/lib/commonjs/renderer/nodes/Drawing.js +3 -7
  36. package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
  37. package/lib/commonjs/renderer/nodes/Node.js +9 -7
  38. package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
  39. package/lib/commonjs/renderer/processors/Animations/Animations.js +14 -20
  40. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  41. package/lib/commonjs/skia/core/Data.js +10 -22
  42. package/lib/commonjs/skia/core/Data.js.map +1 -1
  43. package/lib/commonjs/skia/core/Font.js +2 -3
  44. package/lib/commonjs/skia/core/Font.js.map +1 -1
  45. package/lib/commonjs/skia/core/Image.js.map +1 -1
  46. package/lib/commonjs/skia/core/SVG.js.map +1 -1
  47. package/lib/commonjs/skia/core/Typeface.js.map +1 -1
  48. package/lib/commonjs/skia/types/Data/Data.js +5 -0
  49. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  50. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  51. package/lib/commonjs/skia/web/Host.js +12 -21
  52. package/lib/commonjs/skia/web/Host.js.map +1 -1
  53. package/lib/commonjs/skia/web/JsiSkCanvas.js +50 -28
  54. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  55. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +4 -4
  56. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  57. package/lib/commonjs/skia/web/JsiSkFont.js +7 -3
  58. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  59. package/lib/commonjs/skia/web/JsiSkImage.js +4 -2
  60. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  61. package/lib/commonjs/skia/web/JsiSkImageFactory.js +4 -2
  62. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  63. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +61 -19
  64. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  65. package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
  66. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  67. package/lib/commonjs/skia/web/JsiSkPaint.js +19 -6
  68. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  69. package/lib/commonjs/skia/web/JsiSkPath.js +16 -60
  70. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  71. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +7 -3
  72. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  73. package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
  74. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  75. package/lib/commonjs/skia/web/JsiSkPicture.js +5 -1
  76. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  77. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +3 -1
  78. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  79. package/lib/commonjs/skia/web/JsiSkPoint.js +9 -1
  80. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  81. package/lib/commonjs/skia/web/JsiSkRRect.js +9 -1
  82. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  83. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  84. package/lib/commonjs/skia/web/JsiSkRect.js +3 -3
  85. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  86. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +4 -2
  87. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  88. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +10 -6
  89. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  90. package/lib/commonjs/skia/web/JsiSkSurface.js +3 -1
  91. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  92. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +8 -4
  93. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  94. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +1 -1
  95. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  96. package/lib/commonjs/skia/web/JsiSkia.js +12 -6
  97. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  98. package/lib/commonjs/values/hooks/useComputedValue.js +6 -2
  99. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  100. package/lib/commonjs/values/index.js +13 -0
  101. package/lib/commonjs/values/index.js.map +1 -1
  102. package/lib/commonjs/values/selector.js +24 -0
  103. package/lib/commonjs/values/selector.js.map +1 -0
  104. package/lib/commonjs/values/web/RNSkComputedValue.js +8 -0
  105. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  106. package/lib/commonjs/values/web/RNSkReadonlyValue.js +4 -0
  107. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  108. package/lib/module/mock/index.js +2 -1
  109. package/lib/module/mock/index.js.map +1 -1
  110. package/lib/module/renderer/Canvas.js +17 -6
  111. package/lib/module/renderer/Canvas.js.map +1 -1
  112. package/lib/module/renderer/DependencyManager.js +141 -34
  113. package/lib/module/renderer/DependencyManager.js.map +1 -1
  114. package/lib/module/renderer/HostConfig.js +1 -1
  115. package/lib/module/renderer/HostConfig.js.map +1 -1
  116. package/lib/module/renderer/components/Blend.js +21 -5
  117. package/lib/module/renderer/components/Blend.js.map +1 -1
  118. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  119. package/lib/module/renderer/components/imageFilters/Morphology.js +1 -1
  120. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  121. package/lib/module/renderer/components/imageFilters/Shadow.js +1 -1
  122. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  123. package/lib/module/renderer/nodes/Declaration.js +3 -4
  124. package/lib/module/renderer/nodes/Declaration.js.map +1 -1
  125. package/lib/module/renderer/nodes/Drawing.js +3 -6
  126. package/lib/module/renderer/nodes/Drawing.js.map +1 -1
  127. package/lib/module/renderer/nodes/Node.js +9 -7
  128. package/lib/module/renderer/nodes/Node.js.map +1 -1
  129. package/lib/module/renderer/processors/Animations/Animations.js +9 -15
  130. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  131. package/lib/module/skia/core/Data.js +10 -20
  132. package/lib/module/skia/core/Data.js.map +1 -1
  133. package/lib/module/skia/core/Font.js +2 -3
  134. package/lib/module/skia/core/Font.js.map +1 -1
  135. package/lib/module/skia/core/Image.js.map +1 -1
  136. package/lib/module/skia/core/SVG.js.map +1 -1
  137. package/lib/module/skia/core/Typeface.js.map +1 -1
  138. package/lib/module/skia/types/Data/Data.js +1 -1
  139. package/lib/module/skia/types/Data/Data.js.map +1 -1
  140. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  141. package/lib/module/skia/web/Host.js +9 -9
  142. package/lib/module/skia/web/Host.js.map +1 -1
  143. package/lib/module/skia/web/JsiSkCanvas.js +40 -29
  144. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  145. package/lib/module/skia/web/JsiSkColorFilterFactory.js +5 -5
  146. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  147. package/lib/module/skia/web/JsiSkFont.js +6 -4
  148. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  149. package/lib/module/skia/web/JsiSkImage.js +4 -3
  150. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  151. package/lib/module/skia/web/JsiSkImageFactory.js +4 -3
  152. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  153. package/lib/module/skia/web/JsiSkImageFilterFactory.js +61 -20
  154. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  155. package/lib/module/skia/web/JsiSkMatrix.js +2 -2
  156. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  157. package/lib/module/skia/web/JsiSkPaint.js +15 -7
  158. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  159. package/lib/module/skia/web/JsiSkPath.js +15 -62
  160. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  161. package/lib/module/skia/web/JsiSkPathEffectFactory.js +6 -4
  162. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  163. package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
  164. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  165. package/lib/module/skia/web/JsiSkPicture.js +4 -2
  166. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  167. package/lib/module/skia/web/JsiSkPictureRecorder.js +3 -2
  168. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  169. package/lib/module/skia/web/JsiSkPoint.js +10 -2
  170. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  171. package/lib/module/skia/web/JsiSkRRect.js +10 -2
  172. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  173. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  174. package/lib/module/skia/web/JsiSkRect.js +4 -4
  175. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  176. package/lib/module/skia/web/JsiSkRuntimeEffect.js +4 -3
  177. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  178. package/lib/module/skia/web/JsiSkShaderFactory.js +9 -7
  179. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  180. package/lib/module/skia/web/JsiSkSurface.js +3 -2
  181. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  182. package/lib/module/skia/web/JsiSkTextBlobFactory.js +7 -5
  183. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  184. package/lib/module/skia/web/JsiSkTypefaceFactory.js +2 -2
  185. package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  186. package/lib/module/skia/web/JsiSkia.js +10 -5
  187. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  188. package/lib/module/values/hooks/useComputedValue.js +7 -3
  189. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  190. package/lib/module/values/index.js +1 -0
  191. package/lib/module/values/index.js.map +1 -1
  192. package/lib/module/values/selector.js +15 -0
  193. package/lib/module/values/selector.js.map +1 -0
  194. package/lib/module/values/web/RNSkComputedValue.js +8 -0
  195. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  196. package/lib/module/values/web/RNSkReadonlyValue.js +4 -0
  197. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  198. package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
  199. package/lib/typescript/src/renderer/DependencyManager.d.ts +40 -14
  200. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +2 -2
  201. package/lib/typescript/src/renderer/nodes/Drawing.d.ts +2 -2
  202. package/lib/typescript/src/renderer/nodes/Node.d.ts +3 -2
  203. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +7 -3
  204. package/lib/typescript/src/skia/core/Data.d.ts +3 -5
  205. package/lib/typescript/src/skia/core/Font.d.ts +2 -2
  206. package/lib/typescript/src/skia/core/Image.d.ts +2 -2
  207. package/lib/typescript/src/skia/core/SVG.d.ts +2 -2
  208. package/lib/typescript/src/skia/core/Typeface.d.ts +2 -2
  209. package/lib/typescript/src/skia/types/Data/Data.d.ts +10 -3
  210. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +5 -0
  211. package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -1
  212. package/lib/typescript/src/skia/web/Host.d.ts +6 -8
  213. package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +8 -8
  214. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  215. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +3 -2
  216. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +3 -2
  217. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -2
  218. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -3
  219. package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +2 -1
  220. package/lib/typescript/src/values/index.d.ts +1 -0
  221. package/lib/typescript/src/values/selector.d.ts +14 -0
  222. package/lib/typescript/src/values/types.d.ts +4 -0
  223. package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -0
  224. package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -0
  225. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  226. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  227. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  228. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  229. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  230. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  231. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  232. package/package.json +3 -3
  233. package/src/mock/index.ts +2 -1
  234. package/src/renderer/Canvas.tsx +19 -7
  235. package/src/renderer/DependencyManager.tsx +171 -37
  236. package/src/renderer/HostConfig.ts +1 -1
  237. package/src/renderer/components/Blend.tsx +25 -5
  238. package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
  239. package/src/renderer/components/imageFilters/Morphology.tsx +2 -2
  240. package/src/renderer/components/imageFilters/Shadow.tsx +2 -2
  241. package/src/renderer/nodes/Declaration.tsx +6 -8
  242. package/src/renderer/nodes/Drawing.tsx +5 -7
  243. package/src/renderer/nodes/Node.ts +11 -9
  244. package/src/renderer/processors/Animations/Animations.ts +23 -14
  245. package/src/skia/core/Data.ts +20 -51
  246. package/src/skia/core/Font.ts +4 -5
  247. package/src/skia/core/Image.ts +2 -2
  248. package/src/skia/core/SVG.ts +2 -2
  249. package/src/skia/core/Typeface.ts +2 -2
  250. package/src/skia/types/Data/Data.ts +11 -1
  251. package/src/skia/types/Paint/Paint.ts +6 -0
  252. package/src/skia/types/Picture/Picture.ts +2 -1
  253. package/src/skia/web/Host.ts +12 -22
  254. package/src/skia/web/JsiSkCanvas.ts +99 -56
  255. package/src/skia/web/JsiSkColorFilterFactory.ts +15 -5
  256. package/src/skia/web/JsiSkFont.ts +11 -4
  257. package/src/skia/web/JsiSkImage.ts +4 -3
  258. package/src/skia/web/JsiSkImageFactory.ts +6 -3
  259. package/src/skia/web/JsiSkImageFilterFactory.ts +124 -52
  260. package/src/skia/web/JsiSkMatrix.ts +4 -2
  261. package/src/skia/web/JsiSkPaint.ts +15 -7
  262. package/src/skia/web/JsiSkPath.ts +30 -56
  263. package/src/skia/web/JsiSkPathEffectFactory.ts +10 -5
  264. package/src/skia/web/JsiSkPathFactory.ts +3 -3
  265. package/src/skia/web/JsiSkPicture.ts +5 -3
  266. package/src/skia/web/JsiSkPictureRecorder.ts +3 -2
  267. package/src/skia/web/JsiSkPoint.ts +12 -2
  268. package/src/skia/web/JsiSkRRect.ts +16 -2
  269. package/src/skia/web/JsiSkRSXform.ts +1 -1
  270. package/src/skia/web/JsiSkRect.ts +4 -7
  271. package/src/skia/web/JsiSkRuntimeEffect.ts +9 -4
  272. package/src/skia/web/JsiSkShaderFactory.ts +24 -15
  273. package/src/skia/web/JsiSkSurface.ts +7 -2
  274. package/src/skia/web/JsiSkTextBlobFactory.ts +14 -8
  275. package/src/skia/web/JsiSkTypefaceFactory.tsx +4 -2
  276. package/src/skia/web/JsiSkia.ts +17 -5
  277. package/src/values/hooks/useComputedValue.ts +6 -3
  278. package/src/values/index.ts +1 -0
  279. package/src/values/selector.ts +24 -0
  280. package/src/values/types.ts +4 -0
  281. package/src/values/web/RNSkComputedValue.ts +6 -0
  282. package/src/values/web/RNSkReadonlyValue.ts +4 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkImageFilterFactory.ts"],"names":["Host","NotImplementedOnRNWeb","ckEnum","toValue","JsiSkImageFilter","JsiSkImageFilterFactory","constructor","CanvasKit","MakeOffset","_dx","_dy","_input","MakeDisplacementMap","_channelX","_channelY","_scale","_in1","MakeShader","_shader","MakeBlur","sigmaX","sigmaY","mode","input","ImageFilter","MakeColorFilter","cf","MakeCompose","outer","inner","MakeDropShadow","_sigmaX","_sigmaY","_color","_cropRect","MakeDropShadowOnly","MakeErode","_rx","_ry","MakeDilate","MakeBlend","_mode","_background","_foreground","MakeRuntimeShader","_builder","_childShaderName"],"mappings":"AAeA,SAASA,IAAT,EAAeC,qBAAf,EAAsCC,MAAtC,EAA8CC,OAA9C,QAA6D,QAA7D;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA,OAAO,MAAMC,uBAAN,SACGL,IADH,CAGP;AACEM,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,MAHQ,EAIO;AACf,UAAM,IAAIV,qBAAJ,EAAN;AACD;;AAEDW,EAAAA,mBAAmB,CACjBC,SADiB,EAEjBC,SAFiB,EAGjBC,MAHiB,EAIjBC,IAJiB,EAKjBL,MALiB,EAMF;AACf,UAAM,IAAIV,qBAAJ,EAAN;AACD;;AAEDgB,EAAAA,UAAU,CAACC,OAAD,EAAoBP,MAApB,EAAiE;AACzE,UAAM,IAAIV,qBAAJ,EAAN;AACD;;AAEDkB,EAAAA,QAAQ,CACNC,MADM,EAENC,MAFM,EAGNC,IAHM,EAINC,KAJM,EAKN;AACA,WAAO,IAAInB,gBAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeiB,WAAf,CAA2BL,QAA3B,CACEC,MADF,EA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,GAFQ,EAGR3B,MAHQ,EAIRuB,SAJQ,EAKO;AACf,UAAM,IAAIjC,qBAAJ,EAAN;AACD;;AAEDuC,EAAAA,SAAS,CACPC,KADO,EAEPC,WAFO,EAGPC,WAHO,EAIPT,SAJO,EAKQ;AACf,UAAM,IAAIjC,qBAAJ,EAAN;AACD;;AAED2C,EAAAA,iBAAiB,CACfC,QADe,EAEfC,gBAFe,EAGfnC,MAHe,EAIA;AACf,UAAM,IAAIV,qBAAJ,EAAN;AACD;;AAzHH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n ColorChannel,\n ImageFilterFactory,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n BlendMode,\n SkRect,\n SkRuntimeShaderBuilder,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { Host, NotImplementedOnRNWeb, ckEnum, toValue } from \"./Host\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\n\nexport class JsiSkImageFilterFactory\n extends Host\n implements ImageFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeOffset(\n _dx: number,\n _dy: number,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeDisplacementMap(\n _channelX: ColorChannel,\n _channelY: ColorChannel,\n _scale: number,\n _in1: SkImageFilter,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeShader(_shader: SkShader, _input: SkImageFilter | null): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeBlur(\n sigmaX: number,\n sigmaY: number,\n mode: TileMode,\n input: SkImageFilter | null\n ) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeBlur(\n sigmaX,\n sigmaY,\n ckEnum(mode),\n input === null ? null : toValue(input)\n )\n );\n }\n\n MakeColorFilter(cf: SkColorFilter, input: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeColorFilter(\n toValue(cf),\n input === null ? null : toValue(input)\n )\n );\n }\n\n MakeCompose(outer: SkImageFilter | null, inner: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeCompose(\n outer === null ? null : toValue(outer),\n inner === null ? null : toValue(inner)\n )\n );\n }\n\n MakeDropShadow(\n _dx: number,\n _dy: number,\n _sigmaX: number,\n _sigmaY: number,\n _color: SkColor,\n _input: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeDropShadowOnly(\n _dx: number,\n _dy: number,\n _sigmaX: number,\n _sigmaY: number,\n _color: SkColor,\n _input: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeErode(\n _rx: number,\n _ry: number,\n _input: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeDilate(\n _rx: number,\n _ry: number,\n _input: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeBlend(\n _mode: BlendMode,\n _background: SkImageFilter,\n _foreground: SkImageFilter | null,\n _cropRect?: SkRect\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeRuntimeShader(\n _builder: SkRuntimeShaderBuilder,\n _childShaderName: string | null,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkImageFilterFactory.ts"],"names":["Host","NotImplementedOnRNWeb","ckEnum","JsiSkImageFilter","JsiSkColorFilter","JsiSkImageFilterFactory","constructor","CanvasKit","MakeOffset","dx","dy","input","inputFilter","fromValue","filter","ImageFilter","MakeDisplacementMap","channelX","channelY","scale","in1","MakeShader","shader","_input","MakeBlur","sigmaX","sigmaY","mode","MakeColorFilter","cf","MakeCompose","outer","inner","MakeDropShadow","color","cropRect","MakeDropShadowOnly","MakeErode","rx","ry","MakeDilate","MakeBlend","background","foreground","MakeRuntimeShader","_builder","_childShaderName"],"mappings":"AAeA,SAASA,IAAT,EAAeC,qBAAf,EAAsCC,MAAtC,QAAoD,QAApD;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA,OAAO,MAAMC,uBAAN,SACGL,IADH,CAGP;AACEM,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,UAAU,CAACC,EAAD,EAAaC,EAAb,EAAyBC,KAAzB,EAAsD;AAC9D,UAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBR,gBAAgB,CAACU,SAAjB,CAAwCF,KAAxC,CAD1B;AAEA,UAAMG,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2BP,UAA3B,CAAsCC,EAAtC,EAA0CC,EAA1C,EAA8CE,WAA9C,CAAf;AACA,WAAO,IAAIT,gBAAJ,CAAqB,KAAKI,SAA1B,EAAqCO,MAArC,CAAP;AACD;;AAEDE,EAAAA,mBAAmB,CACjBC,QADiB,EAEjBC,QAFiB,EAGjBC,KAHiB,EAIjBC,GAJiB,EAKjBT,KALiB,EAMF;AACf,UAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBR,gBAAgB,CAACU,SAAjB,CAAwCF,KAAxC,CAD1B;AAEA,UAAMG,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2BC,mBAA3B,CACbd,MAAM,CAACe,QAAD,CADO,EAEbf,MAAM,CAACgB,QAAD,CAFO,EAGbC,KAHa,EAIbhB,gBAAgB,CAACU,SAAjB,CAA2BO,GAA3B,CAJa,EAKbR,WALa,CAAf;AAOA,WAAO,IAAIT,gBAAJ,CAAqB,KAAKI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MAAM,CAACyB,IAAD,CADO,EAEbxB,gBAAgB,CAACU,SAAjB,CAA2B6B,UAA3B,CAFa,EAGb9B,WAHa,CAAf;AAKA,WAAO,IAAIT,gBAAJ,CAAqB,KAAKI,SAA1B,EAAqCO,MAArC,CAAP;AACD;;AAED8B,EAAAA,iBAAiB,CACfC,QADe,EAEfC,gBAFe,EAGfvB,MAHe,EAIA;AACf,UAAM,IAAItB,qBAAJ,EAAN;AACD;;AAhMH","sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type {\n ColorChannel,\n ImageFilterFactory,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n BlendMode,\n SkRect,\n SkRuntimeShaderBuilder,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { Host, NotImplementedOnRNWeb, ckEnum } from \"./Host\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkImageFilterFactory\n extends Host\n implements ImageFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeOffset(dx: number, dy: number, input: SkImageFilter | null) {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeOffset(dx, dy, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDisplacementMap(\n channelX: ColorChannel,\n channelY: ColorChannel,\n scale: number,\n in1: SkImageFilter,\n input: SkImageFilter | null\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(\n ckEnum(channelX),\n ckEnum(channelY),\n scale,\n JsiSkImageFilter.fromValue(in1),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeShader(shader: SkShader, _input: SkImageFilter | null): SkImageFilter {\n const filter = this.CanvasKit.ImageFilter.MakeShader(\n JsiSkImageFilter.fromValue(shader)\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlur(\n sigmaX: number,\n sigmaY: number,\n mode: TileMode,\n input: SkImageFilter | null\n ) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeBlur(\n sigmaX,\n sigmaY,\n ckEnum(mode),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeColorFilter(cf: SkColorFilter, input: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeColorFilter(\n JsiSkColorFilter.fromValue(cf),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeCompose(outer: SkImageFilter | null, inner: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeCompose(\n outer === null ? null : JsiSkImageFilter.fromValue(outer),\n inner === null ? null : JsiSkImageFilter.fromValue(inner)\n )\n );\n }\n\n MakeDropShadow(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadow(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDropShadowOnly(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadowOnly(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeErode(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeErode(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDilate(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDilate(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlend(\n mode: BlendMode,\n background: SkImageFilter,\n foreground: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n foreground === null\n ? null\n : JsiSkImageFilter.fromValue<ImageFilter>(foreground);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeBlend(\n ckEnum(mode),\n JsiSkImageFilter.fromValue(background),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeRuntimeShader(\n _builder: SkRuntimeShaderBuilder,\n _childShaderName: string | null,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n}\n"]}
@@ -1,11 +1,11 @@
1
- import { HostObject, toValue } from "./Host";
1
+ import { HostObject } from "./Host";
2
2
  export class JsiSkMatrix extends HostObject {
3
3
  constructor(CanvasKit, ref) {
4
4
  super(CanvasKit, ref, "Matrix");
5
5
  }
6
6
 
7
7
  concat(matrix) {
8
- this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, toValue(matrix)));
8
+ this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix)));
9
9
  }
10
10
 
11
11
  translate(x, y) {
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkMatrix.ts"],"names":["HostObject","toValue","JsiSkMatrix","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","identity"],"mappings":"AAIA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AAEA,OAAO,MAAMC,WAAN,SACGF,UADH,CAGP;AACEG,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;AAChD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;AACD;;AAEDC,EAAAA,MAAM,CAACC,MAAD,EAAmB;AACvB,SAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCJ,OAAO,CAACM,MAAD,CAAhD,CAAb;AACD;;AAEDI,EAAAA,SAAS,CAACC,CAAD,EAAYC,CAAZ,EAAuB;AAC9B,SAAKP,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEU,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKX,SAAL,CAAeK,MAAf,CAAsBO,UAAtB,CAAiCJ,CAAjC,EAAoCC,CAApC,CAAnB,CAFF,CADF;AAMD;;AAEDI,EAAAA,KAAK,CAACL,CAAD,EAAYC,CAAZ,EAAwB;AAC3B,SAAKP,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEU,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKX,SAAL,CAAeK,MAAf,CAAsBS,MAAtB,CAA6BN,CAA7B,EAAgCC,CAAhC,aAAgCA,CAAhC,cAAgCA,CAAhC,GAAqCD,CAArC,CAAnB,CAFF,CADF;AAMD;;AAEDO,EAAAA,IAAI,CAACP,CAAD,EAAYC,CAAZ,EAAuB;AACzB,SAAKP,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEU,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKX,SAAL,CAAeK,MAAf,CAAsBW,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAnB,CAFF,CADF;AAMD;;AAEDQ,EAAAA,MAAM,CAACC,KAAD,EAAgB;AACpB,SAAKhB,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEU,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKX,SAAL,CAAeK,MAAf,CAAsBc,OAAtB,CAA8BD,KAA9B,CAAnB,CAFF,CADF;AAMD;;AAEDE,EAAAA,QAAQ,GAAG;AACT,SAAKnB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBe,QAAtB,EAAb;AACD;;AA/CH","sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject, toValue } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n concat(matrix: SkMatrix) {\n this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, toValue(matrix)));\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkMatrix.ts"],"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","fromValue","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","identity"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,WAAN,SACGD,UADH,CAGP;AACEE,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;AAChD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;AACD;;AAEDC,EAAAA,MAAM,CAACC,MAAD,EAAmB;AACvB,SAAKF,GAAL,CAASG,GAAT,CACE,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCH,WAAW,CAACS,SAAZ,CAAsBJ,MAAtB,CAAzC,CADF;AAGD;;AAEDK,EAAAA,SAAS,CAACC,CAAD,EAAYC,CAAZ,EAAuB;AAC9B,SAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBQ,UAAtB,CAAiCJ,CAAjC,EAAoCC,CAApC,CAAnB,CAFF,CADF;AAMD;;AAEDI,EAAAA,KAAK,CAACL,CAAD,EAAYC,CAAZ,EAAwB;AAC3B,SAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBU,MAAtB,CAA6BN,CAA7B,EAAgCC,CAAhC,aAAgCA,CAAhC,cAAgCA,CAAhC,GAAqCD,CAArC,CAAnB,CAFF,CADF;AAMD;;AAEDO,EAAAA,IAAI,CAACP,CAAD,EAAYC,CAAZ,EAAuB;AACzB,SAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBY,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAnB,CAFF,CADF;AAMD;;AAEDQ,EAAAA,MAAM,CAACC,KAAD,EAAgB;AACpB,SAAKjB,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBe,OAAtB,CAA8BD,KAA9B,CAAnB,CAFF,CADF;AAMD;;AAEDE,EAAAA,QAAQ,GAAG;AACT,SAAKpB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBgB,QAAtB,EAAb;AACD;;AAjDH","sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n }\n}\n"]}
@@ -1,7 +1,11 @@
1
- import { HostObject, toNullableValue, ckEnum } from "./Host";
1
+ import { HostObject, ckEnum } from "./Host";
2
+ import { JsiSkColorFilter } from "./JsiSkColorFilter";
3
+ import { JsiSkImageFilter } from "./JsiSkImageFilter";
4
+ import { JsiSkMaskFilter } from "./JsiSkMaskFilter";
5
+ import { JsiSkPathEffect } from "./JsiSkPathEffect";
6
+ import { JsiSkShader } from "./JsiSkShader";
2
7
  export class JsiSkPaint extends HostObject {
3
8
  constructor(CanvasKit, ref) {
4
- ref.setAntiAlias(true);
5
9
  super(CanvasKit, ref, "Paint");
6
10
  }
7
11
 
@@ -9,6 +13,10 @@ export class JsiSkPaint extends HostObject {
9
13
  return new JsiSkPaint(this.CanvasKit, this.ref.copy());
10
14
  }
11
15
 
16
+ reset() {
17
+ this.ref = new this.CanvasKit.Paint();
18
+ }
19
+
12
20
  getColor() {
13
21
  return this.ref.getColor();
14
22
  }
@@ -46,23 +54,23 @@ export class JsiSkPaint extends HostObject {
46
54
  }
47
55
 
48
56
  setColorFilter(filter) {
49
- this.ref.setColorFilter(toNullableValue(filter));
57
+ this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);
50
58
  }
51
59
 
52
60
  setImageFilter(filter) {
53
- this.ref.setImageFilter(toNullableValue(filter));
61
+ this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);
54
62
  }
55
63
 
56
64
  setMaskFilter(filter) {
57
- this.ref.setMaskFilter(toNullableValue(filter));
65
+ this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);
58
66
  }
59
67
 
60
68
  setPathEffect(effect) {
61
- this.ref.setPathEffect(toNullableValue(effect));
69
+ this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);
62
70
  }
63
71
 
64
72
  setShader(shader) {
65
- this.ref.setShader(toNullableValue(shader));
73
+ this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);
66
74
  }
67
75
 
68
76
  setStrokeCap(cap) {
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkPaint.ts"],"names":["HostObject","toNullableValue","ckEnum","JsiSkPaint","constructor","CanvasKit","ref","setAntiAlias","copy","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","aa","setBlendMode","blendMode","setColor","color","setColorFilter","filter","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","setStrokeJoin","join","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"mappings":"AAgBA,SAASA,UAAT,EAAqBC,eAArB,EAAsCC,MAAtC,QAAoD,QAApD;AAEA,OAAO,MAAMC,UAAN,SAAyBH,UAAzB,CAAuE;AAC5EI,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;AAC5CA,IAAAA,GAAG,CAACC,YAAJ,CAAiB,IAAjB;AACA,UAAMF,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;AACD;;AAEDE,EAAAA,IAAI,GAAG;AACL,WAAO,IAAIL,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;AACD;;AAEDC,EAAAA,QAAQ,GAAG;AACT,WAAO,KAAKH,GAAL,CAASG,QAAT,EAAP;AACD;;AAEDC,EAAAA,YAAY,GAAG;AACb,WAAO,KAAKJ,GAAL,C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C;AACD;;AAEDC,EAAAA,YAAY,CAACC,GAAD,EAAiB;AAC3B,SAAKzB,GAAL,CAASwB,YAAT,CAAsB5B,MAAM,CAAC6B,GAAD,CAA5B;AACD;;AAEDC,EAAAA,aAAa,CAACC,IAAD,EAAmB;AAC9B,SAAK3B,GAAL,CAAS0B,aAAT,CAAuB9B,MAAM,CAAC+B,IAAD,CAA7B;AACD;;AAEDC,EAAAA,cAAc,CAACC,KAAD,EAAgB;AAC5B,SAAK7B,GAAL,CAAS4B,cAAT,CAAwBC,KAAxB;AACD;;AAEDC,EAAAA,cAAc,CAACC,KAAD,EAAgB;AAC5B,SAAK/B,GAAL,CAAS8B,cAAT,CAAwBC,KAAxB;AACD;;AAEDC,EAAAA,QAAQ,CAACC,KAAD,EAAoB;AAC1B,SAAKjC,GAAL,CAASgC,QAAT,CAAkB;AAAE3B,MAAAA,KAAK,EAAE4B;AAAT,KAAlB;AACD;;AApF2E","sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, toNullableValue, ckEnum } from \"./Host\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n ref.setAntiAlias(true);\n super(CanvasKit, ref, \"Paint\");\n }\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(ckEnum(blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(toNullableValue(filter));\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(toNullableValue(filter));\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(toNullableValue(filter));\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(toNullableValue(effect));\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(toNullableValue(shader));\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(ckEnum(cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(ckEnum(join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkPaint.ts"],"names":["HostObject","ckEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","copy","reset","Paint","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setBlendMode","blendMode","setColor","color","setColorFilter","filter","fromValue","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","setStrokeJoin","join","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"mappings":"AAgBA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,e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T,CAAwBC,KAAxB;AACD;;AAEDC,EAAAA,QAAQ,CAACC,KAAD,EAAoB;AAC1B,SAAKpC,GAAL,CAASmC,QAAT,CAAkB;AAAE7B,MAAAA,KAAK,EAAE8B;AAAT,KAAlB;AACD;;AAvF2E","sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(ckEnum(blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(ckEnum(cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(ckEnum(join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"]}
@@ -1,7 +1,9 @@
1
1
  import { PathVerb } from "../types";
2
- import { ckEnum, HostObject, optEnum, toValue } from "./Host";
2
+ import { ckEnum, HostObject, optEnum } from "./Host";
3
3
  import { JsiSkPoint } from "./JsiSkPoint";
4
4
  import { JsiSkRect } from "./JsiSkRect";
5
+ import { JsiSkRRect } from "./JsiSkRRect";
6
+ import { JsiSkMatrix } from "./JsiSkMatrix";
5
7
  const CommandCount = {
6
8
  [PathVerb.Move]: 3,
7
9
  [PathVerb.Line]: 3,
@@ -10,35 +12,18 @@ const CommandCount = {
10
12
  [PathVerb.Cubic]: 7,
11
13
  [PathVerb.Close]: 1
12
14
  };
13
-
14
- const areCmdsInterpolatable = (cmd1, cmd2) => {
15
- if (cmd1.length !== cmd2.length) {
16
- return false;
17
- }
18
-
19
- for (let i = 0; i < cmd1.length; i++) {
20
- if (cmd1[i][0] !== cmd2[i][0]) {
21
- return false;
22
- } else if (cmd1[i][0] === PathVerb.Conic && cmd1[i][5] !== cmd2[i][5]) {
23
- return false;
24
- }
25
- }
26
-
27
- return true;
28
- };
29
-
30
15
  export class JsiSkPath extends HostObject {
31
16
  constructor(CanvasKit, ref) {
32
17
  super(CanvasKit, ref, "Path");
33
18
  }
34
19
 
35
20
  addArc(oval, startAngleInDegrees, sweepAngleInDegrees) {
36
- this.ref.addArc(toValue(oval), startAngleInDegrees, sweepAngleInDegrees);
21
+ this.ref.addArc(JsiSkRect.fromValue(this.CanvasKit, oval), startAngleInDegrees, sweepAngleInDegrees);
37
22
  return this;
38
23
  }
39
24
 
40
25
  addOval(oval, isCCW, startIndex) {
41
- this.ref.addOval(toValue(oval), isCCW, startIndex);
26
+ this.ref.addOval(JsiSkRect.fromValue(this.CanvasKit, oval), isCCW, startIndex);
42
27
  return this;
43
28
  }
44
29
 
@@ -47,7 +32,7 @@ export class JsiSkPath extends HostObject {
47
32
  }
48
33
 
49
34
  addPoly(points, close) {
50
- this.ref.addPoly(points.map(p => toValue(p)), close);
35
+ this.ref.addPoly(points.map(p => Array.from(JsiSkPoint.fromValue(p))).flat(), close);
51
36
  return this;
52
37
  }
53
38
 
@@ -138,7 +123,7 @@ export class JsiSkPath extends HostObject {
138
123
  }
139
124
 
140
125
  arcToOval(oval, startAngleInDegrees, sweepAngleInDegrees, forceMoveTo) {
141
- this.ref.arcToOval(toValue(oval), startAngleInDegrees, sweepAngleInDegrees, forceMoveTo);
126
+ this.ref.arcToOval(JsiSkRect.fromValue(this.CanvasKit, oval), startAngleInDegrees, sweepAngleInDegrees, forceMoveTo);
142
127
  return this;
143
128
  }
144
129
 
@@ -175,7 +160,7 @@ export class JsiSkPath extends HostObject {
175
160
  }
176
161
 
177
162
  equals(other) {
178
- return this.ref.equals(toValue(other));
163
+ return this.ref.equals(JsiSkPath.fromValue(other));
179
164
  }
180
165
 
181
166
  getBounds() {
@@ -191,11 +176,11 @@ export class JsiSkPath extends HostObject {
191
176
  }
192
177
 
193
178
  addRect(rect, isCCW) {
194
- this.ref.addRect(toValue(rect), isCCW);
179
+ this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);
195
180
  }
196
181
 
197
182
  addRRect(rrect, isCCW) {
198
- this.ref.addRRect(toValue(rrect), isCCW);
183
+ this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);
199
184
  return this;
200
185
  }
201
186
 
@@ -212,9 +197,7 @@ export class JsiSkPath extends HostObject {
212
197
  }
213
198
 
214
199
  addCircle(x, y, r) {
215
- // We leave the comment below to remind us that this is not implemented in CanvasKit
216
- // throw new NotImplementedOnRNWeb();
217
- this.ref.addOval(this.CanvasKit.LTRBRect(x - r, y - r, x + r, y + r));
200
+ this.ref.addCircle(x, y, r);
218
201
  return this;
219
202
  }
220
203
 
@@ -223,7 +206,7 @@ export class JsiSkPath extends HostObject {
223
206
  }
224
207
 
225
208
  op(path, op) {
226
- return this.ref.op(toValue(path), ckEnum(op));
209
+ return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));
227
210
  }
228
211
 
229
212
  simplify() {
@@ -240,37 +223,11 @@ export class JsiSkPath extends HostObject {
240
223
  }
241
224
 
242
225
  transform(m3) {
243
- this.ref.transform(toValue(m3));
226
+ this.ref.transform(JsiSkMatrix.fromValue(m3));
244
227
  }
245
228
 
246
229
  interpolate(end, t) {
247
- // Do not remove the comment below. We use it to track missing APIs in CanvasKit
248
- // throw new NotImplementedOnRNWeb();
249
- const cmd1 = this.toCmds();
250
- const cmd2 = end.toCmds();
251
-
252
- if (!areCmdsInterpolatable(cmd1, cmd2)) {
253
- return null;
254
- }
255
-
256
- const interpolated = [];
257
- cmd1.forEach((cmd, i) => {
258
- const interpolatedCmd = [cmd[0]];
259
- interpolated.push(interpolatedCmd);
260
- cmd.forEach((c, j) => {
261
- if (j === 0) {
262
- return;
263
- }
264
-
265
- if (interpolatedCmd[0] === PathVerb.Conic && j === 5) {
266
- interpolatedCmd.push(c);
267
- } else {
268
- const c2 = cmd2[i][j];
269
- interpolatedCmd.push(c2 + (c - c2) * t);
270
- }
271
- });
272
- });
273
- const path = this.CanvasKit.Path.MakeFromCmds(interpolated.flat());
230
+ const path = this.CanvasKit.Path.MakeFromPathInterpolation(this.ref, JsiSkPath.fromValue(end), t);
274
231
 
275
232
  if (path === null) {
276
233
  return null;
@@ -280,11 +237,7 @@ export class JsiSkPath extends HostObject {
280
237
  }
281
238
 
282
239
  isInterpolatable(path2) {
283
- // Do not remove the comment below. We use it to track missing APIs in CanvasKit
284
- // throw new NotImplementedOnRNWeb();
285
- const cmd1 = this.toCmds();
286
- const cmd2 = path2.toCmds();
287
- return areCmdsInterpolatable(cmd1, cmd2);
240
+ return this.CanvasKit.Path.CanInterpolate(this.ref, JsiSkPath.fromValue(path2));
288
241
  }
289
242
 
290
243
  toCmds() {
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkPath.ts"],"names":["PathVerb","ckEnum","HostObject","optEnum","toValue","JsiSkPoint","JsiSkRect","CommandCount","Move","Line","Quad","Conic","Cubic","Close","areCmdsInterpolatable","cmd1","cmd2","length","i","JsiSkPath","constructor","CanvasKit","ref","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","LTRBRect","getLastPt","op","path","simplify","toSVGString","trim","startT","stopT","isComplement","transform","m3","interpolate","end","t","toCmds","interpolated","forEach","cmd","interpolatedCmd","push","c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;AAC3B+H,UAAAA,OAAO,CAACZ,IAAR,CAAaF,GAAb;AACD;;AACD,YAAIc,OAAO,CAAC/H,MAAR,KAAmBA,MAAnB,IAA6BC,CAAC,KAAK2H,IAAI,CAAC5H,MAAL,GAAc,CAArD,EAAwD;AACtD8H,UAAAA,GAAG,CAACX,IAAJ,CAAS,EAAT;AACD;AACF;;AACD,aAAOW,GAAP;AACD,KArBc,EAqBZ,EArBY,CAAf;AAsBA,WAAOtG,MAAP;AACD;;AAtVuE","sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum, toValue } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst areCmdsInterpolatable = (cmd1: PathCommand[], cmd2: PathCommand[]) => {\n if (cmd1.length !== cmd2.length) {\n return false;\n }\n for (let i = 0; i < cmd1.length; i++) {\n if (cmd1[i][0] !== cmd2[i][0]) {\n return false;\n } else if (cmd1[i][0] === PathVerb.Conic && cmd1[i][5] !== cmd2[i][5]) {\n return false;\n }\n }\n return true;\n};\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(toValue(oval), startAngleInDegrees, sweepAngleInDegrees);\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(toValue(oval), isCCW, startIndex);\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => toValue(p)),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n }\n\n reset() {\n this.ref.reset();\n }\n\n rewind() {\n this.ref.rewind();\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n toValue(oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(toValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(toValue(rect), isCCW);\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(toValue(rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n // We leave the comment below to remind us that this is not implemented in CanvasKit\n // throw new NotImplementedOnRNWeb();\n this.ref.addOval(this.CanvasKit.LTRBRect(x - r, y - r, x + r, y + r));\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(toValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(startT: number, stopT: number, isComplement: boolean) {\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(toValue(m3));\n }\n\n interpolate(end: SkPath, t: number) {\n // Do not remove the comment below. We use it to track missing APIs in CanvasKit\n // throw new NotImplementedOnRNWeb();\n const cmd1 = this.toCmds();\n const cmd2 = end.toCmds();\n if (!areCmdsInterpolatable(cmd1, cmd2)) {\n return null;\n }\n const interpolated: PathCommand[] = [];\n cmd1.forEach((cmd, i) => {\n const interpolatedCmd = [cmd[0]];\n interpolated.push(interpolatedCmd);\n cmd.forEach((c, j) => {\n if (j === 0) {\n return;\n }\n if (interpolatedCmd[0] === PathVerb.Conic && j === 5) {\n interpolatedCmd.push(c);\n } else {\n const c2 = cmd2[i][j];\n interpolatedCmd.push(c2 + (c - c2) * t);\n }\n });\n });\n const path = this.CanvasKit.Path.MakeFromCmds(interpolated.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n isInterpolatable(path2: SkPath): boolean {\n // Do not remove the comment below. We use it to track missing APIs in CanvasKit\n // throw new NotImplementedOnRNWeb();\n const cmd1 = this.toCmds();\n const cmd2 = path2.toCmds();\n return areCmdsInterpolatable(cmd1, cmd2);\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkPath.ts"],"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","JsiSkPath","constructor","CanvasKit","ref","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","fromValue","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","simplify","toSVGString","trim","startT","stopT","isComplement","transform","m3","interpolate","end","t","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"mapp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G,IAAJ,CAAS,EAAT;AACD;AACF;;AACD,aAAOH,GAAP;AACD,KArBc,EAqBZ,EArBY,CAAf;AAsBA,WAAO7F,MAAP;AACD;;AAxUuE","sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n }\n\n reset() {\n this.ref.reset();\n }\n\n rewind() {\n this.ref.rewind();\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(startT: number, stopT: number, isComplement: boolean) {\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(JsiSkMatrix.fromValue(m3));\n }\n\n interpolate(end: SkPath, t: number) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"]}
@@ -1,4 +1,6 @@
1
- import { ckEnum, Host, NotImplementedOnRNWeb, toValue } from "./Host";
1
+ import { ckEnum, Host, NotImplementedOnRNWeb } from "./Host";
2
+ import { JsiSkMatrix } from "./JsiSkMatrix";
3
+ import { JsiSkPath } from "./JsiSkPath";
2
4
  import { JsiSkPathEffect } from "./JsiSkPathEffect";
3
5
  export class JsiSkPathEffectFactory extends Host {
4
6
  constructor(CanvasKit) {
@@ -34,7 +36,7 @@ export class JsiSkPathEffectFactory extends Host {
34
36
  }
35
37
 
36
38
  MakeLine2D(width, matrix) {
37
- const pe = this.CanvasKit.PathEffect.MakeLine2D(width, toValue(matrix));
39
+ const pe = this.CanvasKit.PathEffect.MakeLine2D(width, JsiSkMatrix.fromValue(matrix));
38
40
 
39
41
  if (pe === null) {
40
42
  return null;
@@ -44,7 +46,7 @@ export class JsiSkPathEffectFactory extends Host {
44
46
  }
45
47
 
46
48
  MakePath1D(path, advance, phase, style) {
47
- const pe = this.CanvasKit.PathEffect.MakePath1D(toValue(path), advance, phase, ckEnum(style));
49
+ const pe = this.CanvasKit.PathEffect.MakePath1D(JsiSkPath.fromValue(path), advance, phase, ckEnum(style));
48
50
 
49
51
  if (pe === null) {
50
52
  return null;
@@ -54,7 +56,7 @@ export class JsiSkPathEffectFactory extends Host {
54
56
  }
55
57
 
56
58
  MakePath2D(matrix, path) {
57
- const pe = this.CanvasKit.PathEffect.MakePath2D(toValue(matrix), toValue(path));
59
+ const pe = this.CanvasKit.PathEffect.MakePath2D(JsiSkMatrix.fromValue(matrix), JsiSkPath.fromValue(path));
58
60
 
59
61
  if (pe === null) {
60
62
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkPathEffectFactory.ts"],"names":["ckEnum","Host","NotImplementedOnRNWeb","toValue","JsiSkPathEffect","JsiSkPathEffectFactory","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","MakeSum","MakeLine2D","width","matrix","MakePath1D","path","advance","style","MakePath2D"],"mappings":"AAUA,SAASA,MAAT,EAAiBC,IAAjB,EAAuBC,qBAAvB,EAA8CC,OAA9C,QAA6D,QAA7D;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,sBAAN,SAAqCJ,IAArC,CAAuE;AAC5EK,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,U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AAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDgB,EAAAA,UAAU,CACRC,IADQ,EAERC,OAFQ,EAGRd,KAHQ,EAIRe,KAJQ,EAKR;AACA,UAAMnB,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0Be,UAA1B,CACTvB,OAAO,CAACwB,IAAD,CADE,EAETC,OAFS,EAGTd,KAHS,EAITd,MAAM,CAAC6B,KAAD,CAJG,CAAX;;AAMA,QAAInB,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDoB,EAAAA,UAAU,CAACL,MAAD,EAAmBE,IAAnB,EAAiC;AACzC,UAAMjB,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BmB,UAA1B,CACT3B,OAAO,CAACsB,MAAD,CADE,EAETtB,OAAO,CAACwB,IAAD,CAFE,CAAX;;AAIA,QAAIjB,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAtE2E","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n Path1DEffectStyle,\n PathEffectFactory,\n SkMatrix,\n SkPath,\n SkPathEffect,\n} from \"../types\";\n\nimport { ckEnum, Host, NotImplementedOnRNWeb, toValue } from \"./Host\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\n\nexport class JsiSkPathEffectFactory extends Host implements PathEffectFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeCorner(radius: number) {\n const pe = this.CanvasKit.PathEffect.MakeCorner(radius);\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDash(intervals: number[], phase?: number) {\n const pe = this.CanvasKit.PathEffect.MakeDash(intervals, phase);\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDiscrete(segLength: number, dev: number, seedAssist: number) {\n const pe = this.CanvasKit.PathEffect.MakeDiscrete(\n segLength,\n dev,\n seedAssist\n );\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeSum(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeLine2D(width: number, matrix: SkMatrix) {\n const pe = this.CanvasKit.PathEffect.MakeLine2D(width, toValue(matrix));\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath1D(\n path: SkPath,\n advance: number,\n phase: number,\n style: Path1DEffectStyle\n ) {\n const pe = this.CanvasKit.PathEffect.MakePath1D(\n toValue(path),\n advance,\n phase,\n ckEnum(style)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath2D(matrix: SkMatrix, path: SkPath) {\n const pe = this.CanvasKit.PathEffect.MakePath2D(\n toValue(matrix),\n toValue(path)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkPathEffectFactory.ts"],"names":["ckEnum","Host","NotImplementedOnRNWeb","JsiSkMatrix","JsiSkPath","JsiSkPathEffect","JsiSkPathEffectFactory","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","MakeSum","MakeLine2D","width","matrix","fromValue","MakePath1D","path","advance","style","MakePath2D"],"mappings":"AAUA,SAASA,MAAT,EAAiBC,IAAjB,EAAuBC,qBAAvB,QAAoD,QAApD;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAA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1B,CACTC,KADS,EAETtB,WAAW,CAACwB,SAAZ,CAAsBD,MAAtB,CAFS,CAAX;;AAIA,QAAIf,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDiB,EAAAA,UAAU,CACRC,IADQ,EAERC,OAFQ,EAGRf,KAHQ,EAIRgB,KAJQ,EAKR;AACA,UAAMpB,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BgB,UAA1B,CACTxB,SAAS,CAACuB,SAAV,CAAoBE,IAApB,CADS,EAETC,OAFS,EAGTf,KAHS,EAITf,MAAM,CAAC+B,KAAD,CAJG,CAAX;;AAMA,QAAIpB,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAEDqB,EAAAA,UAAU,CAACN,MAAD,EAAmBG,IAAnB,EAAiC;AACzC,UAAMlB,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BoB,UAA1B,CACT7B,WAAW,CAACwB,SAAZ,CAAsBD,MAAtB,CADS,EAETtB,SAAS,CAACuB,SAAV,CAAoBE,IAApB,CAFS,CAAX;;AAIA,QAAIlB,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;AACD;;AAzE2E","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n Path1DEffectStyle,\n PathEffectFactory,\n SkMatrix,\n SkPath,\n SkPathEffect,\n} from \"../types\";\n\nimport { ckEnum, Host, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\n\nexport class JsiSkPathEffectFactory extends Host implements PathEffectFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeCorner(radius: number) {\n const pe = this.CanvasKit.PathEffect.MakeCorner(radius);\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDash(intervals: number[], phase?: number) {\n const pe = this.CanvasKit.PathEffect.MakeDash(intervals, phase);\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDiscrete(segLength: number, dev: number, seedAssist: number) {\n const pe = this.CanvasKit.PathEffect.MakeDiscrete(\n segLength,\n dev,\n seedAssist\n );\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeSum(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeLine2D(width: number, matrix: SkMatrix) {\n const pe = this.CanvasKit.PathEffect.MakeLine2D(\n width,\n JsiSkMatrix.fromValue(matrix)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath1D(\n path: SkPath,\n advance: number,\n phase: number,\n style: Path1DEffectStyle\n ) {\n const pe = this.CanvasKit.PathEffect.MakePath1D(\n JsiSkPath.fromValue(path),\n advance,\n phase,\n ckEnum(style)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath2D(matrix: SkMatrix, path: SkPath) {\n const pe = this.CanvasKit.PathEffect.MakePath2D(\n JsiSkMatrix.fromValue(matrix),\n JsiSkPath.fromValue(path)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Host, ckEnum, toValue, NotImplementedOnRNWeb } from "./Host";
1
+ import { Host, ckEnum, NotImplementedOnRNWeb } from "./Host";
2
2
  import { JsiSkPath } from "./JsiSkPath";
3
3
  export class JsiSkPathFactory extends Host {
4
4
  constructor(CanvasKit) {
@@ -20,7 +20,7 @@ export class JsiSkPathFactory extends Host {
20
20
  }
21
21
 
22
22
  MakeFromOp(one, two, op) {
23
- const path = this.CanvasKit.Path.MakeFromOp(toValue(one), toValue(two), ckEnum(op));
23
+ const path = this.CanvasKit.Path.MakeFromOp(JsiSkPath.fromValue(one), JsiSkPath.fromValue(two), ckEnum(op));
24
24
 
25
25
  if (path === null) {
26
26
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkPathFactory.ts"],"names":["Host","ckEnum","toValue","NotImplementedOnRNWeb","JsiSkPath","JsiSkPathFactory","constructor","CanvasKit","Make","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font"],"mappings":"AAKA,SAASA,IAAT,EAAeC,MAAf,EAAuBC,OAAvB,EAAgCC,qBAAhC,QAA6D,QAA7D;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,gBAAN,SAA+BL,IAA/B,CAA2D;AAChEM,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,IAAI,GAAG;AACL,WAAO,IAAIJ,SAAJ,CAAc,KAAKG,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeE,IAAnB,EAA9B,CAAP;AACD;;AAEDC,EAAAA,iBAAiB,CAACC,GAAD,EAAc;AAC7B,UAAMC,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;AACA,QAAIC,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;AACD;;AAEDC,EAAAA,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;AAC/C,UAAMJ,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBI,UAApB,CACXX,OAAO,CAACY,GAAD,CADI,EAEXZ,OAAO,CAACa,GAAD,CAFI,EAGXd,MAAM,CAACe,EAAD,CAHK,CAAb;;AAKA,QAAIJ,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;AACD;;AAEDK,EAAAA,YAAY,CAACC,IAAD,EAAsB;AAChC,UAAMN,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBQ,YAApB,CAAiCC,IAAI,CAACC,IAAL,EAAjC,CAAb;;AACA,QAAIP,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;AACD;;AAEDQ,EAAAA,YAAY,CACVC,KADU,EAEVC,EAFU,EAGVC,EAHU,EAIVC,KAJU,EAKK;AACf,UAAM,IAAIrB,qBAAJ,EAAN;AACD;;AA5C+D","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { PathCommand, PathOp, SkFont, SkPath } from \"../types\";\nimport type { PathFactory } from \"../types/Path/PathFactory\";\n\nimport { Host, ckEnum, toValue, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkPathFactory extends Host implements PathFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make() {\n return new JsiSkPath(this.CanvasKit, new this.CanvasKit.Path());\n }\n\n MakeFromSVGString(str: string) {\n const path = this.CanvasKit.Path.MakeFromSVGString(str);\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromOp(one: SkPath, two: SkPath, op: PathOp) {\n const path = this.CanvasKit.Path.MakeFromOp(\n toValue(one),\n toValue(two),\n ckEnum(op)\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromCmds(cmds: PathCommand[]) {\n const path = this.CanvasKit.Path.MakeFromCmds(cmds.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromText(\n _text: string,\n _x: number,\n _y: number,\n _font: SkFont\n ): SkPath | null {\n throw new NotImplementedOnRNWeb();\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkPathFactory.ts"],"names":["Host","ckEnum","NotImplementedOnRNWeb","JsiSkPath","JsiSkPathFactory","constructor","CanvasKit","Make","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font"],"mappings":"AAKA,SAASA,IAAT,EAAeC,MAAf,EAAuBC,qBAAvB,QAAoD,QAApD;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,gBAAN,SAA+BJ,IAA/B,CAA2D;AAChEK,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,IAAI,GAAG;AACL,WAAO,IAAIJ,SAAJ,CAAc,KAAKG,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeE,IAAnB,EAA9B,CAAP;AACD;;AAEDC,EAAAA,iBAAiB,CAACC,GAAD,EAAc;AAC7B,UAAMC,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;AACA,QAAIC,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;AACD;;AAEDC,EAAAA,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;AAC/C,UAAMJ,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBI,UAApB,CACXT,SAAS,CAACa,SAAV,CAAoBH,GAApB,CADW,EAEXV,SAAS,CAACa,SAAV,CAAoBF,GAApB,CAFW,EAGXb,MAAM,CAACc,EAAD,CAHK,CAAb;;AAKA,QAAIJ,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;AACD;;AAEDM,EAAAA,YAAY,CAACC,IAAD,EAAsB;AAChC,UAAMP,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBS,YAApB,CAAiCC,IAAI,CAACC,IAAL,EAAjC,CAAb;;AACA,QAAIR,IAAI,KAAK,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,WAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;AACD;;AAEDS,EAAAA,YAAY,CACVC,KADU,EAEVC,EAFU,EAGVC,EAHU,EAIVC,KAJU,EAKK;AACf,UAAM,IAAItB,qBAAJ,EAAN;AACD;;AA5C+D","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { PathCommand, PathOp, SkFont, SkPath } from \"../types\";\nimport type { PathFactory } from \"../types/Path/PathFactory\";\n\nimport { Host, ckEnum, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkPathFactory extends Host implements PathFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make() {\n return new JsiSkPath(this.CanvasKit, new this.CanvasKit.Path());\n }\n\n MakeFromSVGString(str: string) {\n const path = this.CanvasKit.Path.MakeFromSVGString(str);\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromOp(one: SkPath, two: SkPath, op: PathOp) {\n const path = this.CanvasKit.Path.MakeFromOp(\n JsiSkPath.fromValue(one),\n JsiSkPath.fromValue(two),\n ckEnum(op)\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromCmds(cmds: PathCommand[]) {\n const path = this.CanvasKit.Path.MakeFromCmds(cmds.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromText(\n _text: string,\n _x: number,\n _y: number,\n _font: SkFont\n ): SkPath | null {\n throw new NotImplementedOnRNWeb();\n }\n}\n"]}
@@ -1,13 +1,15 @@
1
1
  // TODO: suggest to rename SkPicture to Picture for consistency
2
- import { HostObject, toValue, ckEnum } from "./Host";
2
+ import { HostObject, ckEnum } from "./Host";
3
3
  import { JsiSkShader } from "./JsiSkShader";
4
+ import { JsiSkMatrix } from "./JsiSkMatrix";
5
+ import { JsiSkRect } from "./JsiSkRect";
4
6
  export class JsiSkPicture extends HostObject {
5
7
  constructor(CanvasKit, ref) {
6
8
  super(CanvasKit, ref, "Picture");
7
9
  }
8
10
 
9
11
  makeShader(tmx, tmy, mode, localMatrix, tileRect) {
10
- return new JsiSkShader(this.CanvasKit, this.ref.makeShader(ckEnum(tmx), ckEnum(tmy), ckEnum(mode), localMatrix ? toValue(localMatrix) : undefined, tileRect ? toValue(tileRect) : undefined));
12
+ return new JsiSkShader(this.CanvasKit, this.ref.makeShader(ckEnum(tmx), ckEnum(tmy), ckEnum(mode), localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined, tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined));
11
13
  }
12
14
 
13
15
  serialize() {
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkPicture.ts"],"names":["HostObject","toValue","ckEnum","JsiSkShader","JsiSkPicture","constructor","CanvasKit","ref","makeShader","tmx","tmy","mode","localMatrix","tileRect","undefined","serialize"],"mappings":"AAAA;AAWA,SAASA,UAAT,EAAqBC,OAArB,EAA8BC,MAA9B,QAA4C,QAA5C;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,YAAN,SACGJ,UADH,CAGP;AACEK,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAEDC,EAAAA,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;AACA,WAAO,IAAIV,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASC,UAAT,CACEN,MAAM,CAACO,GAAD,CADR,EAEEP,MAAM,CAACQ,GAAD,CAFR,EAGER,MAAM,CAACS,IAAD,CAHR,EAIEC,WAAW,GAAGX,OAAO,CAACW,WAAD,CAAV,GAA0BE,SAJvC,EAKED,QAAQ,GAAGZ,OAAO,CAACY,QAAD,CAAV,GAAuBC,SALjC,CAFK,CAAP;AAUD;;AAEDC,EAAAA,SAAS,GAAG;AACV,WAAO,KAAKR,GAAL,CAASQ,SAAT,EAAP;AACD;;AA1BH","sourcesContent":["// TODO: suggest to rename SkPicture to Picture for consistency\nimport type { CanvasKit, SkPicture as Picture } from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n SkRect,\n TileMode,\n SkPicture,\n SkMatrix,\n} from \"../types\";\n\nimport { HostObject, toValue, ckEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPicture\n extends HostObject<Picture, \"Picture\">\n implements SkPicture\n{\n constructor(CanvasKit: CanvasKit, ref: Picture) {\n super(CanvasKit, ref, \"Picture\");\n }\n\n makeShader(\n tmx: TileMode,\n tmy: TileMode,\n mode: FilterMode,\n localMatrix?: SkMatrix,\n tileRect?: SkRect\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n ckEnum(tmx),\n ckEnum(tmy),\n ckEnum(mode),\n localMatrix ? toValue(localMatrix) : undefined,\n tileRect ? toValue(tileRect) : undefined\n )\n );\n }\n\n serialize() {\n return this.ref.serialize();\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkPicture.ts"],"names":["HostObject","ckEnum","JsiSkShader","JsiSkMatrix","JsiSkRect","JsiSkPicture","constructor","CanvasKit","ref","makeShader","tmx","tmy","mode","localMatrix","tileRect","fromValue","undefined","serialize"],"mappings":"AAAA;AAWA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,YAAN,SACGL,UADH,CAGP;AACEM,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAEDC,EAAAA,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;AACA,WAAO,IAAIZ,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASC,UAAT,CACER,MAAM,CAACS,GAAD,CADR,EAEET,MAAM,CAACU,GAAD,CAFR,EAGEV,MAAM,CAACW,IAAD,CAHR,EAIEC,WAAW,GAAGV,WAAW,CAACY,SAAZ,CAAsBF,WAAtB,CAAH,GAAwCG,SAJrD,EAKEF,QAAQ,GAAGV,SAAS,CAACW,SAAV,CAAoB,KAAKR,SAAzB,EAAoCO,QAApC,CAAH,GAAmDE,SAL7D,CAFK,CAAP;AAUD;;AAEDC,EAAAA,SAAS,GAAG;AACV,WAAO,KAAKT,GAAL,CAASS,SAAT,EAAP;AACD;;AA1BH","sourcesContent":["// TODO: suggest to rename SkPicture to Picture for consistency\nimport type { CanvasKit, SkPicture as Picture } from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n SkRect,\n TileMode,\n SkPicture,\n SkMatrix,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPicture\n extends HostObject<Picture, \"Picture\">\n implements SkPicture\n{\n constructor(CanvasKit: CanvasKit, ref: Picture) {\n super(CanvasKit, ref, \"Picture\");\n }\n\n makeShader(\n tmx: TileMode,\n tmy: TileMode,\n mode: FilterMode,\n localMatrix?: SkMatrix,\n tileRect?: SkRect\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n ckEnum(tmx),\n ckEnum(tmy),\n ckEnum(mode),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,\n tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined\n )\n );\n }\n\n serialize() {\n return this.ref.serialize();\n }\n}\n"]}
@@ -1,13 +1,14 @@
1
- import { HostObject, toValue } from "./Host";
1
+ import { HostObject } from "./Host";
2
2
  import { JsiSkCanvas } from "./JsiSkCanvas";
3
3
  import { JsiSkPicture } from "./JsiSkPicture";
4
+ import { JsiSkRect } from "./JsiSkRect";
4
5
  export class JsiSkPictureRecorder extends HostObject {
5
6
  constructor(CanvasKit, ref) {
6
7
  super(CanvasKit, ref, "PictureRecorder");
7
8
  }
8
9
 
9
10
  beginRecording(bounds) {
10
- return new JsiSkCanvas(this.CanvasKit, this.ref.beginRecording(toValue(bounds)));
11
+ return new JsiSkCanvas(this.CanvasKit, this.ref.beginRecording(JsiSkRect.fromValue(this.CanvasKit, bounds)));
11
12
  }
12
13
 
13
14
  finishRecordingAsPicture() {
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkPictureRecorder.ts"],"names":["HostObject","toValue","JsiSkCanvas","JsiSkPicture","JsiSkPictureRecorder","constructor","CanvasKit","ref","beginRecording","bounds","finishRecordingAsPicture"],"mappings":"AAKA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA,OAAO,MAAMC,oBAAN,SACGJ,UADH,CAGP;AACEK,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA6C;AACtD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,iBAAtB;AACD;;AAEDC,EAAAA,cAAc,CAACC,MAAD,EAAiB;AAC7B,WAAO,IAAIP,WAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASC,cAAT,CAAwBP,OAAO,CAACQ,MAAD,CAA/B,CAFK,CAAP;AAID;;AAEDC,EAAAA,wBAAwB,GAAG;AACzB,WAAO,IAAIP,YAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASG,wBAAT,EAFK,CAAP;AAID;;AAjBH","sourcesContent":["import type { CanvasKit, PictureRecorder } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\nimport type { SkPictureRecorder } from \"../types/Picture/PictureRecorder\";\n\nimport { HostObject, toValue } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\n\nexport class JsiSkPictureRecorder\n extends HostObject<PictureRecorder, \"PictureRecorder\">\n implements SkPictureRecorder\n{\n constructor(CanvasKit: CanvasKit, ref: PictureRecorder) {\n super(CanvasKit, ref, \"PictureRecorder\");\n }\n\n beginRecording(bounds: SkRect) {\n return new JsiSkCanvas(\n this.CanvasKit,\n this.ref.beginRecording(toValue(bounds))\n );\n }\n\n finishRecordingAsPicture() {\n return new JsiSkPicture(\n this.CanvasKit,\n this.ref.finishRecordingAsPicture()\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkPictureRecorder.ts"],"names":["HostObject","JsiSkCanvas","JsiSkPicture","JsiSkRect","JsiSkPictureRecorder","constructor","CanvasKit","ref","beginRecording","bounds","fromValue","finishRecordingAsPicture"],"mappings":"AAKA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,oBAAN,SACGJ,UADH,CAGP;AACEK,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA6C;AACtD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,iBAAtB;AACD;;AAEDC,EAAAA,cAAc,CAACC,MAAD,EAAiB;AAC7B,WAAO,IAAIR,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASC,cAAT,CAAwBL,SAAS,CAACO,SAAV,CAAoB,KAAKJ,SAAzB,EAAoCG,MAApC,CAAxB,CAFK,CAAP;AAID;;AAEDE,EAAAA,wBAAwB,GAAG;AACzB,WAAO,IAAIT,YAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASI,wBAAT,EAFK,CAAP;AAID;;AAjBH","sourcesContent":["import type { CanvasKit, PictureRecorder } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\nimport type { SkPictureRecorder } from \"../types/Picture/PictureRecorder\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPictureRecorder\n extends HostObject<PictureRecorder, \"PictureRecorder\">\n implements SkPictureRecorder\n{\n constructor(CanvasKit: CanvasKit, ref: PictureRecorder) {\n super(CanvasKit, ref, \"PictureRecorder\");\n }\n\n beginRecording(bounds: SkRect) {\n return new JsiSkCanvas(\n this.CanvasKit,\n this.ref.beginRecording(JsiSkRect.fromValue(this.CanvasKit, bounds))\n );\n }\n\n finishRecordingAsPicture() {\n return new JsiSkPicture(\n this.CanvasKit,\n this.ref.finishRecordingAsPicture()\n );\n }\n}\n"]}
@@ -1,5 +1,13 @@
1
- import { HostObject } from "./Host";
2
- export class JsiSkPoint extends HostObject {
1
+ import { BaseHostObject } from "./Host";
2
+ export class JsiSkPoint extends BaseHostObject {
3
+ static fromValue(point) {
4
+ if (point instanceof JsiSkPoint) {
5
+ return point.ref;
6
+ }
7
+
8
+ return new Float32Array([point.x, point.y]);
9
+ }
10
+
3
11
  constructor(CanvasKit, ref) {
4
12
  super(CanvasKit, ref, "Point");
5
13
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkPoint.ts"],"names":["HostObject","JsiSkPoint","constructor","CanvasKit","ref","x","y"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,UAAN,SAAyBD,UAAzB,CAAuE;AAC5EE,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;AAC5C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;AACD;;AAEI,MAADC,CAAC,GAAG;AACN,WAAO,KAAKD,GAAL,CAAS,CAAT,CAAP;AACD;;AAEI,MAADE,CAAC,GAAG;AACN,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAX2E","sourcesContent":["import type { CanvasKit, Point } from \"canvaskit-wasm\";\n\nimport type { SkPoint } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkPoint extends HostObject<Point, \"Point\"> implements SkPoint {\n constructor(CanvasKit: CanvasKit, ref: Point) {\n super(CanvasKit, ref, \"Point\");\n }\n\n get x() {\n return this.ref[0];\n }\n\n get y() {\n return this.ref[1];\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkPoint.ts"],"names":["BaseHostObject","JsiSkPoint","fromValue","point","ref","Float32Array","x","y","constructor","CanvasKit"],"mappings":"AAIA,SAASA,cAAT,QAA+B,QAA/B;AAEA,OAAO,MAAMC,UAAN,SACGD,cADH,CAGP;AACkB,SAATE,SAAS,CAACC,KAAD,EAAiB;AAC/B,QAAIA,KAAK,YAAYF,UAArB,EAAiC;AAC/B,aAAOE,KAAK,CAACC,GAAb;AACD;;AACD,WAAO,IAAIC,YAAJ,CAAiB,CAACF,KAAK,CAACG,CAAP,EAAUH,KAAK,CAACI,CAAhB,CAAjB,CAAP;AACD;;AAEDC,EAAAA,WAAW,CAACC,SAAD,EAAuBL,GAAvB,EAAmC;AAC5C,UAAMK,SAAN,EAAiBL,GAAjB,EAAsB,OAAtB;AACD;;AAEI,MAADE,CAAC,GAAG;AACN,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAEI,MAADG,CAAC,GAAG;AACN,WAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;AACD;;AAlBH","sourcesContent":["import type { CanvasKit, Point } from \"canvaskit-wasm\";\n\nimport type { SkPoint } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\n\nexport class JsiSkPoint\n extends BaseHostObject<Point, \"Point\">\n implements SkPoint\n{\n static fromValue(point: SkPoint) {\n if (point instanceof JsiSkPoint) {\n return point.ref;\n }\n return new Float32Array([point.x, point.y]);\n }\n\n constructor(CanvasKit: CanvasKit, ref: Point) {\n super(CanvasKit, ref, \"Point\");\n }\n\n get x() {\n return this.ref[0];\n }\n\n get y() {\n return this.ref[1];\n }\n}\n"]}