@shopify/react-native-skia 0.1.191 → 0.1.193

Sign up to get free protection for your applications and to get access to all the features.
Files changed (615) hide show
  1. package/android/CMakeLists.txt +1 -1
  2. package/android/build.gradle +1 -0
  3. package/android/cpp/jni/JniPlatformContext.cpp +1 -1
  4. package/cpp/api/JsiSkColorFilter.h +2 -17
  5. package/cpp/api/JsiSkContourMeasure.h +3 -17
  6. package/cpp/api/JsiSkContourMeasureIter.h +3 -18
  7. package/cpp/api/JsiSkData.h +1 -18
  8. package/cpp/api/JsiSkFont.h +4 -14
  9. package/cpp/api/JsiSkHostObjects.h +85 -10
  10. package/cpp/api/JsiSkImage.h +26 -16
  11. package/cpp/api/JsiSkImageFactory.h +2 -2
  12. package/cpp/api/JsiSkImageFilter.h +1 -17
  13. package/cpp/api/JsiSkMaskFilter.h +1 -17
  14. package/cpp/api/JsiSkMatrix.h +3 -6
  15. package/cpp/api/JsiSkPaint.h +3 -15
  16. package/cpp/api/JsiSkPath.h +10 -21
  17. package/cpp/api/JsiSkPathEffect.h +2 -17
  18. package/cpp/api/JsiSkPicture.h +4 -18
  19. package/cpp/api/JsiSkPictureRecorder.h +4 -1
  20. package/cpp/api/JsiSkPoint.h +6 -1
  21. package/cpp/api/JsiSkRRect.h +6 -1
  22. package/cpp/api/JsiSkRSXform.h +4 -6
  23. package/cpp/api/JsiSkRect.h +6 -2
  24. package/cpp/api/JsiSkRuntimeEffect.h +4 -7
  25. package/cpp/api/JsiSkRuntimeShaderBuilder.h +2 -10
  26. package/cpp/api/JsiSkSVG.h +1 -10
  27. package/cpp/api/JsiSkShader.h +2 -16
  28. package/cpp/api/JsiSkSurface.h +3 -16
  29. package/cpp/api/JsiSkTextBlob.h +2 -18
  30. package/cpp/api/JsiSkTypeface.h +1 -22
  31. package/cpp/api/JsiSkVertices.h +3 -17
  32. package/cpp/rnskia/dom/base/Declaration.h +5 -7
  33. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +1 -0
  34. package/cpp/rnskia/dom/nodes/JsiPathNode.h +2 -2
  35. package/cpp/rnskia/dom/props/BoxShadowProps.h +2 -0
  36. package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -2
  37. package/cpp/rnskia/values/RNSkValue.h +1 -1
  38. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +2 -8
  39. package/cpp/skia/include/android/SkImageAndroid.h +101 -0
  40. package/cpp/skia/include/codec/SkAndroidCodec.h +26 -8
  41. package/cpp/skia/include/codec/SkCodec.h +31 -17
  42. package/cpp/skia/include/codec/SkEncodedImageFormat.h +36 -0
  43. package/cpp/skia/include/codec/SkPixmapUtils.h +31 -0
  44. package/cpp/skia/include/config/SkUserConfig.h +61 -29
  45. package/cpp/skia/include/core/SkBitmap.h +25 -25
  46. package/cpp/skia/include/core/SkBlurTypes.h +0 -2
  47. package/cpp/skia/include/core/SkCanvas.h +32 -15
  48. package/cpp/skia/include/core/SkCapabilities.h +2 -2
  49. package/cpp/skia/include/core/SkColor.h +2 -0
  50. package/cpp/skia/include/core/SkColorPriv.h +19 -4
  51. package/cpp/skia/include/core/SkColorSpace.h +14 -17
  52. package/cpp/skia/include/core/SkColorType.h +1 -0
  53. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  54. package/cpp/skia/include/core/SkCoverageMode.h +0 -2
  55. package/cpp/skia/include/core/SkCubicMap.h +2 -0
  56. package/cpp/skia/include/core/SkData.h +5 -2
  57. package/cpp/skia/include/core/SkDataTable.h +6 -2
  58. package/cpp/skia/include/core/SkDeferredDisplayList.h +11 -10
  59. package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +9 -8
  60. package/cpp/skia/include/core/SkDrawable.h +10 -2
  61. package/cpp/skia/include/core/SkEncodedImageFormat.h +3 -30
  62. package/cpp/skia/include/core/SkFlattenable.h +4 -2
  63. package/cpp/skia/include/core/SkFont.h +1 -0
  64. package/cpp/skia/include/core/SkFontMetrics.h +1 -0
  65. package/cpp/skia/include/core/SkFontMgr.h +20 -29
  66. package/cpp/skia/include/core/SkFontStyle.h +4 -1
  67. package/cpp/skia/include/core/SkGraphics.h +21 -18
  68. package/cpp/skia/include/core/SkICC.h +3 -13
  69. package/cpp/skia/include/core/SkImage.h +395 -717
  70. package/cpp/skia/include/core/SkImageGenerator.h +19 -74
  71. package/cpp/skia/include/core/SkImageInfo.h +7 -5
  72. package/cpp/skia/include/core/SkM44.h +11 -0
  73. package/cpp/skia/include/core/SkMaskFilter.h +6 -3
  74. package/cpp/skia/include/core/SkMatrix.h +14 -4
  75. package/cpp/skia/include/core/SkMesh.h +52 -18
  76. package/cpp/skia/include/core/SkMilestone.h +1 -1
  77. package/cpp/skia/include/core/SkPaint.h +11 -34
  78. package/cpp/skia/include/core/SkPath.h +23 -4
  79. package/cpp/skia/include/core/SkPathBuilder.h +13 -5
  80. package/cpp/skia/include/core/SkPathMeasure.h +1 -1
  81. package/cpp/skia/include/core/SkPathTypes.h +0 -2
  82. package/cpp/skia/include/core/SkPathUtils.h +42 -0
  83. package/cpp/skia/include/core/SkPicture.h +3 -2
  84. package/cpp/skia/include/core/SkPictureRecorder.h +2 -0
  85. package/cpp/skia/include/core/SkPixelRef.h +4 -8
  86. package/cpp/skia/include/core/SkPixmap.h +12 -20
  87. package/cpp/skia/include/core/SkPoint.h +4 -2
  88. package/cpp/skia/include/core/SkPromiseImageTexture.h +2 -2
  89. package/cpp/skia/include/core/SkRRect.h +5 -1
  90. package/cpp/skia/include/core/SkRect.h +6 -3
  91. package/cpp/skia/include/core/SkRefCnt.h +9 -14
  92. package/cpp/skia/include/core/SkRegion.h +1 -1
  93. package/cpp/skia/include/core/SkScalar.h +2 -4
  94. package/cpp/skia/include/core/SkSerialProcs.h +18 -10
  95. package/cpp/skia/include/core/SkShader.h +1 -64
  96. package/cpp/skia/include/core/SkSize.h +2 -0
  97. package/cpp/skia/include/core/SkSpan.h +4 -112
  98. package/cpp/skia/include/core/SkStream.h +11 -12
  99. package/cpp/skia/include/core/SkString.h +9 -25
  100. package/cpp/skia/include/core/SkStrokeRec.h +1 -1
  101. package/cpp/skia/include/core/SkSurface.h +83 -61
  102. package/cpp/skia/include/core/SkSurfaceCharacterization.h +3 -3
  103. package/cpp/skia/include/core/SkSurfaceProps.h +9 -1
  104. package/cpp/skia/include/core/SkTextBlob.h +2 -2
  105. package/cpp/skia/include/core/SkTextureCompressionType.h +30 -0
  106. package/cpp/skia/include/core/SkTime.h +1 -1
  107. package/cpp/skia/include/core/SkTypeface.h +9 -2
  108. package/cpp/skia/include/core/SkTypes.h +37 -466
  109. package/cpp/skia/include/core/SkVertices.h +2 -0
  110. package/cpp/skia/include/core/SkYUVAInfo.h +4 -0
  111. package/cpp/skia/include/core/SkYUVAPixmaps.h +7 -1
  112. package/cpp/skia/include/docs/SkPDFDocument.h +12 -1
  113. package/cpp/skia/include/effects/SkColorMatrix.h +2 -1
  114. package/cpp/skia/include/effects/SkGradientShader.h +65 -14
  115. package/cpp/skia/include/effects/SkImageFilters.h +0 -11
  116. package/cpp/skia/include/effects/SkRuntimeEffect.h +41 -11
  117. package/cpp/skia/include/encode/SkEncoder.h +7 -3
  118. package/cpp/skia/include/encode/SkICC.h +36 -0
  119. package/cpp/skia/include/encode/SkJpegEncoder.h +102 -71
  120. package/cpp/skia/include/encode/SkPngEncoder.h +89 -71
  121. package/cpp/skia/include/encode/SkWebpEncoder.h +65 -38
  122. package/cpp/skia/include/gpu/GpuTypes.h +23 -1
  123. package/cpp/skia/include/gpu/GrBackendSurface.h +9 -7
  124. package/cpp/skia/include/gpu/GrContextOptions.h +28 -9
  125. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +6 -4
  126. package/cpp/skia/include/gpu/GrDirectContext.h +84 -63
  127. package/cpp/skia/include/gpu/GrDriverBugWorkarounds.h +2 -1
  128. package/cpp/skia/include/gpu/GrRecordingContext.h +9 -5
  129. package/cpp/skia/include/gpu/GrTypes.h +18 -18
  130. package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +4 -4
  131. package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +3 -3
  132. package/cpp/skia/include/gpu/ganesh/GrTextureGenerator.h +77 -0
  133. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +385 -0
  134. package/cpp/skia/include/gpu/gl/GrGLExtensions.h +3 -3
  135. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  136. package/cpp/skia/include/gpu/gl/GrGLInterface.h +0 -3
  137. package/cpp/skia/include/gpu/gl/GrGLTypes.h +2 -1
  138. package/cpp/skia/include/gpu/graphite/BackendTexture.h +72 -3
  139. package/cpp/skia/include/gpu/graphite/Context.h +85 -32
  140. package/cpp/skia/include/gpu/graphite/ContextOptions.h +15 -11
  141. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +55 -5
  142. package/cpp/skia/include/gpu/graphite/ImageProvider.h +6 -4
  143. package/cpp/skia/include/gpu/graphite/Recorder.h +41 -11
  144. package/cpp/skia/include/gpu/graphite/Recording.h +50 -3
  145. package/cpp/skia/include/gpu/graphite/TextureInfo.h +47 -8
  146. package/cpp/skia/include/gpu/graphite/YUVABackendTextures.h +139 -0
  147. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +40 -0
  148. package/cpp/skia/include/gpu/graphite/dawn/DawnUtils.h +28 -0
  149. package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +1 -1
  150. package/cpp/skia/include/gpu/graphite/mtl/{MtlTypes.h → MtlGraphiteTypes.h} +7 -6
  151. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteUtils.h +27 -0
  152. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +4 -9
  153. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteUtils.h +28 -0
  154. package/cpp/skia/include/gpu/mock/GrMockTypes.h +17 -13
  155. package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
  156. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  157. package/cpp/skia/include/gpu/vk/GrVkTypes.h +3 -3
  158. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +3 -3
  159. package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +5 -7
  160. package/cpp/skia/include/pathops/SkPathOps.h +3 -3
  161. package/cpp/skia/include/ports/SkFontMgr_data.h +22 -0
  162. package/cpp/skia/include/ports/SkFontMgr_indirect.h +14 -14
  163. package/cpp/skia/include/ports/SkRemotableFontMgr.h +2 -2
  164. package/cpp/skia/include/ports/SkTypeface_win.h +2 -1
  165. package/cpp/skia/include/private/SkChecksum.h +32 -7
  166. package/cpp/skia/include/private/SkColorData.h +1 -26
  167. package/cpp/skia/include/private/SkGainmapInfo.h +97 -0
  168. package/cpp/skia/include/private/SkGainmapShader.h +53 -0
  169. package/cpp/skia/include/private/SkIDChangeListener.h +4 -3
  170. package/cpp/skia/include/private/SkJpegGainmapEncoder.h +71 -0
  171. package/cpp/skia/include/private/SkJpegMetadataDecoder.h +61 -0
  172. package/cpp/skia/include/private/SkOpts_spi.h +3 -1
  173. package/cpp/skia/include/private/SkPathRef.h +64 -47
  174. package/cpp/skia/include/private/SkSLDefines.h +5 -5
  175. package/cpp/skia/include/private/SkSLSampleUsage.h +0 -4
  176. package/cpp/skia/include/private/SkSpinlock.h +1 -1
  177. package/cpp/skia/include/private/SkWeakRefCnt.h +3 -0
  178. package/cpp/skia/include/private/{SingleOwner.h → base/SingleOwner.h} +8 -5
  179. package/cpp/skia/include/private/base/SkAPI.h +52 -0
  180. package/cpp/skia/include/private/base/SkAlign.h +39 -0
  181. package/cpp/skia/include/private/base/SkAlignedStorage.h +32 -0
  182. package/cpp/skia/include/private/base/SkAssert.h +92 -0
  183. package/cpp/skia/include/private/base/SkAttributes.h +102 -0
  184. package/cpp/skia/include/private/base/SkCPUTypes.h +25 -0
  185. package/cpp/skia/include/private/base/SkContainers.h +46 -0
  186. package/cpp/skia/include/private/base/SkDebug.h +27 -0
  187. package/cpp/skia/include/private/{SkDeque.h → base/SkDeque.h} +3 -1
  188. package/cpp/skia/include/private/base/SkFeatures.h +151 -0
  189. package/cpp/skia/include/private/{SkFixed.h → base/SkFixed.h} +9 -7
  190. package/cpp/skia/include/private/{SkFloatBits.h → base/SkFloatBits.h} +2 -3
  191. package/cpp/skia/include/private/{SkFloatingPoint.h → base/SkFloatingPoint.h} +18 -9
  192. package/cpp/skia/include/private/base/SkLoadUserConfig.h +63 -0
  193. package/cpp/skia/include/private/{SkMacros.h → base/SkMacros.h} +17 -2
  194. package/cpp/skia/include/private/{SkMalloc.h → base/SkMalloc.h} +4 -7
  195. package/cpp/skia/include/{core → private/base}/SkMath.h +25 -2
  196. package/cpp/skia/include/private/{SkMutex.h → base/SkMutex.h} +5 -5
  197. package/cpp/skia/include/private/{SkNoncopyable.h → base/SkNoncopyable.h} +2 -2
  198. package/cpp/skia/include/private/{SkOnce.h → base/SkOnce.h} +3 -1
  199. package/cpp/skia/include/private/base/SkPathEnums.h +25 -0
  200. package/cpp/skia/include/private/{SkSafe32.h → base/SkSafe32.h} +16 -1
  201. package/cpp/skia/include/private/{SkSemaphore.h → base/SkSemaphore.h} +4 -3
  202. package/cpp/skia/include/private/base/SkSpan_impl.h +129 -0
  203. package/cpp/skia/include/private/base/SkTArray.h +694 -0
  204. package/cpp/skia/include/private/{SkTDArray.h → base/SkTDArray.h} +17 -54
  205. package/cpp/skia/include/private/{SkTFitsIn.h → base/SkTFitsIn.h} +14 -8
  206. package/cpp/skia/include/private/{SkTLogic.h → base/SkTLogic.h} +1 -1
  207. package/cpp/skia/include/private/{SkTemplates.h → base/SkTemplates.h} +63 -88
  208. package/cpp/skia/include/private/{SkThreadID.h → base/SkThreadID.h} +5 -2
  209. package/cpp/skia/include/private/{SkTo.h → base/SkTo.h} +13 -2
  210. package/cpp/skia/include/private/base/SkTypeTraits.h +33 -0
  211. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +130 -0
  212. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +5 -9
  213. package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +70 -0
  214. package/cpp/skia/include/private/chromium/Slug.h +0 -9
  215. package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +2 -1
  216. package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
  217. package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +1 -1
  218. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +1 -1
  219. package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +1 -1
  220. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +3 -2
  221. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +1 -1
  222. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +17 -23
  223. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -2
  224. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +38 -0
  225. package/cpp/skia/include/private/gpu/graphite/{MtlTypesPriv.h → MtlGraphiteTypesPriv.h} +5 -5
  226. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +1 -9
  227. package/cpp/skia/include/private/gpu/vk/SkiaVulkan.h +4 -0
  228. package/cpp/skia/include/utils/SkCamera.h +1 -1
  229. package/cpp/skia/include/utils/SkCustomTypeface.h +7 -1
  230. package/cpp/skia/include/utils/SkNWayCanvas.h +6 -6
  231. package/cpp/skia/include/utils/SkOrderedFontMgr.h +7 -6
  232. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +2 -2
  233. package/cpp/skia/include/utils/SkParsePath.h +1 -1
  234. package/cpp/skia/modules/skcms/skcms.h +14 -0
  235. package/cpp/skia/modules/skcms/src/Transform_inl.h +19 -0
  236. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -2
  237. package/cpp/skia/modules/skparagraph/include/Paragraph.h +72 -2
  238. package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -11
  239. package/cpp/skia/modules/skparagraph/include/ParagraphPainter.h +63 -0
  240. package/cpp/skia/modules/skparagraph/include/TextStyle.h +27 -4
  241. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +13 -13
  242. package/cpp/skia/modules/skresources/include/SkResources.h +18 -4
  243. package/cpp/skia/modules/svg/include/SkSVGAttribute.h +1 -1
  244. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +2 -2
  245. package/cpp/skia/modules/svg/include/SkSVGContainer.h +2 -2
  246. package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
  247. package/cpp/skia/modules/svg/include/SkSVGFilterContext.h +2 -2
  248. package/cpp/skia/modules/svg/include/SkSVGGradient.h +2 -2
  249. package/cpp/skia/modules/svg/include/SkSVGIDMapper.h +2 -2
  250. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
  251. package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
  252. package/cpp/skia/modules/svg/include/SkSVGTypes.h +22 -21
  253. package/cpp/skia/modules/svg/include/SkSVGValue.h +1 -1
  254. package/cpp/skia/{include/private → src/core}/SkTHash.h +41 -37
  255. package/ios/RNSkia-iOS/ViewScreenshotService.mm +1 -1
  256. package/lib/commonjs/renderer/Canvas.js +17 -1
  257. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  258. package/lib/commonjs/skia/core/Data.d.ts +2 -2
  259. package/lib/commonjs/skia/core/Data.js.map +1 -1
  260. package/lib/commonjs/skia/types/Data/Data.d.ts +2 -2
  261. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  262. package/lib/commonjs/skia/types/Image/Image.d.ts +2 -2
  263. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  264. package/lib/commonjs/skia/types/JsiInstance.d.ts +4 -4
  265. package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
  266. package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -2
  267. package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
  268. package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -2
  269. package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
  270. package/lib/commonjs/skia/web/Host.d.ts +1 -0
  271. package/lib/commonjs/skia/web/Host.js +2 -0
  272. package/lib/commonjs/skia/web/Host.js.map +1 -1
  273. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -0
  274. package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -0
  275. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  276. package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +1 -0
  277. package/lib/commonjs/skia/web/JsiSkColorFilter.js +6 -0
  278. package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
  279. package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +1 -0
  280. package/lib/commonjs/skia/web/JsiSkContourMeasure.js +6 -0
  281. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
  282. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  283. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +6 -0
  284. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  285. package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
  286. package/lib/commonjs/skia/web/JsiSkData.js +4 -2
  287. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
  288. package/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -0
  289. package/lib/commonjs/skia/web/JsiSkFont.js +6 -0
  290. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  291. package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -1
  292. package/lib/commonjs/skia/web/JsiSkImage.js +6 -4
  293. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  294. package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +1 -0
  295. package/lib/commonjs/skia/web/JsiSkImageFilter.js +6 -0
  296. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
  297. package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +1 -0
  298. package/lib/commonjs/skia/web/JsiSkMaskFilter.js +6 -0
  299. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
  300. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -0
  301. package/lib/commonjs/skia/web/JsiSkMatrix.js +5 -0
  302. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  303. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  304. package/lib/commonjs/skia/web/JsiSkPaint.js +6 -0
  305. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  306. package/lib/commonjs/skia/web/JsiSkPath.d.ts +1 -0
  307. package/lib/commonjs/skia/web/JsiSkPath.js +6 -0
  308. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  309. package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +1 -0
  310. package/lib/commonjs/skia/web/JsiSkPathEffect.js +6 -0
  311. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
  312. package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -0
  313. package/lib/commonjs/skia/web/JsiSkPicture.js +6 -1
  314. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  315. package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  316. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +6 -0
  317. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  318. package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -0
  319. package/lib/commonjs/skia/web/JsiSkPoint.js +5 -0
  320. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  321. package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -0
  322. package/lib/commonjs/skia/web/JsiSkRRect.js +5 -0
  323. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  324. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -0
  325. package/lib/commonjs/skia/web/JsiSkRSXform.js +5 -0
  326. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  327. package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -0
  328. package/lib/commonjs/skia/web/JsiSkRect.js +5 -0
  329. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  330. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  331. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -0
  332. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  333. package/lib/commonjs/skia/web/JsiSkShader.d.ts +1 -0
  334. package/lib/commonjs/skia/web/JsiSkShader.js +6 -0
  335. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
  336. package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -0
  337. package/lib/commonjs/skia/web/JsiSkSurface.js +6 -0
  338. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  339. package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +1 -0
  340. package/lib/commonjs/skia/web/JsiSkTextBlob.js +6 -0
  341. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
  342. package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +1 -1
  343. package/lib/commonjs/skia/web/JsiSkTypeface.js +6 -4
  344. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
  345. package/lib/commonjs/skia/web/JsiSkVertices.d.ts +1 -0
  346. package/lib/commonjs/skia/web/JsiSkVertices.js +6 -0
  347. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
  348. package/lib/commonjs/values/hooks/useComputedValue.js +1 -1
  349. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  350. package/lib/commonjs/values/types.d.ts +1 -1
  351. package/lib/commonjs/values/types.js.map +1 -1
  352. package/lib/commonjs/values/web/RNSkComputedValue.d.ts +1 -1
  353. package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
  354. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  355. package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +1 -1
  356. package/lib/commonjs/values/web/RNSkReadonlyValue.js +1 -1
  357. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  358. package/lib/commonjs/views/SkiaDomView.web.js +14 -4
  359. package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
  360. package/lib/commonjs/views/types.d.ts +2 -1
  361. package/lib/commonjs/views/types.js.map +1 -1
  362. package/lib/module/renderer/Canvas.js +15 -1
  363. package/lib/module/renderer/Canvas.js.map +1 -1
  364. package/lib/module/skia/core/Data.d.ts +2 -2
  365. package/lib/module/skia/core/Data.js.map +1 -1
  366. package/lib/module/skia/types/Data/Data.d.ts +2 -2
  367. package/lib/module/skia/types/Data/Data.js.map +1 -1
  368. package/lib/module/skia/types/Image/Image.d.ts +2 -2
  369. package/lib/module/skia/types/Image/Image.js.map +1 -1
  370. package/lib/module/skia/types/JsiInstance.d.ts +4 -4
  371. package/lib/module/skia/types/JsiInstance.js.map +1 -1
  372. package/lib/module/skia/types/SVG/SVG.d.ts +2 -2
  373. package/lib/module/skia/types/SVG/SVG.js.map +1 -1
  374. package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -2
  375. package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
  376. package/lib/module/skia/web/Host.d.ts +1 -0
  377. package/lib/module/skia/web/Host.js +2 -0
  378. package/lib/module/skia/web/Host.js.map +1 -1
  379. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
  380. package/lib/module/skia/web/JsiSkCanvas.js +6 -0
  381. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  382. package/lib/module/skia/web/JsiSkColorFilter.d.ts +1 -0
  383. package/lib/module/skia/web/JsiSkColorFilter.js +6 -0
  384. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  385. package/lib/module/skia/web/JsiSkContourMeasure.d.ts +1 -0
  386. package/lib/module/skia/web/JsiSkContourMeasure.js +6 -0
  387. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  388. package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  389. package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -0
  390. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  391. package/lib/module/skia/web/JsiSkData.d.ts +1 -1
  392. package/lib/module/skia/web/JsiSkData.js +4 -2
  393. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  394. package/lib/module/skia/web/JsiSkFont.d.ts +1 -0
  395. package/lib/module/skia/web/JsiSkFont.js +6 -0
  396. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  397. package/lib/module/skia/web/JsiSkImage.d.ts +1 -1
  398. package/lib/module/skia/web/JsiSkImage.js +6 -4
  399. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  400. package/lib/module/skia/web/JsiSkImageFilter.d.ts +1 -0
  401. package/lib/module/skia/web/JsiSkImageFilter.js +6 -0
  402. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  403. package/lib/module/skia/web/JsiSkMaskFilter.d.ts +1 -0
  404. package/lib/module/skia/web/JsiSkMaskFilter.js +6 -0
  405. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  406. package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -0
  407. package/lib/module/skia/web/JsiSkMatrix.js +5 -0
  408. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  409. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  410. package/lib/module/skia/web/JsiSkPaint.js +6 -0
  411. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  412. package/lib/module/skia/web/JsiSkPath.d.ts +1 -0
  413. package/lib/module/skia/web/JsiSkPath.js +6 -0
  414. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  415. package/lib/module/skia/web/JsiSkPathEffect.d.ts +1 -0
  416. package/lib/module/skia/web/JsiSkPathEffect.js +6 -0
  417. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  418. package/lib/module/skia/web/JsiSkPicture.d.ts +1 -0
  419. package/lib/module/skia/web/JsiSkPicture.js +6 -0
  420. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  421. package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  422. package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -0
  423. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  424. package/lib/module/skia/web/JsiSkPoint.d.ts +1 -0
  425. package/lib/module/skia/web/JsiSkPoint.js +5 -0
  426. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  427. package/lib/module/skia/web/JsiSkRRect.d.ts +1 -0
  428. package/lib/module/skia/web/JsiSkRRect.js +5 -0
  429. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  430. package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -0
  431. package/lib/module/skia/web/JsiSkRSXform.js +5 -0
  432. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  433. package/lib/module/skia/web/JsiSkRect.d.ts +1 -0
  434. package/lib/module/skia/web/JsiSkRect.js +5 -0
  435. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  436. package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  437. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -0
  438. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  439. package/lib/module/skia/web/JsiSkShader.d.ts +1 -0
  440. package/lib/module/skia/web/JsiSkShader.js +6 -0
  441. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  442. package/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
  443. package/lib/module/skia/web/JsiSkSurface.js +6 -0
  444. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  445. package/lib/module/skia/web/JsiSkTextBlob.d.ts +1 -0
  446. package/lib/module/skia/web/JsiSkTextBlob.js +6 -0
  447. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  448. package/lib/module/skia/web/JsiSkTypeface.d.ts +1 -1
  449. package/lib/module/skia/web/JsiSkTypeface.js +6 -4
  450. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  451. package/lib/module/skia/web/JsiSkVertices.d.ts +1 -0
  452. package/lib/module/skia/web/JsiSkVertices.js +6 -0
  453. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  454. package/lib/module/values/hooks/useComputedValue.js +1 -1
  455. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  456. package/lib/module/values/types.d.ts +1 -1
  457. package/lib/module/values/types.js.map +1 -1
  458. package/lib/module/values/web/RNSkComputedValue.d.ts +1 -1
  459. package/lib/module/values/web/RNSkComputedValue.js +1 -1
  460. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  461. package/lib/module/values/web/RNSkReadonlyValue.d.ts +1 -1
  462. package/lib/module/values/web/RNSkReadonlyValue.js +1 -1
  463. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  464. package/lib/module/views/SkiaDomView.web.js +13 -4
  465. package/lib/module/views/SkiaDomView.web.js.map +1 -1
  466. package/lib/module/views/types.d.ts +2 -1
  467. package/lib/module/views/types.js.map +1 -1
  468. package/lib/typescript/src/skia/core/Data.d.ts +2 -2
  469. package/lib/typescript/src/skia/types/Data/Data.d.ts +2 -2
  470. package/lib/typescript/src/skia/types/Image/Image.d.ts +2 -2
  471. package/lib/typescript/src/skia/types/JsiInstance.d.ts +4 -4
  472. package/lib/typescript/src/skia/types/SVG/SVG.d.ts +2 -2
  473. package/lib/typescript/src/skia/types/Typeface/Typeface.d.ts +2 -2
  474. package/lib/typescript/src/skia/web/Host.d.ts +1 -0
  475. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -0
  476. package/lib/typescript/src/skia/web/JsiSkColorFilter.d.ts +1 -0
  477. package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +1 -0
  478. package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
  479. package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
  480. package/lib/typescript/src/skia/web/JsiSkFont.d.ts +1 -0
  481. package/lib/typescript/src/skia/web/JsiSkImage.d.ts +1 -1
  482. package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +1 -0
  483. package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +1 -0
  484. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -0
  485. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  486. package/lib/typescript/src/skia/web/JsiSkPath.d.ts +1 -0
  487. package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +1 -0
  488. package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -0
  489. package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -0
  490. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -0
  491. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -0
  492. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -0
  493. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -0
  494. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
  495. package/lib/typescript/src/skia/web/JsiSkShader.d.ts +1 -0
  496. package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
  497. package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +1 -0
  498. package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +1 -1
  499. package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +1 -0
  500. package/lib/typescript/src/values/types.d.ts +1 -1
  501. package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -1
  502. package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -1
  503. package/lib/typescript/src/views/types.d.ts +2 -1
  504. package/libs/android/arm64-v8a/libskia.a +0 -0
  505. package/libs/android/arm64-v8a/libskottie.a +0 -0
  506. package/libs/android/arm64-v8a/libsksg.a +0 -0
  507. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  508. package/libs/android/arm64-v8a/libsvg.a +0 -0
  509. package/libs/android/armeabi-v7a/libskia.a +0 -0
  510. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  511. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  512. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  513. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  514. package/libs/android/x86/libskia.a +0 -0
  515. package/libs/android/x86/libskottie.a +0 -0
  516. package/libs/android/x86/libsksg.a +0 -0
  517. package/libs/android/x86/libskshaper.a +0 -0
  518. package/libs/android/x86/libsvg.a +0 -0
  519. package/libs/android/x86_64/libskia.a +0 -0
  520. package/libs/android/x86_64/libskottie.a +0 -0
  521. package/libs/android/x86_64/libsksg.a +0 -0
  522. package/libs/android/x86_64/libskshaper.a +0 -0
  523. package/libs/android/x86_64/libsvg.a +0 -0
  524. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  525. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  526. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  527. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  528. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  529. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  530. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  531. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  532. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  533. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  534. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  535. package/package.json +1 -1
  536. package/react-native-skia.podspec +1 -1
  537. package/scripts/install-npm.js +11 -1
  538. package/src/renderer/Canvas.tsx +21 -1
  539. package/src/skia/core/Data.ts +3 -3
  540. package/src/skia/types/Data/Data.ts +2 -2
  541. package/src/skia/types/Image/Image.ts +2 -2
  542. package/src/skia/types/JsiInstance.ts +4 -4
  543. package/src/skia/types/SVG/SVG.ts +2 -2
  544. package/src/skia/types/Typeface/Typeface.ts +2 -2
  545. package/src/skia/web/Host.ts +2 -0
  546. package/src/skia/web/JsiSkCanvas.ts +4 -0
  547. package/src/skia/web/JsiSkColorFilter.ts +4 -0
  548. package/src/skia/web/JsiSkContourMeasure.ts +4 -0
  549. package/src/skia/web/JsiSkContourMeasureIter.ts +4 -0
  550. package/src/skia/web/JsiSkData.ts +3 -3
  551. package/src/skia/web/JsiSkFont.ts +4 -0
  552. package/src/skia/web/JsiSkImage.ts +2 -2
  553. package/src/skia/web/JsiSkImageFilter.ts +4 -0
  554. package/src/skia/web/JsiSkMaskFilter.ts +4 -0
  555. package/src/skia/web/JsiSkMatrix.ts +4 -0
  556. package/src/skia/web/JsiSkPaint.ts +4 -0
  557. package/src/skia/web/JsiSkPath.ts +4 -0
  558. package/src/skia/web/JsiSkPathEffect.ts +4 -0
  559. package/src/skia/web/JsiSkPicture.ts +4 -0
  560. package/src/skia/web/JsiSkPictureRecorder.ts +4 -0
  561. package/src/skia/web/JsiSkPoint.ts +4 -0
  562. package/src/skia/web/JsiSkRRect.ts +4 -0
  563. package/src/skia/web/JsiSkRSXform.ts +4 -0
  564. package/src/skia/web/JsiSkRect.ts +4 -0
  565. package/src/skia/web/JsiSkRuntimeEffect.ts +4 -0
  566. package/src/skia/web/JsiSkShader.ts +4 -0
  567. package/src/skia/web/JsiSkSurface.ts +4 -0
  568. package/src/skia/web/JsiSkTextBlob.ts +4 -0
  569. package/src/skia/web/JsiSkTypeface.ts +2 -2
  570. package/src/skia/web/JsiSkVertices.ts +4 -0
  571. package/src/values/hooks/useComputedValue.ts +1 -1
  572. package/src/values/types.ts +1 -1
  573. package/src/values/web/RNSkComputedValue.ts +1 -1
  574. package/src/values/web/RNSkReadonlyValue.ts +1 -1
  575. package/src/views/SkiaDomView.web.tsx +6 -1
  576. package/src/views/types.ts +2 -1
  577. package/cpp/skia/include/core/SkImageEncoder.h +0 -71
  578. package/cpp/skia/include/gpu/GrConfig.h +0 -53
  579. package/cpp/skia/include/gpu/graphite/CombinationBuilder.h +0 -195
  580. package/cpp/skia/include/private/SkHalf.h +0 -38
  581. package/cpp/skia/include/private/SkImageInfoPriv.h +0 -199
  582. package/cpp/skia/include/private/SkSLIRNode.h +0 -64
  583. package/cpp/skia/include/private/SkSLLayout.h +0 -144
  584. package/cpp/skia/include/private/SkSLModifiers.h +0 -178
  585. package/cpp/skia/include/private/SkSLProgramElement.h +0 -77
  586. package/cpp/skia/include/private/SkSLProgramKind.h +0 -35
  587. package/cpp/skia/include/private/SkSLStatement.h +0 -86
  588. package/cpp/skia/include/private/SkSLString.h +0 -41
  589. package/cpp/skia/include/private/SkSLSymbol.h +0 -94
  590. package/cpp/skia/include/private/SkSafe_math.h +0 -52
  591. package/cpp/skia/include/private/SkStringView.h +0 -51
  592. package/cpp/skia/include/private/SkTArray.h +0 -655
  593. package/cpp/skia/include/private/SkUniquePaintParamsID.h +0 -35
  594. package/cpp/skia/include/private/SkVx.h +0 -1026
  595. package/cpp/skia/include/sksl/DSL.h +0 -37
  596. package/cpp/skia/include/sksl/DSLBlock.h +0 -58
  597. package/cpp/skia/include/sksl/DSLCase.h +0 -62
  598. package/cpp/skia/include/sksl/DSLCore.h +0 -492
  599. package/cpp/skia/include/sksl/DSLExpression.h +0 -241
  600. package/cpp/skia/include/sksl/DSLFunction.h +0 -113
  601. package/cpp/skia/include/sksl/DSLLayout.h +0 -92
  602. package/cpp/skia/include/sksl/DSLModifiers.h +0 -69
  603. package/cpp/skia/include/sksl/DSLStatement.h +0 -82
  604. package/cpp/skia/include/sksl/DSLSymbols.h +0 -61
  605. package/cpp/skia/include/sksl/DSLType.h +0 -271
  606. package/cpp/skia/include/sksl/DSLVar.h +0 -231
  607. package/cpp/skia/include/sksl/SkSLErrorReporter.h +0 -65
  608. package/cpp/skia/include/sksl/SkSLOperator.h +0 -154
  609. package/cpp/skia/include/sksl/SkSLPosition.h +0 -104
  610. package/cpp/skia/include/utils/SkRandom.h +0 -169
  611. package/cpp/skia/src/core/SkLRUCache.h +0 -126
  612. package/cpp/skia/src/core/SkTInternalLList.h +0 -302
  613. /package/cpp/skia/include/{core → codec}/SkPngChunkReader.h +0 -0
  614. /package/cpp/skia/include/private/{SkTPin.h → base/SkTPin.h} +0 -0
  615. /package/cpp/skia/include/private/{SkThreadAnnotations.h → base/SkThreadAnnotations.h} +0 -0
