@shopify/react-native-skia 0.1.142 → 0.1.146

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. package/cpp/api/JsiSkContourMeasure.h +4 -4
  2. package/cpp/api/JsiSkDataFactory.h +3 -3
  3. package/cpp/api/JsiSkFont.h +1 -1
  4. package/cpp/api/JsiSkPaint.h +6 -0
  5. package/cpp/api/JsiSkPathFactory.h +2 -2
  6. package/cpp/api/JsiSkPicture.h +7 -1
  7. package/cpp/api/JsiSkPictureFactory.h +1 -1
  8. package/cpp/api/JsiSkRuntimeEffect.h +6 -6
  9. package/cpp/api/JsiSkRuntimeEffectFactory.h +1 -1
  10. package/cpp/jsi/JsiSimpleValueWrapper.h +27 -27
  11. package/cpp/jsi/JsiValueWrapper.h +127 -0
  12. package/cpp/rnskia/RNSkDrawView.cpp +44 -20
  13. package/cpp/rnskia/RNSkDrawView.h +18 -20
  14. package/cpp/rnskia/RNSkJsiViewApi.h +180 -166
  15. package/cpp/rnskia/values/RNSkComputedValue.h +11 -11
  16. package/cpp/rnskia/values/RNSkReadonlyValue.h +19 -19
  17. package/cpp/rnskia/values/RNSkValue.h +13 -13
  18. package/cpp/utils/RNSkLog.h +4 -4
  19. package/lib/commonjs/renderer/Canvas.js +17 -7
  20. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  21. package/lib/commonjs/renderer/DependencyManager.js +144 -36
  22. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  23. package/lib/commonjs/renderer/HostConfig.js +18 -2
  24. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  25. package/lib/commonjs/renderer/components/Blend.js +20 -5
  26. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  27. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  28. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -1
  29. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  30. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -1
  31. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  32. package/lib/commonjs/renderer/nodes/Declaration.js +2 -3
  33. package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
  34. package/lib/commonjs/renderer/nodes/Drawing.js +3 -7
  35. package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
  36. package/lib/commonjs/renderer/nodes/Node.js +9 -7
  37. package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
  38. package/lib/commonjs/renderer/processors/Animations/Animations.js +3 -22
  39. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  40. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  41. package/lib/commonjs/skia/web/Host.js +12 -21
  42. package/lib/commonjs/skia/web/Host.js.map +1 -1
  43. package/lib/commonjs/skia/web/JsiSkCanvas.js +46 -26
  44. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  45. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +4 -4
  46. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  47. package/lib/commonjs/skia/web/JsiSkFont.js +7 -3
  48. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  49. package/lib/commonjs/skia/web/JsiSkImage.js +4 -2
  50. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  51. package/lib/commonjs/skia/web/JsiSkImageFactory.js +4 -2
  52. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  53. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +61 -19
  54. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  55. package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
  56. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  57. package/lib/commonjs/skia/web/JsiSkPaint.js +19 -6
  58. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  59. package/lib/commonjs/skia/web/JsiSkPath.js +9 -55
  60. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  61. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +7 -3
  62. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  63. package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
  64. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  65. package/lib/commonjs/skia/web/JsiSkPicture.js +5 -1
  66. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  67. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +3 -1
  68. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  69. package/lib/commonjs/skia/web/JsiSkPoint.js +9 -1
  70. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  71. package/lib/commonjs/skia/web/JsiSkRRect.js +1 -1
  72. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  73. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  74. package/lib/commonjs/skia/web/JsiSkRect.js +1 -1
  75. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  76. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +4 -2
  77. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  78. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +10 -6
  79. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  80. package/lib/commonjs/skia/web/JsiSkSurface.js +3 -1
  81. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  82. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +8 -4
  83. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  84. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +1 -1
  85. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  86. package/lib/commonjs/skia/web/JsiSkia.js +12 -6
  87. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  88. package/lib/commonjs/views/SkiaView.js +11 -27
  89. package/lib/commonjs/views/SkiaView.js.map +1 -1
  90. package/lib/commonjs/views/types.js.map +1 -1
  91. package/lib/module/renderer/Canvas.js +17 -6
  92. package/lib/module/renderer/Canvas.js.map +1 -1
  93. package/lib/module/renderer/DependencyManager.js +140 -33
  94. package/lib/module/renderer/DependencyManager.js.map +1 -1
  95. package/lib/module/renderer/HostConfig.js +18 -2
  96. package/lib/module/renderer/HostConfig.js.map +1 -1
  97. package/lib/module/renderer/components/Blend.js +21 -5
  98. package/lib/module/renderer/components/Blend.js.map +1 -1
  99. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  100. package/lib/module/renderer/components/imageFilters/Morphology.js +1 -1
  101. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  102. package/lib/module/renderer/components/imageFilters/Shadow.js +1 -1
  103. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  104. package/lib/module/renderer/nodes/Declaration.js +3 -4
  105. package/lib/module/renderer/nodes/Declaration.js.map +1 -1
  106. package/lib/module/renderer/nodes/Drawing.js +3 -6
  107. package/lib/module/renderer/nodes/Drawing.js.map +1 -1
  108. package/lib/module/renderer/nodes/Node.js +9 -7
  109. package/lib/module/renderer/nodes/Node.js.map +1 -1
  110. package/lib/module/renderer/processors/Animations/Animations.js +1 -16
  111. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  112. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  113. package/lib/module/skia/web/Host.js +9 -9
  114. package/lib/module/skia/web/Host.js.map +1 -1
  115. package/lib/module/skia/web/JsiSkCanvas.js +37 -27
  116. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  117. package/lib/module/skia/web/JsiSkColorFilterFactory.js +5 -5
  118. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  119. package/lib/module/skia/web/JsiSkFont.js +6 -4
  120. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  121. package/lib/module/skia/web/JsiSkImage.js +4 -3
  122. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  123. package/lib/module/skia/web/JsiSkImageFactory.js +4 -3
  124. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  125. package/lib/module/skia/web/JsiSkImageFilterFactory.js +61 -20
  126. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  127. package/lib/module/skia/web/JsiSkMatrix.js +2 -2
  128. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  129. package/lib/module/skia/web/JsiSkPaint.js +15 -7
  130. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  131. package/lib/module/skia/web/JsiSkPath.js +9 -57
  132. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  133. package/lib/module/skia/web/JsiSkPathEffectFactory.js +6 -4
  134. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  135. package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
  136. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  137. package/lib/module/skia/web/JsiSkPicture.js +4 -2
  138. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  139. package/lib/module/skia/web/JsiSkPictureRecorder.js +3 -2
  140. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  141. package/lib/module/skia/web/JsiSkPoint.js +10 -2
  142. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  143. package/lib/module/skia/web/JsiSkRRect.js +2 -2
  144. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  145. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  146. package/lib/module/skia/web/JsiSkRect.js +2 -2
  147. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  148. package/lib/module/skia/web/JsiSkRuntimeEffect.js +4 -3
  149. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  150. package/lib/module/skia/web/JsiSkShaderFactory.js +9 -7
  151. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  152. package/lib/module/skia/web/JsiSkSurface.js +3 -2
  153. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  154. package/lib/module/skia/web/JsiSkTextBlobFactory.js +7 -5
  155. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  156. package/lib/module/skia/web/JsiSkTypefaceFactory.js +2 -2
  157. package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  158. package/lib/module/skia/web/JsiSkia.js +10 -5
  159. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  160. package/lib/module/views/SkiaView.js +11 -26
  161. package/lib/module/views/SkiaView.js.map +1 -1
  162. package/lib/module/views/types.js.map +1 -1
  163. package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
  164. package/lib/typescript/src/renderer/DependencyManager.d.ts +40 -14
  165. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +2 -2
  166. package/lib/typescript/src/renderer/nodes/Drawing.d.ts +2 -2
  167. package/lib/typescript/src/renderer/nodes/Node.d.ts +3 -2
  168. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +0 -1
  169. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +5 -0
  170. package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -1
  171. package/lib/typescript/src/skia/web/Host.d.ts +6 -8
  172. package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +8 -8
  173. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  174. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +3 -2
  175. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +2 -2
  176. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -2
  177. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +2 -2
  178. package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +2 -1
  179. package/lib/typescript/src/views/SkiaView.d.ts +1 -11
  180. package/lib/typescript/src/views/types.d.ts +5 -5
  181. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  182. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  183. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  184. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  185. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  186. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  187. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  188. package/package.json +2 -2
  189. package/src/renderer/Canvas.tsx +19 -7
  190. package/src/renderer/DependencyManager.tsx +170 -39
  191. package/src/renderer/HostConfig.ts +12 -2
  192. package/src/renderer/components/Blend.tsx +25 -5
  193. package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
  194. package/src/renderer/components/imageFilters/Morphology.tsx +2 -2
  195. package/src/renderer/components/imageFilters/Shadow.tsx +2 -2
  196. package/src/renderer/nodes/Declaration.tsx +6 -8
  197. package/src/renderer/nodes/Drawing.tsx +5 -7
  198. package/src/renderer/nodes/Node.ts +11 -9
  199. package/src/renderer/processors/Animations/Animations.ts +2 -15
  200. package/src/skia/types/Paint/Paint.ts +6 -0
  201. package/src/skia/types/Picture/Picture.ts +2 -1
  202. package/src/skia/web/Host.ts +12 -22
  203. package/src/skia/web/JsiSkCanvas.ts +78 -47
  204. package/src/skia/web/JsiSkColorFilterFactory.ts +15 -5
  205. package/src/skia/web/JsiSkFont.ts +11 -4
  206. package/src/skia/web/JsiSkImage.ts +4 -3
  207. package/src/skia/web/JsiSkImageFactory.ts +6 -3
  208. package/src/skia/web/JsiSkImageFilterFactory.ts +124 -52
  209. package/src/skia/web/JsiSkMatrix.ts +4 -2
  210. package/src/skia/web/JsiSkPaint.ts +15 -7
  211. package/src/skia/web/JsiSkPath.ts +16 -51
  212. package/src/skia/web/JsiSkPathEffectFactory.ts +10 -5
  213. package/src/skia/web/JsiSkPathFactory.ts +3 -3
  214. package/src/skia/web/JsiSkPicture.ts +5 -3
  215. package/src/skia/web/JsiSkPictureRecorder.ts +3 -2
  216. package/src/skia/web/JsiSkPoint.ts +12 -2
  217. package/src/skia/web/JsiSkRRect.ts +5 -2
  218. package/src/skia/web/JsiSkRSXform.ts +1 -1
  219. package/src/skia/web/JsiSkRect.ts +2 -2
  220. package/src/skia/web/JsiSkRuntimeEffect.ts +9 -4
  221. package/src/skia/web/JsiSkShaderFactory.ts +24 -15
  222. package/src/skia/web/JsiSkSurface.ts +7 -2
  223. package/src/skia/web/JsiSkTextBlobFactory.ts +14 -8
  224. package/src/skia/web/JsiSkTypefaceFactory.tsx +4 -2
  225. package/src/skia/web/JsiSkia.ts +17 -5
  226. package/src/views/SkiaView.tsx +17 -28
  227. package/src/views/types.ts +7 -6
