@shopify/react-native-skia 0.1.130 → 0.1.131

Sign up to get free protection for your applications and to get access to all the features.
Files changed (942) hide show
  1. package/README.md +8 -0
  2. package/android/cpp/jni/JniSkiaDrawView.cpp +3 -2
  3. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +2 -1
  4. package/cpp/api/JsiSkCanvas.h +2 -2
  5. package/cpp/api/JsiSkMatrix.h +40 -27
  6. package/cpp/api/JsiSkPaint.h +3 -1
  7. package/cpp/api/JsiSkPath.h +67 -61
  8. package/cpp/api/JsiSkPathFactory.h +14 -1
  9. package/cpp/api/JsiSkRuntimeShaderBuilder.h +18 -0
  10. package/cpp/api/JsiSkTypeface.h +11 -2
  11. package/cpp/api/JsiSkTypefaceFactory.h +5 -1
  12. package/cpp/rnskia/RNSkInfoParameter.h +2 -0
  13. package/cpp/utils/RNSkLog.h +22 -0
  14. package/ios/RNSkia-iOS/SkiaDrawView.mm +2 -1
  15. package/lib/commonjs/animation/functions/index.js +47 -17
  16. package/lib/commonjs/animation/functions/index.js.map +1 -1
  17. package/lib/commonjs/animation/functions/interpolatePaths.js +45 -0
  18. package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -0
  19. package/lib/commonjs/animation/functions/interpolateVector.js +20 -0
  20. package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -0
  21. package/lib/commonjs/index.js +13 -0
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/commonjs/renderer/Canvas.js +19 -35
  24. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  25. package/lib/commonjs/renderer/HostConfig.js +2 -2
  26. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  27. package/lib/commonjs/renderer/components/Blend.js +10 -7
  28. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  29. package/lib/commonjs/renderer/components/Compose.js +9 -6
  30. package/lib/commonjs/renderer/components/Compose.js.map +1 -1
  31. package/lib/commonjs/renderer/components/Group.js +7 -6
  32. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  33. package/lib/commonjs/renderer/components/Mask.js +13 -10
  34. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  35. package/lib/commonjs/renderer/components/Paint.js +7 -4
  36. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  37. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  38. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js +1 -1
  39. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  40. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js +7 -6
  41. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  42. package/lib/commonjs/renderer/components/colorFilters/Compose.js +6 -6
  43. package/lib/commonjs/renderer/components/colorFilters/Compose.js.map +1 -1
  44. package/lib/commonjs/renderer/components/colorFilters/Lerp.js +8 -7
  45. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  46. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js +6 -6
  47. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  48. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js +6 -6
  49. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  50. package/lib/commonjs/renderer/components/colorFilters/Matrix.js +6 -7
  51. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  52. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js +6 -6
  53. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  54. package/lib/commonjs/renderer/components/image/BoxFit.js +7 -9
  55. package/lib/commonjs/renderer/components/image/BoxFit.js.map +1 -1
  56. package/lib/commonjs/renderer/components/image/Image.js +3 -2
  57. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  58. package/lib/commonjs/renderer/components/image/ImageSVG.js +3 -2
  59. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  60. package/lib/commonjs/renderer/components/image/ImageShader.js +9 -6
  61. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  62. package/lib/commonjs/renderer/components/imageFilters/Blur.js +7 -4
  63. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  64. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js +10 -7
  65. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  66. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js +10 -15
  67. package/lib/commonjs/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  68. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +7 -6
  69. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  70. package/lib/commonjs/renderer/components/imageFilters/Offset.js +5 -4
  71. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  72. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js +13 -6
  73. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  74. package/lib/commonjs/renderer/components/imageFilters/Shadow.js +8 -7
  75. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  76. package/lib/commonjs/renderer/components/imageFilters/getInput.js +7 -7
  77. package/lib/commonjs/renderer/components/imageFilters/getInput.js.map +1 -1
  78. package/lib/commonjs/renderer/components/maskFilters/Blur.js +6 -3
  79. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  80. package/lib/commonjs/renderer/components/pathEffects/Corner.js +8 -6
  81. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  82. package/lib/commonjs/renderer/components/pathEffects/Dash.js +8 -6
  83. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  84. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +8 -6
  85. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  86. package/lib/commonjs/renderer/components/pathEffects/Line2D.js +8 -6
  87. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  88. package/lib/commonjs/renderer/components/pathEffects/Path1D.js +8 -6
  89. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  90. package/lib/commonjs/renderer/components/pathEffects/Path2D.js +8 -6
  91. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  92. package/lib/commonjs/renderer/components/pathEffects/Sum.js +7 -4
  93. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  94. package/lib/commonjs/renderer/components/shaders/Color.js +7 -4
  95. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  96. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +5 -4
  97. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  98. package/lib/commonjs/renderer/components/shaders/Gradient.js +5 -5
  99. package/lib/commonjs/renderer/components/shaders/Gradient.js.map +1 -1
  100. package/lib/commonjs/renderer/components/shaders/LinearGradient.js +6 -5
  101. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  102. package/lib/commonjs/renderer/components/shaders/RadialGradient.js +6 -5
  103. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  104. package/lib/commonjs/renderer/components/shaders/Shader.js +6 -43
  105. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  106. package/lib/commonjs/renderer/components/shaders/SweepGradient.js +6 -5
  107. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  108. package/lib/commonjs/renderer/components/shaders/Turbulence.js +5 -4
  109. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  110. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js +6 -5
  111. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  112. package/lib/commonjs/renderer/components/shapes/Box.js +26 -29
  113. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  114. package/lib/commonjs/renderer/components/shapes/Circle.js +7 -5
  115. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  116. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  117. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  118. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  119. package/lib/commonjs/renderer/components/shapes/Oval.js +3 -2
  120. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  121. package/lib/commonjs/renderer/components/shapes/Patch.js +8 -5
  122. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  123. package/lib/commonjs/renderer/components/shapes/Path.js +5 -4
  124. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  125. package/lib/commonjs/renderer/components/shapes/Points.js +2 -2
  126. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  127. package/lib/commonjs/renderer/components/shapes/Rect.js +3 -2
  128. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  129. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +3 -2
  130. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  131. package/lib/commonjs/renderer/components/shapes/Vertices.js +9 -8
  132. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  133. package/lib/commonjs/renderer/components/text/Glyphs.js +3 -2
  134. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  135. package/lib/commonjs/renderer/components/text/Text.js +3 -2
  136. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  137. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  138. package/lib/commonjs/renderer/components/text/TextPath.js +7 -11
  139. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  140. package/lib/commonjs/renderer/index.js +13 -13
  141. package/lib/commonjs/renderer/index.js.map +1 -1
  142. package/lib/commonjs/renderer/nodes/Declaration.js.map +1 -1
  143. package/lib/commonjs/renderer/nodes/Drawing.js +5 -5
  144. package/lib/commonjs/renderer/nodes/Drawing.js.map +1 -1
  145. package/lib/commonjs/renderer/nodes/Node.js.map +1 -1
  146. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  147. package/lib/commonjs/renderer/processors/Circles.js +2 -4
  148. package/lib/commonjs/renderer/processors/Circles.js.map +1 -1
  149. package/lib/commonjs/renderer/processors/Clips.js +5 -5
  150. package/lib/commonjs/renderer/processors/Clips.js.map +1 -1
  151. package/lib/commonjs/{skia/core → renderer/processors}/Color.js +2 -6
  152. package/lib/commonjs/renderer/processors/Color.js.map +1 -0
  153. package/lib/commonjs/renderer/processors/Font.js +4 -4
  154. package/lib/commonjs/renderer/processors/Font.js.map +1 -1
  155. package/lib/commonjs/renderer/processors/Paint.js +18 -14
  156. package/lib/commonjs/renderer/processors/Paint.js.map +1 -1
  157. package/lib/commonjs/renderer/processors/Paths.js +4 -4
  158. package/lib/commonjs/renderer/processors/Paths.js.map +1 -1
  159. package/lib/commonjs/renderer/processors/Radius.js +2 -4
  160. package/lib/commonjs/renderer/processors/Radius.js.map +1 -1
  161. package/lib/commonjs/renderer/processors/Rects.js +8 -59
  162. package/lib/commonjs/renderer/processors/Rects.js.map +1 -1
  163. package/lib/commonjs/renderer/processors/Transform.js +26 -17
  164. package/lib/commonjs/renderer/processors/Transform.js.map +1 -1
  165. package/lib/commonjs/renderer/processors/index.js +26 -13
  166. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  167. package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
  168. package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
  169. package/lib/commonjs/renderer/processors/math/index.js +0 -26
  170. package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
  171. package/lib/commonjs/renderer/useCanvas.js +30 -0
  172. package/lib/commonjs/renderer/useCanvas.js.map +1 -0
  173. package/lib/commonjs/skia/NativeSetup.js +1 -1
  174. package/lib/commonjs/skia/NativeSetup.js.map +1 -1
  175. package/lib/commonjs/skia/Skia.web.js +12 -0
  176. package/lib/commonjs/skia/Skia.web.js.map +1 -0
  177. package/lib/commonjs/skia/core/Data.js +9 -4
  178. package/lib/commonjs/skia/core/Data.js.map +1 -1
  179. package/lib/commonjs/skia/core/Font.js +2 -4
  180. package/lib/commonjs/skia/core/Font.js.map +1 -1
  181. package/lib/commonjs/skia/core/Matrix.js +15 -0
  182. package/lib/commonjs/skia/core/Matrix.js.map +1 -0
  183. package/lib/commonjs/skia/core/Paint.js +4 -12
  184. package/lib/commonjs/skia/core/Paint.js.map +1 -1
  185. package/lib/commonjs/skia/core/Path.js +14 -2
  186. package/lib/commonjs/skia/core/Path.js.map +1 -1
  187. package/lib/commonjs/skia/core/RRect.js +13 -0
  188. package/lib/commonjs/skia/core/RRect.js.map +1 -0
  189. package/lib/commonjs/skia/core/Rect.js +47 -0
  190. package/lib/commonjs/skia/core/Rect.js.map +1 -0
  191. package/lib/commonjs/skia/core/Vector.js +49 -0
  192. package/lib/commonjs/skia/core/Vector.js.map +1 -0
  193. package/lib/commonjs/skia/core/index.js +51 -25
  194. package/lib/commonjs/skia/core/index.js.map +1 -1
  195. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  196. package/lib/commonjs/skia/types/Matrix.js +58 -1
  197. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  198. package/lib/commonjs/skia/types/Path/Path.js +1 -0
  199. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  200. package/lib/commonjs/skia/types/Point.js.map +1 -1
  201. package/lib/commonjs/skia/types/RRect.js +7 -0
  202. package/lib/commonjs/skia/types/RRect.js.map +1 -1
  203. package/lib/commonjs/skia/types/Shader/Shader.js +51 -1
  204. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  205. package/lib/commonjs/skia/web/{api/Host.js → Host.js} +10 -1
  206. package/lib/commonjs/skia/web/Host.js.map +1 -0
  207. package/lib/commonjs/skia/web/JsiImageFilterFactory.js +68 -0
  208. package/lib/commonjs/skia/web/JsiImageFilterFactory.js.map +1 -0
  209. package/lib/commonjs/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +20 -6
  210. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -0
  211. package/lib/commonjs/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +163 -4
  212. package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -0
  213. package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
  214. package/lib/commonjs/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
  215. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +48 -0
  216. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -0
  217. package/lib/commonjs/skia/web/JsiSkContourMeasure.js +42 -0
  218. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -0
  219. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +30 -0
  220. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -0
  221. package/lib/commonjs/skia/web/JsiSkData.js +18 -0
  222. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -0
  223. package/lib/commonjs/skia/web/JsiSkDataFactory.js +44 -0
  224. package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -0
  225. package/lib/commonjs/skia/web/JsiSkFont.js +111 -0
  226. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -0
  227. package/lib/commonjs/skia/web/JsiSkFontMgr.js +35 -0
  228. package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +1 -0
  229. package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js +25 -0
  230. package/lib/commonjs/skia/web/JsiSkFontMgrFactory.js.map +1 -0
  231. package/lib/commonjs/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +0 -0
  232. package/lib/commonjs/skia/web/{api/JsiSkImage.js.map → JsiSkImage.js.map} +1 -1
  233. package/lib/commonjs/skia/web/JsiSkImageFactory.js +47 -0
  234. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -0
  235. package/lib/commonjs/skia/web/JsiSkImageFilter.js +18 -0
  236. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -0
  237. package/lib/commonjs/skia/web/JsiSkMaskFilter.js +18 -0
  238. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -0
  239. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +24 -0
  240. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
  241. package/lib/commonjs/skia/web/JsiSkMatrix.js +38 -0
  242. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -0
  243. package/lib/commonjs/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +4 -9
  244. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -0
  245. package/lib/commonjs/skia/web/JsiSkPath.js +324 -0
  246. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -0
  247. package/lib/commonjs/skia/web/JsiSkPathEffect.js +18 -0
  248. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -0
  249. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +78 -0
  250. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -0
  251. package/lib/commonjs/skia/web/JsiSkPathFactory.js +58 -0
  252. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -0
  253. package/lib/commonjs/skia/web/JsiSkPicture.js +29 -0
  254. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -0
  255. package/lib/commonjs/skia/web/JsiSkPictureFactory.js +30 -0
  256. package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -0
  257. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +30 -0
  258. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -0
  259. package/lib/commonjs/skia/web/JsiSkPoint.js +26 -0
  260. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -0
  261. package/lib/commonjs/skia/web/JsiSkRRect.js +32 -0
  262. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -0
  263. package/lib/commonjs/skia/web/JsiSkRSXform.js +18 -0
  264. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -0
  265. package/lib/commonjs/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
  266. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -0
  267. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +44 -0
  268. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -0
  269. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +30 -0
  270. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
  271. package/lib/commonjs/skia/web/JsiSkSVGFactory.js +26 -0
  272. package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -0
  273. package/lib/commonjs/skia/web/JsiSkShader.js +18 -0
  274. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -0
  275. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +52 -0
  276. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -0
  277. package/lib/commonjs/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
  278. package/lib/commonjs/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
  279. package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
  280. package/lib/commonjs/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
  281. package/lib/commonjs/skia/web/JsiSkTextBlob.js +18 -0
  282. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -0
  283. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +36 -0
  284. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -0
  285. package/lib/commonjs/skia/web/JsiSkTypeface.js +28 -0
  286. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -0
  287. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +30 -0
  288. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -0
  289. package/lib/commonjs/skia/web/JsiSkVertices.js +28 -0
  290. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -0
  291. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +27 -0
  292. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -0
  293. package/lib/commonjs/skia/web/JsiSkia.js +97 -0
  294. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -0
  295. package/lib/commonjs/skia/web/index.js +4 -4
  296. package/lib/commonjs/skia/web/index.js.map +1 -1
  297. package/lib/commonjs/values/web/api.js +2 -2
  298. package/lib/commonjs/values/web/api.js.map +1 -1
  299. package/lib/commonjs/views/SkiaView.web.js +216 -0
  300. package/lib/commonjs/views/SkiaView.web.js.map +1 -0
  301. package/lib/commonjs/views/types.js.map +1 -1
  302. package/lib/commonjs/views/useTouchHandler.js +70 -46
  303. package/lib/commonjs/views/useTouchHandler.js.map +1 -1
  304. package/lib/commonjs/web/index.js +20 -0
  305. package/lib/commonjs/web/index.js.map +1 -0
  306. package/lib/module/animation/functions/index.js +4 -2
  307. package/lib/module/animation/functions/index.js.map +1 -1
  308. package/lib/module/animation/functions/interpolatePaths.js +36 -0
  309. package/lib/module/animation/functions/interpolatePaths.js.map +1 -0
  310. package/lib/module/animation/functions/interpolateVector.js +7 -0
  311. package/lib/module/animation/functions/interpolateVector.js.map +1 -0
  312. package/lib/module/index.js +1 -0
  313. package/lib/module/index.js.map +1 -1
  314. package/lib/module/renderer/Canvas.js +15 -26
  315. package/lib/module/renderer/Canvas.js.map +1 -1
  316. package/lib/module/renderer/HostConfig.js +2 -2
  317. package/lib/module/renderer/HostConfig.js.map +1 -1
  318. package/lib/module/renderer/components/Blend.js +5 -2
  319. package/lib/module/renderer/components/Blend.js.map +1 -1
  320. package/lib/module/renderer/components/Compose.js +5 -2
  321. package/lib/module/renderer/components/Compose.js.map +1 -1
  322. package/lib/module/renderer/components/Group.js +7 -6
  323. package/lib/module/renderer/components/Group.js.map +1 -1
  324. package/lib/module/renderer/components/Mask.js +7 -3
  325. package/lib/module/renderer/components/Mask.js.map +1 -1
  326. package/lib/module/renderer/components/Paint.js +6 -3
  327. package/lib/module/renderer/components/Paint.js.map +1 -1
  328. package/lib/module/renderer/components/Picture.js.map +1 -1
  329. package/lib/module/renderer/components/backdrop/BackdropFilter.js +1 -1
  330. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  331. package/lib/module/renderer/components/colorFilters/BlendColor.js +6 -3
  332. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  333. package/lib/module/renderer/components/colorFilters/Compose.js +2 -2
  334. package/lib/module/renderer/components/colorFilters/Compose.js.map +1 -1
  335. package/lib/module/renderer/components/colorFilters/Lerp.js +6 -3
  336. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  337. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js +5 -3
  338. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  339. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js +5 -3
  340. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  341. package/lib/module/renderer/components/colorFilters/Matrix.js +5 -3
  342. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  343. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js +5 -3
  344. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  345. package/lib/module/renderer/components/image/BoxFit.js +7 -8
  346. package/lib/module/renderer/components/image/BoxFit.js.map +1 -1
  347. package/lib/module/renderer/components/image/Image.js +3 -2
  348. package/lib/module/renderer/components/image/Image.js.map +1 -1
  349. package/lib/module/renderer/components/image/ImageSVG.js +3 -2
  350. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  351. package/lib/module/renderer/components/image/ImageShader.js +10 -7
  352. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  353. package/lib/module/renderer/components/imageFilters/Blur.js +7 -4
  354. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  355. package/lib/module/renderer/components/imageFilters/DisplacementMap.js +7 -4
  356. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  357. package/lib/module/renderer/components/imageFilters/InnerShadow.js +3 -3
  358. package/lib/module/renderer/components/imageFilters/InnerShadow.js.map +1 -1
  359. package/lib/module/renderer/components/imageFilters/Morphology.js +6 -4
  360. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  361. package/lib/module/renderer/components/imageFilters/Offset.js +5 -3
  362. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  363. package/lib/module/renderer/components/imageFilters/RuntimeShader.js +13 -4
  364. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  365. package/lib/module/renderer/components/imageFilters/Shadow.js +6 -5
  366. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  367. package/lib/module/renderer/components/imageFilters/getInput.js +2 -2
  368. package/lib/module/renderer/components/imageFilters/getInput.js.map +1 -1
  369. package/lib/module/renderer/components/maskFilters/Blur.js +5 -2
  370. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  371. package/lib/module/renderer/components/pathEffects/Corner.js +5 -2
  372. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  373. package/lib/module/renderer/components/pathEffects/Dash.js +5 -2
  374. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  375. package/lib/module/renderer/components/pathEffects/Discrete.js +5 -2
  376. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  377. package/lib/module/renderer/components/pathEffects/Line2D.js +5 -2
  378. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  379. package/lib/module/renderer/components/pathEffects/Path1D.js +6 -3
  380. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  381. package/lib/module/renderer/components/pathEffects/Path2D.js +6 -3
  382. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  383. package/lib/module/renderer/components/pathEffects/Sum.js +5 -2
  384. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  385. package/lib/module/renderer/components/shaders/Color.js +6 -3
  386. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  387. package/lib/module/renderer/components/shaders/FractalNoise.js +4 -2
  388. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  389. package/lib/module/renderer/components/shaders/Gradient.js +3 -3
  390. package/lib/module/renderer/components/shaders/Gradient.js.map +1 -1
  391. package/lib/module/renderer/components/shaders/LinearGradient.js +5 -3
  392. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  393. package/lib/module/renderer/components/shaders/RadialGradient.js +5 -3
  394. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  395. package/lib/module/renderer/components/shaders/Shader.js +6 -44
  396. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  397. package/lib/module/renderer/components/shaders/SweepGradient.js +5 -3
  398. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  399. package/lib/module/renderer/components/shaders/Turbulence.js +4 -2
  400. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  401. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js +5 -3
  402. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  403. package/lib/module/renderer/components/shapes/Box.js +20 -19
  404. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  405. package/lib/module/renderer/components/shapes/Circle.js +7 -4
  406. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  407. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  408. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  409. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  410. package/lib/module/renderer/components/shapes/Oval.js +3 -2
  411. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  412. package/lib/module/renderer/components/shapes/Patch.js +5 -3
  413. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  414. package/lib/module/renderer/components/shapes/Path.js +4 -3
  415. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  416. package/lib/module/renderer/components/shapes/Points.js +1 -1
  417. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  418. package/lib/module/renderer/components/shapes/Rect.js +3 -2
  419. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  420. package/lib/module/renderer/components/shapes/RoundedRect.js +3 -2
  421. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  422. package/lib/module/renderer/components/shapes/Vertices.js +5 -3
  423. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  424. package/lib/module/renderer/components/text/Glyphs.js +3 -2
  425. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  426. package/lib/module/renderer/components/text/Text.js +3 -2
  427. package/lib/module/renderer/components/text/Text.js.map +1 -1
  428. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  429. package/lib/module/renderer/components/text/TextPath.js +3 -3
  430. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  431. package/lib/module/renderer/index.js +1 -1
  432. package/lib/module/renderer/index.js.map +1 -1
  433. package/lib/module/renderer/nodes/Declaration.js.map +1 -1
  434. package/lib/module/renderer/nodes/Drawing.js +3 -3
  435. package/lib/module/renderer/nodes/Drawing.js.map +1 -1
  436. package/lib/module/renderer/nodes/Node.js.map +1 -1
  437. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  438. package/lib/module/renderer/processors/Circles.js +2 -4
  439. package/lib/module/renderer/processors/Circles.js.map +1 -1
  440. package/lib/module/renderer/processors/Clips.js +3 -3
  441. package/lib/module/renderer/processors/Clips.js.map +1 -1
  442. package/lib/module/{skia/core → renderer/processors}/Color.js +1 -2
  443. package/lib/module/renderer/processors/Color.js.map +1 -0
  444. package/lib/module/renderer/processors/Font.js +3 -2
  445. package/lib/module/renderer/processors/Font.js.map +1 -1
  446. package/lib/module/renderer/processors/Paint.js +8 -5
  447. package/lib/module/renderer/processors/Paint.js.map +1 -1
  448. package/lib/module/renderer/processors/Paths.js +2 -2
  449. package/lib/module/renderer/processors/Paths.js.map +1 -1
  450. package/lib/module/renderer/processors/Radius.js +2 -3
  451. package/lib/module/renderer/processors/Radius.js.map +1 -1
  452. package/lib/module/renderer/processors/Rects.js +7 -26
  453. package/lib/module/renderer/processors/Rects.js.map +1 -1
  454. package/lib/module/renderer/processors/Transform.js +24 -16
  455. package/lib/module/renderer/processors/Transform.js.map +1 -1
  456. package/lib/module/renderer/processors/index.js +2 -1
  457. package/lib/module/renderer/processors/index.js.map +1 -1
  458. package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
  459. package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
  460. package/lib/module/renderer/processors/math/index.js +0 -2
  461. package/lib/module/renderer/processors/math/index.js.map +1 -1
  462. package/lib/module/renderer/useCanvas.js +13 -0
  463. package/lib/module/renderer/useCanvas.js.map +1 -0
  464. package/lib/module/skia/NativeSetup.js +2 -2
  465. package/lib/module/skia/NativeSetup.js.map +1 -1
  466. package/lib/module/skia/Skia.web.js +3 -0
  467. package/lib/module/skia/Skia.web.js.map +1 -0
  468. package/lib/module/skia/core/Data.js +11 -5
  469. package/lib/module/skia/core/Data.js.map +1 -1
  470. package/lib/module/skia/core/Font.js +2 -4
  471. package/lib/module/skia/core/Font.js.map +1 -1
  472. package/lib/module/skia/core/Matrix.js +4 -0
  473. package/lib/module/skia/core/Matrix.js.map +1 -0
  474. package/lib/module/skia/core/Paint.js +3 -7
  475. package/lib/module/skia/core/Paint.js.map +1 -1
  476. package/lib/module/skia/core/Path.js +11 -2
  477. package/lib/module/skia/core/Path.js.map +1 -1
  478. package/lib/module/skia/core/RRect.js +3 -0
  479. package/lib/module/skia/core/RRect.js.map +1 -0
  480. package/lib/module/skia/core/Rect.js +17 -0
  481. package/lib/module/skia/core/Rect.js.map +1 -0
  482. package/lib/module/{renderer/processors/math → skia/core}/Vector.js +2 -7
  483. package/lib/module/skia/core/Vector.js.map +1 -0
  484. package/lib/module/skia/core/index.js +5 -3
  485. package/lib/module/skia/core/index.js.map +1 -1
  486. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  487. package/lib/module/skia/types/Matrix.js +55 -0
  488. package/lib/module/skia/types/Matrix.js.map +1 -1
  489. package/lib/module/skia/types/Path/Path.js +1 -0
  490. package/lib/module/skia/types/Path/Path.js.map +1 -1
  491. package/lib/module/skia/types/Point.js.map +1 -1
  492. package/lib/module/skia/types/RRect.js +3 -1
  493. package/lib/module/skia/types/RRect.js.map +1 -1
  494. package/lib/module/skia/types/Shader/Shader.js +48 -0
  495. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  496. package/lib/module/skia/web/{api/Host.js → Host.js} +6 -0
  497. package/lib/module/skia/web/Host.js.map +1 -0
  498. package/lib/module/skia/web/JsiImageFilterFactory.js +57 -0
  499. package/lib/module/skia/web/JsiImageFilterFactory.js.map +1 -0
  500. package/lib/module/skia/web/{api/JsiSkCanvas.js → JsiSkCanvas.js} +19 -6
  501. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -0
  502. package/lib/module/skia/web/{api/JsiSkColor.js → JsiSkColor.js} +164 -4
  503. package/lib/module/skia/web/JsiSkColor.js.map +1 -0
  504. package/lib/module/skia/web/{api/JsiSkColorFilter.js → JsiSkColorFilter.js} +0 -0
  505. package/lib/module/skia/web/{api/JsiSkColorFilter.js.map → JsiSkColorFilter.js.map} +1 -1
  506. package/lib/module/skia/web/JsiSkColorFilterFactory.js +37 -0
  507. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -0
  508. package/lib/module/skia/web/JsiSkContourMeasure.js +31 -0
  509. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -0
  510. package/lib/module/skia/web/JsiSkContourMeasureIter.js +19 -0
  511. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -0
  512. package/lib/module/skia/web/JsiSkData.js +8 -0
  513. package/lib/module/skia/web/JsiSkData.js.map +1 -0
  514. package/lib/module/skia/web/JsiSkDataFactory.js +33 -0
  515. package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -0
  516. package/lib/module/skia/web/JsiSkFont.js +99 -0
  517. package/lib/module/skia/web/JsiSkFont.js.map +1 -0
  518. package/lib/module/skia/web/JsiSkFontMgr.js +25 -0
  519. package/lib/module/skia/web/JsiSkFontMgr.js.map +1 -0
  520. package/lib/module/skia/web/JsiSkFontMgrFactory.js +14 -0
  521. package/lib/module/skia/web/JsiSkFontMgrFactory.js.map +1 -0
  522. package/lib/module/skia/web/{api/JsiSkImage.js → JsiSkImage.js} +0 -0
  523. package/lib/module/skia/web/{api/JsiSkImage.js.map → JsiSkImage.js.map} +1 -1
  524. package/lib/module/skia/web/JsiSkImageFactory.js +36 -0
  525. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -0
  526. package/lib/module/skia/web/JsiSkImageFilter.js +8 -0
  527. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -0
  528. package/lib/module/skia/web/JsiSkMaskFilter.js +8 -0
  529. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -0
  530. package/lib/module/skia/web/JsiSkMaskFilterFactory.js +13 -0
  531. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -0
  532. package/lib/module/skia/web/JsiSkMatrix.js +28 -0
  533. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -0
  534. package/lib/module/skia/web/{api/JsiSkPaint.js → JsiSkPaint.js} +5 -10
  535. package/lib/module/skia/web/JsiSkPaint.js.map +1 -0
  536. package/lib/module/skia/web/JsiSkPath.js +311 -0
  537. package/lib/module/skia/web/JsiSkPath.js.map +1 -0
  538. package/lib/module/skia/web/JsiSkPathEffect.js +8 -0
  539. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -0
  540. package/lib/module/skia/web/JsiSkPathEffectFactory.js +67 -0
  541. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -0
  542. package/lib/module/skia/web/JsiSkPathFactory.js +47 -0
  543. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -0
  544. package/lib/module/skia/web/JsiSkPicture.js +18 -0
  545. package/lib/module/skia/web/JsiSkPicture.js.map +1 -0
  546. package/lib/module/skia/web/JsiSkPictureFactory.js +19 -0
  547. package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -0
  548. package/lib/module/skia/web/JsiSkPictureRecorder.js +18 -0
  549. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -0
  550. package/lib/module/skia/web/JsiSkPoint.js +16 -0
  551. package/lib/module/skia/web/JsiSkPoint.js.map +1 -0
  552. package/lib/module/skia/web/JsiSkRRect.js +21 -0
  553. package/lib/module/skia/web/JsiSkRRect.js.map +1 -0
  554. package/lib/module/skia/web/JsiSkRSXform.js +8 -0
  555. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -0
  556. package/lib/module/skia/web/{api/JsiSkRect.js → JsiSkRect.js} +8 -0
  557. package/lib/module/skia/web/JsiSkRect.js.map +1 -0
  558. package/lib/module/skia/web/JsiSkRuntimeEffect.js +33 -0
  559. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -0
  560. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +19 -0
  561. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -0
  562. package/lib/module/skia/web/JsiSkSVGFactory.js +16 -0
  563. package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -0
  564. package/lib/module/skia/web/JsiSkShader.js +8 -0
  565. package/lib/module/skia/web/JsiSkShader.js.map +1 -0
  566. package/lib/module/skia/web/JsiSkShaderFactory.js +41 -0
  567. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -0
  568. package/lib/module/skia/web/{api/JsiSkSurface.js → JsiSkSurface.js} +0 -0
  569. package/lib/module/skia/web/{api/JsiSkSurface.js.map → JsiSkSurface.js.map} +1 -1
  570. package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js → JsiSkSurfaceFactory.js} +0 -0
  571. package/lib/module/skia/web/{api/JsiSkSurfaceFactory.js.map → JsiSkSurfaceFactory.js.map} +1 -1
  572. package/lib/module/skia/web/JsiSkTextBlob.js +8 -0
  573. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -0
  574. package/lib/module/skia/web/JsiSkTextBlobFactory.js +25 -0
  575. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -0
  576. package/lib/module/skia/web/JsiSkTypeface.js +18 -0
  577. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -0
  578. package/lib/module/skia/web/JsiSkTypefaceFactory.js +19 -0
  579. package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -0
  580. package/lib/module/skia/web/JsiSkVertices.js +17 -0
  581. package/lib/module/skia/web/JsiSkVertices.js.map +1 -0
  582. package/lib/module/skia/web/JsiSkVerticesFactory.js +16 -0
  583. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -0
  584. package/lib/module/skia/web/JsiSkia.js +61 -0
  585. package/lib/module/skia/web/JsiSkia.js.map +1 -0
  586. package/lib/module/skia/web/index.js +1 -1
  587. package/lib/module/skia/web/index.js.map +1 -1
  588. package/lib/module/values/web/api.js +2 -2
  589. package/lib/module/values/web/api.js.map +1 -1
  590. package/lib/module/views/SkiaView.web.js +202 -0
  591. package/lib/module/views/SkiaView.web.js.map +1 -0
  592. package/lib/module/views/types.js.map +1 -1
  593. package/lib/module/views/useTouchHandler.js +64 -43
  594. package/lib/module/views/useTouchHandler.js.map +1 -1
  595. package/lib/module/web/index.js +8 -0
  596. package/lib/module/web/index.js.map +1 -0
  597. package/lib/typescript/src/animation/functions/index.d.ts +4 -2
  598. package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +17 -0
  599. package/lib/typescript/src/animation/functions/interpolateVector.d.ts +10 -0
  600. package/lib/typescript/src/index.d.ts +1 -0
  601. package/lib/typescript/src/renderer/Canvas.d.ts +3 -14
  602. package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -3
  603. package/lib/typescript/src/renderer/components/Blend.d.ts +1 -1
  604. package/lib/typescript/src/renderer/components/Group.d.ts +1 -1
  605. package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
  606. package/lib/typescript/src/renderer/components/Picture.d.ts +1 -1
  607. package/lib/typescript/src/renderer/components/colorFilters/BlendColor.d.ts +2 -2
  608. package/lib/typescript/src/renderer/components/colorFilters/Compose.d.ts +2 -2
  609. package/lib/typescript/src/renderer/components/image/BoxFit.d.ts +13 -3
  610. package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -1
  611. package/lib/typescript/src/renderer/components/image/ImageSVG.d.ts +1 -1
  612. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -2
  613. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +1 -1
  614. package/lib/typescript/src/renderer/components/imageFilters/DisplacementMap.d.ts +1 -1
  615. package/lib/typescript/src/renderer/components/imageFilters/InnerShadow.d.ts +2 -2
  616. package/lib/typescript/src/renderer/components/imageFilters/RuntimeShader.d.ts +2 -1
  617. package/lib/typescript/src/renderer/components/imageFilters/Shadow.d.ts +1 -1
  618. package/lib/typescript/src/renderer/components/imageFilters/getInput.d.ts +2 -1
  619. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +1 -1
  620. package/lib/typescript/src/renderer/components/pathEffects/Line2D.d.ts +1 -1
  621. package/lib/typescript/src/renderer/components/pathEffects/Path1D.d.ts +1 -1
  622. package/lib/typescript/src/renderer/components/pathEffects/Path2D.d.ts +1 -1
  623. package/lib/typescript/src/renderer/components/shaders/Color.d.ts +1 -1
  624. package/lib/typescript/src/renderer/components/shaders/Gradient.d.ts +4 -4
  625. package/lib/typescript/src/renderer/components/shaders/LinearGradient.d.ts +2 -1
  626. package/lib/typescript/src/renderer/components/shaders/RadialGradient.d.ts +2 -1
  627. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -8
  628. package/lib/typescript/src/renderer/components/shaders/SweepGradient.d.ts +2 -1
  629. package/lib/typescript/src/renderer/components/shaders/TwoPointConicalGradient.d.ts +2 -1
  630. package/lib/typescript/src/renderer/components/shapes/Box.d.ts +1 -1
  631. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +4 -1
  632. package/lib/typescript/src/renderer/components/shapes/DiffRect.d.ts +1 -1
  633. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +1 -1
  634. package/lib/typescript/src/renderer/components/shapes/Line.d.ts +2 -1
  635. package/lib/typescript/src/renderer/components/shapes/Patch.d.ts +3 -3
  636. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +1 -1
  637. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -2
  638. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -2
  639. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +1 -1
  640. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +1 -1
  641. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +1 -1
  642. package/lib/typescript/src/renderer/index.d.ts +1 -1
  643. package/lib/typescript/src/renderer/nodes/Declaration.d.ts +1 -1
  644. package/lib/typescript/src/renderer/nodes/Node.d.ts +1 -1
  645. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +0 -2
  646. package/lib/typescript/src/renderer/processors/Circles.d.ts +2 -2
  647. package/lib/typescript/src/renderer/processors/Clips.d.ts +2 -2
  648. package/lib/typescript/src/{skia/core → renderer/processors}/Color.d.ts +2 -2
  649. package/lib/typescript/src/renderer/processors/Font.d.ts +2 -2
  650. package/lib/typescript/src/renderer/processors/Paint.d.ts +3 -3
  651. package/lib/typescript/src/renderer/processors/Paths.d.ts +2 -2
  652. package/lib/typescript/src/renderer/processors/Radius.d.ts +2 -2
  653. package/lib/typescript/src/renderer/processors/Rects.d.ts +3 -14
  654. package/lib/typescript/src/renderer/processors/Transform.d.ts +3 -4
  655. package/lib/typescript/src/renderer/processors/index.d.ts +2 -1
  656. package/lib/typescript/src/renderer/processors/math/Coordinates.d.ts +1 -1
  657. package/lib/typescript/src/renderer/processors/math/Transforms.d.ts +1 -1
  658. package/lib/typescript/src/renderer/processors/math/index.d.ts +0 -2
  659. package/lib/typescript/src/renderer/useCanvas.d.ts +14 -0
  660. package/lib/typescript/src/skia/Skia.web.d.ts +1 -0
  661. package/lib/typescript/src/skia/core/Data.d.ts +4 -4
  662. package/lib/typescript/src/skia/core/Matrix.d.ts +2 -0
  663. package/lib/typescript/src/skia/core/Paint.d.ts +0 -1
  664. package/lib/typescript/src/skia/core/RRect.d.ts +2 -0
  665. package/lib/typescript/src/skia/core/Rect.d.ts +8 -0
  666. package/lib/typescript/src/skia/core/Vector.d.ts +12 -0
  667. package/lib/typescript/src/skia/core/index.d.ts +5 -3
  668. package/lib/typescript/src/skia/types/ContourMeasure.d.ts +2 -4
  669. package/lib/typescript/src/skia/types/Data/Data.d.ts +1 -1
  670. package/lib/typescript/src/skia/types/Data/DataFactory.d.ts +4 -4
  671. package/lib/typescript/src/skia/types/FontMgr/FontMgr.d.ts +1 -1
  672. package/lib/typescript/src/skia/types/FontMgr/FontMgrFactory.d.ts +2 -2
  673. package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +3 -3
  674. package/lib/typescript/src/skia/types/Matrix.d.ts +15 -14
  675. package/lib/typescript/src/skia/types/Path/Path.d.ts +29 -23
  676. package/lib/typescript/src/skia/types/Path/PathFactory.d.ts +5 -0
  677. package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -2
  678. package/lib/typescript/src/skia/types/Point.d.ts +1 -0
  679. package/lib/typescript/src/skia/types/RRect.d.ts +1 -0
  680. package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +3 -2
  681. package/lib/typescript/src/skia/types/SVG/SVGFactory.d.ts +2 -2
  682. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +8 -0
  683. package/lib/typescript/src/skia/types/Skia.d.ts +1 -1
  684. package/lib/typescript/src/skia/types/Typeface/TypefaceFactory.d.ts +2 -2
  685. package/lib/typescript/src/skia/web/{api/Host.d.ts → Host.d.ts} +4 -1
  686. package/lib/typescript/src/skia/web/JsiImageFilterFactory.d.ts +19 -0
  687. package/lib/typescript/src/skia/web/{api/JsiSkCanvas.d.ts → JsiSkCanvas.d.ts} +1 -1
  688. package/lib/typescript/src/skia/web/JsiSkColor.d.ts +2 -0
  689. package/lib/typescript/src/skia/web/{api/JsiSkColorFilter.d.ts → JsiSkColorFilter.d.ts} +1 -1
  690. package/lib/typescript/src/skia/web/JsiSkColorFilterFactory.d.ts +14 -0
  691. package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +16 -0
  692. package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +8 -0
  693. package/lib/typescript/src/skia/web/JsiSkData.d.ts +8 -0
  694. package/lib/typescript/src/skia/web/JsiSkDataFactory.d.ts +19 -0
  695. package/lib/typescript/src/skia/web/JsiSkFont.d.ts +33 -0
  696. package/lib/typescript/src/skia/web/JsiSkFontMgr.d.ts +9 -0
  697. package/lib/typescript/src/skia/web/JsiSkFontMgrFactory.d.ts +8 -0
  698. package/lib/typescript/src/skia/web/{api/JsiSkImage.d.ts → JsiSkImage.d.ts} +1 -1
  699. package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +10 -0
  700. package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +6 -0
  701. package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +6 -0
  702. package/lib/typescript/src/skia/web/JsiSkMaskFilterFactory.d.ts +9 -0
  703. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +11 -0
  704. package/lib/typescript/src/skia/web/{api/JsiSkPaint.d.ts → JsiSkPaint.d.ts} +1 -1
  705. package/lib/typescript/src/skia/web/JsiSkPath.d.ts +56 -0
  706. package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +6 -0
  707. package/lib/typescript/src/skia/web/JsiSkPathEffectFactory.d.ts +15 -0
  708. package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +13 -0
  709. package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +9 -0
  710. package/lib/typescript/src/skia/web/JsiSkPictureFactory.d.ts +8 -0
  711. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +11 -0
  712. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +8 -0
  713. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +10 -0
  714. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -0
  715. package/lib/typescript/src/skia/web/{api/JsiSkRect.d.ts → JsiSkRect.d.ts} +2 -1
  716. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +14 -0
  717. package/lib/typescript/src/skia/web/JsiSkRuntimeEffectFactory.d.ts +8 -0
  718. package/lib/typescript/src/skia/web/JsiSkSVGFactory.d.ts +9 -0
  719. package/lib/typescript/src/skia/web/JsiSkShader.d.ts +6 -0
  720. package/lib/typescript/src/skia/web/JsiSkShaderFactory.d.ts +16 -0
  721. package/lib/typescript/src/skia/web/{api/JsiSkSurface.d.ts → JsiSkSurface.d.ts} +1 -1
  722. package/lib/typescript/src/skia/web/{api/JsiSkSurfaceFactory.d.ts → JsiSkSurfaceFactory.d.ts} +1 -1
  723. package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +6 -0
  724. package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +12 -0
  725. package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +8 -0
  726. package/lib/typescript/src/skia/web/JsiSkTypefaceFactory.d.ts +8 -0
  727. package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +9 -0
  728. package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +4 -0
  729. package/lib/typescript/src/skia/web/JsiSkia.d.ts +3 -0
  730. package/lib/typescript/src/skia/web/index.d.ts +1 -1
  731. package/lib/typescript/src/views/SkiaView.web.d.ts +56 -0
  732. package/lib/typescript/src/views/types.d.ts +1 -0
  733. package/lib/typescript/src/views/useTouchHandler.d.ts +11 -1
  734. package/lib/typescript/src/web/index.d.ts +5 -0
  735. package/package.json +4 -5
  736. package/src/animation/functions/index.ts +4 -2
  737. package/src/animation/functions/interpolatePaths.ts +38 -0
  738. package/src/animation/functions/interpolateVector.ts +26 -0
  739. package/src/index.ts +1 -0
  740. package/src/renderer/Canvas.tsx +13 -35
  741. package/src/renderer/DrawingContext.ts +3 -4
  742. package/src/renderer/HostConfig.ts +2 -2
  743. package/src/renderer/components/Blend.tsx +12 -10
  744. package/src/renderer/components/Compose.tsx +2 -2
  745. package/src/renderer/components/Group.tsx +11 -6
  746. package/src/renderer/components/Mask.tsx +5 -3
  747. package/src/renderer/components/Paint.tsx +5 -4
  748. package/src/renderer/components/Picture.tsx +1 -1
  749. package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
  750. package/src/renderer/components/colorFilters/BlendColor.tsx +4 -4
  751. package/src/renderer/components/colorFilters/Compose.ts +3 -2
  752. package/src/renderer/components/colorFilters/Lerp.tsx +3 -2
  753. package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx +2 -3
  754. package/src/renderer/components/colorFilters/LumaColorFilter.tsx +2 -3
  755. package/src/renderer/components/colorFilters/Matrix.tsx +2 -3
  756. package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx +2 -3
  757. package/src/renderer/components/image/BoxFit.ts +7 -13
  758. package/src/renderer/components/image/Image.tsx +3 -3
  759. package/src/renderer/components/image/ImageSVG.tsx +3 -3
  760. package/src/renderer/components/image/ImageShader.tsx +8 -7
  761. package/src/renderer/components/imageFilters/Blur.tsx +12 -10
  762. package/src/renderer/components/imageFilters/DisplacementMap.tsx +4 -4
  763. package/src/renderer/components/imageFilters/InnerShadow.tsx +4 -3
  764. package/src/renderer/components/imageFilters/Morphology.tsx +3 -4
  765. package/src/renderer/components/imageFilters/Offset.tsx +5 -4
  766. package/src/renderer/components/imageFilters/RuntimeShader.tsx +12 -4
  767. package/src/renderer/components/imageFilters/Shadow.tsx +10 -6
  768. package/src/renderer/components/imageFilters/getInput.ts +3 -2
  769. package/src/renderer/components/maskFilters/Blur.tsx +2 -2
  770. package/src/renderer/components/pathEffects/Corner.tsx +2 -2
  771. package/src/renderer/components/pathEffects/Dash.tsx +2 -2
  772. package/src/renderer/components/pathEffects/Discrete.tsx +2 -2
  773. package/src/renderer/components/pathEffects/Line2D.tsx +3 -3
  774. package/src/renderer/components/pathEffects/Path1D.tsx +3 -3
  775. package/src/renderer/components/pathEffects/Path2D.tsx +4 -4
  776. package/src/renderer/components/pathEffects/Sum.tsx +7 -5
  777. package/src/renderer/components/shaders/Color.tsx +7 -5
  778. package/src/renderer/components/shaders/FractalNoise.tsx +1 -2
  779. package/src/renderer/components/shaders/Gradient.ts +7 -10
  780. package/src/renderer/components/shaders/LinearGradient.tsx +4 -4
  781. package/src/renderer/components/shaders/RadialGradient.tsx +4 -4
  782. package/src/renderer/components/shaders/Shader.tsx +6 -56
  783. package/src/renderer/components/shaders/SweepGradient.tsx +4 -4
  784. package/src/renderer/components/shaders/Turbulence.tsx +1 -2
  785. package/src/renderer/components/shaders/TwoPointConicalGradient.tsx +4 -4
  786. package/src/renderer/components/shapes/Box.tsx +36 -17
  787. package/src/renderer/components/shapes/Circle.tsx +3 -4
  788. package/src/renderer/components/shapes/DiffRect.tsx +1 -1
  789. package/src/renderer/components/shapes/FitBox.tsx +1 -1
  790. package/src/renderer/components/shapes/Line.tsx +2 -1
  791. package/src/renderer/components/shapes/Oval.tsx +6 -4
  792. package/src/renderer/components/shapes/Patch.tsx +6 -10
  793. package/src/renderer/components/shapes/Path.tsx +3 -3
  794. package/src/renderer/components/shapes/Points.tsx +2 -2
  795. package/src/renderer/components/shapes/Rect.tsx +6 -4
  796. package/src/renderer/components/shapes/RoundedRect.tsx +2 -2
  797. package/src/renderer/components/shapes/Vertices.tsx +5 -4
  798. package/src/renderer/components/text/Glyphs.tsx +6 -3
  799. package/src/renderer/components/text/Text.tsx +2 -2
  800. package/src/renderer/components/text/TextBlob.tsx +1 -1
  801. package/src/renderer/components/text/TextPath.tsx +3 -4
  802. package/src/renderer/index.ts +1 -1
  803. package/src/renderer/nodes/Declaration.tsx +1 -1
  804. package/src/renderer/nodes/Drawing.tsx +3 -2
  805. package/src/renderer/nodes/Node.ts +1 -1
  806. package/src/renderer/processors/Animations/Animations.ts +0 -3
  807. package/src/renderer/processors/Circles.ts +4 -4
  808. package/src/renderer/processors/Clips.ts +9 -4
  809. package/src/{skia/core → renderer/processors}/Color.ts +2 -3
  810. package/src/renderer/processors/Font.ts +10 -3
  811. package/src/renderer/processors/Paint.ts +12 -7
  812. package/src/renderer/processors/Paths.ts +3 -3
  813. package/src/renderer/processors/Radius.ts +3 -4
  814. package/src/renderer/processors/Rects.ts +10 -45
  815. package/src/renderer/processors/Transform.ts +28 -19
  816. package/src/renderer/processors/index.ts +2 -1
  817. package/src/renderer/processors/math/Coordinates.ts +1 -1
  818. package/src/renderer/processors/math/Transforms.ts +2 -1
  819. package/src/renderer/processors/math/index.ts +0 -2
  820. package/src/renderer/useCanvas.ts +21 -0
  821. package/src/skia/NativeSetup.ts +2 -2
  822. package/src/skia/Skia.web.ts +3 -0
  823. package/src/skia/core/Data.ts +17 -14
  824. package/src/skia/core/Font.ts +2 -4
  825. package/src/skia/core/Matrix.ts +6 -0
  826. package/src/skia/core/Paint.ts +2 -6
  827. package/src/skia/core/Path.ts +14 -6
  828. package/src/skia/core/RRect.tsx +5 -0
  829. package/src/skia/core/Rect.ts +33 -0
  830. package/src/skia/core/Vector.ts +11 -0
  831. package/src/skia/core/index.ts +5 -3
  832. package/src/skia/types/ContourMeasure.tsx +2 -4
  833. package/src/skia/types/Data/Data.ts +1 -1
  834. package/src/skia/types/Data/DataFactory.ts +4 -4
  835. package/src/skia/types/FontMgr/FontMgr.ts +1 -1
  836. package/src/skia/types/FontMgr/FontMgrFactory.ts +2 -2
  837. package/src/skia/types/Image/ImageFactory.ts +3 -3
  838. package/src/skia/types/Matrix.ts +79 -14
  839. package/src/skia/types/Path/Path.ts +34 -23
  840. package/src/skia/types/Path/PathFactory.ts +7 -0
  841. package/src/skia/types/Picture/Picture.ts +2 -2
  842. package/src/skia/types/Point.ts +2 -0
  843. package/src/skia/types/RRect.ts +5 -0
  844. package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +4 -2
  845. package/src/skia/types/SVG/SVGFactory.ts +2 -2
  846. package/src/skia/types/Shader/Shader.ts +61 -0
  847. package/src/skia/types/Skia.ts +1 -1
  848. package/src/skia/types/Typeface/TypefaceFactory.ts +2 -2
  849. package/src/skia/web/{api/Host.ts → Host.ts} +7 -1
  850. package/src/skia/web/JsiImageFilterFactory.ts +144 -0
  851. package/src/skia/web/{api/JsiSkCanvas.ts → JsiSkCanvas.ts} +19 -11
  852. package/src/skia/web/{api/JsiSkColor.ts → JsiSkColor.ts} +152 -6
  853. package/src/skia/web/{api/JsiSkColorFilter.ts → JsiSkColorFilter.ts} +1 -1
  854. package/src/skia/web/JsiSkColorFilterFactory.ts +67 -0
  855. package/src/skia/web/JsiSkContourMeasure.ts +35 -0
  856. package/src/skia/web/JsiSkContourMeasureIter.ts +23 -0
  857. package/src/skia/web/JsiSkData.ts +13 -0
  858. package/src/skia/web/JsiSkDataFactory.ts +35 -0
  859. package/src/skia/web/JsiSkFont.ts +124 -0
  860. package/src/skia/web/JsiSkFontMgr.ts +42 -0
  861. package/src/skia/web/JsiSkFontMgrFactory.ts +18 -0
  862. package/src/skia/web/{api/JsiSkImage.ts → JsiSkImage.ts} +1 -1
  863. package/src/skia/web/JsiSkImageFactory.ts +40 -0
  864. package/src/skia/web/JsiSkImageFilter.ts +14 -0
  865. package/src/skia/web/JsiSkMaskFilter.ts +14 -0
  866. package/src/skia/web/JsiSkMaskFilterFactory.ts +20 -0
  867. package/src/skia/web/JsiSkMatrix.ts +54 -0
  868. package/src/skia/web/{api/JsiSkPaint.ts → JsiSkPaint.ts} +6 -5
  869. package/src/skia/web/JsiSkPath.ts +369 -0
  870. package/src/skia/web/JsiSkPathEffect.ts +14 -0
  871. package/src/skia/web/JsiSkPathEffectFactory.ts +85 -0
  872. package/src/skia/web/JsiSkPathFactory.ts +54 -0
  873. package/src/skia/web/JsiSkPicture.ts +45 -0
  874. package/src/skia/web/JsiSkPictureFactory.ts +20 -0
  875. package/src/skia/web/JsiSkPictureRecorder.ts +31 -0
  876. package/src/skia/web/JsiSkPoint.ts +19 -0
  877. package/src/skia/web/JsiSkRRect.ts +27 -0
  878. package/src/skia/web/JsiSkRSXform.ts +16 -0
  879. package/src/skia/web/{api/JsiSkRect.ts → JsiSkRect.ts} +11 -1
  880. package/src/skia/web/JsiSkRuntimeEffect.ts +57 -0
  881. package/src/skia/web/JsiSkRuntimeEffectFactory.ts +23 -0
  882. package/src/skia/web/JsiSkSVGFactory.ts +20 -0
  883. package/src/skia/web/JsiSkShader.ts +14 -0
  884. package/src/skia/web/JsiSkShaderFactory.ts +178 -0
  885. package/src/skia/web/{api/JsiSkSurface.ts → JsiSkSurface.ts} +1 -1
  886. package/src/skia/web/{api/JsiSkSurfaceFactory.ts → JsiSkSurfaceFactory.ts} +1 -1
  887. package/src/skia/web/JsiSkTextBlob.ts +14 -0
  888. package/src/skia/web/JsiSkTextBlobFactory.ts +49 -0
  889. package/src/skia/web/JsiSkTypeface.ts +28 -0
  890. package/src/skia/web/JsiSkTypefaceFactory.tsx +20 -0
  891. package/src/skia/web/JsiSkVertices.ts +23 -0
  892. package/src/skia/web/JsiSkVerticesFactory.ts +27 -0
  893. package/src/skia/web/JsiSkia.ts +98 -0
  894. package/src/skia/web/index.ts +1 -1
  895. package/src/values/web/api.ts +2 -2
  896. package/src/views/SkiaView.web.tsx +192 -0
  897. package/src/views/types.ts +1 -0
  898. package/src/views/useTouchHandler.ts +82 -51
  899. package/src/web/index.ts +13 -0
  900. package/lib/commonjs/renderer/processors/math/Matrix3.js +0 -66
  901. package/lib/commonjs/renderer/processors/math/Matrix3.js.map +0 -1
  902. package/lib/commonjs/renderer/processors/math/Vector.js +0 -60
  903. package/lib/commonjs/renderer/processors/math/Vector.js.map +0 -1
  904. package/lib/commonjs/skia/core/Color.js.map +0 -1
  905. package/lib/commonjs/skia/core/Shader.js +0 -18
  906. package/lib/commonjs/skia/core/Shader.js.map +0 -1
  907. package/lib/commonjs/skia/web/api/Host.js.map +0 -1
  908. package/lib/commonjs/skia/web/api/JsiSkCanvas.js.map +0 -1
  909. package/lib/commonjs/skia/web/api/JsiSkColor.js.map +0 -1
  910. package/lib/commonjs/skia/web/api/JsiSkPaint.js.map +0 -1
  911. package/lib/commonjs/skia/web/api/JsiSkRect.js.map +0 -1
  912. package/lib/commonjs/skia/web/api/index.js +0 -26
  913. package/lib/commonjs/skia/web/api/index.js.map +0 -1
  914. package/lib/module/renderer/processors/math/Matrix3.js +0 -55
  915. package/lib/module/renderer/processors/math/Matrix3.js.map +0 -1
  916. package/lib/module/renderer/processors/math/Vector.js.map +0 -1
  917. package/lib/module/skia/core/Color.js.map +0 -1
  918. package/lib/module/skia/core/Shader.js +0 -7
  919. package/lib/module/skia/core/Shader.js.map +0 -1
  920. package/lib/module/skia/web/api/Host.js.map +0 -1
  921. package/lib/module/skia/web/api/JsiSkCanvas.js.map +0 -1
  922. package/lib/module/skia/web/api/JsiSkColor.js.map +0 -1
  923. package/lib/module/skia/web/api/JsiSkPaint.js.map +0 -1
  924. package/lib/module/skia/web/api/JsiSkRect.js.map +0 -1
  925. package/lib/module/skia/web/api/index.js +0 -13
  926. package/lib/module/skia/web/api/index.js.map +0 -1
  927. package/lib/typescript/src/renderer/processors/math/Matrix3.d.ts +0 -10
  928. package/lib/typescript/src/renderer/processors/math/Vector.d.ts +0 -23
  929. package/lib/typescript/src/skia/core/Shader.d.ts +0 -1
  930. package/lib/typescript/src/skia/web/api/JsiSkColor.d.ts +0 -3
  931. package/lib/typescript/src/skia/web/api/index.d.ts +0 -10
  932. package/src/animation/timing/functions/__tests__/timing.spec.ts +0 -29
  933. package/src/renderer/processors/math/Matrix3.ts +0 -73
  934. package/src/renderer/processors/math/Vector.ts +0 -38
  935. package/src/skia/__tests__/Rects.spec.ts +0 -40
  936. package/src/skia/__tests__/snapshots/lightblue-rect.png +0 -0
  937. package/src/skia/core/Shader.ts +0 -9
  938. package/src/skia/web/api/index.ts +0 -15
  939. package/src/values/web/__tests__/RNSkAnimation.spec.ts +0 -21
  940. package/src/values/web/__tests__/RNSkDerivedValue.spec.ts +0 -15
  941. package/src/values/web/__tests__/RNSkReadonlyValue.spec.ts +0 -8
  942. package/src/values/web/__tests__/RNSkValue.spec.ts +0 -11
