@shopify/react-native-skia 0.1.234 → 0.1.237

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. package/cpp/api/JsiSkApi.h +2 -0
  2. package/cpp/api/JsiSkCanvas.h +36 -0
  3. package/cpp/api/JsiSkRSXform.h +35 -7
  4. package/cpp/api/JsiSkTypefaceFactory.h +2 -1
  5. package/cpp/rnskia/dom/JsiDomApi.h +2 -0
  6. package/cpp/rnskia/dom/nodes/JsiAtlasNode.h +60 -0
  7. package/cpp/rnskia/dom/props/RSXformProp.h +52 -0
  8. package/cpp/rnskia/dom/props/RectProp.h +31 -0
  9. package/cpp/skia/include/android/AHardwareBufferUtils.h +23 -0
  10. package/cpp/skia/include/android/GrAHardwareBufferUtils.h +2 -0
  11. package/cpp/skia/include/android/graphite/SurfaceAndroid.h +59 -0
  12. package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
  13. package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
  14. package/cpp/skia/include/codec/SkCodec.h +21 -3
  15. package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
  16. package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
  17. package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
  18. package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
  19. package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
  20. package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
  21. package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
  22. package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
  23. package/cpp/skia/include/config/SkUserConfig.h +3 -1
  24. package/cpp/skia/include/core/SkCanvas.h +66 -37
  25. package/cpp/skia/include/core/SkColorFilter.h +5 -2
  26. package/cpp/skia/include/core/SkContourMeasure.h +1 -0
  27. package/cpp/skia/include/core/SkDocument.h +1 -0
  28. package/cpp/skia/include/core/SkFont.h +14 -24
  29. package/cpp/skia/include/core/SkFontArguments.h +1 -1
  30. package/cpp/skia/include/core/SkFontMetrics.h +1 -1
  31. package/cpp/skia/include/core/SkFontMgr.h +0 -7
  32. package/cpp/skia/include/core/SkGraphics.h +13 -0
  33. package/cpp/skia/include/core/SkMesh.h +9 -13
  34. package/cpp/skia/include/core/SkMilestone.h +1 -1
  35. package/cpp/skia/include/core/SkPathMeasure.h +2 -0
  36. package/cpp/skia/include/core/SkSerialProcs.h +29 -11
  37. package/cpp/skia/include/core/SkSize.h +3 -3
  38. package/cpp/skia/include/core/SkStream.h +3 -13
  39. package/cpp/skia/include/core/SkSurface.h +6 -3
  40. package/cpp/skia/include/core/SkSurfaceProps.h +2 -4
  41. package/cpp/skia/include/core/SkTraceMemoryDump.h +15 -0
  42. package/cpp/skia/include/core/SkTypeface.h +8 -56
  43. package/cpp/skia/include/core/SkTypes.h +8 -0
  44. package/cpp/skia/include/core/SkVertices.h +1 -1
  45. package/cpp/skia/include/docs/SkMultiPictureDocument.h +53 -0
  46. package/cpp/skia/include/docs/SkPDFDocument.h +11 -0
  47. package/cpp/skia/include/effects/SkGradientShader.h +9 -0
  48. package/cpp/skia/include/effects/SkRuntimeEffect.h +3 -7
  49. package/cpp/skia/include/gpu/GrBackendSemaphore.h +33 -47
  50. package/cpp/skia/include/gpu/GrBackendSurface.h +2 -3
  51. package/cpp/skia/include/gpu/GrContextOptions.h +0 -6
  52. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +44 -28
  53. package/cpp/skia/include/gpu/GrDirectContext.h +12 -31
  54. package/cpp/skia/include/gpu/GrTypes.h +1 -16
  55. package/cpp/skia/include/gpu/MutableTextureState.h +35 -80
  56. package/cpp/skia/include/gpu/ShaderErrorHandler.h +11 -1
  57. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +2 -2
  58. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
  59. package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +3 -2
  60. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
  61. package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +30 -0
  62. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  63. package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -0
  64. package/cpp/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h +6 -0
  65. package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +3 -3
  66. package/cpp/skia/include/gpu/graphite/BackendTexture.h +39 -27
  67. package/cpp/skia/include/gpu/graphite/Context.h +39 -13
  68. package/cpp/skia/include/gpu/graphite/ContextOptions.h +2 -0
  69. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +2 -1
  70. package/cpp/skia/include/gpu/graphite/Image.h +106 -87
  71. package/cpp/skia/include/gpu/graphite/Recorder.h +24 -3
  72. package/cpp/skia/include/gpu/graphite/Surface.h +7 -2
  73. package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +41 -2
  74. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +11 -6
  75. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -2
  76. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +6 -6
  77. package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -0
  78. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  79. package/cpp/skia/include/gpu/vk/GrVkTypes.h +1 -44
  80. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
  81. package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +25 -0
  82. package/cpp/skia/include/gpu/vk/VulkanTypes.h +44 -0
  83. package/cpp/skia/include/ports/SkFontConfigInterface.h +3 -6
  84. package/cpp/skia/include/private/SkEncodedInfo.h +5 -0
  85. package/cpp/skia/include/private/SkExif.h +102 -0
  86. package/cpp/skia/include/private/SkGainmapInfo.h +11 -1
  87. package/cpp/skia/include/private/base/SkAssert.h +16 -0
  88. package/cpp/skia/include/private/base/SkDeque.h +2 -7
  89. package/cpp/skia/include/private/base/SkLoadUserConfig.h +1 -1
  90. package/cpp/skia/include/private/base/SkTArray.h +69 -28
  91. package/cpp/skia/include/private/base/SkThreadAnnotations.h +18 -5
  92. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +26 -30
  93. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +4 -3
  94. package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
  95. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +8 -6
  96. package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +29 -0
  97. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +12 -9
  98. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +16 -11
  99. package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -2
  100. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
  101. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
  102. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
  103. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
  104. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
  105. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +9 -2
  106. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +31 -3
  107. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10624 -5716
  108. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +2 -1
  109. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +2 -1
  110. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +28 -1
  111. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +2 -1
  112. package/cpp/skia/include/utils/mac/SkCGUtils.h +23 -11
  113. package/cpp/skia/modules/skcms/skcms.h +2 -410
  114. package/cpp/skia/modules/skcms/src/Transform_inl.h +831 -704
  115. package/cpp/skia/modules/skcms/src/skcms_Transform.h +161 -0
  116. package/cpp/skia/modules/skcms/src/skcms_internals.h +136 -0
  117. package/cpp/skia/modules/skcms/src/skcms_public.h +404 -0
  118. package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
  119. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -0
  120. package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -2
  121. package/cpp/skia/modules/skparagraph/include/TextStyle.h +4 -3
  122. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -3
  123. package/cpp/skia/modules/skresources/include/SkResources.h +28 -17
  124. package/cpp/skia/modules/skunicode/include/SkUnicode.h +12 -0
  125. package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -1
  126. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +4 -1
  127. package/cpp/skia/src/base/SkUTF.h +7 -0
  128. package/cpp/skia/src/core/SkTHash.h +20 -8
  129. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +5 -3
  130. package/lib/commonjs/dom/nodes/JsiSkDOM.js +60 -57
  131. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  132. package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  133. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +47 -0
  134. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +1 -0
  135. package/lib/commonjs/dom/nodes/drawings/index.d.ts +1 -0
  136. package/lib/commonjs/dom/nodes/drawings/index.js +13 -0
  137. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
  138. package/lib/commonjs/dom/types/Drawings.d.ts +7 -1
  139. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  140. package/lib/commonjs/dom/types/NodeType.d.ts +1 -0
  141. package/lib/commonjs/dom/types/NodeType.js +1 -0
  142. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  143. package/lib/commonjs/dom/types/SkDOM.d.ts +2 -1
  144. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  145. package/lib/commonjs/external/reanimated/buffers.d.ts +5 -0
  146. package/lib/commonjs/external/reanimated/buffers.js +48 -0
  147. package/lib/commonjs/external/reanimated/buffers.js.map +1 -0
  148. package/lib/commonjs/external/reanimated/index.d.ts +2 -0
  149. package/lib/commonjs/external/reanimated/index.js +26 -0
  150. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  151. package/lib/commonjs/external/reanimated/interpolators.js +13 -1
  152. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  153. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +1 -0
  154. package/lib/commonjs/external/reanimated/moduleWrapper.js +5 -3
  155. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  156. package/lib/commonjs/external/reanimated/textures.d.ts +5 -0
  157. package/lib/commonjs/external/reanimated/textures.js +38 -0
  158. package/lib/commonjs/external/reanimated/textures.js.map +1 -0
  159. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +8 -1
  160. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
  161. package/lib/commonjs/headless/index.js +1 -1
  162. package/lib/commonjs/headless/index.js.map +1 -1
  163. package/lib/commonjs/mock/index.js +8 -0
  164. package/lib/commonjs/mock/index.js.map +1 -1
  165. package/lib/commonjs/renderer/Canvas.js +1 -1
  166. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  167. package/lib/commonjs/renderer/Container.d.ts +1 -1
  168. package/lib/commonjs/renderer/Container.js +2 -1
  169. package/lib/commonjs/renderer/Container.js.map +1 -1
  170. package/lib/commonjs/renderer/HostComponents.d.ts +3 -1
  171. package/lib/commonjs/renderer/HostComponents.js +3 -0
  172. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  173. package/lib/commonjs/renderer/Offscreen.d.ts +4 -1
  174. package/lib/commonjs/renderer/Offscreen.js +28 -10
  175. package/lib/commonjs/renderer/Offscreen.js.map +1 -1
  176. package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
  177. package/lib/commonjs/renderer/Reconciler.js +7 -4
  178. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  179. package/lib/commonjs/renderer/components/shapes/Atlas.d.ts +4 -0
  180. package/lib/commonjs/renderer/components/shapes/Atlas.js +17 -0
  181. package/lib/commonjs/renderer/components/shapes/Atlas.js.map +1 -0
  182. package/lib/commonjs/renderer/components/shapes/index.d.ts +1 -0
  183. package/lib/commonjs/renderer/components/shapes/index.js +13 -0
  184. package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
  185. package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
  186. package/lib/commonjs/skia/core/AnimatedImage.js +4 -1
  187. package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
  188. package/lib/commonjs/skia/core/Data.d.ts +1 -1
  189. package/lib/commonjs/skia/core/Data.js +11 -4
  190. package/lib/commonjs/skia/core/Data.js.map +1 -1
  191. package/lib/commonjs/skia/core/Rect.d.ts +2 -2
  192. package/lib/commonjs/skia/types/Canvas.d.ts +16 -1
  193. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  194. package/lib/commonjs/skia/types/Image/Image.d.ts +8 -0
  195. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  196. package/lib/commonjs/skia/types/Matrix4.d.ts +2 -2
  197. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  198. package/lib/commonjs/skia/types/RSXform.d.ts +7 -1
  199. package/lib/commonjs/skia/types/RSXform.js.map +1 -1
  200. package/lib/commonjs/skia/types/Rect.d.ts +4 -0
  201. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  202. package/lib/commonjs/skia/types/Shader/Shader.d.ts +1 -1
  203. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  204. package/lib/commonjs/skia/types/Skia.d.ts +3 -2
  205. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  206. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +2 -1
  207. package/lib/commonjs/skia/web/JsiSkCanvas.js +19 -0
  208. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  209. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +8 -2
  210. package/lib/commonjs/skia/web/JsiSkRSXform.js +33 -2
  211. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  212. package/lib/commonjs/skia/web/JsiSkRect.d.ts +3 -2
  213. package/lib/commonjs/skia/web/JsiSkRect.js +7 -0
  214. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  215. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +2 -1
  216. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  217. package/lib/commonjs/skia/web/JsiSkia.js +5 -0
  218. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  219. package/lib/module/dom/nodes/JsiSkDOM.d.ts +5 -3
  220. package/lib/module/dom/nodes/JsiSkDOM.js +61 -57
  221. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  222. package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  223. package/lib/module/dom/nodes/drawings/AtlasNode.js +34 -0
  224. package/lib/module/dom/nodes/drawings/AtlasNode.js.map +1 -0
  225. package/lib/module/dom/nodes/drawings/index.d.ts +1 -0
  226. package/lib/module/dom/nodes/drawings/index.js +1 -0
  227. package/lib/module/dom/nodes/drawings/index.js.map +1 -1
  228. package/lib/module/dom/types/Drawings.d.ts +7 -1
  229. package/lib/module/dom/types/Drawings.js.map +1 -1
  230. package/lib/module/dom/types/NodeType.d.ts +1 -0
  231. package/lib/module/dom/types/NodeType.js +1 -0
  232. package/lib/module/dom/types/NodeType.js.map +1 -1
  233. package/lib/module/dom/types/SkDOM.d.ts +2 -1
  234. package/lib/module/dom/types/SkDOM.js.map +1 -1
  235. package/lib/module/external/reanimated/buffers.d.ts +5 -0
  236. package/lib/module/external/reanimated/buffers.js +27 -0
  237. package/lib/module/external/reanimated/buffers.js.map +1 -0
  238. package/lib/module/external/reanimated/index.d.ts +2 -0
  239. package/lib/module/external/reanimated/index.js +2 -0
  240. package/lib/module/external/reanimated/index.js.map +1 -1
  241. package/lib/module/external/reanimated/interpolators.js +13 -1
  242. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  243. package/lib/module/external/reanimated/moduleWrapper.d.ts +1 -0
  244. package/lib/module/external/reanimated/moduleWrapper.js +3 -2
  245. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  246. package/lib/module/external/reanimated/textures.d.ts +5 -0
  247. package/lib/module/external/reanimated/textures.js +24 -0
  248. package/lib/module/external/reanimated/textures.js.map +1 -0
  249. package/lib/module/external/reanimated/useAnimatedImageValue.js +7 -1
  250. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  251. package/lib/module/headless/index.js +1 -1
  252. package/lib/module/headless/index.js.map +1 -1
  253. package/lib/module/mock/index.js +8 -0
  254. package/lib/module/mock/index.js.map +1 -1
  255. package/lib/module/renderer/Canvas.js +1 -1
  256. package/lib/module/renderer/Canvas.js.map +1 -1
  257. package/lib/module/renderer/Container.d.ts +1 -1
  258. package/lib/module/renderer/Container.js +2 -1
  259. package/lib/module/renderer/Container.js.map +1 -1
  260. package/lib/module/renderer/HostComponents.d.ts +3 -1
  261. package/lib/module/renderer/HostComponents.js +3 -0
  262. package/lib/module/renderer/HostComponents.js.map +1 -1
  263. package/lib/module/renderer/Offscreen.d.ts +4 -1
  264. package/lib/module/renderer/Offscreen.js +19 -9
  265. package/lib/module/renderer/Offscreen.js.map +1 -1
  266. package/lib/module/renderer/Reconciler.d.ts +1 -1
  267. package/lib/module/renderer/Reconciler.js +7 -4
  268. package/lib/module/renderer/Reconciler.js.map +1 -1
  269. package/lib/module/renderer/components/shapes/Atlas.d.ts +4 -0
  270. package/lib/module/renderer/components/shapes/Atlas.js +5 -0
  271. package/lib/module/renderer/components/shapes/Atlas.js.map +1 -0
  272. package/lib/module/renderer/components/shapes/index.d.ts +1 -0
  273. package/lib/module/renderer/components/shapes/index.js +1 -0
  274. package/lib/module/renderer/components/shapes/index.js.map +1 -1
  275. package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
  276. package/lib/module/skia/core/AnimatedImage.js +4 -1
  277. package/lib/module/skia/core/AnimatedImage.js.map +1 -1
  278. package/lib/module/skia/core/Data.d.ts +1 -1
  279. package/lib/module/skia/core/Data.js +11 -4
  280. package/lib/module/skia/core/Data.js.map +1 -1
  281. package/lib/module/skia/core/Rect.d.ts +2 -2
  282. package/lib/module/skia/types/Canvas.d.ts +16 -1
  283. package/lib/module/skia/types/Canvas.js.map +1 -1
  284. package/lib/module/skia/types/Image/Image.d.ts +8 -0
  285. package/lib/module/skia/types/Image/Image.js.map +1 -1
  286. package/lib/module/skia/types/Matrix4.d.ts +2 -2
  287. package/lib/module/skia/types/Matrix4.js.map +1 -1
  288. package/lib/module/skia/types/RSXform.d.ts +7 -1
  289. package/lib/module/skia/types/RSXform.js.map +1 -1
  290. package/lib/module/skia/types/Rect.d.ts +4 -0
  291. package/lib/module/skia/types/Rect.js.map +1 -1
  292. package/lib/module/skia/types/Shader/Shader.d.ts +1 -1
  293. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  294. package/lib/module/skia/types/Skia.d.ts +3 -2
  295. package/lib/module/skia/types/Skia.js.map +1 -1
  296. package/lib/module/skia/web/JsiSkCanvas.d.ts +2 -1
  297. package/lib/module/skia/web/JsiSkCanvas.js +18 -0
  298. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  299. package/lib/module/skia/web/JsiSkRSXform.d.ts +8 -2
  300. package/lib/module/skia/web/JsiSkRSXform.js +34 -3
  301. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  302. package/lib/module/skia/web/JsiSkRect.d.ts +3 -2
  303. package/lib/module/skia/web/JsiSkRect.js +7 -0
  304. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  305. package/lib/module/skia/web/JsiSkTextBlobFactory.js +2 -1
  306. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  307. package/lib/module/skia/web/JsiSkia.js +5 -0
  308. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  309. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +5 -3
  310. package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  311. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +1 -0
  312. package/lib/typescript/src/dom/types/Drawings.d.ts +7 -1
  313. package/lib/typescript/src/dom/types/NodeType.d.ts +1 -0
  314. package/lib/typescript/src/dom/types/SkDOM.d.ts +2 -1
  315. package/lib/typescript/src/external/reanimated/buffers.d.ts +5 -0
  316. package/lib/typescript/src/external/reanimated/index.d.ts +2 -0
  317. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +1 -0
  318. package/lib/typescript/src/external/reanimated/textures.d.ts +5 -0
  319. package/lib/typescript/src/renderer/Container.d.ts +1 -1
  320. package/lib/typescript/src/renderer/HostComponents.d.ts +3 -1
  321. package/lib/typescript/src/renderer/Offscreen.d.ts +4 -1
  322. package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
  323. package/lib/typescript/src/renderer/components/shapes/Atlas.d.ts +4 -0
  324. package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
  325. package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
  326. package/lib/typescript/src/skia/core/Data.d.ts +1 -1
  327. package/lib/typescript/src/skia/core/Rect.d.ts +2 -2
  328. package/lib/typescript/src/skia/types/Canvas.d.ts +16 -1
  329. package/lib/typescript/src/skia/types/Image/Image.d.ts +8 -0
  330. package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
  331. package/lib/typescript/src/skia/types/RSXform.d.ts +7 -1
  332. package/lib/typescript/src/skia/types/Rect.d.ts +4 -0
  333. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  334. package/lib/typescript/src/skia/types/Skia.d.ts +3 -2
  335. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +2 -1
  336. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -2
  337. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -2
  338. package/libs/android/arm64-v8a/libskia.a +0 -0
  339. package/libs/android/arm64-v8a/libskottie.a +0 -0
  340. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  341. package/libs/android/arm64-v8a/libsksg.a +0 -0
  342. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  343. package/libs/android/arm64-v8a/libskunicode.a +0 -0
  344. package/libs/android/arm64-v8a/libsvg.a +0 -0
  345. package/libs/android/armeabi-v7a/libskia.a +0 -0
  346. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  347. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  348. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  349. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  350. package/libs/android/armeabi-v7a/libskunicode.a +0 -0
  351. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  352. package/libs/android/x86/libskia.a +0 -0
  353. package/libs/android/x86/libskottie.a +0 -0
  354. package/libs/android/x86/libskparagraph.a +0 -0
  355. package/libs/android/x86/libsksg.a +0 -0
  356. package/libs/android/x86/libskshaper.a +0 -0
  357. package/libs/android/x86/libskunicode.a +0 -0
  358. package/libs/android/x86/libsvg.a +0 -0
  359. package/libs/android/x86_64/libskia.a +0 -0
  360. package/libs/android/x86_64/libskottie.a +0 -0
  361. package/libs/android/x86_64/libskparagraph.a +0 -0
  362. package/libs/android/x86_64/libsksg.a +0 -0
  363. package/libs/android/x86_64/libskshaper.a +0 -0
  364. package/libs/android/x86_64/libskunicode.a +0 -0
  365. package/libs/android/x86_64/libsvg.a +0 -0
  366. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  367. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  368. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  369. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  370. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  371. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  372. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  373. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  374. package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
  375. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  376. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  377. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  378. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  379. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  380. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  381. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  382. package/package.json +1 -1
  383. package/src/dom/nodes/JsiSkDOM.ts +63 -56
  384. package/src/dom/nodes/drawings/AtlasNode.ts +24 -0
  385. package/src/dom/nodes/drawings/index.ts +1 -0
  386. package/src/dom/types/Drawings.ts +9 -0
  387. package/src/dom/types/NodeType.ts +1 -0
  388. package/src/dom/types/SkDOM.ts +2 -0
  389. package/src/external/reanimated/buffers.ts +53 -0
  390. package/src/external/reanimated/index.ts +2 -0
  391. package/src/external/reanimated/interpolators.ts +15 -2
  392. package/src/external/reanimated/moduleWrapper.ts +1 -0
  393. package/src/external/reanimated/textures.tsx +38 -0
  394. package/src/external/reanimated/useAnimatedImageValue.ts +15 -4
  395. package/src/headless/index.ts +1 -1
  396. package/src/mock/index.ts +8 -0
  397. package/src/renderer/Canvas.tsx +1 -1
  398. package/src/renderer/Container.tsx +3 -2
  399. package/src/renderer/HostComponents.ts +6 -1
  400. package/src/renderer/Offscreen.tsx +24 -11
  401. package/src/renderer/Reconciler.tsx +5 -2
  402. package/src/renderer/components/shapes/Atlas.tsx +8 -0
  403. package/src/renderer/components/shapes/index.ts +1 -0
  404. package/src/skia/core/AnimatedImage.ts +3 -2
  405. package/src/skia/core/Data.ts +8 -4
  406. package/src/skia/types/Canvas.ts +32 -1
  407. package/src/skia/types/Image/Image.ts +10 -0
  408. package/src/skia/types/Matrix4.ts +2 -2
  409. package/src/skia/types/RSXform.ts +7 -1
  410. package/src/skia/types/Rect.ts +6 -0
  411. package/src/skia/types/Shader/Shader.ts +6 -1
  412. package/src/skia/types/Skia.ts +10 -2
  413. package/src/skia/web/JsiSkCanvas.ts +60 -23
  414. package/src/skia/web/JsiSkRSXform.ts +28 -4
  415. package/src/skia/web/JsiSkRect.ts +12 -2
  416. package/src/skia/web/JsiSkTextBlobFactory.ts +5 -5
  417. package/src/skia/web/JsiSkia.ts +15 -0
  418. package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -142
  419. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +0 -107
  420. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +0 -32
  421. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +0 -83
  422. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +0 -47
  423. package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +0 -57
  424. package/cpp/skia/include/utils/SkBase64.h +0 -53
  425. package/cpp/skia/modules/skcms/skcms_internal.h +0 -56