@@ -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"]}
@@ -1,6 +1,6 @@
1
- import { HostObject } from "./Host";
1
+ import { BaseHostObject } from "./Host";
2
2
  import { JsiSkRect } from "./JsiSkRect";
3
- export class JsiSkRRect extends HostObject {
3
+ export class JsiSkRRect extends BaseHostObject {
4
4
  static fromValue(CanvasKit, rect) {
5
5
  if (rect instanceof JsiSkRect) {
6
6
  return rect.ref;
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkRRect.ts"],"names":["HostObject","JsiSkRect","JsiSkRRect","fromValue","CanvasKit","rect","ref","RRectXY","rx","ry","constructor","Float32Array","of"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,UAAN,SAAyBF,UAAzB,CAAuE;AAC5D,SAATG,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAsC;AACpD,QAAIA,IAAI,YAAYJ,SAApB,EAA+B;AAC7B,aAAOI,IAAI,CAACC,GAAZ;AACD;;AACD,WAAOF,SAAS,CAACG,OAAV,CACLN,SAAS,CAACE,SAAV,CAAoBC,SAApB,EAA+BC,IAAI,CAACA,IAApC,CADK,EAELA,IAAI,CAACG,EAFA,EAGLH,IAAI,CAACI,EAHA,CAAP;AAKD;;AAEDC,EAAAA,WAAW,CAACN,SAAD,EAAuBE,GAAvB,EAAmC;AAC5C,UAAMF,SAAN,EAAiBE,GAAjB,EAAsB,OAAtB;AACD;;AAEK,MAAFE,EAAE,GAAG;AACP,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAEK,MAAFG,EAAE,GAAG;AACP,WAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;AACD;;AAEO,MAAJD,IAAI,GAAG;AACT,WAAO,IAAIJ,SAAJ,CACL,KAAKG,SADA,EAELO,YAAY,CAACC,EAAb,CAAgB,KAAKN,GAAL,CAAS,CAAT,CAAhB,EAA6B,KAAKA,GAAL,CAAS,CAAT,CAA7B,EAA0C,KAAKA,GAAL,CAAS,CAAT,CAA1C,EAAuD,KAAKA,GAAL,CAAS,CAAT,CAAvD,CAFK,CAAP;AAID;;AA7B2E","sourcesContent":["import type { CanvasKit, RRect } from \"canvaskit-wasm\";\n\nimport type { SkRRect } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkRRect extends HostObject<RRect, \"RRect\"> implements SkRRect {\n static fromValue(CanvasKit: CanvasKit, rect: SkRRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.RRectXY(\n JsiSkRect.fromValue(CanvasKit, rect.rect),\n rect.rx,\n rect.ry\n );\n }\n\n constructor(CanvasKit: CanvasKit, ref: RRect) {\n super(CanvasKit, ref, \"RRect\");\n }\n\n get rx() {\n return this.ref[4];\n }\n\n get ry() {\n return this.ref[5];\n }\n\n get rect() {\n return new JsiSkRect(\n this.CanvasKit,\n Float32Array.of(this.ref[0], this.ref[1], this.ref[2], this.ref[3])\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkRRect.ts"],"names":["BaseHostObject","JsiSkRect","JsiSkRRect","fromValue","CanvasKit","rect","ref","RRectXY","rx","ry","constructor","Float32Array","of"],"mappings":"AAIA,SAASA,cAAT,QAA+B,QAA/B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,UAAN,SACGF,cADH,CAGP;AACkB,SAATG,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAsC;AACpD,QAAIA,IAAI,YAAYJ,SAApB,EAA+B;AAC7B,aAAOI,IAAI,CAACC,GAAZ;AACD;;AACD,WAAOF,SAAS,CAACG,OAAV,CACLN,SAAS,CAACE,SAAV,CAAoBC,SAApB,EAA+BC,IAAI,CAACA,IAApC,CADK,EAELA,IAAI,CAACG,EAFA,EAGLH,IAAI,CAACI,EAHA,CAAP;AAKD;;AAEDC,EAAAA,WAAW,CAACN,SAAD,EAAuBE,GAAvB,EAAmC;AAC5C,UAAMF,SAAN,EAAiBE,GAAjB,EAAsB,OAAtB;AACD;;AAEK,MAAFE,EAAE,GAAG;AACP,WAAO,KAAKF,GAAL,CAAS,CAAT,CAAP;AACD;;AAEK,MAAFG,EAAE,GAAG;AACP,WAAO,KAAKH,GAAL,CAAS,CAAT,CAAP;AACD;;AAEO,MAAJD,IAAI,GAAG;AACT,WAAO,IAAIJ,SAAJ,CACL,KAAKG,SADA,EAELO,YAAY,CAACC,EAAb,CAAgB,KAAKN,GAAL,CAAS,CAAT,CAAhB,EAA6B,KAAKA,GAAL,CAAS,CAAT,CAA7B,EAA0C,KAAKA,GAAL,CAAS,CAAT,CAA1C,EAAuD,KAAKA,GAAL,CAAS,CAAT,CAAvD,CAFK,CAAP;AAID;;AA7BH","sourcesContent":["import type { CanvasKit, RRect } from \"canvaskit-wasm\";\n\nimport type { SkRRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkRRect\n extends BaseHostObject<RRect, \"RRect\">\n implements SkRRect\n{\n static fromValue(CanvasKit: CanvasKit, rect: SkRRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.RRectXY(\n JsiSkRect.fromValue(CanvasKit, rect.rect),\n rect.rx,\n rect.ry\n );\n }\n\n constructor(CanvasKit: CanvasKit, ref: RRect) {\n super(CanvasKit, ref, \"RRect\");\n }\n\n get rx() {\n return this.ref[4];\n }\n\n get ry() {\n return this.ref[5];\n }\n\n get rect() {\n return new JsiSkRect(\n this.CanvasKit,\n Float32Array.of(this.ref[0], this.ref[1], this.ref[2], this.ref[3])\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkRSXform.ts"],"names":["HostObject","JsiSkRSXform","constructor","CanvasKit","ref"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAIA,OAAO,MAAMC,YAAN,SACGD,UADH,CAGP;AACEE,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAHH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkRSXform } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\ntype RSXform = Float32Array;\n\nexport class JsiSkRSXform\n extends HostObject<RSXform, \"RSXform\">\n implements SkRSXform\n{\n constructor(CanvasKit: CanvasKit, ref: RSXform) {\n super(CanvasKit, ref, \"RSXform\");\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkRSXform.ts"],"names":["HostObject","JsiSkRSXform","constructor","CanvasKit","ref"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAIA,OAAO,MAAMC,YAAN,SACGD,UADH,CAGP;AACEE,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;AAC9C,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;AACD;;AAHH","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkRSXform } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport type RSXform = Float32Array;\n\nexport class JsiSkRSXform\n extends HostObject<RSXform, \"RSXform\">\n implements SkRSXform\n{\n constructor(CanvasKit: CanvasKit, ref: RSXform) {\n super(CanvasKit, ref, \"RSXform\");\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { HostObject } from "./Host";
2
- export class JsiSkRect extends HostObject {
1
+ import { BaseHostObject } from "./Host";
2
+ export class JsiSkRect extends BaseHostObject {
3
3
  static fromValue(CanvasKit, rect) {
4
4
  if (rect instanceof JsiSkRect) {
5
5
  return rect.ref;
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkRect.ts"],"names":["HostObject","JsiSkRect","fromValue","CanvasKit","rect","ref","XYWHRect","x","y","width","height","constructor"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,SAAN,SAAwBD,UAAxB,CAAmE;AACxD,SAATE,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAqC;AACnD,QAAIA,IAAI,YAAYH,SAApB,EAA+B;AAC7B,aAAOG,IAAI,CAACC,GAAZ;AACD;;AACD,WAAOF,SAAS,CAACG,QAAV,CAAmBF,IAAI,CAACG,CAAxB,EAA2BH,IAAI,CAACI,CAAhC,EAAmCJ,IAAI,CAACK,KAAxC,EAA+CL,IAAI,CAACM,MAApD,CAAP;AACD;;AAEDC,EAAAA,WAAW,CAACR,SAAD,EAAuBE,GAAvB,EAAkC;AAC3C,UAAMF,SAAN,EAAiBE,GAAjB,EAAsB,MAAtB;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;;AAEQ,MAALI,KAAK,GAAG;AACV,WAAO,KAAKJ,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AAES,MAANK,MAAM,GAAG;AACX,WAAO,KAAKL,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AA1BuE","sourcesContent":["import type { CanvasKit, Rect } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkRect extends HostObject<Rect, \"Rect\"> implements SkRect {\n static fromValue(CanvasKit: CanvasKit, rect: SkRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height);\n }\n\n constructor(CanvasKit: CanvasKit, ref: Rect) {\n super(CanvasKit, ref, \"Rect\");\n }\n\n get x() {\n return this.ref[0];\n }\n\n get y() {\n return this.ref[1];\n }\n\n get width() {\n return this.ref[2] - this.ref[0];\n }\n\n get height() {\n return this.ref[3] - this.ref[1];\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkRect.ts"],"names":["BaseHostObject","JsiSkRect","fromValue","CanvasKit","rect","ref","XYWHRect","x","y","width","height","constructor"],"mappings":"AAIA,SAASA,cAAT,QAA+B,QAA/B;AAEA,OAAO,MAAMC,SAAN,SAAwBD,cAAxB,CAAuE;AAC5D,SAATE,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAqC;AACnD,QAAIA,IAAI,YAAYH,SAApB,EAA+B;AAC7B,aAAOG,IAAI,CAACC,GAAZ;AACD;;AACD,WAAOF,SAAS,CAACG,QAAV,CAAmBF,IAAI,CAACG,CAAxB,EAA2BH,IAAI,CAACI,CAAhC,EAAmCJ,IAAI,CAACK,KAAxC,EAA+CL,IAAI,CAACM,MAApD,CAAP;AACD;;AAEDC,EAAAA,WAAW,CAACR,SAAD,EAAuBE,GAAvB,EAAkC;AAC3C,UAAMF,SAAN,EAAiBE,GAAjB,EAAsB,MAAtB;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;;AAEQ,MAALI,KAAK,GAAG;AACV,WAAO,KAAKJ,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AAES,MAANK,MAAM,GAAG;AACX,WAAO,KAAKL,GAAL,CAAS,CAAT,IAAc,KAAKA,GAAL,CAAS,CAAT,CAArB;AACD;;AA1B2E","sourcesContent":["import type { CanvasKit, Rect } from \"canvaskit-wasm\";\n\nimport type { SkRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\n\nexport class JsiSkRect extends BaseHostObject<Rect, \"Rect\"> implements SkRect {\n static fromValue(CanvasKit: CanvasKit, rect: SkRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n return CanvasKit.XYWHRect(rect.x, rect.y, rect.width, rect.height);\n }\n\n constructor(CanvasKit: CanvasKit, ref: Rect) {\n super(CanvasKit, ref, \"Rect\");\n }\n\n get x() {\n return this.ref[0];\n }\n\n get y() {\n return this.ref[1];\n }\n\n get width() {\n return this.ref[2] - this.ref[0];\n }\n\n get height() {\n return this.ref[3] - this.ref[1];\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
- import { HostObject, toValue } from "./Host";
1
+ import { HostObject } from "./Host";
2
+ import { JsiSkMatrix } from "./JsiSkMatrix";
2
3
  import { JsiSkShader } from "./JsiSkShader";
3
4
  export class JsiSkRuntimeEffect extends HostObject {
4
5
  constructor(CanvasKit, ref) {
@@ -6,11 +7,11 @@ export class JsiSkRuntimeEffect extends HostObject {
6
7
  }
7
8
 
8
9
  makeShader(uniforms, localMatrix) {
9
- return new JsiSkShader(this.CanvasKit, this.ref.makeShader(uniforms, localMatrix !== undefined ? toValue(localMatrix) : localMatrix));
10
+ return new JsiSkShader(this.CanvasKit, this.ref.makeShader(uniforms, localMatrix !== undefined ? JsiSkMatrix.fromValue(localMatrix) : localMatrix));
10
11
  }
11
12
 
12
13
  makeShaderWithChildren(uniforms, children, localMatrix) {
13
- return new JsiSkShader(this.CanvasKit, this.ref.makeShaderWithChildren(uniforms, children === null || children === void 0 ? void 0 : children.map(child => toValue(child)), localMatrix !== undefined ? toValue(localMatrix) : localMatrix));
14
+ return new JsiSkShader(this.CanvasKit, this.ref.makeShaderWithChildren(uniforms, children === null || children === void 0 ? void 0 : children.map(child => JsiSkShader.fromValue(child)), localMatrix !== undefined ? JsiSkMatrix.fromValue(localMatrix) : localMatrix));
14
15
  }
15
16
 
16
17
  getUniform(index) {
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkRuntimeEffect.ts"],"names":["HostObject","toValue","JsiSkShader","JsiSkRuntimeEffect","constructor","CanvasKit","ref","makeShader","uniforms","localMatrix","undefined","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"mappings":"AAKA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SACGH,UADH,CAGP;AACEI,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA2C;AACpD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,eAAtB;AACD;;AAEDC,EAAAA,UAAU,CAACC,QAAD,EAAqBC,WAArB,EAA6C;AACrD,WAAO,IAAIP,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASC,UAAT,CACEC,QADF,EAEEC,WAAW,KAAKC,SAAhB,GAA4BT,OAAO,CAACQ,WAAD,CAAnC,GAAmDA,WAFrD,CAFK,CAAP;AAOD;;AAEDE,EAAAA,sBAAsB,CACpBH,QADoB,EAEpBI,QAFoB,EAGpBH,WAHoB,EAIpB;AACA,WAAO,IAAIP,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASK,sBAAT,CACEH,QADF,EAEEI,QAFF,aAEEA,QAFF,uBAEEA,QAAQ,CAAEC,GAAV,CAAeC,KAAD,IAAWb,OAAO,CAACa,KAAD,CAAhC,CAFF,EAGEL,WAAW,KAAKC,SAAhB,GAA4BT,OAAO,CAACQ,WAAD,CAAnC,GAAmDA,WAHrD,CAFK,CAAP;AAQD;;AAEDM,EAAAA,UAAU,CAACC,KAAD,EAAgB;AACxB,WAAO,KAAKV,GAAL,CAASS,UAAT,CAAoBC,KAApB,CAAP;AACD;;AAEDC,EAAAA,eAAe,GAAG;AAChB,WAAO,KAAKX,GAAL,CAASW,eAAT,EAAP;AACD;;AAEDC,EAAAA,oBAAoB,GAAG;AACrB,WAAO,KAAKZ,GAAL,CAASY,oBAAT,EAAP;AACD;;AAEDC,EAAAA,cAAc,CAACH,KAAD,EAAgB;AAC5B,WAAO,KAAKV,GAAL,CAASa,cAAT,CAAwBH,KAAxB,CAAP;AACD;;AA5CH","sourcesContent":["import type { CanvasKit, RuntimeEffect } from \"canvaskit-wasm\";\n\nimport type { SkMatrix, SkShader } from \"../types\";\nimport type { SkRuntimeEffect } from \"../types/RuntimeEffect/RuntimeEffect\";\n\nimport { HostObject, toValue } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkRuntimeEffect\n extends HostObject<RuntimeEffect, \"RuntimeEffect\">\n implements SkRuntimeEffect\n{\n constructor(CanvasKit: CanvasKit, ref: RuntimeEffect) {\n super(CanvasKit, ref, \"RuntimeEffect\");\n }\n\n makeShader(uniforms: number[], localMatrix?: SkMatrix) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n uniforms,\n localMatrix !== undefined ? toValue(localMatrix) : localMatrix\n )\n );\n }\n\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderWithChildren(\n uniforms,\n children?.map((child) => toValue(child)),\n localMatrix !== undefined ? toValue(localMatrix) : localMatrix\n )\n );\n }\n\n getUniform(index: number) {\n return this.ref.getUniform(index);\n }\n\n getUniformCount() {\n return this.ref.getUniformCount();\n }\n\n getUniformFloatCount() {\n return this.ref.getUniformFloatCount();\n }\n\n getUniformName(index: number) {\n return this.ref.getUniformName(index);\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkRuntimeEffect.ts"],"names":["HostObject","JsiSkMatrix","JsiSkShader","JsiSkRuntimeEffect","constructor","CanvasKit","ref","makeShader","uniforms","localMatrix","undefined","fromValue","makeShaderWithChildren","children","map","child","getUniform","index","getUniformCount","getUniformFloatCount","getUniformName"],"mappings":"AAKA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SACGH,UADH,CAGP;AACEI,EAAAA,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA2C;AACpD,UAAMD,SAAN,EAAiBC,GAAjB,EAAsB,eAAtB;AACD;;AAEDC,EAAAA,UAAU,CAACC,QAAD,EAAqBC,WAArB,EAA6C;AACrD,WAAO,IAAIP,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASC,UAAT,CACEC,QADF,EAEEC,WAAW,KAAKC,SAAhB,GACIT,WAAW,CAACU,SAAZ,CAAsBF,WAAtB,CADJ,GAEIA,WAJN,CAFK,CAAP;AASD;;AAEDG,EAAAA,sBAAsB,CACpBJ,QADoB,EAEpBK,QAFoB,EAGpBJ,WAHoB,EAIpB;AACA,WAAO,IAAIP,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKC,GAAL,CAASM,sBAAT,CACEJ,QADF,EAEEK,QAFF,aAEEA,QAFF,uBAEEA,QAAQ,CAAEC,GAAV,CAAeC,KAAD,IAAWb,WAAW,CAACS,SAAZ,CAAsBI,KAAtB,CAAzB,CAFF,EAGEN,WAAW,KAAKC,SAAhB,GACIT,WAAW,CAACU,SAAZ,CAAsBF,WAAtB,CADJ,GAEIA,WALN,CAFK,CAAP;AAUD;;AAEDO,EAAAA,UAAU,CAACC,KAAD,EAAgB;AACxB,WAAO,KAAKX,GAAL,CAASU,UAAT,CAAoBC,KAApB,CAAP;AACD;;AAEDC,EAAAA,eAAe,GAAG;AAChB,WAAO,KAAKZ,GAAL,CAASY,eAAT,EAAP;AACD;;AAEDC,EAAAA,oBAAoB,GAAG;AACrB,WAAO,KAAKb,GAAL,CAASa,oBAAT,EAAP;AACD;;AAEDC,EAAAA,cAAc,CAACH,KAAD,EAAgB;AAC5B,WAAO,KAAKX,GAAL,CAASc,cAAT,CAAwBH,KAAxB,CAAP;AACD;;AAhDH","sourcesContent":["import type { CanvasKit, RuntimeEffect } from \"canvaskit-wasm\";\n\nimport type { SkMatrix, SkShader } from \"../types\";\nimport type { SkRuntimeEffect } from \"../types/RuntimeEffect/RuntimeEffect\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkRuntimeEffect\n extends HostObject<RuntimeEffect, \"RuntimeEffect\">\n implements SkRuntimeEffect\n{\n constructor(CanvasKit: CanvasKit, ref: RuntimeEffect) {\n super(CanvasKit, ref, \"RuntimeEffect\");\n }\n\n makeShader(uniforms: number[], localMatrix?: SkMatrix) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n uniforms,\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n makeShaderWithChildren(\n uniforms: number[],\n children?: SkShader[],\n localMatrix?: SkMatrix\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderWithChildren(\n uniforms,\n children?.map((child) => JsiSkShader.fromValue(child)),\n localMatrix !== undefined\n ? JsiSkMatrix.fromValue(localMatrix)\n : localMatrix\n )\n );\n }\n\n getUniform(index: number) {\n return this.ref.getUniform(index);\n }\n\n getUniformCount() {\n return this.ref.getUniformCount();\n }\n\n getUniformFloatCount() {\n return this.ref.getUniformFloatCount();\n }\n\n getUniformName(index: number) {\n return this.ref.getUniformName(index);\n }\n}\n"]}
@@ -1,4 +1,6 @@
1
- import { Host, toValue, ckEnum } from "./Host";
1
+ import { Host, ckEnum } from "./Host";
2
+ import { JsiSkMatrix } from "./JsiSkMatrix";
3
+ import { JsiSkPoint } from "./JsiSkPoint";
2
4
  import { JsiSkShader } from "./JsiSkShader";
3
5
  export class JsiSkShaderFactory extends Host {
4
6
  constructor(CanvasKit) {
@@ -6,19 +8,19 @@ export class JsiSkShaderFactory extends Host {
6
8
  }
7
9
 
8
10
  MakeLinearGradient(start, end, colors, pos, mode, localMatrix, flags) {
9
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(toValue(start), toValue(end), colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : toValue(localMatrix), flags));
11
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(JsiSkPoint.fromValue(start), JsiSkPoint.fromValue(end), colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
10
12
  }
11
13
 
12
14
  MakeRadialGradient(center, radius, colors, pos, mode, localMatrix, flags) {
13
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(toValue(center), radius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : toValue(localMatrix), flags));
15
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(JsiSkPoint.fromValue(center), radius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
14
16
  }
15
17
 
16
18
  MakeTwoPointConicalGradient(start, startRadius, end, endRadius, colors, pos, mode, localMatrix, flags) {
17
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(toValue(start), startRadius, toValue(end), endRadius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : toValue(localMatrix), flags));
19
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(JsiSkPoint.fromValue(start), startRadius, JsiSkPoint.fromValue(end), endRadius, colors, pos, ckEnum(mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
18
20
  }
19
21
 
20
22
  MakeSweepGradient(cx, cy, colors, pos, mode, localMatrix, flags, startAngleInDegrees, endAngleInDegrees) {
21
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, ckEnum(mode), localMatrix === undefined || localMatrix === null ? undefined : toValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
23
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, ckEnum(mode), localMatrix === undefined || localMatrix === null ? undefined : JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
22
24
  }
23
25
 
24
26
  MakeTurbulence(baseFreqX, baseFreqY, octaves, seed, tileW, tileH) {
@@ -30,11 +32,11 @@ export class JsiSkShaderFactory extends Host {
30
32
  }
31
33
 
32
34
  MakeBlend(mode, one, two) {
33
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(ckEnum(mode), toValue(one), toValue(two)));
35
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(ckEnum(mode), JsiSkShader.fromValue(one), JsiSkShader.fromValue(two)));
34
36
  }
35
37
 
36
38
  MakeColor(color) {
37
- return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeColor(toValue(color), this.CanvasKit.ColorSpace.SRGB));
39
+ return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB));
38
40
  }
39
41
 
40
42
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkShaderFactory.ts"],"names":["Host","toValue","ckEnum","JsiSkShader","JsiSkShaderFactory","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","Shader","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","MakeColor","color","ColorSpace","SRGB"],"mappings":"AAYA,SAASA,IAAT,EAAeC,OAAf,EAAwBC,MAAxB,QAAsC,QAAtC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,kBAAN,SAAiCJ,IAAjC,CAA+D;AACpEK,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,kBAAkB,CAChBC,KADgB,EAEhBC,GAFgB,EAGhBC,MAHgB,EAIhBC,GAJgB,EAKhBC,IALgB,EAMhBC,WANgB,EAOhBC,KAPgB,EAQhB;AACA,WAAO,IAAIX,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsBR,kBAAtB,CACEN,OAAO,CAACO,KAAD,CADT,EAEEP,OAAO,CAACQ,GAAD,CAFT,EAGEC,MAHF,EAIEC,GAJF,EAKET,MAAM,CAACU,IAAD,CALR,EAMEC,WAAW,KAAKG,SAAhB,GAA4BA,SAA5B,GAAwCf,OAAO,CAACY,WAAD,CANjD,EAOEC,KAPF,CAFK,CAAP;AAYD;;AAEDG,EAAAA,kBAAkB,CA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5B,CAFK,CAAP;AAOD;;AApKmE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, toValue, ckEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n toValue(start),\n toValue(end),\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined ? undefined : toValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n toValue(center),\n radius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined ? undefined : toValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n toValue(start),\n startRadius,\n toValue(end),\n endRadius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined ? undefined : toValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : toValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(ckEnum(mode), toValue(one), toValue(two))\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(\n toValue(color),\n this.CanvasKit.ColorSpace.SRGB\n )\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkShaderFactory.ts"],"names":["Host","ckEnum","JsiSkMatrix","JsiSkPoint","JsiSkShader","JsiSkShaderFactory","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","Shader","fromValue","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","M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L,CAAeS,MAAf,CAAsBc,cAAtB,CACEC,SADF,EAEEC,SAFF,EAGEC,OAHF,EAIEC,IAJF,EAKEC,KALF,EAMEC,KANF,CAFK,CAAP;AAWD;;AAEDC,EAAAA,gBAAgB,CACdN,SADc,EAEdC,SAFc,EAGdC,OAHc,EAIdC,IAJc,EAKdC,KALc,EAMdC,KANc,EAOd;AACA,WAAO,IAAIhC,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsBqB,gBAAtB,CACEN,SADF,EAEEC,SAFF,EAGEC,OAHF,EAIEC,IAJF,EAKEC,KALF,EAMEC,KANF,CAFK,CAAP;AAWD;;AAEDE,EAAAA,SAAS,CAACzB,IAAD,EAAkB0B,GAAlB,EAAiCC,GAAjC,EAAgD;AACvD,WAAO,IAAIpC,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsBsB,SAAtB,CACErC,MAAM,CAACY,IAAD,CADR,EAEET,WAAW,CAACa,SAAZ,CAAsBsB,GAAtB,CAFF,EAGEnC,WAAW,CAACa,SAAZ,CAAsBuB,GAAtB,CAHF,CAFK,CAAP;AAQD;;AAEDC,EAAAA,SAAS,CAACC,KAAD,EAAiB;AACxB,WAAO,IAAItC,WAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeS,MAAf,CAAsByB,SAAtB,CAAgCC,KAAhC,EAAuC,KAAKnC,SAAL,CAAeoC,UAAf,CAA0BC,IAAjE,CAFK,CAAP;AAID;;AA3KmE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, ckEnum } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n JsiSkPoint.fromValue(start),\n JsiSkPoint.fromValue(end),\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n JsiSkPoint.fromValue(center),\n radius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n JsiSkPoint.fromValue(start),\n startRadius,\n JsiSkPoint.fromValue(end),\n endRadius,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n ckEnum(mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(\n ckEnum(mode),\n JsiSkShader.fromValue(one),\n JsiSkShader.fromValue(two)\n )\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB)\n );\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
- import { HostObject, toUndefinedableValue } from "./Host";
1
+ import { HostObject } from "./Host";
2
2
  import { JsiSkCanvas } from "./JsiSkCanvas";
3
3
  import { JsiSkImage } from "./JsiSkImage";
4
+ import { JsiSkRect } from "./JsiSkRect";
4
5
  export class JsiSkSurface extends HostObject {
5
6
  constructor(CanvasKit, ref) {
6
7
  super(CanvasKit, ref, "Surface");
@@ -11,7 +12,7 @@ export class JsiSkSurface extends HostObject {
11
12
  }
12
13
 
13
14
  makeImageSnapshot(bounds) {
14
- const image = this.ref.makeImageSnapshot(toUndefinedableValue(bounds));
15
+ const image = this.ref.makeImageSnapshot(bounds ? Array.from(JsiSkRect.fromValue(this.CanvasKit, bounds)) : undefined);
15
16
  return new JsiSkImage(this.CanvasKit, image);
16
17
  }
17
18
 
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkSurface.ts"],"names":["HostObject","toUndefinedableValue","JsiSkCanvas","JsiSkImage","JsiSkSurface","constructor","CanvasKit","ref","getCanvas","makeImageSnapshot","bounds","image"],"mappings":"AAIA,SAASA,UAAT,EAAqBC,oBAArB,QAAiD,QAAjD;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;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,SAAS,GAAa;AACpB,WAAO,IAAIN,WAAJ,CAAgB,KAAKI,SAArB,EAAgC,KAAKC,GAAL,CAASC,SAAT,EAAhC,CAAP;AACD;;AAEDC,EAAAA,iBAAiB,CAACC,MAAD,EAA2B;AAC1C,UAAMC,KAAK,GAAG,KAAKJ,GAAL,CAASE,iBAAT,CAA2BR,oBAAoB,CAACS,MAAD,CAA/C,CAAd;AACA,WAAO,IAAIP,UAAJ,CAAe,KAAKG,SAApB,EAA+BK,KAA/B,CAAP;AACD;;AAZH","sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { SkCanvas, SkImage, SkRect, SkSurface } from \"../types\";\n\nimport { HostObject, toUndefinedableValue } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkImage } from \"./JsiSkImage\";\n\nexport class JsiSkSurface\n extends HostObject<Surface, \"Surface\">\n implements SkSurface\n{\n constructor(CanvasKit: CanvasKit, ref: Surface) {\n super(CanvasKit, ref, \"Surface\");\n }\n\n getCanvas(): SkCanvas {\n return new JsiSkCanvas(this.CanvasKit, this.ref.getCanvas());\n }\n\n makeImageSnapshot(bounds?: SkRect): SkImage {\n const image = this.ref.makeImageSnapshot(toUndefinedableValue(bounds));\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkSurface.ts"],"names":["HostObject","JsiSkCanvas","JsiSkImage","JsiSkRect","JsiSkSurface","constructor","CanvasKit","ref","getCanvas","makeImageSnapshot","bounds","image","Array","from","fromValue","undefined"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;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,SAAS,GAAa;AACpB,WAAO,IAAIP,WAAJ,CAAgB,KAAKK,SAArB,EAAgC,KAAKC,GAAL,CAASC,SAAT,EAAhC,CAAP;AACD;;AAEDC,EAAAA,iBAAiB,CAACC,MAAD,EAA2B;AAC1C,UAAMC,KAAK,GAAG,KAAKJ,GAAL,CAASE,iBAAT,CACZC,MAAM,GACFE,KAAK,CAACC,IAAN,CAAWV,SAAS,CAACW,SAAV,CAAoB,KAAKR,SAAzB,EAAoCI,MAApC,CAAX,CADE,GAEFK,SAHQ,CAAd;AAKA,WAAO,IAAIb,UAAJ,CAAe,KAAKI,SAApB,EAA+BK,KAA/B,CAAP;AACD;;AAhBH","sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { SkCanvas, SkImage, SkRect, SkSurface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkSurface\n extends HostObject<Surface, \"Surface\">\n implements SkSurface\n{\n constructor(CanvasKit: CanvasKit, ref: Surface) {\n super(CanvasKit, ref, \"Surface\");\n }\n\n getCanvas(): SkCanvas {\n return new JsiSkCanvas(this.CanvasKit, this.ref.getCanvas());\n }\n\n makeImageSnapshot(bounds?: SkRect): SkImage {\n const image = this.ref.makeImageSnapshot(\n bounds\n ? Array.from(JsiSkRect.fromValue(this.CanvasKit, bounds))\n : undefined\n );\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"]}
@@ -1,24 +1,26 @@
1
- import { Host, toValue } from "./Host";
1
+ import { Host } from "./Host";
2
+ import { JsiSkFont } from "./JsiSkFont";
2
3
  import { JsiSkTextBlob } from "./JsiSkTextBlob";
4
+ import { JsiSkRSXform } from "./JsiSkRSXform";
3
5
  export class JsiSkTextBlobFactory extends Host {
4
6
  constructor(CanvasKit) {
5
7
  super(CanvasKit);
6
8
  }
7
9
 
8
10
  MakeFromText(str, font) {
9
- return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromText(str, toValue(font)));
11
+ return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromText(str, JsiSkFont.fromValue(font)));
10
12
  }
11
13
 
12
14
  MakeFromGlyphs(glyphs, font) {
13
- return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, toValue(font)));
15
+ return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, JsiSkFont.fromValue(font)));
14
16
  }
15
17
 
16
18
  MakeFromRSXform(str, rsxforms, font) {
17
- return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXform(str, rsxforms.map(f => Array.from(toValue(f))).flat(), toValue(font)));
19
+ return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXform(str, rsxforms.map(f => Array.from(JsiSkRSXform.fromValue(f))).flat(), JsiSkFont.fromValue(font)));
18
20
  }
19
21
 
20
22
  MakeFromRSXformGlyphs(glyphs, rsxforms, font) {
21
- return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(glyphs, rsxforms.map(f => toValue(f)), toValue(font)));
23
+ return new JsiSkTextBlob(this.CanvasKit, this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(glyphs, rsxforms.map(f => JsiSkRSXform.fromValue(f)), JsiSkFont.fromValue(font)));
22
24
  }