@@ -9,4 +9,5 @@ export declare class JsiSkContourMeasure extends HostObject<ContourMeasure, "Con
9
9
  getSegment(startD: number, stopD: number, startWithMoveTo: boolean): JsiSkPath;
10
10
  isClosed(): boolean;
11
11
  length(): number;
12
+ dispose: () => void;
12
13
  }
@@ -1,9 +1,15 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject } from "./Host";
2
4
  import { JsiSkPath } from "./JsiSkPath";
3
5
  import { JsiSkPoint } from "./JsiSkPoint";
4
6
  export class JsiSkContourMeasure extends HostObject {
5
7
  constructor(CanvasKit, ref) {
6
8
  super(CanvasKit, ref, "ContourMeasure");
9
+
10
+ _defineProperty(this, "dispose", () => {
11
+ this.ref.delete();
12
+ });
7
13
  }
8
14
 
9
15
  getPosTan(distance) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkPath","JsiSkPoint","JsiSkContourMeasure","constructor","CanvasKit","ref","getPosTan","distance","posTan","slice","getSegment","startD","stopD","startWithMoveTo","isClosed","length"],"sources":["JsiSkContourMeasure.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasure } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasure } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkContourMeasure\n extends HostObject<ContourMeasure, \"ContourMeasure\">\n implements SkContourMeasure\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasure) {\n super(CanvasKit, ref, \"ContourMeasure\");\n }\n\n getPosTan(distance: number): [position: JsiSkPoint, tangent: JsiSkPoint] {\n const posTan = this.ref.getPosTan(distance);\n return [\n new JsiSkPoint(this.CanvasKit, posTan.slice(0, 2)),\n new JsiSkPoint(this.CanvasKit, posTan.slice(2)),\n ];\n }\n\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean) {\n return new JsiSkPath(\n this.CanvasKit,\n this.ref.getSegment(startD, stopD, startWithMoveTo)\n );\n }\n\n isClosed() {\n return this.ref.isClosed();\n }\n\n length() {\n return this.ref.length();\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,mBAAN,SACGH,UADH,CAGP;EACEI,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA4C;IACrD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,gBAAtB;EACD;;EAEDC,SAAS,CAACC,QAAD,EAAgE;IACvE,MAAMC,MAAM,GAAG,KAAKH,GAAL,CAASC,SAAT,CAAmBC,QAAnB,CAAf;IACA,OAAO,CACL,IAAIN,UAAJ,CAAe,KAAKG,SAApB,EAA+BI,MAAM,CAACC,KAAP,CAAa,CAAb,EAAgB,CAAhB,CAA/B,CADK,EAEL,IAAIR,UAAJ,CAAe,KAAKG,SAApB,EAA+BI,MAAM,CAACC,KAAP,CAAa,CAAb,CAA/B,CAFK,CAAP;EAID;;EAEDC,UAAU,CAACC,MAAD,EAAiBC,KAAjB,EAAgCC,eAAhC,EAA0D;IAClE,OAAO,IAAIb,SAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASK,UAAT,CAAoBC,MAApB,EAA4BC,KAA5B,EAAmCC,eAAnC,CAFK,CAAP;EAID;;EAEDC,QAAQ,GAAG;IACT,OAAO,KAAKT,GAAL,CAASS,QAAT,EAAP;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKV,GAAL,CAASU,MAAT,EAAP;EACD;;AA1BH"}