package/README.md CHANGED
@@ -31,6 +31,14 @@ If the NDK is not installed, you can install it via Android Studio by going to t
31
31
 
32
32
  And then the _SDK Location_ section. It will show you the NDK path, or the option to download it if you don't have it installed.
33
33
 
34
+ ### Proguard
35
+
36
+ If you're using Proguard, make sure to add the following rule:
37
+
38
+ ```
39
+ -keep class com.shopify.reactnative.skia.** { *; }
40
+ ```
41
+
34
42
  ## Playground
35
43
 
36
44
  We have an example project you can play with [here](https://github.com/Shopify/react-native-skia/tree/main/example).
@@ -76,14 +76,15 @@ namespace RNSkia
76
76
  std::vector<RNSkia::RNSkTouchPoint> points;
77
77
  auto pin = touches.pin();
78
78
  auto scale = _drawView->getPixelDensity();
79
- points.reserve(pin.size() / 4);
80
- for (size_t i = 0; i < pin.size(); i += 4)
79
+ points.reserve(pin.size() / 5);
80
+ for (size_t i = 0; i < pin.size(); i += 5)
81
81
  {
82
82
  RNSkTouchPoint point;
83
83
  point.x = pin[i] / scale;
84
84
  point.y = pin[i + 1] / scale;
85
85
  point.force = pin[i + 2];
86
86
  point.type = (RNSkia::RNSkTouchType)pin[i + 3];
87
+ point.id = pin[i + 4];
87
88
  points.push_back(point);
88
89
  }
89
90
  _drawView->updateTouchState(std::move(points));
@@ -59,7 +59,7 @@ public class SkiaDrawView extends TextureView implements TextureView.SurfaceText
59
59
  int action = ev.getAction();
60
60
  int count = ev.getPointerCount();
61
61
  MotionEvent.PointerCoords r = new MotionEvent.PointerCoords();
62
- double[] points = new double[count*4];
62
+ double[] points = new double[count*5];
63
63
  for (int i = 0; i < count; i++) {
64
64
  ev.getPointerCoords(i, r);
65
65
  points[i] = r.x;
@@ -81,6 +81,7 @@ public class SkiaDrawView extends TextureView implements TextureView.SurfaceText
81
81
  points[i+3] = 3;
82
82
  break;
83
83
  }
84
+ points[i+4] = ev.getPointerId(i);
84
85
  }