23
25
 
24
26
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkTextBlobFactory.ts"],"names":["Host","toValue","JsiSkTextBlob","JsiSkTextBlobFactory","constructor","CanvasKit","MakeFromText","str","font","TextBlob","MakeFromGlyphs","glyphs","MakeFromRSXform","rsxforms","map","f","Array","from","flat","MakeFromRSXformGlyphs"],"mappings":"AAKA,SAASA,IAAT,EAAeC,OAAf,QAA8B,QAA9B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,oBAAN,SAAmCH,IAAnC,CAAmE;AACxEI,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,YAAY,CAACC,GAAD,EAAcC,IAAd,EAA4B;AACtC,WAAO,IAAIN,aAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeI,QAAf,CAAwBH,YAAxB,CAAqCC,GAArC,EAA0CN,OAAO,CAACO,IAAD,CAAjD,CAFK,CAAP;AAID;;AAEDE,EAAAA,cAAc,CAACC,MAAD,EAAmBH,IAAnB,EAAiC;AAC7C,WAAO,IAAIN,aAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeI,QAAf,CAAwBC,cAAxB,CAAuCC,MAAvC,EAA+CV,OAAO,CAACO,IAAD,CAAtD,CAFK,CAAP;AAID;;AAEDI,EAAAA,eAAe,CAACL,GAAD,EAAcM,QAAd,EAAqCL,IAArC,EAAmD;AAChE,WAAO,IAAIN,aAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeI,QAAf,CAAwBG,eAAxB,CACEL,GADF,EAEEM,QAAQ,CAACC,GAAT,CAAcC,CAAD,IAAOC,KAAK,CAACC,IAAN,CAAWhB,OAAO,CAAec,CAAf,CAAlB,CAApB,EAA0DG,IAA1D,EAFF,EAGEjB,OAAO,CAACO,IAAD,CAHT,CAFK,CAAP;AAQD;;AAEDW,EAAAA,qBAAqB,CAACR,MAAD,EAAmBE,QAAnB,EAA0CL,IAA1C,EAAwD;AAC3E,WAAO,IAAIN,aAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeI,QAAf,CAAwBU,qBAAxB,CACER,MADF,EAEEE,QAAQ,CAACC,GAAT,CAAcC,CAAD,IAAOd,OAAO,CAACc,CAAD,CAA3B,CAFF,EAGEd,OAAO,CAACO,IAAD,CAHT,CAFK,CAAP;AAQD;;AAvCuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkFont, SkRSXform } from \"../types\";\nimport type { TextBlobFactory } from \"../types/TextBlob\";\n\nimport { Host, toValue } from \"./Host\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\n\nexport class JsiSkTextBlobFactory extends Host implements TextBlobFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFromText(str: string, font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromText(str, toValue(font))\n );\n }\n\n MakeFromGlyphs(glyphs: number[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, toValue(font))\n );\n }\n\n MakeFromRSXform(str: string, rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXform(\n str,\n rsxforms.map((f) => Array.from(toValue<Float32Array>(f))).flat(),\n toValue(font)\n )\n );\n }\n\n MakeFromRSXformGlyphs(glyphs: number[], rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(\n glyphs,\n rsxforms.map((f) => toValue(f)),\n toValue(font)\n )\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkTextBlobFactory.ts"],"names":["Host","JsiSkFont","JsiSkTextBlob","JsiSkRSXform","JsiSkTextBlobFactory","constructor","CanvasKit","MakeFromText","str","font","TextBlob","fromValue","MakeFromGlyphs","glyphs","MakeFromRSXform","rsxforms","map","f","Array","from","flat","MakeFromRSXformGlyphs"],"mappings":"AAMA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,SAASC,YAAT,QAA6B,gBAA7B;AAEA,OAAO,MAAMC,oBAAN,SAAmCJ,IAAnC,CAAmE;AACxEK,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,YAAY,CAACC,GAAD,EAAcC,IAAd,EAA4B;AACtC,WAAO,IAAIP,aAAJ,CACL,KAAKI,SADA,EAEL,KAAKA,SAAL,CAAeI,QAAf,CAAwBH,YAAxB,CAAqCC,GAArC,EAA0CP,SAAS,CAACU,SAAV,CAAoBF,IAApB,CAA1C,CAFK,CAAP;AAID;;AAEDG,EAAAA,cAAc,CAACC,MAAD,EAAmBJ,IAAnB,EAAiC;AAC7C,WAAO,IAAIP,aAAJ,CACL,KAAKI,SADA,EAEL,KAAKA,SAAL,CAAeI,QAAf,CAAwBE,cAAxB,CAAuCC,MAAvC,EAA+CZ,SAAS,CAACU,SAAV,CAAoBF,IAApB,CAA/C,CAFK,CAAP;AAID;;AAEDK,EAAAA,eAAe,CAACN,GAAD,EAAcO,QAAd,EAAqCN,IAArC,EAAmD;AAChE,WAAO,IAAIP,aAAJ,CACL,KAAKI,SADA,EAEL,KAAKA,SAAL,CAAeI,QAAf,CAAwBI,eAAxB,CACEN,GADF,EAEEO,QAAQ,CACLC,GADH,CACQC,CAAD,IAAOC,KAAK,CAACC,IAAN,CAAWhB,YAAY,CAACQ,SAAb,CAAgCM,CAAhC,CAAX,CADd,EAEGG,IAFH,EAFF,EAKEnB,SAAS,CAACU,SAAV,CAAoBF,IAApB,CALF,CAFK,CAAP;AAUD;;AAEDY,EAAAA,qBAAqB,CAACR,MAAD,EAAmBE,QAAnB,EAA0CN,IAA1C,EAAwD;AAC3E,WAAO,IAAIP,aAAJ,CACL,KAAKI,SADA,EAEL,KAAKA,SAAL,CAAeI,QAAf,CAAwBW,qBAAxB,CACER,MADF,EAEEE,QAAQ,CAACC,GAAT,CAAcC,CAAD,IAAOd,YAAY,CAACQ,SAAb,CAAuBM,CAAvB,CAApB,CAFF,EAGEhB,SAAS,CAACU,SAAV,CAAoBF,IAApB,CAHF,CAFK,CAAP;AAQD;;AAzCuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkFont } from \"../types\";\nimport type { TextBlobFactory } from \"../types/TextBlob\";\nimport type { SkRSXform } from \"../types/RSXform\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport type { RSXform } from \"./JsiSkRSXform\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\n\nexport class JsiSkTextBlobFactory extends Host implements TextBlobFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFromText(str: string, font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromText(str, JsiSkFont.fromValue(font))\n );\n }\n\n MakeFromGlyphs(glyphs: number[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromGlyphs(glyphs, JsiSkFont.fromValue(font))\n );\n }\n\n MakeFromRSXform(str: string, rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXform(\n str,\n rsxforms\n .map((f) => Array.from(JsiSkRSXform.fromValue<RSXform>(f)))\n .flat(),\n JsiSkFont.fromValue(font)\n )\n );\n }\n\n MakeFromRSXformGlyphs(glyphs: number[], rsxforms: SkRSXform[], font: SkFont) {\n return new JsiSkTextBlob(\n this.CanvasKit,\n this.CanvasKit.TextBlob.MakeFromRSXformGlyphs(\n glyphs,\n rsxforms.map((f) => JsiSkRSXform.fromValue(f)),\n JsiSkFont.fromValue(font)\n )\n );\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Host, toValue } from "./Host";
1
+ import { Host } from "./Host";
2
2
  import { JsiSkTypeface } from "./JsiSkTypeface";