1
+ {"version":3,"names":["HostObject","JsiSkPath","JsiSkPoint","JsiSkContourMeasure","constructor","CanvasKit","ref","delete","getPosTan","distance","posTan","slice","getSegment","startD","stopD","startWithMoveTo","isClosed","length"],"sources":["JsiSkContourMeasure.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasure } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasure } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkContourMeasure\n extends HostObject<ContourMeasure, \"ContourMeasure\">\n implements SkContourMeasure\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasure) {\n super(CanvasKit, ref, \"ContourMeasure\");\n }\n\n getPosTan(distance: number): [position: JsiSkPoint, tangent: JsiSkPoint] {\n const posTan = this.ref.getPosTan(distance);\n return [\n new JsiSkPoint(this.CanvasKit, posTan.slice(0, 2)),\n new JsiSkPoint(this.CanvasKit, posTan.slice(2)),\n ];\n }\n\n getSegment(startD: number, stopD: number, startWithMoveTo: boolean) {\n return new JsiSkPath(\n this.CanvasKit,\n this.ref.getSegment(startD, stopD, startWithMoveTo)\n );\n }\n\n isClosed() {\n return this.ref.isClosed();\n }\n\n length() {\n return this.ref.length();\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,mBAAN,SACGH,UADH,CAGP;EACEI,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAA4C;IACrD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,gBAAtB;;IADqD,iCA2B7C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CA7BsD;EAEtD;;EAEDC,SAAS,CAACC,QAAD,EAAgE;IACvE,MAAMC,MAAM,GAAG,KAAKJ,GAAL,CAASE,SAAT,CAAmBC,QAAnB,CAAf;IACA,OAAO,CACL,IAAIP,UAAJ,CAAe,KAAKG,SAApB,EAA+BK,MAAM,CAACC,KAAP,CAAa,CAAb,EAAgB,CAAhB,CAA/B,CADK,EAEL,IAAIT,UAAJ,CAAe,KAAKG,SAApB,EAA+BK,MAAM,CAACC,KAAP,CAAa,CAAb,CAA/B,CAFK,CAAP;EAID;;EAEDC,UAAU,CAACC,MAAD,EAAiBC,KAAjB,EAAgCC,eAAhC,EAA0D;IAClE,OAAO,IAAId,SAAJ,CACL,KAAKI,SADA,EAEL,KAAKC,GAAL,CAASM,UAAT,CAAoBC,MAApB,EAA4BC,KAA5B,EAAmCC,eAAnC,CAFK,CAAP;EAID;;EAEDC,QAAQ,GAAG;IACT,OAAO,KAAKV,GAAL,CAASU,QAAT,EAAP;EACD;;EAEDC,MAAM,GAAG;IACP,OAAO,KAAKX,GAAL,CAASW,MAAT,EAAP;EACD;;AA1BH"}
@@ -5,4 +5,5 @@ import { JsiSkContourMeasure } from "./JsiSkContourMeasure";
5
5
  export declare class JsiSkContourMeasureIter extends HostObject<ContourMeasureIter, "ContourMeasureIter"> implements SkContourMeasureIter {
6
6
  constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter);
7
7
  next(): JsiSkContourMeasure | null;
8
+ dispose: () => void;
8
9
  }