@@ -38,6 +38,7 @@ import type {
38
38
  BoxProps,
39
39
  BoxShadowProps,
40
40
  ChildrenProps,
41
+ AtlasProps,
41
42
  } from "../types";
42
43
  import type {
43
44
  BlendImageFilterProps,
@@ -55,7 +56,6 @@ import type {
55
56
  Path1DPathEffectProps,
56
57
  Path2DPathEffectProps,
57
58
  } from "../types/PathEffects";
58
- import { NATIVE_DOM } from "../../renderer/HostComponents";
59
59
  import type { ParagraphProps } from "../types/Paragraph";
60
60
 
61
61
  import {
@@ -80,6 +80,7 @@ import {
80
80
  BackdropFilterNode,
81
81
  BoxNode,
82
82
  BoxShadowNode,
83
+ AtlasNode,
83
84
  } from "./drawings";
84
85
  import {
85
86
  BlendImageFilterNode,
@@ -125,200 +126,206 @@ import { LayerNode } from "./LayerNode";
125
126
  import { ParagraphNode } from "./drawings/ParagraphNode";
126
127
 
127
128
  export class JsiSkDOM implements SkDOM {
128
- constructor(private ctx: NodeContext) {}
129
+ constructor(private ctx: NodeContext, private native: boolean) {}
129
130
 
130
131
  Layer(props?: ChildrenProps) {
131
- return NATIVE_DOM
132
+ return this.native
132
133
  ? global.SkiaDomApi.LayerNode(props ?? {})
133
134
  : new LayerNode(this.ctx, props ?? {});
134
135
  }
135
136
 
136
137
  Group(props?: GroupProps) {
137
- return NATIVE_DOM
138
+ return this.native
138
139
  ? global.SkiaDomApi.GroupNode(props ?? {})
139
140
  : new GroupNode(this.ctx, props ?? {});
140
141
  }
141
142
 
142
143
  Paint(props: PaintProps) {
143
- return NATIVE_DOM
144
+ return this.native
144
145
  ? global.SkiaDomApi.PaintNode(props ?? {})
145
146
  : new PaintNode(this.ctx, props);
146
147
  }
147
148
 
148
149
  // Drawings
149
150
  Fill(props?: DrawingNodeProps) {
150
- return NATIVE_DOM
151
+ return this.native
151
152
  ? global.SkiaDomApi.FillNode(props ?? {})
152
153
  : new FillNode(this.ctx, props);
153
154
  }
154
155
 
155
156
  Image(props: ImageProps) {
156
- return NATIVE_DOM
157
+ return this.native
157
158
  ? global.SkiaDomApi.ImageNode(props ?? {})
158
159
  : new ImageNode(this.ctx, props);
159
160
  }
160
161
 
161
162
  Circle(props: CircleProps) {
162
- return NATIVE_DOM
163
+ return this.native
163
164
  ? global.SkiaDomApi.CircleNode(props ?? {})
164
165
  : new CircleNode(this.ctx, props);
165
166
  }
166
167
 
167
168
  Path(props: PathProps) {
168
- return NATIVE_DOM
169
+ return this.native
169
170
  ? global.SkiaDomApi.PathNode(props ?? {})
170
171
  : new PathNode(this.ctx, props);
171
172
  }
172
173
 
173
174
  Line(props: LineProps) {
174
- return NATIVE_DOM
175
+ return this.native
175
176
  ? global.SkiaDomApi.LineNode(props ?? {})
176
177
  : new LineNode(this.ctx, props);
177
178
  }
178
179
 
179
180
  Oval(props: OvalProps) {
180
- return NATIVE_DOM
181
+ return this.native
181
182
  ? global.SkiaDomApi.OvalNode(props ?? {})
182
183
  : new OvalNode(this.ctx, props);
183
184
  }
184
185
 
185
186
  Patch(props: PatchProps) {
186
- return NATIVE_DOM
187
+ return this.native
187
188
  ? global.SkiaDomApi.PatchNode(props ?? {})
188
189
  : new PatchNode(this.ctx, props);
189
190
  }
190
191
 
191
192
  Points(props: PointsProps) {
192
- return NATIVE_DOM
193
+ return this.native
193
194
  ? global.SkiaDomApi.PointsNode(props ?? {})
194
195
  : new PointsNode(this.ctx, props);
195
196
  }
196
197
 
197
198
  Rect(props: RectProps) {
198
- return NATIVE_DOM
199
+ return this.native
199
200
  ? global.SkiaDomApi.RectNode(props)
200
201
  : new RectNode(this.ctx, props);
201
202
  }
202
203
 
203
204
  RRect(props: RoundedRectProps) {
204
- return NATIVE_DOM
205
+ return this.native
205
206
  ? global.SkiaDomApi.RRectNode(props)
206
207
  : new RRectNode(this.ctx, props);
207
208
  }
208
209
 
209
210
  Vertices(props: VerticesProps) {
210
- return NATIVE_DOM
211
+ return this.native
211
212
  ? global.SkiaDomApi.VerticesNode(props)
212
213
  : new VerticesNode(this.ctx, props);
213
214
  }
214
215
 
215
216
  Text(props: TextProps) {
216
- return NATIVE_DOM
217
+ return this.native
217
218
  ? global.SkiaDomApi.TextNode(props)
218
219
  : new TextNode(this.ctx, props);
219
220
  }
220
221
 
221
222
  TextPath(props: TextPathProps) {
222
- return NATIVE_DOM
223
+ return this.native
223
224
  ? global.SkiaDomApi.TextPathNode(props)
224
225
  : new TextPathNode(this.ctx, props);
225
226
  }
226
227
 
227
228
  TextBlob(props: TextBlobProps) {
228
- return NATIVE_DOM
229
+ return this.native
229
230
  ? global.SkiaDomApi.TextBlobNode(props)
230
231
  : new TextBlobNode(this.ctx, props);
231
232
  }
232
233
 
233
234
  Glyphs(props: GlyphsProps) {
234
- return NATIVE_DOM
235
+ return this.native
235
236
  ? global.SkiaDomApi.GlyphsNode(props)
236
237
  : new GlyphsNode(this.ctx, props);
237
238
  }
238
239
 
239
240
  DiffRect(props: DiffRectProps) {
240
- return NATIVE_DOM
241
+ return this.native
241
242
  ? global.SkiaDomApi.DiffRectNode(props)
242
243
  : new DiffRectNode(this.ctx, props);
243
244
  }
244
245
 
245
246
  Picture(props: PictureProps) {
246
- return NATIVE_DOM
247
+ return this.native
247
248
  ? global.SkiaDomApi.PictureNode(props)
248
249
  : new PictureNode(this.ctx, props);
249
250
  }
250
251
 
252
+ Atlas(props: AtlasProps) {
253
+ return this.native
254
+ ? global.SkiaDomApi.AtlasNode(props)
255
+ : new AtlasNode(this.ctx, props);
256
+ }
257
+
251
258
  ImageSVG(props: ImageSVGProps) {
252
- return NATIVE_DOM
259
+ return this.native
253
260
  ? global.SkiaDomApi.ImageSVGNode(props)
254
261
  : new ImageSVGNode(this.ctx, props);
255
262
  }
256
263
 
257
264
  // BlurMaskFilters
258
265
  BlurMaskFilter(props: BlurMaskFilterProps) {
259
- return NATIVE_DOM
266
+ return this.native
260
267
  ? global.SkiaDomApi.BlurMaskFilterNode(props)
261
268
  : new BlurMaskFilterNode(this.ctx, props);
262
269
  }
263
270
 
264
271
  // ImageFilters
265
272
  BlendImageFilter(props: BlendImageFilterProps) {
266
- return NATIVE_DOM
273
+ return this.native
267
274
  ? global.SkiaDomApi.BlendImageFilterNode(props)
268
275
  : new BlendImageFilterNode(this.ctx, props);
269
276
  }
270
277
 
271
278
  DropShadowImageFilter(props: DropShadowImageFilterProps) {
272
- return NATIVE_DOM
279
+ return this.native
273
280
  ? global.SkiaDomApi.DropShadowImageFilterNode(props)
274
281
  : new DropShadowImageFilterNode(this.ctx, props);
275
282
  }
276
283
 
277
284
  DisplacementMapImageFilter(props: DisplacementMapImageFilterProps) {
278
- return NATIVE_DOM
285
+ return this.native
279
286
  ? global.SkiaDomApi.DisplacementMapImageFilterNode(props)
280
287
  : new DisplacementMapImageFilterNode(this.ctx, props);
281
288
  }
282
289
 
283
290
  BlurImageFilter(props: BlurImageFilterProps) {
284
- return NATIVE_DOM
291
+ return this.native
285
292
  ? global.SkiaDomApi.BlurImageFilterNode(props)
286
293
  : new BlurImageFilterNode(this.ctx, props);
287
294
  }
288
295
 
289
296
  OffsetImageFilter(props: OffsetImageFilterProps) {
290
- return NATIVE_DOM
297
+ return this.native
291
298
  ? global.SkiaDomApi.OffsetImageFilterNode(props)
292
299
  : new OffsetImageFilterNode(this.ctx, props);
293
300
  }
294
301
 
295
302
  MorphologyImageFilter(props: MorphologyImageFilterProps) {
296
- return NATIVE_DOM
303
+ return this.native
297
304
  ? global.SkiaDomApi.MorphologyImageFilterNode(props)
298
305
  : new MorphologyImageFilterNode(this.ctx, props);
299
306
  }
300
307
 
301
308
  RuntimeShaderImageFilter(props: RuntimeShaderImageFilterProps) {
302
- return NATIVE_DOM
309
+ return this.native
303
310
  ? global.SkiaDomApi.RuntimeShaderImageFilterNode(props)
304
311
  : new RuntimeShaderImageFilterNode(this.ctx, props);
305
312
  }
306
313
 
307
314
  // Color Filters
308
315
  MatrixColorFilter(props: MatrixColorFilterProps) {
309
- return NATIVE_DOM
316
+ return this.native
310
317
  ? global.SkiaDomApi.MatrixColorFilterNode(props)
311
318
  : new MatrixColorFilterNode(this.ctx, props);
312
319
  }
313
320
 
314
321
  BlendColorFilter(props: BlendColorFilterProps) {
315
- return NATIVE_DOM
322
+ return this.native
316
323
  ? global.SkiaDomApi.BlendColorFilterNode(props)
317
324
  : new BlendColorFilterNode(this.ctx, props);
318
325
  }
319
326
 
320
327
  LumaColorFilter() {
321
- return NATIVE_DOM
328
+ return this.native
322
329
  ? global.SkiaDomApi.LumaColorFilterNode()
323
330
  : new LumaColorFilterNode(this.ctx);
324
331
  }
@@ -338,136 +345,136 @@ export class JsiSkDOM implements SkDOM {
338
345
  }
339
346
 
340
347
  LerpColorFilter(props: LerpColorFilterProps) {
341
- return NATIVE_DOM
348
+ return this.native
342
349
  ? global.SkiaDomApi.LerpColorFilterNode(props)
343
350
  : new LerpColorFilterNode(this.ctx, props);
344
351
  }
345
352
 
346
353
  // Shaders
347
354
  Shader(props: ShaderProps) {
348
- return NATIVE_DOM
355
+ return this.native
349
356
  ? global.SkiaDomApi.ShaderNode(props)
350
357
  : new ShaderNode(this.ctx, props);
351
358
  }
352
359
 
353
360
  ImageShader(props: ImageShaderProps) {
354
- return NATIVE_DOM
361
+ return this.native
355
362
  ? global.SkiaDomApi.ImageShaderNode(props)
356
363
  : new ImageShaderNode(this.ctx, props);
357
364
  }
358
365
 
359
366
  ColorShader(props: ColorProps) {
360
- return NATIVE_DOM
367
+ return this.native
361
368
  ? global.SkiaDomApi.ColorShaderNode(props)
362
369
  : new ColorNode(this.ctx, props);
363
370
  }
364
371
 
365
372
  SweepGradient(props: SweepGradientProps) {
366
- return NATIVE_DOM
373
+ return this.native
367
374
  ? global.SkiaDomApi.SweepGradientNode(props)
368
375
  : new SweepGradientNode(this.ctx, props);
369
376
  }
370
377
 
371
378
  Turbulence(props: TurbulenceProps) {
372
- return NATIVE_DOM
379
+ return this.native
373
380
  ? global.SkiaDomApi.TurbulenceNode(props)
374
381
  : new TurbulenceNode(this.ctx, props);
375
382
  }
376
383
 
377
384
  FractalNoise(props: FractalNoiseProps) {
378
- return NATIVE_DOM
385
+ return this.native
379
386
  ? global.SkiaDomApi.FractalNoiseNode(props)
380
387
  : new FractalNoiseNode(this.ctx, props);
381
388
  }
382
389
 
383
390
  LinearGradient(props: LinearGradientProps) {
384
- return NATIVE_DOM
391
+ return this.native
385
392
  ? global.SkiaDomApi.LinearGradientNode(props)
386
393
  : new LinearGradientNode(this.ctx, props);
387
394
  }
388
395
 
389
396
  RadialGradient(props: RadialGradientProps) {
390
- return NATIVE_DOM
397
+ return this.native
391
398
  ? global.SkiaDomApi.RadialGradientNode(props)
392
399
  : new RadialGradientNode(this.ctx, props);
393
400
  }
394
401
 
395
402
  TwoPointConicalGradient(props: TwoPointConicalGradientProps) {
396
- return NATIVE_DOM
403
+ return this.native
397
404
  ? global.SkiaDomApi.TwoPointConicalGradientNode(props)
398
405
  : new TwoPointConicalGradientNode(this.ctx, props);
399
406
  }
400
407
 
401
408
  // Path Effects
402
409
  CornerPathEffect(props: CornerPathEffectProps) {
403
- return NATIVE_DOM
410
+ return this.native
404
411
  ? global.SkiaDomApi.CornerPathEffectNode(props)
405
412
  : new CornerPathEffectNode(this.ctx, props);
406
413
  }
407
414
 
408
415
  DiscretePathEffect(props: DiscretePathEffectProps) {
409
- return NATIVE_DOM
416
+ return this.native
410
417
  ? global.SkiaDomApi.DiscretePathEffectNode(props)
411
418
  : new DiscretePathEffectNode(this.ctx, props);
412
419
  }
413
420
 
414
421
  DashPathEffect(props: DashPathEffectProps) {
415
- return NATIVE_DOM
422
+ return this.native
416
423
  ? global.SkiaDomApi.DashPathEffectNode(props)
417
424
  : new DashPathEffectNode(this.ctx, props);
418
425
  }
419
426
 
420
427
  Path1DPathEffect(props: Path1DPathEffectProps) {
421
- return NATIVE_DOM
428
+ return this.native
422
429
  ? global.SkiaDomApi.Path1DPathEffectNode(props)
423
430
  : new Path1DPathEffectNode(this.ctx, props);
424
431
  }
425
432
 
426
433
  Path2DPathEffect(props: Path2DPathEffectProps) {
427
- return NATIVE_DOM
434
+ return this.native
428
435
  ? global.SkiaDomApi.Path2DPathEffectNode(props)
429
436
  : new Path2DPathEffectNode(this.ctx, props);
430
437
  }
431
438
 
432
439
  SumPathEffect() {
433
- return NATIVE_DOM
440
+ return this.native
434
441
  ? global.SkiaDomApi.SumPathEffectNode()
435
442
  : new SumPathEffectNode(this.ctx);
436
443
  }
437
444
 
438
445
  Line2DPathEffect(props: Line2DPathEffectProps) {
439
- return NATIVE_DOM
446
+ return this.native
440
447
  ? global.SkiaDomApi.Line2DPathEffectNode(props)
441
448
  : new Line2DPathEffectNode(this.ctx, props);
442
449
  }
443
450
 
444
451
  Blend(props: BlendProps) {
445
- return NATIVE_DOM
452
+ return this.native
446
453
  ? global.SkiaDomApi.BlendNode(props)
447
454
  : new BlendNode(this.ctx, props);
448
455
  }
449
456
 
450
457
  BackdropFilter(props: ChildrenProps) {
451
- return NATIVE_DOM
458
+ return this.native
452
459
  ? global.SkiaDomApi.BackdropFilterNode(props)
453
460
  : new BackdropFilterNode(this.ctx, props);
454
461
  }
455
462
 
456
463
  Box(props: BoxProps) {
457
- return NATIVE_DOM
464
+ return this.native
458
465
  ? global.SkiaDomApi.BoxNode(props)
459
466
  : new BoxNode(this.ctx, props);
460
467
  }
461
468
 
462
469
  BoxShadow(props: BoxShadowProps) {
463
- return NATIVE_DOM
470
+ return this.native
464
471
  ? global.SkiaDomApi.BoxShadowNode(props)
465
472
  : new BoxShadowNode(this.ctx, props);
466
473
  }
467
474
 
468
475
  // Paragraph
469
476
  Paragraph(props: ParagraphProps) {
470
- return NATIVE_DOM
477
+ return this.native
471
478
  ? global.SkiaDomApi.ParagraphNode(props)
472
479
  : new ParagraphNode(this.ctx, props);
473
480
  }
@@ -0,0 +1,24 @@
1
+ import { BlendMode } from "../../../skia/types";
2
+ import type { AtlasProps, DrawingContext } from "../../types";
3
+ import { NodeType } from "../../types";
4
+ import { JsiDrawingNode } from "../DrawingNode";
5
+ import type { NodeContext } from "../Node";
6
+ import { enumKey } from "../datatypes";
7
+
8
+ export class AtlasNode extends JsiDrawingNode<AtlasProps, null> {
9
+ protected deriveProps() {
10
+ return null;
11
+ }
12
+
13
+ constructor(ctx: NodeContext, props: AtlasProps) {
14
+ super(ctx, NodeType.Atlas, props);
15
+ }
16
+
17
+ draw({ canvas, paint }: DrawingContext) {
18
+ const { image, sprites, transforms, colors, blendMode } = this.props;
19
+ const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;
20
+ if (image) {
21
+ canvas.drawAtlas(image, sprites, transforms, paint, blend, colors);
22
+ }
23
+ }
24
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./AtlasNode";
1
2
  export * from "./CircleNode";
2
3
  export * from "./FillNode";
3
4
  export * from "./ImageNode";
@@ -15,6 +15,8 @@ import type {
15
15
  SkSVG,
16
16
  SkPaint,
17
17
  SkRect,
18
+ SkRSXform,
19
+ SkColor,
18
20
  } from "../../skia/types";
19
21
 
20
22
  import type {
@@ -58,6 +60,13 @@ export type RectProps = RectDef & DrawingNodeProps;
58
60
 
59
61
  export type RoundedRectProps = RRectDef & DrawingNodeProps;
60
62
 
63
+ export interface AtlasProps extends DrawingNodeProps {
64
+ image: SkImage | null;
65
+ sprites: SkRect[];
66
+ transforms: SkRSXform[];
67
+ colors?: SkColor[];
68
+ }
69
+
61
70
  export interface CubicBezierHandle {
62
71
  pos: Vector;
63
72
  c1: Vector;
@@ -67,6 +67,7 @@ export const enum NodeType {
67
67
  Glyphs = "skGlyphs",
68
68
  Picture = "skPicture",
69
69
  ImageSVG = "skImageSVG",
70
+ Atlas = "skAtlas",
70
71
 
71
72
  // Paragraph
72
73
  Paragraph = "skParagraph",
@@ -36,6 +36,7 @@ import type {
36
36
  DrawingNodeProps,
37
37
  BoxProps,
38
38
  BoxShadowProps,
39
+ AtlasProps,
39
40
  } from "./Drawings";
40
41
  import type { BlurMaskFilterProps } from "./MaskFilters";
41
42
  import type {
@@ -90,6 +91,7 @@ export interface SkDOM {
90
91
  DiffRect(props: DiffRectProps): DrawingNode<DiffRectProps>;
91
92
  Picture(props: PictureProps): DrawingNode<PictureProps>;
92
93
  ImageSVG(props: ImageSVGProps): DrawingNode<ImageSVGProps>;
94
+ Atlas(props: AtlasProps): DrawingNode<AtlasProps>;
93
95
 
94
96
  // BlurMaskFilters
95
97
  BlurMaskFilter(
@@ -0,0 +1,53 @@
1
+ import { useMemo } from "react";
2
+
3
+ import type { SkColor, SkHostRect, SkPoint, SkRSXform } from "../../skia/types";
4
+ import { Skia } from "../../skia";
5
+
6
+ import { useDerivedValue, useSharedValue } from "./moduleWrapper";
7
+ import { notifyChange } from "./interpolators";
8
+
9
+ const useBuffer = <T>(
10
+ size: number,
11
+ bufferInitializer: () => T,
12
+ modifier: (input: T, index: number) => void
13
+ ) => {
14
+ const buffer = useMemo(
15
+ () => new Array(size).fill(0).map(bufferInitializer),
16
+ // eslint-disable-next-line react-hooks/exhaustive-deps
17
+ [size]
18
+ );
19
+ const transforms = useSharedValue(buffer);
20
+
21
+ useDerivedValue(() => {
22
+ buffer.forEach((val, index) => {
23
+ modifier(val, index);
24
+ });
25
+ // Assuming notifyChange is a function that notifies about the change in transforms.
26
+ notifyChange(transforms);
27
+ });
28
+
29
+ return transforms;
30
+ };
31
+
32
+ export const useRectBuffer = (
33
+ size: number,
34
+ modifier: (input: SkHostRect, index: number) => void
35
+ ) => useBuffer(size, () => Skia.XYWHRect(0, 0, 0, 0), modifier);
36
+
37
+ // Usage for RSXform Buffer
38
+ export const useRSXformBuffer = (
39
+ size: number,
40
+ modifier: (input: SkRSXform, index: number) => void
41
+ ) => useBuffer(size, () => Skia.RSXform(1, 0, 0, 0), modifier);
42
+
43
+ // Usage for Point Buffer
44
+ export const usePointBuffer = (
45
+ size: number,
46
+ modifier: (input: SkPoint, index: number) => void
47
+ ) => useBuffer(size, () => Skia.Point(0, 0), modifier);
48
+
49
+ // Usage for Color Buffer
50
+ export const useColorBuffer = (
51
+ size: number,
52
+ modifier: (input: SkColor, index: number) => void
53
+ ) => useBuffer(size, () => Skia.Color("black"), modifier);
@@ -2,3 +2,5 @@ export * from "./useAnimatedImageValue";
2
2
  export * from "./useDerivedValueOnJS";
3
3
  export * from "./renderHelpers";
4
4
  export * from "./interpolators";
5
+ export * from "./textures";
6
+ export * from "./buffers";
@@ -87,8 +87,20 @@ export const usePathInterpolation = (
87
87
  input: number[],
88
88
  outputRange: SkPath[],
89
89
  options?: ExtrapolationType
90
- ) =>
91
- useInterpolator(
90
+ ) => {
91
+ // Check if all paths in outputRange are interpolable
92
+ const allPathsInterpolable = outputRange
93
+ .slice(1)
94
+ .every((path) => outputRange[0].isInterpolatable(path));
95
+ if (!allPathsInterpolable) {
96
+ // Handle the case where not all paths are interpolable
97
+ // For example, throw an error or return early
98
+ throw new Error(
99
+ `Not all paths in the output range are interpolable.
100
+ See: https://shopify.github.io/react-native-skia/docs/animations/hooks#usepathinterpolation`
101
+ );
102
+ }
103
+ return useInterpolator(
92
104
  () => Skia.Path.Make(),
93
105
  value,
94
106
  interpolatePaths,
@@ -96,6 +108,7 @@ export const usePathInterpolation = (
96
108
  outputRange,
97
109
  options
98
110
  );
111
+ };
99
112
 
100
113
  export const useVectorInterpolation = (
101
114
  value: SharedValue<number>,
@@ -63,6 +63,7 @@ export const stopMapper: (mapperID: number) => void =
63
63
  Reanimated2?.stopMapper || throwOnMissingReanimated;
64
64
 
65
65
  export const runOnJS = Reanimated2?.runOnJS || throwOnMissingReanimated;
66
+ export const runOnUI = Reanimated2?.runOnUI || throwOnMissingReanimated;
66
67
 
67
68
  export const useAnimatedReaction: <T>(
68
69
  prepare: () => T,
@@ -0,0 +1,38 @@
1
+ import { useEffect, useMemo } from "react";
2
+ import type { ReactElement } from "react";
3
+ import type { SharedValue } from "react-native-reanimated";
4
+
5
+ import type { SkImage, SkPicture, SkSize } from "../../skia/types";
6
+ import {
7
+ drawAsImageFromPicture,
8
+ drawAsPicture,
9
+ } from "../../renderer/Offscreen";
10
+
11
+ import { runOnUI, useSharedValue } from "./moduleWrapper";
12
+
13
+ const createTextureValue = (
14
+ texture: SharedValue<SkImage | null>,
15
+ picture: SkPicture,
16
+ size: SkSize
17
+ ) => {
18
+ "worklet";
19
+ texture.value = drawAsImageFromPicture(picture, size);
20
+ };
21
+
22
+ export const useTextureValue = (element: ReactElement, size: SkSize) => {
23
+ const picture = useMemo(() => {
24
+ return drawAsPicture(element);
25
+ }, [element]);
26
+ return useTextureValueFromPicture(picture, size);
27
+ };
28
+
29
+ export const useTextureValueFromPicture = (
30
+ picture: SkPicture,
31
+ size: SkSize
32
+ ) => {
33
+ const texture = useSharedValue<SkImage | null>(null);
34
+ useEffect(() => {
35
+ runOnUI(createTextureValue)(texture, picture, size);
36
+ }, [texture, picture, size]);
37
+ return texture;
38
+ };
@@ -1,3 +1,4 @@
1
+ import { useEffect } from "react";
1
2
  import type { FrameInfo } from "react-native-reanimated";
2
3
 
3
4
  import { useAnimatedImage } from "../../skia/core/AnimatedImage";
@@ -15,10 +16,14 @@ export const useAnimatedImageValue = (source: DataSourceParam) => {
15
16
  throwOnMissingReanimated();
16
17
  const currentFrame = useSharedValue<null | SkImage>(null);
17
18
  const lastTimestamp = useSharedValue(0);
18
- const animatedImage = useAnimatedImage(source, (err) => {
19
- console.error(err);
20
- throw new Error(`Could not load animated image - got '${err.message}'`);
21
- });
19
+ const animatedImage = useAnimatedImage(
20
+ source,
21
+ (err) => {
22
+ console.error(err);
23
+ throw new Error(`Could not load animated image - got '${err.message}'`);
24
+ },
25
+ false
26
+ );
22
27
  const frameDuration =
23
28
  animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;
24
29
 
@@ -47,5 +52,11 @@ export const useAnimatedImageValue = (source: DataSourceParam) => {
47
52
  lastTimestamp.value = timestamp;
48
53
  // eslint-disable-next-line react-hooks/exhaustive-deps
49
54
  }, true);
55
+ useEffect(() => {
56
+ return () => {
57
+ animatedImage?.dispose();
58
+ };
59
+ // eslint-disable-next-line react-hooks/exhaustive-deps
60
+ }, []);
50
61
  return currentFrame;
51
62
  };
@@ -25,7 +25,7 @@ export const makeOffscreenSurface = (width: number, height: number) => {
25
25
  };
26
26
 
27
27
  export const drawOffscreen = (surface: SkSurface, element: ReactNode) => {
28
- const root = new SkiaRoot(Skia);
28
+ const root = new SkiaRoot(Skia, false);
29
29
  root.render(element);
30
30
  const canvas = surface.getCanvas();
31
31
  const ctx = new JsiDrawingContext(Skia, canvas);