3
3
  export class JsiSkTypefaceFactory extends Host {
4
4
  constructor(CanvasKit) {
@@ -6,7 +6,7 @@ export class JsiSkTypefaceFactory extends Host {
6
6
  }
7
7
 
8
8
  MakeFreeTypeFaceFromData(data) {
9
- const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(toValue(data));
9
+ const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(JsiSkTypeface.fromValue(data));
10
10
 
11
11
  if (tf === null) {
12
12
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkTypefaceFactory.tsx"],"names":["Host","toValue","JsiSkTypeface","JsiSkTypefaceFactory","constructor","CanvasKit","MakeFreeTypeFaceFromData","data","tf","Typeface"],"mappings":"AAIA,SAASA,IAAT,EAAeC,OAAf,QAA8B,QAA9B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,oBAAN,SAAmCH,IAAnC,CAAmE;AACxEI,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,wBAAwB,CAACC,IAAD,EAAe;AACrC,UAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,QAAf,CAAwBH,wBAAxB,CAAiDL,OAAO,CAACM,IAAD,CAAxD,CAAX;;AACA,QAAIC,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIN,aAAJ,CAAkB,KAAKG,SAAvB,EAAkCG,EAAlC,CAAP;AACD;;AAXuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData, TypefaceFactory } from \"../types\";\n\nimport { Host, toValue } from \"./Host\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkTypefaceFactory extends Host implements TypefaceFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFreeTypeFaceFromData(data: SkData) {\n const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(toValue(data));\n if (tf === null) {\n return null;\n }\n return new JsiSkTypeface(this.CanvasKit, tf);\n }\n}\n"]}
1
+ {"version":3,"sources":["JsiSkTypefaceFactory.tsx"],"names":["Host","JsiSkTypeface","JsiSkTypefaceFactory","constructor","CanvasKit","MakeFreeTypeFaceFromData","data","tf","Typeface","fromValue"],"mappings":"AAIA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,oBAAN,SAAmCF,IAAnC,CAAmE;AACxEG,EAAAA,WAAW,CAACC,SAAD,EAAuB;AAChC,UAAMA,SAAN;AACD;;AAEDC,EAAAA,wBAAwB,CAACC,IAAD,EAAe;AACrC,UAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,QAAf,CAAwBH,wBAAxB,CACTJ,aAAa,CAACQ,SAAd,CAAwBH,IAAxB,CADS,CAAX;;AAGA,QAAIC,EAAE,KAAK,IAAX,EAAiB;AACf,aAAO,IAAP;AACD;;AACD,WAAO,IAAIN,aAAJ,CAAkB,KAAKG,SAAvB,EAAkCG,EAAlC,CAAP;AACD;;AAbuE","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData, TypefaceFactory } from \"../types\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkTypefaceFactory extends Host implements TypefaceFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeFreeTypeFaceFromData(data: SkData) {\n const tf = this.CanvasKit.Typeface.MakeFreeTypeFaceFromData(\n JsiSkTypeface.fromValue(data)\n );\n if (tf === null) {\n return null;\n }\n return new JsiSkTypeface(this.CanvasKit, tf);\n }\n}\n"]}
@@ -5,7 +5,6 @@ import { Color } from "./JsiSkColor";
5
5
  import { JsiSkSurfaceFactory } from "./JsiSkSurfaceFactory";