@@ -1,8 +1,14 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject } from "./Host";
2
4
  import { JsiSkContourMeasure } from "./JsiSkContourMeasure";
3
5
  export class JsiSkContourMeasureIter extends HostObject {
4
6
  constructor(CanvasKit, ref) {
5
7
  super(CanvasKit, ref, "ContourMeasureIter");
8
+
9
+ _defineProperty(this, "dispose", () => {
10
+ this.ref.delete();
11
+ });
6
12
  }
7
13
 
8
14
  next() {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkContourMeasure","JsiSkContourMeasureIter","constructor","CanvasKit","ref","next","result"],"sources":["JsiSkContourMeasureIter.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasureIter } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasureIter } from \"../types/ContourMeasure\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkContourMeasure } from \"./JsiSkContourMeasure\";\n\nexport class JsiSkContourMeasureIter\n extends HostObject<ContourMeasureIter, \"ContourMeasureIter\">\n implements SkContourMeasureIter\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter) {\n super(CanvasKit, ref, \"ContourMeasureIter\");\n }\n\n next() {\n const result = this.ref.next();\n if (result === null) {\n return null;\n }\n return new JsiSkContourMeasure(this.CanvasKit, result);\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,mBAAT,QAAoC,uBAApC;AAEA,OAAO,MAAMC,uBAAN,SACGF,UADH,CAGP;EACEG,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAgD;IACzD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,oBAAtB;EACD;;EAEDC,IAAI,GAAG;IACL,MAAMC,MAAM,GAAG,KAAKF,GAAL,CAASC,IAAT,EAAf;;IACA,IAAIC,MAAM,KAAK,IAAf,EAAqB;MACnB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,mBAAJ,CAAwB,KAAKG,SAA7B,EAAwCG,MAAxC,CAAP;EACD;;AAXH"}