85
86
  updateTouchPoints(points);
86
87
  return true;
@@ -456,7 +456,7 @@ public:
456
456
  }
457
457
 
458
458
  JSI_HOST_FUNCTION(drawColor) {
459
- SkColor cl = arguments[0].asNumber();
459
+ SkColor cl = JsiSkColor::fromValue(runtime, arguments[0]);
460
460
  if (count == 1) {
461
461
  _canvas->drawColor(cl);
462
462
  } else {
@@ -467,7 +467,7 @@ public:
467
467
  }
468
468
 
469
469
  JSI_HOST_FUNCTION(clear) {
470
- SkColor cl = arguments[0].asNumber();
470
+ SkColor cl = JsiSkColor::fromValue(runtime, arguments[0]);
471
471
  _canvas->clear(cl);
472
472
  return jsi::Value::undefined();
473
473
  }
@@ -18,6 +18,7 @@ namespace RNSkia {
18
18
 
19
19
  using namespace facebook;
20
20
 
21
+
21
22
  class JsiSkMatrix : public JsiSkWrappingSharedPtrHostObject<SkMatrix> {
22
23
  public:
23
24
 
@@ -26,45 +27,64 @@ public:
26
27
  context, std::make_shared<SkMatrix>(std::move(m))) {}
27
28
 
28
29
 
29
- JSI_HOST_FUNCTION(preConcat) {
30
+ static SkMatrix getMatrix(jsi::Runtime &runtime, const jsi::Value& value) {
31
+ const auto& object = value.asObject(runtime);
32
+ const auto& array = object.asArray(runtime);
33
+ auto scaleX = array.getValueAtIndex(runtime, 0).asNumber();
34
+ auto skewX = array.getValueAtIndex(runtime, 1).asNumber();
35
+ auto transX = array.getValueAtIndex(runtime, 2).asNumber();
36
+ auto skewY = array.getValueAtIndex(runtime, 3).asNumber();
37
+ auto scaleY = array.getValueAtIndex(runtime, 4).asNumber();
38
+ auto transY = array.getValueAtIndex(runtime, 5).asNumber();
39
+ auto pers0 = array.getValueAtIndex(runtime, 6).asNumber();
40
+ auto pers1 = array.getValueAtIndex(runtime, 7).asNumber();
41
+ auto pers2 = array.getValueAtIndex(runtime, 8).asNumber();
42
+ return SkMatrix::MakeAll(
43
+ scaleX, skewX, transX,
44
+ skewY, scaleY, transY,
45
+ pers0, pers1, pers2
46
+ );
47
+ }
48
+
49
+ JSI_HOST_FUNCTION(concat) {
30
50
  auto m3 = JsiSkMatrix::fromValue(runtime, arguments[0]);
31
51
  getObject()->preConcat(*m3);
32
52
  return jsi::Value::undefined();
33
53
  }
34
54
 
35
- JSI_HOST_FUNCTION(preTranslate) {
55
+ JSI_HOST_FUNCTION(translate) {
36
56
  auto x = arguments[0].asNumber();
37
57
  auto y = arguments[1].asNumber();
38
58
  getObject()->preTranslate(x, y);
39
59
  return jsi::Value::undefined();
40
60
  }
41
61
 
42
- JSI_HOST_FUNCTION(preScale) {
62
+ JSI_HOST_FUNCTION(scale) {
43
63
  auto x = arguments[0].asNumber();
44
- auto y = arguments[1].asNumber();
64
+ auto y = count > 1 ? arguments[1].asNumber() : 1;
45
65
  getObject()->preScale(x, y);
46
66
  return jsi::Value::undefined();
47
67
  }
48
68
 
49
- JSI_HOST_FUNCTION(preSkew) {
69
+ JSI_HOST_FUNCTION(skew) {
50
70
  auto x = arguments[0].asNumber();
51
71
  auto y = arguments[1].asNumber();
52
72
  getObject()->preSkew(x, y);
53
73
  return jsi::Value::undefined();
54
74
  }
55
75
 
56
- JSI_HOST_FUNCTION(preRotate) {
76
+ JSI_HOST_FUNCTION(rotate) {
57
77
  auto a = arguments[0].asNumber();
58
- getObject()->preRotate(a);
78
+ getObject()->preRotate(SkRadiansToDegrees(a));
59
79
  return jsi::Value::undefined();
60
80
  }
61
81
 
62
82
  JSI_EXPORT_FUNCTIONS(
63
- JSI_EXPORT_FUNC(JsiSkMatrix, preConcat),
64
- JSI_EXPORT_FUNC(JsiSkMatrix, preTranslate),
65
- JSI_EXPORT_FUNC(JsiSkMatrix, preScale),
66
- JSI_EXPORT_FUNC(JsiSkMatrix, preSkew),
67
- JSI_EXPORT_FUNC(JsiSkMatrix, preRotate),
83
+ JSI_EXPORT_FUNC(JsiSkMatrix, concat),
84
+ JSI_EXPORT_FUNC(JsiSkMatrix, translate),
85
+ JSI_EXPORT_FUNC(JsiSkMatrix, scale),
86
+ JSI_EXPORT_FUNC(JsiSkMatrix, skew),
87
+ JSI_EXPORT_FUNC(JsiSkMatrix, rotate),
68
88
  )
69
89
 
70
90
  /**
@@ -78,28 +98,21 @@ public:
78
98
  .asHostObject<JsiSkMatrix>(runtime)
79
99
  ->getObject();
80
100
  } else {
81
- const auto& array = object.asArray(runtime);
82
- auto scaleX = array.getValueAtIndex(runtime, 0).asNumber();
83
- auto skewX = array.getValueAtIndex(runtime, 1).asNumber();
84
- auto transX = array.getValueAtIndex(runtime, 2).asNumber();
85
- auto skewY = array.getValueAtIndex(runtime, 3).asNumber();
86
- auto scaleY = array.getValueAtIndex(runtime, 4).asNumber();
87
- auto transY = array.getValueAtIndex(runtime, 5).asNumber();
88
- auto pers0 = array.getValueAtIndex(runtime, 6).asNumber();
89
- auto pers1 = array.getValueAtIndex(runtime, 7).asNumber();
90
- auto pers2 = array.getValueAtIndex(runtime, 8).asNumber();
91
- return std::make_shared<SkMatrix>(SkMatrix::MakeAll(
92
- scaleX, skewX, transX,
93
- skewY, scaleY, transY,
94
- pers0, pers1, pers2));
101
+ return std::make_shared<SkMatrix>(JsiSkMatrix::getMatrix(runtime, obj));
95
102
  }
96
103
  }
97
104
 
98
105
  static const jsi::HostFunctionType
99
106
  createCtor(std::shared_ptr<RNSkPlatformContext> context) {
100
107
  return JSI_HOST_FUNCTION_LAMBDA {
108
+ SkMatrix matrix;
109
+ if (count == 1) {
110
+ matrix = JsiSkMatrix::getMatrix(runtime, arguments[0]);
111
+ } else {
112
+ matrix = SkMatrix::I();
113
+ }
101
114
  return jsi::Object::createFromHostObject(
102
- runtime, std::make_shared<JsiSkMatrix>(std::move(context), SkMatrix::I()));
115
+ runtime, std::make_shared<JsiSkMatrix>(std::move(context), matrix));
103
116
  };
104
117
  }
105
118
  };
@@ -215,9 +215,11 @@ Returns the underlying object from a host object of this type
215
215
  static const jsi::HostFunctionType
216
216
  createCtor(std::shared_ptr<RNSkPlatformContext> context) {
217
217
  return JSI_HOST_FUNCTION_LAMBDA {
218
+ auto paint = SkPaint();
219
+ paint.setAntiAlias(true);
218
220
  // Return the newly constructed object
219
221
  return jsi::Object::createFromHostObject(
220
- runtime, std::make_shared<JsiSkPaint>(std::move(context), SkPaint()));
222
+ runtime, std::make_shared<JsiSkPaint>(std::move(context), paint));
221
223
  };
222
224
  }
223
225
  };
@@ -31,18 +31,19 @@ using namespace facebook;
31
31
 
32
32
 
33
33
  class JsiSkPath : public JsiSkWrappingSharedPtrHostObject<SkPath> {
34
+
34
35
  public:
35
- // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
36
- JSI_PROPERTY_GET(__typename__) {
37
- return jsi::String::createFromUtf8(runtime, "Path");
38
- }
36
+ // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
37
+ JSI_PROPERTY_GET(__typename__) {
38
+ return jsi::String::createFromUtf8(runtime, "Path");
39
+ }
39
40
 
40
- JSI_HOST_FUNCTION(addArc) {
41
+ JSI_HOST_FUNCTION(addArc) {
41
42
  auto rect = JsiSkRect::fromValue(runtime, arguments[0]).get();
42
43
  auto start = arguments[1].asNumber();
43
44
  auto sweep = arguments[2].asNumber();
44
45
  getObject()->addArc(*rect, start, sweep);
45
- return jsi::Value::undefined();
46
+ return thisValue.getObject(runtime);
46
47
  }
47
48
 
48
49
  JSI_HOST_FUNCTION(addOval) {
@@ -52,8 +53,8 @@ public:
52
53
  direction = SkPathDirection::kCCW;
53
54
  }
54
55
  unsigned startIndex = count < 3 ? 0 : arguments[2].asNumber();
55
- getObject()->addOval(*rect, direction, startIndex);
56
- return jsi::Value::undefined();
56
+ auto result = getObject()->addOval(*rect, direction, startIndex);
57
+ return thisValue.getObject(runtime);
57
58
  }
58
59
 
59
60
  JSI_HOST_FUNCTION(addPoly) {
@@ -68,7 +69,7 @@ public:
68
69
  points.push_back(*point.get());
69
70
  }
70
71
  getObject()->addPoly(points.data(), (int)points.size(), close);
71
- return jsi::Value::undefined();
72
+ return thisValue.getObject(runtime);
72
73
  }
73
74
 
74
75
  JSI_HOST_FUNCTION(addRect) {
@@ -88,7 +89,7 @@ public:
88
89
  direction = SkPathDirection::kCCW;
89
90
  }
90
91
  getObject()->addRRect(*rrect, direction);
91
- return jsi::Value::undefined();
92
+ return thisValue.getObject(runtime);
92
93
  }
93
94
 
94
95
  JSI_HOST_FUNCTION(arcToOval) {
@@ -97,7 +98,7 @@ public:
97
98
  auto sweep = arguments[2].asNumber();
98
99
  auto forceMoveTo = arguments[3].getBool();
99
100
  getObject()->arcTo(*rect, start, sweep, forceMoveTo);
100
- return jsi::Value::undefined();
101
+ return thisValue.getObject(runtime);
101
102
  }
102
103
 
103
104
  JSI_HOST_FUNCTION(arcToRotated) {
@@ -112,7 +113,7 @@ public:
112
113
  auto x = arguments[5].asNumber();
113
114
  auto y = arguments[6].asNumber();
114
115
  getObject()->arcTo(rx, ry, xAxisRotate, arcSize, sweep, x, y);
115
- return jsi::Value::undefined();
116
+ return thisValue.getObject(runtime);
116
117
  }
117
118
 
118
119
  JSI_HOST_FUNCTION(rArcTo) {
@@ -127,7 +128,7 @@ public:
127
128
  auto x = arguments[5].asNumber();
128
129
  auto y = arguments[6].asNumber();
129
130
  getObject()->rArcTo(rx, ry, xAxisRotate, arcSize, sweep, x, y);
130
- return jsi::Value::undefined();
131
+ return thisValue.getObject(runtime);
131
132
  }
132
133
 
133
134
  JSI_HOST_FUNCTION(arcToTangent) {
@@ -137,7 +138,7 @@ public:
137
138
  auto y2 = arguments[3].asNumber();
138
139
  auto r = arguments[4].asNumber();
139
140
  getObject()->arcTo(x1, y1, x2, y2, r);
140
- return jsi::Value::undefined();
141
+ return thisValue.getObject(runtime);
141
142
  }
142
143
 
143
144
  JSI_HOST_FUNCTION(computeTightBounds) {
@@ -160,7 +161,7 @@ public:
160
161
  auto y2 = arguments[3].asNumber();
161
162
  auto w = arguments[4].asNumber();
162
163
  getObject()->conicTo(x1, y1, x2, y2, w);
163
- return jsi::Value::undefined();
164
+ return thisValue.getObject(runtime);
164
165
  }
165
166
 
166
167
  JSI_HOST_FUNCTION(rConicTo) {
@@ -170,7 +171,7 @@ public:
170
171
  auto y2 = arguments[3].asNumber();
171
172
  auto w = arguments[4].asNumber();
172
173
  getObject()->rConicTo(x1, y1, x2, y2, w);
173
- return jsi::Value::undefined();
174
+ return thisValue.getObject(runtime);
174
175
  }
175
176
 
176
177
  JSI_HOST_FUNCTION(contains) {
@@ -270,7 +271,7 @@ public:
270
271
  auto precision = jsiPrecision.isUndefined() ? 1 : jsiPrecision.asNumber();
271
272
  auto result = p.getFillPath(path, &path, nullptr, precision);
272
273
  getObject()->swap(path);
273
- return jsi::Value(result);
274
+ return result ? thisValue.getObject(runtime) : jsi::Value::null();
274
275
  }
275
276
 
276
277
  JSI_HOST_FUNCTION(trim) {
@@ -284,15 +285,15 @@ public:
284
285
  if (!pe) {
285
286
  // SkDebugf("Invalid args to trim(): startT and stopT must be in
286
287
  // [0,1]\n");
287
- return jsi::Value(false);
288
+ return jsi::Value::null();
288
289
  }
289
290
  SkStrokeRec rec(SkStrokeRec::InitStyle::kHairline_InitStyle);
290
291
  if (pe->filterPath(&path, path, &rec, nullptr)) {
291
292
  getObject()->swap(path);
292
- return jsi::Value(true);
293
+ return thisValue.getObject(runtime);
293
294
  }
294
295
  SkDebugf("Could not trim path\n");
295
- return jsi::Value(false);
296
+ return jsi::Value::null();
296
297
  }
297
298
 
298
299
  JSI_HOST_FUNCTION(getPoint) {
@@ -312,8 +313,8 @@ public:
312
313
  JSI_HOST_FUNCTION(makeAsWinding) {
313
314
  SkPath out;
314
315
  if (AsWinding(*getObject(), &out)) {
315
- return jsi::Object::createFromHostObject(
316
- runtime, std::make_shared<JsiSkPath>(getContext(), std::move(out)));
316
+ getObject()->swap(out);
317
+ return thisValue.getObject(runtime);
317
318
  }
318
319
  return jsi::Value::null();
319
320
  }
@@ -324,34 +325,34 @@ public:
324
325
  SkScalar dx = arguments[0].asNumber();
325
326
  SkScalar dy = arguments[1].asNumber();
326
327
  getObject()->offset(dx, dy);
327
- return jsi::Value::undefined();
328
+ return thisValue.getObject(runtime);
328
329
  }
329
330
 
330
331
  JSI_HOST_FUNCTION(moveTo) {
331
332
  SkScalar x = arguments[0].asNumber();
332
333
  SkScalar y = arguments[1].asNumber();
333
334
  getObject()->moveTo(x, y);
334
- return jsi::Value::undefined();
335
+ return thisValue.getObject(runtime);
335
336
  }
336
337
 
337
338
  JSI_HOST_FUNCTION(rMoveTo) {
338
339
  SkScalar x = arguments[0].asNumber();
339
340
  SkScalar y = arguments[1].asNumber();
340
341
  getObject()->rMoveTo(x, y);
341
- return jsi::Value::undefined();
342
+ return thisValue.getObject(runtime);
342
343
  }
343
344
  JSI_HOST_FUNCTION(lineTo) {
344
345
  SkScalar x = arguments[0].asNumber();
345
346
  SkScalar y = arguments[1].asNumber();
346
347
  getObject()->lineTo(x, y);
347
- return jsi::Value::undefined();
348
+ return thisValue.getObject(runtime);
348
349
  }
349
350
 
350
351
  JSI_HOST_FUNCTION(rlineTo) {
351
352
  SkScalar x = arguments[0].asNumber();
352
353
  SkScalar y = arguments[1].asNumber();
353
354
  getObject()->rLineTo(x, y);
354
- return jsi::Value::undefined();
355
+ return thisValue.getObject(runtime);
355
356
  }
356
357
 
357
358
  JSI_HOST_FUNCTION(cubicTo) {
@@ -362,7 +363,7 @@ public:
362
363
  auto x3 = arguments[4].asNumber();
363
364
  auto y3 = arguments[5].asNumber();
364
365
  getObject()->cubicTo(x1, y1, x2, y2, x3, y3);
365
- return jsi::Value::undefined();
366
+ return thisValue.getObject(runtime);
366
367
  }
367
368
 
368
369
  JSI_HOST_FUNCTION(rCubicTo) {
@@ -373,7 +374,7 @@ public:
373
374
  auto x3 = arguments[4].asNumber();
374
375
  auto y3 = arguments[5].asNumber();
375
376
  getObject()->rCubicTo(x1, y1, x2, y2, x3, y3);
376
- return jsi::Value::undefined();
377
+ return thisValue.getObject(runtime);
377
378
  }
378
379
 
379
380
  JSI_HOST_FUNCTION(reset) {
@@ -401,7 +402,7 @@ public:
401
402
  auto x2 = arguments[2].asNumber();
402
403
  auto y2 = arguments[3].asNumber();
403
404
  getObject()->rQuadTo(x1, y1, x2, y2);
404
- return jsi::Value::undefined();
405
+ return thisValue.getObject(runtime);
405
406
  }
406
407
 
407
408
  JSI_HOST_FUNCTION(addCircle) {
@@ -409,7 +410,7 @@ public:
409
410
  auto y = arguments[1].asNumber();
410
411
  auto r = arguments[2].asNumber();
411
412
  getObject()->addCircle(x, y, r);
412
- return jsi::Value::undefined();
413
+ return thisValue.getObject(runtime);
413
414
  }
414
415
 
415
416
  JSI_HOST_FUNCTION(getLastPt) {
@@ -446,19 +447,6 @@ public:
446
447
  runtime, std::make_shared<JsiSkPath>(getContext(), SkPath(*path)));
447
448
  }
448
449
 
449
- JSI_HOST_FUNCTION(fromText) {
450
- auto text = arguments[0].asString(runtime).utf8(runtime);
451
- auto x = arguments[1].asNumber();
452
- auto y = arguments[2].asNumber();
453
- auto font = JsiSkFont::fromValue(runtime, arguments[3]);
454
- SkPath result;
455
- SkTextUtils::GetPath(text.c_str(), strlen(text.c_str()),
456
- SkTextEncoding::kUTF8, x, y, *font, &result);
457
-
458
- getObject()->swap(result);
459
- return jsi::Value::undefined();
460
- }
461
-
462
450
  JSI_HOST_FUNCTION(op) {
463
451
  auto path2 = JsiSkPath::fromValue(runtime, arguments[0]);
464
452
  int pathOp = arguments[1].asNumber();
@@ -479,7 +467,10 @@ public:
479
467
  auto path2 = JsiSkPath::fromValue(runtime, arguments[0]);
480
468
  auto weight = arguments[1].asNumber();
481
469
  SkPath result;
482
- getObject()->interpolate(*path2, weight, &result);
470
+ auto succeed = getObject()->interpolate(*path2, weight, &result);
471
+ if (!succeed) {
472
+ return nullptr;
473
+ }
483
474
  return jsi::Object::createFromHostObject(
484
475
  runtime, std::make_shared<JsiSkPath>(getContext(), std::move(result)));
485
476
  }
@@ -514,8 +505,10 @@ public:
514
505
  JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPath, __typename__))
515
506
 
516
507
  JSI_EXPORT_FUNCTIONS(
517
- JSI_EXPORT_FUNC(JsiSkPath, addArc), JSI_EXPORT_FUNC(JsiSkPath, addOval),
518
- JSI_EXPORT_FUNC(JsiSkPath, addPoly), JSI_EXPORT_FUNC(JsiSkPath, addRect),
508
+ JSI_EXPORT_FUNC(JsiSkPath, addArc),
509
+ JSI_EXPORT_FUNC(JsiSkPath, addOval),
510
+ JSI_EXPORT_FUNC(JsiSkPath, addPoly),
511
+ JSI_EXPORT_FUNC(JsiSkPath, addRect),
519
512
  JSI_EXPORT_FUNC(JsiSkPath, addRRect),
520
513
  JSI_EXPORT_FUNC(JsiSkPath, arcToOval),
521
514
  JSI_EXPORT_FUNC(JsiSkPath, arcToRotated),
@@ -523,28 +516,40 @@ public:
523
516
  JSI_EXPORT_FUNC(JsiSkPath, arcToTangent),
524
517
  JSI_EXPORT_FUNC(JsiSkPath, computeTightBounds),
525
518
  JSI_EXPORT_FUNC(JsiSkPath, getBounds),
526
- JSI_EXPORT_FUNC(JsiSkPath, conicTo), JSI_EXPORT_FUNC(JsiSkPath, rConicTo),
527
- JSI_EXPORT_FUNC(JsiSkPath, contains), JSI_EXPORT_FUNC(JsiSkPath, dash),
519
+ JSI_EXPORT_FUNC(JsiSkPath, conicTo),
520
+ JSI_EXPORT_FUNC(JsiSkPath, rConicTo),
521
+ JSI_EXPORT_FUNC(JsiSkPath, contains),
522
+ JSI_EXPORT_FUNC(JsiSkPath, dash),
528
523
  JSI_EXPORT_FUNC(JsiSkPath, equals),
529
524
  JSI_EXPORT_FUNC(JsiSkPath, getFillType),
530
525
  JSI_EXPORT_FUNC(JsiSkPath, setFillType),
531
526
  JSI_EXPORT_FUNC(JsiSkPath, setIsVolatile),
532
527
  JSI_EXPORT_FUNC(JsiSkPath, isVolatile),
533
- JSI_EXPORT_FUNC(JsiSkPath, transform), JSI_EXPORT_FUNC(JsiSkPath, stroke),
534
- JSI_EXPORT_FUNC(JsiSkPath, trim), JSI_EXPORT_FUNC(JsiSkPath, getPoint),
528
+ JSI_EXPORT_FUNC(JsiSkPath, transform),
529
+ JSI_EXPORT_FUNC(JsiSkPath, stroke),
530
+ JSI_EXPORT_FUNC(JsiSkPath, trim),
531
+ JSI_EXPORT_FUNC(JsiSkPath, getPoint),
535
532
  JSI_EXPORT_FUNC(JsiSkPath, toSVGString),
536
533
  JSI_EXPORT_FUNC(JsiSkPath, makeAsWinding),
537
- JSI_EXPORT_FUNC(JsiSkPath, isEmpty), JSI_EXPORT_FUNC(JsiSkPath, offset),
538
- JSI_EXPORT_FUNC(JsiSkPath, moveTo), JSI_EXPORT_FUNC(JsiSkPath, rMoveTo),
539
- JSI_EXPORT_FUNC(JsiSkPath, lineTo), JSI_EXPORT_FUNC(JsiSkPath, rlineTo),
540
- JSI_EXPORT_FUNC(JsiSkPath, cubicTo), JSI_EXPORT_FUNC(JsiSkPath, rCubicTo),
541
- JSI_EXPORT_FUNC(JsiSkPath, reset), JSI_EXPORT_FUNC(JsiSkPath, rewind),
542
- JSI_EXPORT_FUNC(JsiSkPath, quadTo), JSI_EXPORT_FUNC(JsiSkPath, rQuadTo),
534
+ JSI_EXPORT_FUNC(JsiSkPath, isEmpty),
535
+ JSI_EXPORT_FUNC(JsiSkPath, offset),
536
+ JSI_EXPORT_FUNC(JsiSkPath, moveTo),
537
+ JSI_EXPORT_FUNC(JsiSkPath, rMoveTo),
538
+ JSI_EXPORT_FUNC(JsiSkPath, lineTo),
539
+ JSI_EXPORT_FUNC(JsiSkPath, rlineTo),
540
+ JSI_EXPORT_FUNC(JsiSkPath, cubicTo),
541
+ JSI_EXPORT_FUNC(JsiSkPath, rCubicTo),
542
+ JSI_EXPORT_FUNC(JsiSkPath, reset),
543
+ JSI_EXPORT_FUNC(JsiSkPath, rewind),
544
+ JSI_EXPORT_FUNC(JsiSkPath, quadTo),
545
+ JSI_EXPORT_FUNC(JsiSkPath, rQuadTo),
543
546
  JSI_EXPORT_FUNC(JsiSkPath, addCircle),
544
- JSI_EXPORT_FUNC(JsiSkPath, getLastPt), JSI_EXPORT_FUNC(JsiSkPath, close),
547
+ JSI_EXPORT_FUNC(JsiSkPath, getLastPt),
548
+ JSI_EXPORT_FUNC(JsiSkPath, close),
545
549
  JSI_EXPORT_FUNC(JsiSkPath, simplify),
546
- JSI_EXPORT_FUNC(JsiSkPath, countPoints), JSI_EXPORT_FUNC(JsiSkPath, copy),
547
- JSI_EXPORT_FUNC(JsiSkPath, fromText), JSI_EXPORT_FUNC(JsiSkPath, op),
550
+ JSI_EXPORT_FUNC(JsiSkPath, countPoints),
551
+ JSI_EXPORT_FUNC(JsiSkPath, copy),
552
+ JSI_EXPORT_FUNC(JsiSkPath, op),
548
553
  JSI_EXPORT_FUNC(JsiSkPath, isInterpolatable),
549
554
  JSI_EXPORT_FUNC(JsiSkPath, interpolate),
550
555
  JSI_EXPORT_FUNC(JsiSkPath, toCmds),
@@ -552,7 +557,8 @@ public:
552
557
 
553
558
  JsiSkPath(std::shared_ptr<RNSkPlatformContext> context, SkPath path)
554
559
  : JsiSkWrappingSharedPtrHostObject<SkPath>(
555
- std::move(context), std::make_shared<SkPath>(std::move(path))){}
560
+ std::move(context), std::make_shared<SkPath>(std::move(path))) {
561
+ }
556
562
 
557
563
  /**
558
564
  Returns the underlying object from a host object of this type
@@ -147,10 +147,23 @@ public:
147
147
  runtime, std::make_shared<JsiSkPath>(getContext(), std::move(path)));
148
148
  }
149
149
 
150
+ JSI_HOST_FUNCTION(MakeFromText) {
151
+ auto text = arguments[0].asString(runtime).utf8(runtime);
152
+ auto x = arguments[1].asNumber();
153
+ auto y = arguments[2].asNumber();
154
+ auto font = JsiSkFont::fromValue(runtime, arguments[3]);
155
+ SkPath path;
156
+ SkTextUtils::GetPath(text.c_str(), strlen(text.c_str()),
157
+ SkTextEncoding::kUTF8, x, y, *font, &path);
158
+ return jsi::Object::createFromHostObject(
159
+ runtime, std::make_shared<JsiSkPath>(getContext(), std::move(path)));;
160
+ }
161
+
150
162
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPathFactory, Make),
151
163
  JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromSVGString),
152
164
  JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromOp),
153
- JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromCmds))
165
+ JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromCmds),
166
+ JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromText))
154
167
 
155
168
  JsiSkPathFactory(std::shared_ptr<RNSkPlatformContext> context)
156
169
  : JsiSkHostObject(std::move(context)) {}
@@ -29,6 +29,24 @@ namespace RNSkia {
29
29
  : JsiSkWrappingSharedPtrHostObject<SkRuntimeShaderBuilder>(
30
30
  std::move(context), std::make_shared<SkRuntimeShaderBuilder>(rt)){}
31
31
 
32
+ JSI_HOST_FUNCTION(setUniform) {
33
+ auto name = arguments[0].asString(runtime).utf8(runtime);
34
+ auto jsiValue = arguments[1].asObject(runtime).asArray(runtime);
35
+ auto size = jsiValue.size(runtime);
36
+ std::vector<SkScalar> value;
37
+ value.reserve(size);
38
+ for (int i = 0; i < size; i++) {
39
+ auto e = jsiValue.getValueAtIndex(runtime, i).asNumber();
40
+ value.push_back(e);
41
+ }
42
+ getObject()->uniform(name.c_str()).set(value.data(), static_cast<int>(size));
43
+ return jsi::Value::undefined();
44
+ }
45
+
46
+ JSI_EXPORT_FUNCTIONS(
47
+ JSI_EXPORT_FUNC(JsiSkRuntimeShaderBuilder, setUniform)
48
+ )
49
+
32
50
  /**
33
51
  Returns the underlying object from a host object of this type
34
52
  */
@@ -6,6 +6,7 @@
6
6
  #include <jsi/jsi.h>
7
7
 
8
8
  #include "JsiSkHostObjects.h"
9
+ #include <RNSkLog.h>
9
10
 
10
11
  #pragma clang diagnostic push
11
12
  #pragma clang diagnostic ignored "-Wdocumentation"
@@ -21,8 +22,16 @@ using namespace facebook;
21
22
 
22
23
  class JsiSkTypeface : public JsiSkWrappingSkPtrHostObject<SkTypeface> {
23
24
  public:
24
- JSI_PROPERTY_GET(bold) { return jsi::Value(getObject()->isBold()); }
25
- JSI_PROPERTY_GET(italic) { return jsi::Value(getObject()->isItalic()); }
25
+ JSI_PROPERTY_GET(bold) {
26
+ RNSkLogger::warnToJavascriptConsole(runtime, "Typeface.bold is deprecated and will be removed in a future release.");
27
+ return jsi::Value(getObject()->isBold());
28
+ }
29
+
30
+ JSI_PROPERTY_GET(italic) {
31
+ RNSkLogger::warnToJavascriptConsole(runtime, "Typeface.italic is deprecated and will be removed in a future release.");
32
+ return jsi::Value(getObject()->isItalic());
33
+ }
34
+
26
35
  // TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
27
36
  JSI_PROPERTY_GET(__typename__) {
28
37
  return jsi::String::createFromUtf8(runtime, "Typeface");
@@ -17,8 +17,12 @@ namespace RNSkia {
17
17
  public:
18
18
  JSI_HOST_FUNCTION(MakeFreeTypeFaceFromData) {
19
19
  auto data = JsiSkData::fromValue(runtime, arguments[0]);
20
+ auto typeface = SkFontMgr::RefDefault()->makeFromData(std::move(data));
21
+ if(typeface == nullptr) {
22
+ return jsi::Value::null();
23
+ }
20
24
  return jsi::Object::createFromHostObject(
21
- runtime, std::make_shared<JsiSkTypeface>(getContext(), SkFontMgr::RefDefault()->makeFromData(std::move(data))));
25
+ runtime, std::make_shared<JsiSkTypeface>(getContext(), typeface));
22
26
  }
23
27
 
24
28
  JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkTypefaceFactory, MakeFreeTypeFaceFromData))
@@ -23,6 +23,7 @@ using RNSkTouchPoint = struct {
23
23
  double y;
24
24
  double force;
25
25
  RNSkTouchType type;
26
+ size_t id;
26
27
  long timestamp;
27
28
  };
28
29
 
@@ -45,6 +46,7 @@ public:
45
46
  touchObj.setProperty(runtime, "force", t.force);
46
47
  touchObj.setProperty(runtime, "type", (double)t.type);
47
48
  touchObj.setProperty(runtime, "timestamp", (double)t.timestamp / 1000.0);
49
+ touchObj.setProperty(runtime, "id", (double)t.id);
48
50
  touches.setValueAtIndex(runtime, n, touchObj);
49
51
  }
50
52
  ops.setValueAtIndex(runtime, i, touches);
@@ -49,5 +49,27 @@ public:
49
49
  #endif
50
50
  va_end(args);
51
51
  }
52
+
53
+ static void logToJavascriptConsole(jsi::Runtime& runtime, const std::string& message) {
54
+ auto console = RNSkLogger::getJavascriptConsole(runtime).asObject(runtime);
55
+ auto log = console.getPropertyAsFunction(runtime, "log");
56
+ log.call(runtime, jsi::String::createFromUtf8(runtime, message));
57
+ }
58
+
59
+ static void warnToJavascriptConsole(jsi::Runtime& runtime, const std::string& message) {
60
+ auto console = RNSkLogger::getJavascriptConsole(runtime).asObject(runtime);
61
+ auto warn = console.getPropertyAsFunction(runtime, "warn");
62
+ warn.call(runtime, jsi::String::createFromUtf8(runtime, message));
63
+ }
64
+
65
+ private:
66
+ static jsi::Value getJavascriptConsole(jsi::Runtime& runtime) {
67
+ auto console = runtime.global().getProperty(runtime, "console");
68
+ if(console.isUndefined() || console.isNull()) {
69
+ jsi::detail::throwJSError(runtime, "Could not find console object.");
70
+ return jsi::Value::undefined();
71
+ }
72
+ return console;
73
+ }
52
74
  };
53
75
  } // namespace RNSkia