6
6
  import { JsiSkRRect } from "./JsiSkRRect";
7
7
  import { JsiSkRSXform } from "./JsiSkRSXform";
8
- import { toValue } from "./Host";
9
8
  import { JsiSkContourMeasureIter } from "./JsiSkContourMeasureIter";
10
9
  import { JsiSkPictureRecorder } from "./JsiSkPictureRecorder";
11
10
  import { JsiSkPictureFactory } from "./JsiSkPictureFactory";
@@ -24,22 +23,28 @@ import { JsiSkSVGFactory } from "./JsiSkSVGFactory";
24
23
  import { JsiSkTextBlobFactory } from "./JsiSkTextBlobFactory";
25
24
  import { JsiSkFont } from "./JsiSkFont";
26
25
  import { MakeVertices } from "./JsiSkVerticesFactory";
26
+ import { JsiSkPath } from "./JsiSkPath";
27
+ import { JsiSkTypeface } from "./JsiSkTypeface";
27
28
  export const JsiSkApi = CanvasKit => ({
28
29
  Point: (x, y) => new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),
29
30
  RuntimeShaderBuilder: _ => {
30
31
  throw new Error("Not implemented on React Native Web");
31
32
  },
32
- RRectXY: (rect, rx, ry) => new JsiSkRRect(CanvasKit, CanvasKit.RRectXY(toValue(rect), rx, ry)),
33
+ RRectXY: (rect, rx, ry) => new JsiSkRRect(CanvasKit, CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect), rx, ry)),
33
34
  RSXform: (scos, ssin, tx, ty) => new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),