1
+ {"version":3,"names":["HostObject","JsiSkContourMeasure","JsiSkContourMeasureIter","constructor","CanvasKit","ref","delete","next","result"],"sources":["JsiSkContourMeasureIter.ts"],"sourcesContent":["import type { CanvasKit, ContourMeasureIter } from \"canvaskit-wasm\";\n\nimport type { SkContourMeasureIter } from \"../types/ContourMeasure\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkContourMeasure } from \"./JsiSkContourMeasure\";\n\nexport class JsiSkContourMeasureIter\n extends HostObject<ContourMeasureIter, \"ContourMeasureIter\">\n implements SkContourMeasureIter\n{\n constructor(CanvasKit: CanvasKit, ref: ContourMeasureIter) {\n super(CanvasKit, ref, \"ContourMeasureIter\");\n }\n\n next() {\n const result = this.ref.next();\n if (result === null) {\n return null;\n }\n return new JsiSkContourMeasure(this.CanvasKit, result);\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AACA,SAASC,mBAAT,QAAoC,uBAApC;AAEA,OAAO,MAAMC,uBAAN,SACGF,UADH,CAGP;EACEG,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAgD;IACzD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,oBAAtB;;IADyD,iCAYjD,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAd0D;EAE1D;;EAEDC,IAAI,GAAG;IACL,MAAMC,MAAM,GAAG,KAAKH,GAAL,CAASE,IAAT,EAAf;;IACA,IAAIC,MAAM,KAAK,IAAf,EAAqB;MACnB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIP,mBAAJ,CAAwB,KAAKG,SAA7B,EAAwCI,MAAxC,CAAP;EACD;;AAXH"}
@@ -4,6 +4,6 @@ import { HostObject } from "./Host";
4
4
  declare type Data = ArrayBuffer;
5
5
  export declare class JsiSkData extends HostObject<Data, "Data"> implements SkData {
6
6
  constructor(CanvasKit: CanvasKit, ref: Data);
7
- dispose(): void;
7
+ dispose: () => void;
8
8
  }
9
9
  export {};
@@ -1,10 +1,12 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkData extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "Data");
5
- }
6
7
 
7
- dispose() {// Not implemented in data
8
+ _defineProperty(this, "dispose", () => {// Not implemented in data - since data is a raw ArrayBuffer
9
+ });
8
10
  }
9
11
 
10
12
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkData","constructor","CanvasKit","ref","dispose"],"sources":["JsiSkData.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\ntype Data = ArrayBuffer;\n\nexport class JsiSkData extends HostObject<Data, \"Data\"> implements SkData {\n constructor(CanvasKit: CanvasKit, ref: Data) {\n super(CanvasKit, ref, \"Data\");\n }\n\n dispose() {\n // Not implemented in data\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAIA,OAAO,MAAMC,SAAN,SAAwBD,UAAxB,CAAmE;EACxEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;EACD;;EAEDC,OAAO,GAAG,CACR;EACD;;AAPuE"}
1
+ {"version":3,"names":["HostObject","JsiSkData","constructor","CanvasKit","ref"],"sources":["JsiSkData.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\ntype Data = ArrayBuffer;\n\nexport class JsiSkData extends HostObject<Data, \"Data\"> implements SkData {\n constructor(CanvasKit: CanvasKit, ref: Data) {\n super(CanvasKit, ref, \"Data\");\n }\n\n dispose = () => {\n // Not implemented in data - since data is a raw ArrayBuffer\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAIA,OAAO,MAAMC,SAAN,SAAwBD,UAAxB,CAAmE;EACxEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,MAAM,CACd;IACD,CAN4C;EAE5C;;AAHuE"}
@@ -5,6 +5,7 @@ import { JsiSkRect } from "./JsiSkRect";
5
5
  import { JsiSkTypeface } from "./JsiSkTypeface";
6
6
  export declare class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
7
7
  constructor(CanvasKit: CanvasKit, ref: Font);
8
+ dispose: () => void;
8
9
  getTextWidth(text: string, paint?: SkPaint | undefined): number;
9
10
  getMetrics(): {
10
11
  ascent: number;
@@ -1,3 +1,5 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject, ckEnum } from "./Host";
2
4
  import { JsiSkPaint } from "./JsiSkPaint";
3
5
  import { JsiSkPoint } from "./JsiSkPoint";
@@ -6,6 +8,10 @@ import { JsiSkTypeface } from "./JsiSkTypeface";
6
8
  export class JsiSkFont extends HostObject {
7
9
  constructor(CanvasKit, ref) {
8
10
  super(CanvasKit, ref, "Font");
11
+
12
+ _defineProperty(this, "dispose", () => {
13
+ this.ref.delete();
14
+ });
9
15
  }
10
16
 
11
17
  getTextWidth(text, paint) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","ckEnum","JsiSkPaint","JsiSkPoint","JsiSkRect","JsiSkTypeface","JsiSkFont","constructor","CanvasKit","ref","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","undefined","str","numCodePoints","glyphs","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","setEdging","edging","setEmbeddedBitmaps","embeddedBitmaps","setHinting","hinting","setLinearMetrics","linearMetrics","setScaleX","sx","setSize","points","setSkewX","setEmbolden","embolden","setSubpixel","subpixel","setTypeface","face"],"sources":["JsiSkFont.ts"],"sourcesContent":["import type { CanvasKit, Font } from \"canvaskit-wasm\";\n\nimport type {\n FontEdging,\n FontHinting,\n SkFont,\n SkPaint,\n SkPoint,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkFont extends HostObject<Font, \"Font\"> implements SkFont {\n constructor(CanvasKit: CanvasKit, ref: Font) {\n super(CanvasKit, ref, \"Font\");\n }\n\n getTextWidth(text: string, paint?: SkPaint | undefined) {\n const ids = this.getGlyphIDs(text);\n const widths = this.getGlyphWidths(ids, paint);\n return widths.reduce((a, b) => a + b, 0);\n }\n\n getMetrics() {\n const result = this.ref.getMetrics();\n return {\n ascent: result.ascent,\n descent: result.descent,\n leading: result.leading,\n bounds: result.bounds\n ? new JsiSkRect(this.CanvasKit, result.bounds)\n : undefined,\n };\n }\n\n getGlyphIDs(str: string, numCodePoints?: number) {\n // TODO: Fix return value in the C++ implementation\n return [...this.ref.getGlyphIDs(str, numCodePoints)];\n }\n\n // TODO: Fix return value in the C++ implementation, it return float32\n getGlyphWidths(glyphs: number[], paint?: SkPaint | null) {\n return [\n ...this.ref.getGlyphWidths(\n glyphs,\n paint ? JsiSkPaint.fromValue(paint) : null\n ),\n ];\n }\n\n getGlyphIntercepts(\n glyphs: number[],\n positions: SkPoint[],\n top: number,\n bottom: number\n ) {\n return [\n ...this.ref.getGlyphIntercepts(\n glyphs,\n positions.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n top,\n bottom\n ),\n ];\n }\n\n getScaleX() {\n return this.ref.getScaleX();\n }\n\n getSize() {\n return this.ref.getSize();\n }\n\n getSkewX() {\n return this.ref.getSkewX();\n }\n\n isEmbolden() {\n return this.ref.isEmbolden();\n }\n\n getTypeface() {\n const tf = this.ref.getTypeface();\n return tf ? new JsiSkTypeface(this.CanvasKit, tf) : null;\n }\n\n setEdging(edging: FontEdging) {\n this.ref.setEdging(ckEnum(edging));\n }\n\n setEmbeddedBitmaps(embeddedBitmaps: boolean) {\n this.ref.setEmbeddedBitmaps(embeddedBitmaps);\n }\n\n setHinting(hinting: FontHinting) {\n this.ref.setHinting(ckEnum(hinting));\n }\n\n setLinearMetrics(linearMetrics: boolean) {\n this.ref.setLinearMetrics(linearMetrics);\n }\n\n setScaleX(sx: number) {\n this.ref.setScaleX(sx);\n }\n\n setSize(points: number) {\n this.ref.setSize(points);\n }\n\n setSkewX(sx: number) {\n this.ref.setSkewX(sx);\n }\n\n setEmbolden(embolden: boolean) {\n this.ref.setEmbolden(embolden);\n }\n\n setSubpixel(subpixel: boolean) {\n this.ref.setSubpixel(subpixel);\n }\n\n setTypeface(face: SkTypeface | null) {\n this.ref.setTypeface(face ? JsiSkTypeface.fromValue(face) : null);\n }\n}\n"],"mappings":"AAWA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,SAAN,SAAwBN,UAAxB,CAAmE;EACxEO,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;EACD;;EAEDC,YAAY,CAACC,IAAD,EAAeC,KAAf,EAA4C;IACtD,MAAMC,GAAG,GAAG,KAAKC,WAAL,CAAiBH,IAAjB,CAAZ;IACA,MAAMI,M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,EAAoB;IAC7B,KAAKrD,GAAL,CAASoD,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,IAAD,EAA0B;IACnC,KAAKvD,GAAL,CAASsD,WAAT,CAAqBC,IAAI,GAAG3D,aAAa,CAACyB,SAAd,CAAwBkC,IAAxB,CAAH,GAAmC,IAA5D;EACD;;AAjHuE"}