34
35
  Color,
35
- ContourMeasureIter: (path, forceClosed, resScale) => new JsiSkContourMeasureIter(CanvasKit, new CanvasKit.ContourMeasureIter(toValue(path), forceClosed, resScale)),
36
- Paint: () => new JsiSkPaint(CanvasKit, new CanvasKit.Paint()),
36
+ ContourMeasureIter: (path, forceClosed, resScale) => new JsiSkContourMeasureIter(CanvasKit, new CanvasKit.ContourMeasureIter(JsiSkPath.fromValue(path), forceClosed, resScale)),
37
+ Paint: () => {
38
+ const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());
39
+ paint.setAntiAlias(true);
40
+ return paint;
41
+ },
37
42
  PictureRecorder: () => new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),
38
43
  Picture: new JsiSkPictureFactory(CanvasKit),
39
44
  Path: new JsiSkPathFactory(CanvasKit),
40
45
  Matrix: matrix => new JsiSkMatrix(CanvasKit, matrix ? Float32Array.of(...matrix) : Float32Array.of(...CanvasKit.Matrix.identity())),
41
46
  ColorFilter: new JsiSkColorFilterFactory(CanvasKit),
42
- Font: (typeface, size) => new JsiSkFont(CanvasKit, new CanvasKit.Font(typeface === undefined ? null : toValue(typeface), size)),
47
+ Font: (typeface, size) => new JsiSkFont(CanvasKit, new CanvasKit.Font(typeface === undefined ? null : JsiSkTypeface.fromValue(typeface), size)),
43
48
  Typeface: new JsiSkTypefaceFactory(CanvasKit),
44
49
  MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),
45
50
  RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),
@@ -1 +1 @@
1
- {"version":3,"sources":["JsiSkia.ts"],"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","toValue","JsiSkContourMeasureIter","JsiSkPictureRecorder","JsiSkPictureFactory","JsiSkPathFactory","JsiSkMatrix","JsiSkColorFilterFactory","JsiSkTypefaceFactory","JsiSkMaskFilterFactory","JsiSkRuntimeEffectFactory","JsiSkImageFilterFactory","JsiSkShaderFactory","JsiSkPathEffectFactory","JsiSkDataFactory","JsiSkImageFactory","JsiSkSVGFactory","JsiSkTextBlobFactory","JsiSkFont","MakeVertices","JsiSkApi","CanvasKit","Point","x","y","Float32Array","of","RuntimeShaderBuilder","_","Error","RRectXY","rect","rx","ry","RSXform","scos","ssin","tx","ty","ContourMeasureIter","path","forceClosed","resScale","Paint","PictureRecorder","Picture","Path","Matrix","matrix","identity","ColorFilter","Font","typeface","size","undefined","Typeface","MaskFilter","RuntimeEffect","ImageFilter","Shader","PathEffect","bind","Data","Image","SVG","TextBlob","XYWHRect","width","height","Surface"],"mappings":"AAYA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,KAAT,QAAsB,cAAtB;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,OAAT,QAAwB,QAAxB;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,yBAAT,QAA0C,6BAA1C;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SA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kB,IAAlB,EAAwBxC,SAAxB,CA/CyC;AAgDvDyC,EAAAA,IAAI,EAAE,IAAIhD,gBAAJ,CAAqBO,SAArB,CAhDiD;AAiDvD0C,EAAAA,KAAK,EAAE,IAAIhD,iBAAJ,CAAsBM,SAAtB,CAjDgD;AAkDvD2C,EAAAA,GAAG,EAAE,IAAIhD,eAAJ,CAAoBK,SAApB,CAlDkD;AAmDvD4C,EAAAA,QAAQ,EAAE,IAAIhD,oBAAJ,CAAyBI,SAAzB,CAnD6C;AAoDvD6C,EAAAA,QAAQ,EAAE,CAAC3C,CAAD,EAAYC,CAAZ,EAAuB2C,KAAvB,EAAsCC,MAAtC,KAAyD;AACjE,WAAO,IAAIxE,SAAJ,CAAcyB,SAAd,EAAyBA,SAAS,CAAC6C,QAAV,CAAmB3C,CAAnB,EAAsBC,CAAtB,EAAyB2C,KAAzB,EAAgCC,MAAhC,CAAzB,CAAP;AACD,GAtDsD;AAuDvDC,EAAAA,OAAO,EAAE,IAAIvE,mBAAJ,CAAwBuB,SAAxB;AAvD8C,CAAjC,CAAjB","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { toValue } from \"./Host\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect): SkRuntimeShaderBuilder => {\n throw new Error(\"Not implemented on React Native Web\");\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, CanvasKit.RRectXY(toValue(rect), rx, ry)),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(toValue(path), forceClosed, resScale)\n ),\n Paint: () => new JsiSkPaint(CanvasKit, new CanvasKit.Paint()),\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : toValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n});\n"]}
1
+ {"version":3,"sources":["JsiSkia.ts"],"names":["JsiSkPoint","JsiSkPaint","JsiSkRect","Color","JsiSkSurfaceFactory","JsiSkRRect","JsiSkRSXform","JsiSkContourMeasureIter","JsiSkPictureRecorder","JsiSkPictureFactory","JsiSkPathFactory","JsiSkMatrix","JsiSkColorFilterFactory","JsiSkTypefaceFactory","JsiSkMaskFilterFactory","JsiSkRuntimeEffectFactory","JsiSkImageFilterFactory","JsiSkShaderFactory","JsiSkPathEffectFactory","JsiSkDataFactory","JsiSkImageFactory","JsiSkSVGFactory","JsiSkTextBlobFactory","JsiSkFont","MakeVertices","JsiSkPath","JsiSkTypeface","JsiSkApi","CanvasKit","Point","x","y","Float32Array","of","RuntimeShaderBuilder","_","Error","RRectXY","rect","rx","ry","fromValue","RSXform","scos","ssin","tx","ty","ContourMeasureIter","path","forceClosed","resScale","Paint","paint","setAntiAlias","PictureRecorder","Picture","Path","Matrix","matrix","identity","ColorFilter","Font","typeface","size","undefined","Typeface","MaskFilter","RuntimeEffect","ImageFilter","Shader","PathEffect","bind","Data","Image","SVG","TextBlob","XYWHRect","width","height","Surface"],"mappings":"AAYA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,KAAT,QAAsB,cAAtB;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,mBAAT,QAAoC,uBAApC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,yBAAT,QAA0C,6BAA1C;AACA,SAASC,uBAAT,QAAwC,2BAAxC;AACA,SAASC,kBAAT,QAAmC,sBAAnC;AACA,SAASC,sBAAT,QAAuC,0BAAvC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,oBAAT,QAAqC,wBAArC;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,YAAT,QAA6B,wBAA7B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,QAAQ,GAAIC,SAAD,KAAiC;AACvD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b,CAAkB,IAAlB,EAAwB3C,SAAxB,CA1DyC;AA2DvD4C,EAAAA,IAAI,EAAE,IAAIrD,gBAAJ,CAAqBS,SAArB,CA3DiD;AA4DvD6C,EAAAA,KAAK,EAAE,IAAIrD,iBAAJ,CAAsBQ,SAAtB,CA5DgD;AA6DvD8C,EAAAA,GAAG,EAAE,IAAIrD,eAAJ,CAAoBO,SAApB,CA7DkD;AA8DvD+C,EAAAA,QAAQ,EAAE,IAAIrD,oBAAJ,CAAyBM,SAAzB,CA9D6C;AA+DvDgD,EAAAA,QAAQ,EAAE,CAAC9C,CAAD,EAAYC,CAAZ,EAAuB8C,KAAvB,EAAsCC,MAAtC,KAAyD;AACjE,WAAO,IAAI5E,SAAJ,CAAc0B,SAAd,EAAyBA,SAAS,CAACgD,QAAV,CAAmB9C,CAAnB,EAAsBC,CAAtB,EAAyB8C,KAAzB,EAAgCC,MAAhC,CAAzB,CAAP;AACD,GAjEsD;AAkEvDC,EAAAA,OAAO,EAAE,IAAI3E,mBAAJ,CAAwBwB,SAAxB;AAlE8C,CAAjC,CAAjB","sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect): SkRuntimeShaderBuilder => {\n throw new Error(\"Not implemented on React Native Web\");\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(\n CanvasKit,\n CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect), rx, ry)\n ),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(\n JsiSkPath.fromValue(path),\n forceClosed,\n resScale\n )\n ),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n});\n"]}
@@ -19,8 +19,8 @@ export class SkiaView extends React.Component {
19
19
  } = props;
20
20
 
21
21
  if (onDraw) {
22
- assertDrawCallbacksEnabled();
23
- SkiaViewApi.setDrawCallback(this._nativeId, onDraw);
22
+ assertSkiaViewApi();
23
+ SkiaViewApi.setJsiProperty(this._nativeId, "drawCallback", onDraw);
24
24
  }
25
25
  }
26
26
 
@@ -34,8 +34,8 @@ export class SkiaView extends React.Component {
34
34
  } = this.props;
35
35
 
36
36
  if (onDraw !== prevProps.onDraw) {
37
- assertDrawCallbacksEnabled();
38
- SkiaViewApi.setDrawCallback(this._nativeId, onDraw);
37
+ assertSkiaViewApi();
38
+ SkiaViewApi.setJsiProperty(this._nativeId, "drawCallback", onDraw);
39
39
  }
40
40
  }