1
+ {"version":3,"names":["HostObject","ckEnum","JsiSkPaint","JsiSkPoint","JsiSkRect","JsiSkTypeface","JsiSkFont","constructor","CanvasKit","ref","delete","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","undefined","str","numCodePoints","glyphs","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","setEdging","edging","setEmbeddedBitmaps","embeddedBitmaps","setHinting","hinting","setLinearMetrics","linearMetrics","setScaleX","sx","setSize","points","setSkewX","setEmbolden","embolden","setSubpixel","subpixel","setTypeface","face"],"sources":["JsiSkFont.ts"],"sourcesContent":["import type { CanvasKit, Font } from \"canvaskit-wasm\";\n\nimport type {\n FontEdging,\n FontHinting,\n SkFont,\n SkPaint,\n SkPoint,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkFont extends HostObject<Font, \"Font\"> implements SkFont {\n constructor(CanvasKit: CanvasKit, ref: Font) {\n super(CanvasKit, ref, \"Font\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n getTextWidth(text: string, paint?: SkPaint | undefined) {\n const ids = this.getGlyphIDs(text);\n const widths = this.getGlyphWidths(ids, paint);\n return widths.reduce((a, b) => a + b, 0);\n }\n\n getMetrics() {\n const result = this.ref.getMetrics();\n return {\n ascent: result.ascent,\n descent: result.descent,\n leading: result.leading,\n bounds: result.bounds\n ? new JsiSkRect(this.CanvasKit, result.bounds)\n : undefined,\n };\n }\n\n getGlyphIDs(str: string, numCodePoints?: number) {\n // TODO: Fix return value in the C++ implementation\n return [...this.ref.getGlyphIDs(str, numCodePoints)];\n }\n\n // TODO: Fix return value in the C++ implementation, it return float32\n getGlyphWidths(glyphs: number[], paint?: SkPaint | null) {\n return [\n ...this.ref.getGlyphWidths(\n glyphs,\n paint ? JsiSkPaint.fromValue(paint) : null\n ),\n ];\n }\n\n getGlyphIntercepts(\n glyphs: number[],\n positions: SkPoint[],\n top: number,\n bottom: number\n ) {\n return [\n ...this.ref.getGlyphIntercepts(\n glyphs,\n positions.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n top,\n bottom\n ),\n ];\n }\n\n getScaleX() {\n return this.ref.getScaleX();\n }\n\n getSize() {\n return this.ref.getSize();\n }\n\n getSkewX() {\n return this.ref.getSkewX();\n }\n\n isEmbolden() {\n return this.ref.isEmbolden();\n }\n\n getTypeface() {\n const tf = this.ref.getTypeface();\n return tf ? new JsiSkTypeface(this.CanvasKit, tf) : null;\n }\n\n setEdging(edging: FontEdging) {\n this.ref.setEdging(ckEnum(edging));\n }\n\n setEmbeddedBitmaps(embeddedBitmaps: boolean) {\n this.ref.setEmbeddedBitmaps(embeddedBitmaps);\n }\n\n setHinting(hinting: FontHinting) {\n this.ref.setHinting(ckEnum(hinting));\n }\n\n setLinearMetrics(linearMetrics: boolean) {\n this.ref.setLinearMetrics(linearMetrics);\n }\n\n setScaleX(sx: number) {\n this.ref.setScaleX(sx);\n }\n\n setSize(points: number) {\n this.ref.setSize(points);\n }\n\n setSkewX(sx: number) {\n this.ref.setSkewX(sx);\n }\n\n setEmbolden(embolden: boolean) {\n this.ref.setEmbolden(embolden);\n }\n\n setSubpixel(subpixel: boolean) {\n this.ref.setSubpixel(subpixel);\n }\n\n setTypeface(face: SkTypeface | null) {\n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,UAAU,CAACC,OAAD,EAAuB;IAC/B,KAAK3C,GAAL,CAAS0C,UAAT,CAAoBlD,MAAM,CAACmD,OAAD,CAA1B;EACD;;EAEDC,gBAAgB,CAACC,aAAD,EAAyB;IACvC,KAAK7C,GAAL,CAAS4C,gBAAT,CAA0BC,aAA1B;EACD;;EAEDC,SAAS,CAACC,EAAD,EAAa;IACpB,KAAK/C,GAAL,CAAS8C,SAAT,CAAmBC,EAAnB;EACD;;EAEDC,OAAO,CAACC,MAAD,EAAiB;IACtB,KAAKjD,GAAL,CAASgD,OAAT,CAAiBC,MAAjB;EACD;;EAEDC,QAAQ,CAACH,EAAD,EAAa;IACnB,KAAK/C,GAAL,CAASkD,QAAT,CAAkBH,EAAlB;EACD;;EAEDI,WAAW,CAACC,QAAD,EAAoB;IAC7B,KAAKpD,GAAL,CAASmD,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,QAAD,EAAoB;IAC7B,KAAKtD,GAAL,CAASqD,WAAT,CAAqBC,QAArB;EACD;;EAEDC,WAAW,CAACC,IAAD,EAA0B;IACnC,KAAKxD,GAAL,CAASuD,WAAT,CAAqBC,IAAI,GAAG5D,aAAa,CAAC0B,SAAd,CAAwBkC,IAAxB,CAAH,GAAmC,IAA5D;EACD;;AArHuE"}
@@ -10,6 +10,6 @@ export declare class JsiSkImage extends HostObject<Image, "Image"> implements Sk
10
10
  makeShaderCubic(tx: TileMode, ty: TileMode, B: number, C: number, localMatrix?: SkMatrix): SkShader;
11
11
  encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array;
12
12
  encodeToBase64(fmt?: ImageFormat, quality?: number): string;
13
- dispose(): void;
13
+ dispose: () => void;
14
14
  makeNonTextureImage(): SkImage;
15
15
  }
@@ -1,3 +1,5 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { ckEnum, HostObject } from "./Host";
2
4
  import { JsiSkMatrix } from "./JsiSkMatrix";
3
5
  import { JsiSkShader } from "./JsiSkShader"; // https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js
@@ -33,6 +35,10 @@ export const toBase64String = bytes => {
33
35
  export class JsiSkImage extends HostObject {
34
36
  constructor(CanvasKit, ref) {
35
37
  super(CanvasKit, ref, "Image");
38
+
39
+ _defineProperty(this, "dispose", () => {
40
+ this.ref.delete();
41
+ });
36
42
  }
37
43
 
38
44
  height() {
@@ -74,10 +80,6 @@ export class JsiSkImage extends HostObject {
74
80
  return toBase64String(bytes);
75
81
  }
76
82
 
77
- dispose() {
78
- this.ref.delete();
79
- }
80
-
81
83
  makeNonTextureImage() {
82
84
  return new JsiSkImage(this.CanvasKit, this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes()));
83
85
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ckEnum","HostObject","JsiSkMatrix","JsiSkShader","toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","constructor","CanvasKit","ref","height","width","makeShaderOptions","tx","ty","fm","mm","localMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","Error","encodeToBase64","dispose","delete","makeNonTextureImage","MakeImageFromEncoded"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type { CanvasKit, Image } from \"canvaskit-wasm\";\n\nimport type {\n ImageFormat,\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { ckEnum, HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\n// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js\nexport const toBase64String = (bytes: Uint8Array) => {\n if (typeof Buffer !== \"undefined\") {\n // Are we on node?\n return Buffer.from(bytes).toString(\"base64\");\n } else {\n // From https://stackoverflow.com/a/25644409\n // because the naive solution of\n // btoa(String.fromCharCode.apply(null, bytes));\n // would occasionally throw \"Maximum call stack size exceeded\"\n var CHUNK_SIZE = 0x8000; //arbitrary number\n var index = 0;\n var { length } = bytes;\n var result = \"\";\n var slice;\n while (index < length) {\n slice = bytes.slice(index, Math.min(index + CHUNK_SIZE, length));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result += String.fromCharCode.apply(null, slice as any);\n index += CHUNK_SIZE;\n }\n return btoa(result);\n }\n};\n\nexport class JsiSkImage extends HostObject<Image, \"Image\"> implements SkImage {\n constructor(CanvasKit: CanvasKit, ref: Image) {\n super(CanvasKit, ref, \"Image\");\n }\n\n height() {\n return this.ref.height();\n }\n\n width() {\n return this.ref.width();\n }\n\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderOptions(\n ckEnum(tx),\n ckEnum(ty),\n ckEnum(fm),\n ckEnum(mm),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderCubic(\n ckEnum(tx),\n ckEnum(ty),\n B,\n C,\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n encodeToBytes(fmt?: ImageFormat, quality?: number) {\n let result: Uint8Array | null;\n if (fmt && quality) {\n result = this.ref.encodeToBytes(ckEnum(fmt), quality);\n } else if (fmt) {\n result = this.ref.encodeToBytes(ckEnum(fmt));\n } else {\n result = this.ref.encodeToBytes();\n }\n if (!result) {\n throw new Error(\"encodeToBytes failed\");\n }\n return result;\n }\n\n encodeToBase64(fmt?: ImageFormat, quality?: number) {\n const bytes = this.encodeToBytes(fmt, quality);\n return toBase64String(bytes);\n }\n\n dispose() {\n this.ref.delete();\n }\n\n makeNonTextureImage(): SkImage {\n return new JsiSkImage(\n this.CanvasKit,\n this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes())!\n );\n }\n}\n"],"mappings":"AAYA,SAASA,MAAT,EAAiBC,UAAjB,QAAmC,QAAnC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B,C,CAEA;;AACA,OAAO,MAAMC,cAAc,GAAIC,KAAD,IAAuB;EACnD,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;IACjC;IACA,OAAOA,MAAM,CAACC,IAAP,CAAYF,KAAZ,EAAmBG,QAAnB,CAA4B,QAA5B,CAAP;EACD,CAHD,MAGO;IACL;IACA;IACA;IACA;IACA,IAAIC,UAAU,GAAG,MAAjB,CALK,CAKoB;;IACzB,IAAIC,KAAK,GAAG,CAAZ;IACA,IAAI;MAAEC;IAAF,IAAaN,KAAjB;IACA,IAAIO,MAAM,GAAG,EAAb;IACA,IAAIC,KAAJ;;IACA,OAAOH,KAAK,GAAGC,MAAf,EAAuB;MACrBE,KAAK,GAAGR,KAAK,CAACQ,KAAN,CAAYH,KAAZ,EAAmBI,IAAI,CAACC,GAAL,CAASL,KAAK,GAAGD,UAAjB,EAA6BE,MAA7B,CAAnB,CAAR,CADqB,CAErB;;MACAC,MAAM,IAAII,MAAM,CAACC,YAAP,CAAoBC,KAApB,CAA0B,IAA1B,EAAgCL,KAAhC,CAAV;MACAH,KAAK,IAAID,UAAT;IACD;;IACD,OAAOU,IAAI,CAACP,MAAD,CAAX;EACD;AACF,CAtBM;AAwBP,OAAO,MAAMQ,UAAN,SAAyBnB,UAAzB,CAAuE;EAC5EoB,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;EACD;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MACL1B,MAAM,GAAG,KAAKW,GAAL,CAASc,aAAT,EAAT;IACD;;IACD,IAAI,CAACzB,MAAL,EAAa;MACX,MAAM,IAAI4B,KAAJ,CAAU,sBAAV,CAAN;IACD;;IACD,OAAO5B,MAAP;EACD;;EAED6B,cAAc,CAACH,GAAD,EAAoBC,OAApB,EAAsC;IAClD,MAAMlC,KAAK,GAAG,KAAKgC,aAAL,CAAmBC,GAAnB,EAAwBC,OAAxB,CAAd;IACA,OAAOnC,cAAc,CAACC,KAAD,CAArB;EACD;;EAEDqC,OAAO,GAAG;IACR,KAAKnB,GAAL,CAASoB,MAAT;EACD;;EAEDC,mBAAmB,GAAY;IAC7B,OAAO,IAAIxB,UAAJ,CACL,KAAKE,SADA,EAEL,KAAKA,SAAL,CAAeuB,oBAAf,CAAoC,KAAKR,aAAL,EAApC,CAFK,CAAP;EAID;;AAhF2E"}
1
+ {"version":3,"names":["ckEnum","HostObject","JsiSkMatrix","JsiSkShader","toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","constructor","CanvasKit","ref","delete","height","width","makeShaderOptions","tx","ty","fm","mm","localMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","Error","encodeToBase64","makeNonTextureImage","MakeImageFromEncoded"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type { CanvasKit, Image } from \"canvaskit-wasm\";\n\nimport type {\n ImageFormat,\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { ckEnum, HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\n// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js\nexport const toBase64String = (bytes: Uint8Array) => {\n if (typeof Buffer !== \"undefined\") {\n // Are we on node?\n return Buffer.from(bytes).toString(\"base64\");\n } else {\n // From https://stackoverflow.com/a/25644409\n // because the naive solution of\n // btoa(String.fromCharCode.apply(null, bytes));\n // would occasionally throw \"Maximum call stack size exceeded\"\n var CHUNK_SIZE = 0x8000; //arbitrary number\n var index = 0;\n var { length } = bytes;\n var result = \"\";\n var slice;\n while (index < length) {\n slice = bytes.slice(index, Math.min(index + CHUNK_SIZE, length));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result += String.fromCharCode.apply(null, slice as any);\n index += CHUNK_SIZE;\n }\n return btoa(result);\n }\n};\n\nexport class JsiSkImage extends HostObject<Image, \"Image\"> implements SkImage {\n constructor(CanvasKit: CanvasKit, ref: Image) {\n super(CanvasKit, ref, \"Image\");\n }\n\n height() {\n return this.ref.height();\n }\n\n width() {\n return this.ref.width();\n }\n\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderOptions(\n ckEnum(tx),\n ckEnum(ty),\n ckEnum(fm),\n ckEnum(mm),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderCubic(\n ckEnum(tx),\n ckEnum(ty),\n B,\n C,\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n encodeToBytes(fmt?: ImageFormat, quality?: number) {\n let result: Uint8Array | null;\n if (fmt && quality) {\n result = this.ref.encodeToBytes(ckEnum(fmt), quality);\n } else if (fmt) {\n result = this.ref.encodeToBytes(ckEnum(fmt));\n } else {\n result = this.ref.encodeToBytes();\n }\n if (!result) {\n throw new Error(\"encodeToBytes failed\");\n }\n return result;\n }\n\n encodeToBase64(fmt?: ImageFormat, quality?: number) {\n const bytes = this.encodeToBytes(fmt, quality);\n return toBase64String(bytes);\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeNonTextureImage(): SkImage {\n return new JsiSkImage(\n this.CanvasKit,\n this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes())!\n );\n }\n}\n"],"mappings":";;AAYA,SAASA,MAAT,EAAiBC,UAAjB,QAAmC,QAAnC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B,C,CAEA;;AACA,OAAO,MAAMC,cAAc,GAAIC,KAAD,IAAuB;EACnD,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;IACjC;IACA,OAAOA,MAAM,CAACC,IAAP,CAAYF,KAAZ,EAAmBG,QAAnB,CAA4B,QAA5B,CAAP;EACD,CAHD,MAGO;IACL;IACA;IACA;IACA;IACA,IAAIC,UAAU,GAAG,MAAjB,CALK,CAKoB;;IACzB,IAAIC,KAAK,GAAG,CAAZ;IACA,IAAI;MAAEC;IAAF,IAAaN,KAAjB;IACA,IAAIO,MAAM,GAAG,EAAb;IACA,IAAIC,KAAJ;;IACA,OAAOH,KAAK,GAAGC,MAAf,EAAuB;MACrBE,KAAK,GAAGR,KAAK,CAACQ,KAAN,CAAYH,KAAZ,EAAmBI,IAAI,CAACC,GAAL,CAASL,KAAK,GAAGD,UAAjB,EAA6BE,MAA7B,CAAnB,CAAR,CADqB,CAErB;;MACAC,MAAM,IAAII,MAAM,CAACC,YAAP,CAAoBC,KAApB,CAA0B,IAA1B,EAAgCL,KAAhC,CAAV;MACAH,KAAK,IAAID,UAAT;IACD;;IACD,OAAOU,IAAI,CAACP,MAAD,CAAX;EACD;AACF,CAtBM;AAwBP,OAAO,MAAMQ,UAAN,SAAyBnB,UAAzB,CAAuE;EAC5EoB,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAsEpC,MAAM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tC,MAAM,CAACuC,GAAD,CAA7B,CAAT;IACD,CAFM,MAEA;MACL3B,MAAM,GAAG,KAAKW,GAAL,CAASe,aAAT,EAAT;IACD;;IACD,IAAI,CAAC1B,MAAL,EAAa;MACX,MAAM,IAAI6B,KAAJ,CAAU,sBAAV,CAAN;IACD;;IACD,OAAO7B,MAAP;EACD;;EAED8B,cAAc,CAACH,GAAD,EAAoBC,OAApB,EAAsC;IAClD,MAAMnC,KAAK,GAAG,KAAKiC,aAAL,CAAmBC,GAAnB,EAAwBC,OAAxB,CAAd;IACA,OAAOpC,cAAc,CAACC,KAAD,CAArB;EACD;;EAMDsC,mBAAmB,GAAY;IAC7B,OAAO,IAAIvB,UAAJ,CACL,KAAKE,SADA,EAEL,KAAKA,SAAL,CAAesB,oBAAf,CAAoC,KAAKN,aAAL,EAApC,CAFK,CAAP;EAID;;AAhF2E"}
@@ -3,4 +3,5 @@ import type { SkImageFilter } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkImageFilter extends HostObject<ImageFilter, "ImageFilter"> implements SkImageFilter {
5
5
  constructor(CanvasKit: CanvasKit, ref: ImageFilter);
6
+ dispose: () => void;
6
7
  }
@@ -1,7 +1,13 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkImageFilter extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "ImageFilter");
7
+
8
+ _defineProperty(this, "dispose", () => {
9
+ this.ref.delete();
10
+ });
5
11
  }