41
41
  /**
@@ -46,7 +46,7 @@ export class SkiaView extends React.Component {
46
46
 
47
47
 
48
48
  makeImageSnapshot(rect) {
49
- assertDrawCallbacksEnabled();
49
+ assertSkiaViewApi();
50
50
  return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);
51
51
  }
52
52
  /**
@@ -55,23 +55,8 @@ export class SkiaView extends React.Component {
55
55
 
56
56
 
57
57
  redraw() {
58
- assertDrawCallbacksEnabled();
59
- SkiaViewApi.invalidateSkiaView(this._nativeId);
60
- }
61
- /**
62
- * Updates the drawing mode for the skia view. This is the same
63
- * as declaratively setting the mode property on the SkiaView.
64
- * There are two drawing modes, "continuous" and "default",
65
- * where the continuous mode will continuously redraw the view and
66
- * the default mode will only redraw when any of the regular react
67
- * properties are changed like size and margins.
68
- * @param mode Drawing mode to use.
69
- */
70
-
71
-
72
- setDrawMode(mode) {
73
- assertDrawCallbacksEnabled();
74
- SkiaViewApi.setDrawMode(this._nativeId, mode);
58
+ assertSkiaViewApi();
59
+ SkiaViewApi.requestRedraw(this._nativeId);
75
60
  }
76
61
  /**
77
62
  * Registers one or move values as a dependant value of the Skia View. The view will
@@ -81,7 +66,7 @@ export class SkiaView extends React.Component {
81
66
 
82
67
 
83
68
  registerValues(values) {
84
- assertDrawCallbacksEnabled();
69
+ assertSkiaViewApi();
85
70
  return SkiaViewApi.registerValuesInView(this._nativeId, values);
86
71
  }
87
72
 
@@ -101,9 +86,9 @@ export class SkiaView extends React.Component {
101
86
 
102
87
  }
103
88
 
104
- const assertDrawCallbacksEnabled = () => {
105
- if (SkiaViewApi === null || SkiaViewApi.setDrawCallback == null || SkiaViewApi.invalidateSkiaView == null) {
106
- throw Error("Skia Api is not enabled.");
89
+ const assertSkiaViewApi = () => {
90
+ if (SkiaViewApi === null || SkiaViewApi.setJsiProperty === null || SkiaViewApi.callJsiMethod === null || SkiaViewApi.registerValuesInView === null || SkiaViewApi.requestRedraw === null || SkiaViewApi.makeImageSnapshot === null) {
91
+ throw Error("Skia View Api was not found.");
107
92
  }
108
93
  };
109
94
  //# sourceMappingURL=SkiaView.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["SkiaView.tsx"],"names":["React","requireNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaView","SkiaView","Component","constructor","props","_nativeId","onDraw","assertDrawCallbacksEnabled","setDrawCallback","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","invalidateSkiaView","setDrawMode","mode","registerValues","values","registerValuesInView","render","debug","viewProps","Error"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,sBAAT,QAAuC,cAAvC;AAKA,SAASC,WAAT,QAA4B,OAA5B;AAGA,IAAIC,gBAAgB,GAAG,IAAvB;AAEA,MAAMC,cAAc,GAAGH,sBAAsB,CAC3C,qBAD2C,CAA7C;AAIA,OAAO,MAAMI,QAAN,SAAuBL,KAAK,CAACM,SAA7B,CAAsD;AAC3DC,EAAAA,WAAW,CAACC,KAAD,EAAuB;AAChC,UAAMA,KAAN;;AADgC;;AAEhC,SAAKC,SAAL,GAAiBN,gBAAgB,EAAjC;AACA,UAAM;AAAEO,MAAAA;AAAF,QAAaF,KAAnB;;AACA,QAAIE,MAAJ,EAAY;AACVC,MAAAA,0BAA0B;AAC1BT,MAAAA,WAAW,CAACU,eAAZ,CAA4B,KAAKH,SAAjC,EAA4CC,MAA5C;AACD;AACF;;AAIkB,MAARG,QAAQ,GAAG;AACpB,WAAO,KAAKJ,SAAZ;AACD;;AAEDK,EAAAA,kBAAkB,CAACC,SAAD,EAA2B;AAC3C,UAAM;AAAEL,MAAAA;AAAF,QAAa,KAAKF,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AA,WAAW,CAACU,eAAZ,IAA+B,IAD/B,IAEAV,WAAW,CAACiB,kBAAZ,IAAkC,IAHpC,EAIE;AACA,UAAMS,KAAK,CAAC,0BAAD,CAAX;AACD;AACF,CARD","sourcesContent":["import React from \"react\";\nimport { requireNativeComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { DrawMode, NativeSkiaViewProps, SkiaViewProps } from \"./types\";\n\nlet SkiaViewNativeId = 1000;\n\nconst NativeSkiaView = requireNativeComponent<NativeSkiaViewProps>(\n \"ReactNativeSkiaView\"\n);\n\nexport class SkiaView extends React.Component<SkiaViewProps> {\n constructor(props: SkiaViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId++;\n const { onDraw } = props;\n if (onDraw) {\n assertDrawCallbacksEnabled();\n SkiaViewApi.setDrawCallback(this._nativeId, onDraw);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaViewProps) {\n const { onDraw } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertDrawCallbacksEnabled();\n SkiaViewApi.setDrawCallback(this._nativeId, onDraw);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertDrawCallbacksEnabled();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertDrawCallbacksEnabled();\n SkiaViewApi.invalidateSkiaView(this._nativeId);\n }\n\n /**\n * Updates the drawing mode for the skia view. This is the same\n * as declaratively setting the mode property on the SkiaView.\n * There are two drawing modes, \"continuous\" and \"default\",\n * where the continuous mode will continuously redraw the view and\n * the default mode will only redraw when any of the regular react\n * properties are changed like size and margins.\n * @param mode Drawing mode to use.\n */\n public setDrawMode(mode: DrawMode) {\n assertDrawCallbacksEnabled();\n SkiaViewApi.setDrawMode(this._nativeId, mode);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]) {\n assertDrawCallbacksEnabled();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertDrawCallbacksEnabled = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setDrawCallback == null ||\n SkiaViewApi.invalidateSkiaView == null\n ) {\n throw Error(\"Skia Api is not enabled.\");\n }\n};\n"]}
1
+ {"version":3,"sources":["SkiaView.tsx"],"names":["React","requireNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaView","SkiaView","Component","constructor","props","_nativeId","onDraw","assertSkiaViewApi","setJsiProperty","nativeId","componentDidUpdate","prevProps","makeImageSnapshot","rect","redraw","requestRedraw","registerValues","values","registerValuesInView","render","mode","debug","viewProps","callJsiMethod","Error"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,sBAAT,QAAuC,cAAvC;AAKA,SAASC,WAAT,QAA4B,OAA5B;AAGA,IAAIC,gBAAgB,GAAG,IAAvB;AAEA,MAAMC,cAAc,GAAGH,sBAAsB,CAC3C,qBAD2C,CAA7C;AAIA,OAAO,MAAMI,QAAN,SAAuBL,KAAK,CAACM,SAA7B,CAAsD;AAC3DC,EAAAA,WAAW,CAACC,KAAD,EAAuB;AAChC,UAAMA,KAAN;;AADgC;;AAEhC,SAAKC,SAAL,GAAiBN,gBAAgB,EAAjC;AACA,UAAM;AAAEO,MAAAA;AAAF,QAAaF,KAAnB;;AACA,QAAIE,MAAJ,EAAY;AACVC,MAAAA,iBAAiB;AACjBT,MAAA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f,iBAAiB,GAAG,MAAM;AAC9B,MACET,WAAW,KAAK,IAAhB,IACAA,WAAW,CAACU,cAAZ,KAA+B,IAD/B,IAEAV,WAAW,CAACyB,aAAZ,KAA8B,IAF9B,IAGAzB,WAAW,CAACoB,oBAAZ,KAAqC,IAHrC,IAIApB,WAAW,CAACiB,aAAZ,KAA8B,IAJ9B,IAKAjB,WAAW,CAACc,iBAAZ,KAAkC,IANpC,EAOE;AACA,UAAMY,KAAK,CAAC,8BAAD,CAAX;AACD;AACF,CAXD","sourcesContent":["import React from \"react\";\nimport { requireNativeComponent } from \"react-native\";\n\nimport type { SkRect } from \"../skia/types\";\nimport type { SkiaValue } from \"../values\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { NativeSkiaViewProps, SkiaViewProps } from \"./types\";\n\nlet SkiaViewNativeId = 1000;\n\nconst NativeSkiaView = requireNativeComponent<NativeSkiaViewProps>(\n \"ReactNativeSkiaView\"\n);\n\nexport class SkiaView extends React.Component<SkiaViewProps> {\n constructor(props: SkiaViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId++;\n const { onDraw } = props;\n if (onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaViewProps) {\n const { onDraw } = this.props;\n if (onDraw !== prevProps.onDraw) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"drawCallback\", onDraw);\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n /**\n * Registers one or move values as a dependant value of the Skia View. The view will\n * The view will redraw itself when any of the values change.\n * @param values Values to register\n */\n public registerValues(values: SkiaValue<unknown>[]): () => void {\n assertSkiaViewApi();\n return SkiaViewApi.registerValuesInView(this._nativeId, values);\n }\n\n render() {\n const { mode, debug = false, ...viewProps } = this.props;\n return (\n <NativeSkiaView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n mode={mode}\n debug={debug}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.callJsiMethod === null ||\n SkiaViewApi.registerValuesInView === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"]}