6
12
 
7
13
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkImageFilter","constructor","CanvasKit","ref"],"sources":["JsiSkImageFilter.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type { SkImageFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkImageFilter\n extends HostObject<ImageFilter, \"ImageFilter\">\n implements SkImageFilter\n{\n constructor(CanvasKit: CanvasKit, ref: ImageFilter) {\n super(CanvasKit, ref, \"ImageFilter\");\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,gBAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAyC;IAClD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,aAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["HostObject","JsiSkImageFilter","constructor","CanvasKit","ref","delete"],"sources":["JsiSkImageFilter.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type { SkImageFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkImageFilter\n extends HostObject<ImageFilter, \"ImageFilter\">\n implements SkImageFilter\n{\n constructor(CanvasKit: CanvasKit, ref: ImageFilter) {\n super(CanvasKit, ref, \"ImageFilter\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,gBAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAyC;IAClD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,aAAtB;;IADkD,iCAI1C,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANmD;EAEnD;;AAHH"}
@@ -3,4 +3,5 @@ import type { SkMaskFilter } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkMaskFilter extends HostObject<MaskFilter, "MaskFilter"> implements SkMaskFilter {
5
5
  constructor(CanvasKit: CanvasKit, ref: MaskFilter);
6
+ dispose: () => void;
6
7
  }
@@ -1,7 +1,13 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkMaskFilter extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "MaskFilter");
7
+
8
+ _defineProperty(this, "dispose", () => {
9
+ this.ref.delete();
10
+ });
5
11
  }
6
12
 
7
13
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkMaskFilter","constructor","CanvasKit","ref"],"sources":["JsiSkMaskFilter.ts"],"sourcesContent":["import type { CanvasKit, MaskFilter } from \"canvaskit-wasm\";\n\nimport type { SkMaskFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMaskFilter\n extends HostObject<MaskFilter, \"MaskFilter\">\n implements SkMaskFilter\n{\n constructor(CanvasKit: CanvasKit, ref: MaskFilter) {\n super(CanvasKit, ref, \"MaskFilter\");\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,eAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["HostObject","JsiSkMaskFilter","constructor","CanvasKit","ref","delete"],"sources":["JsiSkMaskFilter.ts"],"sourcesContent":["import type { CanvasKit, MaskFilter } from \"canvaskit-wasm\";\n\nimport type { SkMaskFilter } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMaskFilter\n extends HostObject<MaskFilter, \"MaskFilter\">\n implements SkMaskFilter\n{\n constructor(CanvasKit: CanvasKit, ref: MaskFilter) {\n super(CanvasKit, ref, \"MaskFilter\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,eAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;;IADiD,iCAIzC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANkD;EAElD;;AAHH"}
@@ -3,6 +3,7 @@ import type { SkMatrix } from "../types";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkMatrix extends HostObject<Matrix3x3, "Matrix"> implements SkMatrix {
5
5
  constructor(CanvasKit: CanvasKit, ref: Matrix3x3);
6
+ dispose: () => void;
6
7
  concat(matrix: SkMatrix): this;
7
8
  translate(x: number, y: number): this;
8
9
  scale(x: number, y?: number): this;
@@ -1,7 +1,12 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkMatrix extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "Matrix");
7
+
8
+ _defineProperty(this, "dispose", () => {// Do nothing - the matrix is represenetd by a Float32Array
9
+ });
5
10
  }
6
11
 
7
12
  concat(matrix) {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","fromValue","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","identity","get","Array","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n return this;\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n return this;\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n return this;\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\n return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,WAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;EACD;;EAEDC,MAAM,CAACC,MAAD,EAAmB;IACvB,KAAKF,GAAL,CAASG,GAAT,CACE,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyCH,WAAW,CAACS,SAAZ,CAAsBJ,MAAtB,CAAzC,CADF;IAGA,OAAO,IAAP;EACD;;EAEDK,SAAS,CAACC,CAAD,EAAYC,CAAZ,EAAuB;IAC9B,KAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBQ,UAAtB,CAAiCJ,CAAjC,EAAoCC,CAApC,CAAnB,CAFF,CADF;IAMA,OAAO,IAAP;EACD;;EAEDI,KAAK,CAACL,CAAD,EAAYC,CAAZ,EAAwB;IAC3B,KAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBU,MAAtB,CAA6BN,CAA7B,EAAgCC,CAAhC,aAAgCA,CAAhC,cAAgCA,CAAhC,GAAqCD,CAArC,CAAnB,CAFF,CADF;IAMA,OAAO,IAAP;EACD;;EAEDO,IAAI,CAACP,CAAD,EAAYC,CAAZ,EAAuB;IACzB,KAAKR,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBY,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAnB,CAFF,CADF;IAMA,OAAO,IAAP;EACD;;EAEDQ,MAAM,CAACC,KAAD,EAAgB;IACpB,KAAKjB,MAAL,CACE,IAAIJ,WAAJ,CACE,KAAKE,SADP,EAEEW,YAAY,CAACC,EAAb,CAAgB,GAAG,KAAKZ,SAAL,CAAeK,MAAf,CAAsBe,OAAtB,CAA8BD,KAA9B,CAAnB,CAFF,CADF;IAMA,OAAO,IAAP;EACD;;EAEDE,QAAQ,GAAG;IACT,KAAKpB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBgB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAOC,KAAK,CAACC,IAAN,CAAW,KAAKvB,GAAhB,CAAP;EACD;;AA3DH"}
1
+ {"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","concat","matrix","set","Matrix","multiply","fromValue","translate","x","y","Float32Array","of","translated","scale","scaled","skew","skewed","rotate","value","rotated","identity","get","Array","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport type { SkMatrix } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: SkMatrix) {\n this.ref.set(\n this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))\n )\n );\n return this;\n }\n\n scale(x: number, y?: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))\n )\n );\n return this;\n }\n\n skew(x: number, y: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))\n )\n );\n return this;\n }\n\n rotate(value: number) {\n this.concat(\n new JsiSkMatrix(\n this.CanvasKit,\n Float32Array.of(...this.CanvasKit.Matrix.rotated(value))\n )\n );\n return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,WAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IADgD,iCAIxC,MAAM,CACd;IACD,CANiD;EAEjD;;EAMDC,MAAM,CAACC,MAAD,EAAmB;IACvB,KAAKF,GAAL,CAASG,GAAT,CACE,KAAKJ,SAAL,CAAeK,MAAf,CAAsBC,QAAtB,CAA+B,KAAKL,GAApC,EAAyC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,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAOC,KAAK,CAACC,IAAN,CAAW,KAAKvB,GAAhB,CAAP;EACD;;AA/DH"}
@@ -3,6 +3,7 @@ import type { StrokeJoin, BlendMode, SkColor, SkColorFilter, SkImageFilter, SkPa
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkPaint extends HostObject<Paint, "Paint"> implements SkPaint {
5
5
  constructor(CanvasKit: CanvasKit, ref: Paint);
6
+ dispose: () => void;
6
7
  copy(): JsiSkPaint;
7
8
  reset(): void;
8
9
  getAlphaf(): number;
@@ -1,3 +1,5 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject, ckEnum } from "./Host";
2
4
  import { JsiSkColorFilter } from "./JsiSkColorFilter";
3
5
  import { JsiSkImageFilter } from "./JsiSkImageFilter";
@@ -7,6 +9,10 @@ import { JsiSkShader } from "./JsiSkShader";
7
9
  export class JsiSkPaint extends HostObject {
8
10
  constructor(CanvasKit, ref) {
9
11
  super(CanvasKit, ref, "Paint");
12
+
13
+ _defineProperty(this, "dispose", () => {
14
+ this.ref.delete();
15
+ });
10
16
  }
11
17
 
12
18
  copy() {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","ckEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setBlendMode","blendMode","setColor","color","setColorFilter","filter","fromValue","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","setStrokeJoin","join","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(ckEnum(blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(ckEnum(cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(ckEnum(join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":"AAgBA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,UAAN,SAAyBP,UAAzB,CAAuE;EAC5EQ,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;EACD;;EAEDC,IAAI,GAAG;IACL,OAAO,IAAIJ,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASC,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKF,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeI,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKL,GAAL,CAASK,QAAT,EAAP;EACD;;EAEDC,YAAY,GAAG;IACb,OAAO,KAAKN,GAAL,CAASM,YAAT,GAAw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MAAD,EAA0B;IACjC,KAAK3B,GAAL,CAAS0B,SAAT,CAAmBC,MAAM,GAAG/B,WAAW,CAACyB,SAAZ,CAAsBM,MAAtB,CAAH,GAAmC,IAA5D;EACD;;EAEDC,YAAY,CAACC,GAAD,EAAiB;IAC3B,KAAK7B,GAAL,CAAS4B,YAAT,CAAsBrC,MAAM,CAACsC,GAAD,CAA5B;EACD;;EAEDC,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAK/B,GAAL,CAAS8B,aAAT,CAAuBvC,MAAM,CAACwC,IAAD,CAA7B;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKjC,GAAL,CAASgC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKnC,GAAL,CAASkC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAKrC,GAAL,CAASoC,QAAT,CAAkB;MAAE7B,KAAK,EAAE8B;IAAT,CAAlB;EACD;;AA3F2E"}
1
+ {"version":3,"names":["HostObject","ckEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setBlendMode","blendMode","setColor","color","setColorFilter","filter","fromValue","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","setStrokeJoin","join","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, ckEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(ckEnum(blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(ckEnum(cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(ckEnum(join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":";;AAgBA,SAASA,UAAT,EAAqBC,MAArB,QAAmC,QAAnC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,UAAN,SAAyBP,UAAzB,CAAuE;EAC5EQ,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAIpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN6C;EAE7C;;EAMDC,IAAI,GAAG;IACL,OAAO,IAAIL,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKH,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeK,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKN,GAAL,CAASM,QAAT,EAAP;EACD;;EAEDC,YAAY,GAAG;IACb,OAAO,KAAKP,GAAL,CAASO,YAAT,GAAwBC,KAA/B;EACD;;EAEDC,aAAa,GAAG;IACd,OAAO,KAAKT,GAAL,CAASS,aAAT,G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AW,CAAC0B,SAAZ,CAAsBM,MAAtB,CAAH,GAAmC,IAA5D;EACD;;EAEDC,YAAY,CAACC,GAAD,EAAiB;IAC3B,KAAK9B,GAAL,CAAS6B,YAAT,CAAsBtC,MAAM,CAACuC,GAAD,CAA5B;EACD;;EAEDC,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAKhC,GAAL,CAAS+B,aAAT,CAAuBxC,MAAM,CAACyC,IAAD,CAA7B;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKlC,GAAL,CAASiC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKpC,GAAL,CAASmC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAKtC,GAAL,CAASqC,QAAT,CAAkB;MAAE7B,KAAK,EAAE8B;IAAT,CAAlB;EACD;;AA/F2E"}
@@ -5,6 +5,7 @@ import { JsiSkPoint } from "./JsiSkPoint";
5
5
  import { JsiSkRect } from "./JsiSkRect";
6
6
  export declare class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
7
7
  constructor(CanvasKit: CanvasKit, ref: Path);
8
+ dispose: () => void;
8
9
  addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): this;
9
10
  addArc(oval: SkRect, startAngleInDegrees: number, sweepAngleInDegrees: number): this;
10
11
  addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): this;
@@ -1,3 +1,5 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { PathVerb } from "../types";
2
4
  import { ckEnum, HostObject, optEnum } from "./Host";
3
5
  import { JsiSkPoint } from "./JsiSkPoint";
@@ -15,6 +17,10 @@ const CommandCount = {
15
17
  export class JsiSkPath extends HostObject {
16
18
  constructor(CanvasKit, ref) {
17
19
  super(CanvasKit, ref, "Path");
20
+
21
+ _defineProperty(this, "dispose", () => {
22
+ this.ref.delete();
23
+ });
18
24
  }
19
25
 
20
26
  addPath(src, matrix) {
@@ -1 +1 @@
1
- {"version":3,"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","JsiSkPath","constructor","CanvasKit","ref","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","simplify","toSVGString","trim","startT","stopT","isComplement","transform","m3","interpolate","end","t","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n }\n\n reset() {\n this.ref.reset();\n }\n\n rewind() {\n this.ref.rewind();\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(startT: number, stopT: number, isComplement: boolean) {\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(JsiSkMatrix.fromValue(m3));\n }\n\n interpolate(end: SkPath, t: number) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":"AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,OAA7B,QAA4C,QAA5C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QAAQ,CAACS,IAAV,GAAiB,CADE;EAEnB,CAACT,QAAQ,CAACU,IAAV,GAAiB,CAFE;EAGnB,CAACV,QAAQ,CAACW,IAAV,GAAiB,CAHE;EAInB,CAACX,QAAQ,CAACY,KAAV,GAAkB,CAJC;EAKnB,CAACZ,QAAQ,CAACa,KAAV,GAAkB,CALC;EAMnB,CAACb,QAAQ,CAACc,KAAV,GAAkB;AANC,CAArB;AASA,O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,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;QACxBD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACA,MAAMI,MAAM,GAAGxI,YAAY,CAACuI,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF,CAND,MAMO;QACL,MAAME,MAAM,GAAGxI,YAAY,CAACuI,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,GAAiBA,MAArB,EAA6B;UAC3BD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACD;;QACD,IAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAO7F,MAAP;EACD;;AAlVuE"}
1
+ {"version":3,"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","simplify","toSVGString","trim","startT","stopT","isComplement","transform","m3","interpolate","end","t","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n }\n\n reset() {\n this.ref.reset();\n }\n\n rewind() {\n this.ref.rewind();\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(startT: number, stopT: number, isComplement: boolean) {\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(JsiSkMatrix.fromValue(m3));\n }\n\n interpolate(end: SkPath, t: number) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,OAA7B,QAA4C,QAA5C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QAAQ,CAACS,IAAV,GAAiB,CADE;EAEnB,CAACT,QAAQ,CAACU,IAAV,GAAiB,CAFE;EAGnB,CAACV,QAAQ,CAACW,IAAV,GAAiB,CAHE;EAInB,CAACX,QAAQ,CAACY,KAAV,GAAkB,CAJC;EAKnB,CAACZ,QAAQ,CAACa,KAAV,GAAkB,CALC;EAMnB,CAACb,QAAQ,CAACc,KAAV,GAAkB;AANC,CAArB;AASA,OAAO,MAAMC,SAAN,SAAwBb,UAAxB,CAAmE;EACxEc,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN4C;EAE5C;;EAMDC,OAAO,CAACC,GAAD,EAAcC,MAAd,EAAiD;IAAA,IAAhBC,MAAgB,uEAAP,KAAO;IACtD,MAAMC,IAAI,GAAG,CACXT,SAAS,CAACU,SAAV,CAAoBJ,GAApB,CADW,EAEX,IAAIC,MAAM,GAAGf,WAAW,CAACkB,SAAZ,CAAoCH,MAApC,CAAH,GAAiD,EAA3D,CAFW,EAGXC,MAHW,CAAb;IAKA,KAAKL,GAAL,CAASE,OAAT,CAAiB,GAAGI,IAApB;IACA,OAAO,IAAP;EACD;;EAEDE,MAAM,CACJC,IADI,EAEJC,mBAFI,EAG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,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAO7F,MAAP;EACD;;AAtVuE"}
@@ -3,4 +3,5 @@ import type { SkPathEffect } from "../types/PathEffect";
3
3
  import { HostObject } from "./Host";
4
4
  export declare class JsiSkPathEffect extends HostObject<PathEffect, "PathEffect"> implements SkPathEffect {
5
5
  constructor(CanvasKit: CanvasKit, ref: PathEffect);
6
+ dispose: () => void;
6
7
  }
@@ -1,7 +1,13 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import { HostObject } from "./Host";
2
4
  export class JsiSkPathEffect extends HostObject {
3
5
  constructor(CanvasKit, ref) {
4
6
  super(CanvasKit, ref, "PathEffect");
7
+
8
+ _defineProperty(this, "dispose", () => {
9
+ this.ref.delete();
10
+ });
5
11
  }
6
12
 
7
13
  }
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkPathEffect","constructor","CanvasKit","ref"],"sources":["JsiSkPathEffect.ts"],"sourcesContent":["import type { CanvasKit, PathEffect } from \"canvaskit-wasm\";\n\nimport type { SkPathEffect } from \"../types/PathEffect\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkPathEffect\n extends HostObject<PathEffect, \"PathEffect\">\n implements SkPathEffect\n{\n constructor(CanvasKit: CanvasKit, ref: PathEffect) {\n super(CanvasKit, ref, \"PathEffect\");\n }\n}\n"],"mappings":"AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,eAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;EACD;;AAHH"}
1
+ {"version":3,"names":["HostObject","JsiSkPathEffect","constructor","CanvasKit","ref","delete"],"sources":["JsiSkPathEffect.ts"],"sourcesContent":["import type { CanvasKit, PathEffect } from \"canvaskit-wasm\";\n\nimport type { SkPathEffect } from \"../types/PathEffect\";\n\nimport { HostObject } from \"./Host\";\n\nexport class JsiSkPathEffect\n extends HostObject<PathEffect, \"PathEffect\">\n implements SkPathEffect\n{\n constructor(CanvasKit: CanvasKit, ref: PathEffect) {\n super(CanvasKit, ref, \"PathEffect\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n}\n"],"mappings":";;AAIA,SAASA,UAAT,QAA2B,QAA3B;AAEA,OAAO,MAAMC,eAAN,SACGD,UADH,CAGP;EACEE,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAwC;IACjD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,YAAtB;;IADiD,iCAIzC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CANkD;EAElD;;AAHH"}
@@ -4,6 +4,7 @@ import { HostObject } from "./Host";
4
4
  import { JsiSkShader } from "./JsiSkShader";
5
5
  export declare class JsiSkPicture extends HostObject<Picture, "Picture"> implements SkPicture {
6
6
  constructor(CanvasKit: CanvasKit, ref: Picture);
7
+ dispose: () => void;
7
8
  makeShader(tmx: TileMode, tmy: TileMode, mode: FilterMode, localMatrix?: SkMatrix, tileRect?: SkRect): JsiSkShader;
8
9
  serialize(): Uint8Array | null;
9
10
  }
@@ -1,3 +1,5 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  // TODO: suggest to rename SkPicture to Picture for consistency
2
4
  import { HostObject, ckEnum } from "./Host";
3
5
  import { JsiSkShader } from "./JsiSkShader";
@@ -6,6 +8,10 @@ import { JsiSkRect } from "./JsiSkRect";
6
8
  export class JsiSkPicture extends HostObject {
7
9
  constructor(CanvasKit, ref) {
8
10
  super(CanvasKit, ref, "Picture");
11
+
12
+ _defineProperty(this, "dispose", () => {
13
+ this.ref.delete();
14
+ });
9
15
  }
10
16
 
11
17
  makeShader(tmx, tmy, mode, localMatrix, tileRect) {