@shopify/react-native-skia 0.1.172 → 0.1.173

Sign up to get free protection for your applications and to get access to all the features.
Files changed (311) hide show
  1. package/android/CMakeLists.txt +1 -0
  2. package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +5 -0
  3. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +106 -5
  4. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +3 -1
  5. package/cpp/api/JsiSkSurface.h +7 -1
  6. package/cpp/api/JsiSkSurfaceFactory.h +15 -2
  7. package/cpp/rnskia/RNSkDomView.cpp +2 -4
  8. package/cpp/rnskia/RNSkJsView.cpp +3 -0
  9. package/cpp/rnskia/RNSkPictureView.h +3 -0
  10. package/cpp/rnskia/RNSkPlatformContext.h +9 -0
  11. package/cpp/rnskia/dom/JsiDomApi.h +1 -0
  12. package/cpp/rnskia/dom/base/ConcatablePaint.cpp +117 -0
  13. package/cpp/rnskia/dom/base/ConcatablePaint.h +49 -0
  14. package/cpp/rnskia/dom/base/Declaration.h +88 -0
  15. package/cpp/rnskia/dom/base/DeclarationContext.h +79 -0
  16. package/cpp/rnskia/dom/base/DerivedNodeProp.h +25 -9
  17. package/cpp/rnskia/dom/base/DrawingContext.cpp +32 -186
  18. package/cpp/rnskia/dom/base/DrawingContext.h +45 -64
  19. package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +35 -106
  20. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +28 -9
  21. package/cpp/rnskia/dom/base/JsiDomNode.h +46 -17
  22. package/cpp/rnskia/dom/base/JsiDomRenderNode.h +81 -67
  23. package/cpp/rnskia/dom/base/NodeProp.h +12 -2
  24. package/cpp/rnskia/dom/base/NodePropsContainer.h +15 -16
  25. package/cpp/rnskia/dom/nodes/JsiBackdropFilterNode.h +22 -11
  26. package/cpp/rnskia/dom/nodes/JsiBlendNode.h +43 -59
  27. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +16 -17
  28. package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +6 -5
  29. package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +45 -69
  30. package/cpp/rnskia/dom/nodes/JsiGroupNode.h +1 -1
  31. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +121 -161
  32. package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -0
  33. package/cpp/rnskia/dom/nodes/JsiLayerNode.h +28 -18
  34. package/cpp/rnskia/dom/nodes/JsiPaintNode.h +82 -45
  35. package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +68 -101
  36. package/cpp/rnskia/dom/nodes/JsiPathNode.h +3 -2
  37. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +150 -207
  38. package/cpp/rnskia/dom/props/BezierProps.h +4 -2
  39. package/cpp/rnskia/dom/props/BlendModeProp.h +4 -2
  40. package/cpp/rnskia/dom/props/BoxShadowProps.h +8 -10
  41. package/cpp/rnskia/dom/props/CircleProp.h +6 -5
  42. package/cpp/rnskia/dom/props/ClipProp.h +6 -4
  43. package/cpp/rnskia/dom/props/ColorProp.h +8 -4
  44. package/cpp/rnskia/dom/props/DrawingProp.h +5 -3
  45. package/cpp/rnskia/dom/props/FontProp.h +4 -2
  46. package/cpp/rnskia/dom/props/GlyphsProp.h +4 -2
  47. package/cpp/rnskia/dom/props/ImageProps.h +9 -6
  48. package/cpp/rnskia/dom/props/LayerProp.h +6 -4
  49. package/cpp/rnskia/dom/props/MatrixProp.h +4 -2
  50. package/cpp/rnskia/dom/props/NumbersProp.h +8 -4
  51. package/cpp/rnskia/dom/props/PaintProps.h +55 -92
  52. package/cpp/rnskia/dom/props/PathProp.h +4 -2
  53. package/cpp/rnskia/dom/props/PictureProp.h +4 -2
  54. package/cpp/rnskia/dom/props/PointProp.h +4 -2
  55. package/cpp/rnskia/dom/props/PointsProp.h +8 -4
  56. package/cpp/rnskia/dom/props/RRectProp.h +23 -16
  57. package/cpp/rnskia/dom/props/RadiusProp.h +4 -2
  58. package/cpp/rnskia/dom/props/RectProp.h +18 -12
  59. package/cpp/rnskia/dom/props/StrokeProps.h +8 -4
  60. package/cpp/rnskia/dom/props/SvgProp.h +4 -2
  61. package/cpp/rnskia/dom/props/TextBlobProp.h +10 -8
  62. package/cpp/rnskia/dom/props/TileModeProp.h +4 -2
  63. package/cpp/rnskia/dom/props/TransformProp.h +4 -2
  64. package/cpp/rnskia/dom/props/TransformsProps.h +5 -7
  65. package/cpp/rnskia/dom/props/UniformsProp.h +4 -2
  66. package/cpp/rnskia/dom/props/VertexModeProp.h +4 -2
  67. package/cpp/rnskia/dom/props/VerticesProps.h +7 -11
  68. package/ios/RNSkia-iOS/DisplayLink.mm +22 -24
  69. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +53 -50
  70. package/ios/RNSkia-iOS/RNSkiOSPlatformContext.h +2 -0
  71. package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +38 -25
  72. package/ios/RNSkia-iOS/SkiaDomViewManager.mm +17 -17
  73. package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +17 -17
  74. package/ios/RNSkia-iOS/SkiaManager.mm +12 -10
  75. package/ios/RNSkia-iOS/SkiaMetalRenderer.h +5 -0
  76. package/ios/RNSkia-iOS/SkiaMetalRenderer.mm +53 -0
  77. package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +17 -17
  78. package/ios/RNSkia-iOS/SkiaUIView.mm +63 -53
  79. package/ios/RNSkiaModule.mm +5 -7
  80. package/lib/commonjs/dom/nodes/DrawingNode.js +5 -1
  81. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
  82. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +33 -34
  83. package/lib/commonjs/dom/nodes/LayerNode.js +13 -6
  84. package/lib/commonjs/dom/nodes/LayerNode.js.map +1 -1
  85. package/lib/commonjs/dom/nodes/Node.d.ts +6 -11
  86. package/lib/commonjs/dom/nodes/Node.js +8 -26
  87. package/lib/commonjs/dom/nodes/Node.js.map +1 -1
  88. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
  89. package/lib/commonjs/dom/nodes/PaintNode.d.ts +3 -3
  90. package/lib/commonjs/dom/nodes/PaintNode.js +32 -15
  91. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
  92. package/lib/commonjs/dom/nodes/RenderNode.d.ts +2 -3
  93. package/lib/commonjs/dom/nodes/RenderNode.js +19 -187
  94. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  95. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +1 -1
  96. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +25 -7
  97. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  98. package/lib/commonjs/dom/nodes/drawings/Box.d.ts +3 -1
  99. package/lib/commonjs/dom/nodes/drawings/Box.js +3 -0
  100. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  101. package/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +3 -7
  102. package/lib/commonjs/dom/nodes/paint/BlendNode.js +16 -47
  103. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
  104. package/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +10 -11
  105. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +29 -43
  106. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  107. package/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +11 -11
  108. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +45 -42
  109. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  110. package/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +3 -3
  111. package/lib/commonjs/dom/nodes/paint/MaskFilters.js +3 -2
  112. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
  113. package/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +15 -18
  114. package/lib/commonjs/dom/nodes/paint/PathEffects.js +30 -72
  115. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
  116. package/lib/commonjs/dom/nodes/paint/Shaders.d.ts +11 -12
  117. package/lib/commonjs/dom/nodes/paint/Shaders.js +28 -18
  118. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  119. package/lib/commonjs/dom/types/DeclarationContext.d.ts +29 -0
  120. package/lib/commonjs/dom/types/DeclarationContext.js +118 -0
  121. package/lib/commonjs/dom/types/DeclarationContext.js.map +1 -0
  122. package/lib/commonjs/dom/types/DrawingContext.d.ts +18 -1
  123. package/lib/commonjs/dom/types/DrawingContext.js +330 -0
  124. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  125. package/lib/commonjs/dom/types/Node.d.ts +4 -10
  126. package/lib/commonjs/dom/types/Node.js.map +1 -1
  127. package/lib/commonjs/dom/types/SkDOM.d.ts +22 -23
  128. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  129. package/lib/commonjs/dom/types/index.d.ts +1 -0
  130. package/lib/commonjs/dom/types/index.js +13 -0
  131. package/lib/commonjs/dom/types/index.js.map +1 -1
  132. package/lib/commonjs/index.d.ts +1 -0
  133. package/lib/commonjs/index.js +13 -0
  134. package/lib/commonjs/index.js.map +1 -1
  135. package/lib/commonjs/renderer/Canvas.js +3 -3
  136. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  137. package/lib/commonjs/renderer/DrawingContext.d.ts +4 -3
  138. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  139. package/lib/commonjs/renderer/HostComponents.d.ts +35 -35
  140. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  141. package/lib/commonjs/renderer/HostConfig.js +1 -0
  142. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  143. package/lib/commonjs/renderer/Offscreen.d.ts +2 -0
  144. package/lib/commonjs/renderer/Offscreen.js +31 -0
  145. package/lib/commonjs/renderer/Offscreen.js.map +1 -0
  146. package/lib/commonjs/renderer/Reconciler.js +0 -1
  147. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  148. package/lib/commonjs/skia/types/Surface/Surface.d.ts +4 -0
  149. package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
  150. package/lib/commonjs/skia/types/Surface/SurfaceFactory.d.ts +6 -0
  151. package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
  152. package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -0
  153. package/lib/commonjs/skia/web/JsiSkSurface.js +4 -0
  154. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  155. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
  156. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js +21 -1
  157. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  158. package/lib/commonjs/views/SkiaBaseWebView.js +6 -4
  159. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
  160. package/lib/commonjs/views/SkiaDomView.web.js +3 -14
  161. package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
  162. package/lib/commonjs/views/SkiaPictureView.web.js +0 -7
  163. package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
  164. package/lib/commonjs/views/SkiaView.web.js +0 -7
  165. package/lib/commonjs/views/SkiaView.web.js.map +1 -1
  166. package/lib/module/dom/nodes/DrawingNode.js +5 -1
  167. package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
  168. package/lib/module/dom/nodes/JsiSkDOM.d.ts +33 -34
  169. package/lib/module/dom/nodes/LayerNode.js +13 -7
  170. package/lib/module/dom/nodes/LayerNode.js.map +1 -1
  171. package/lib/module/dom/nodes/Node.d.ts +6 -11
  172. package/lib/module/dom/nodes/Node.js +8 -25
  173. package/lib/module/dom/nodes/Node.js.map +1 -1
  174. package/lib/module/dom/nodes/PaintContext.js.map +1 -1
  175. package/lib/module/dom/nodes/PaintNode.d.ts +3 -3
  176. package/lib/module/dom/nodes/PaintNode.js +32 -15
  177. package/lib/module/dom/nodes/PaintNode.js.map +1 -1
  178. package/lib/module/dom/nodes/RenderNode.d.ts +2 -3
  179. package/lib/module/dom/nodes/RenderNode.js +20 -187
  180. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  181. package/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +1 -1
  182. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +23 -4
  183. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  184. package/lib/module/dom/nodes/drawings/Box.d.ts +3 -1
  185. package/lib/module/dom/nodes/drawings/Box.js +3 -0
  186. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  187. package/lib/module/dom/nodes/paint/BlendNode.d.ts +3 -7
  188. package/lib/module/dom/nodes/paint/BlendNode.js +15 -46
  189. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
  190. package/lib/module/dom/nodes/paint/ColorFilters.d.ts +10 -11
  191. package/lib/module/dom/nodes/paint/ColorFilters.js +29 -43
  192. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  193. package/lib/module/dom/nodes/paint/ImageFilters.d.ts +11 -11
  194. package/lib/module/dom/nodes/paint/ImageFilters.js +48 -41
  195. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  196. package/lib/module/dom/nodes/paint/MaskFilters.d.ts +3 -3
  197. package/lib/module/dom/nodes/paint/MaskFilters.js +3 -2
  198. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
  199. package/lib/module/dom/nodes/paint/PathEffects.d.ts +15 -18
  200. package/lib/module/dom/nodes/paint/PathEffects.js +29 -72
  201. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
  202. package/lib/module/dom/nodes/paint/Shaders.d.ts +11 -12
  203. package/lib/module/dom/nodes/paint/Shaders.js +28 -18
  204. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  205. package/lib/module/dom/types/DeclarationContext.d.ts +29 -0
  206. package/lib/module/dom/types/DeclarationContext.js +107 -0
  207. package/lib/module/dom/types/DeclarationContext.js.map +1 -0
  208. package/lib/module/dom/types/DrawingContext.d.ts +18 -1
  209. package/lib/module/dom/types/DrawingContext.js +322 -1
  210. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  211. package/lib/module/dom/types/Node.d.ts +4 -10
  212. package/lib/module/dom/types/Node.js.map +1 -1
  213. package/lib/module/dom/types/SkDOM.d.ts +22 -23
  214. package/lib/module/dom/types/SkDOM.js.map +1 -1
  215. package/lib/module/dom/types/index.d.ts +1 -0
  216. package/lib/module/dom/types/index.js +1 -0
  217. package/lib/module/dom/types/index.js.map +1 -1
  218. package/lib/module/index.d.ts +1 -0
  219. package/lib/module/index.js +1 -0
  220. package/lib/module/index.js.map +1 -1
  221. package/lib/module/renderer/Canvas.js +3 -3
  222. package/lib/module/renderer/Canvas.js.map +1 -1
  223. package/lib/module/renderer/DrawingContext.d.ts +4 -3
  224. package/lib/module/renderer/DrawingContext.js.map +1 -1
  225. package/lib/module/renderer/HostComponents.d.ts +35 -35
  226. package/lib/module/renderer/HostComponents.js.map +1 -1
  227. package/lib/module/renderer/HostConfig.js +1 -0
  228. package/lib/module/renderer/HostConfig.js.map +1 -1
  229. package/lib/module/renderer/Offscreen.d.ts +2 -0
  230. package/lib/module/renderer/Offscreen.js +19 -0
  231. package/lib/module/renderer/Offscreen.js.map +1 -0
  232. package/lib/module/renderer/Reconciler.js +0 -1
  233. package/lib/module/renderer/Reconciler.js.map +1 -1
  234. package/lib/module/skia/types/Surface/Surface.d.ts +4 -0
  235. package/lib/module/skia/types/Surface/Surface.js.map +1 -1
  236. package/lib/module/skia/types/Surface/SurfaceFactory.d.ts +6 -0
  237. package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
  238. package/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
  239. package/lib/module/skia/web/JsiSkSurface.js +4 -0
  240. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  241. package/lib/module/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
  242. package/lib/module/skia/web/JsiSkSurfaceFactory.js +21 -1
  243. package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  244. package/lib/module/views/SkiaBaseWebView.js +6 -4
  245. package/lib/module/views/SkiaBaseWebView.js.map +1 -1
  246. package/lib/module/views/SkiaDomView.web.js +2 -11
  247. package/lib/module/views/SkiaDomView.web.js.map +1 -1
  248. package/lib/module/views/SkiaPictureView.web.js +0 -5
  249. package/lib/module/views/SkiaPictureView.web.js.map +1 -1
  250. package/lib/module/views/SkiaView.web.js +0 -5
  251. package/lib/module/views/SkiaView.web.js.map +1 -1
  252. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +33 -34
  253. package/lib/typescript/src/dom/nodes/Node.d.ts +6 -11
  254. package/lib/typescript/src/dom/nodes/PaintNode.d.ts +3 -3
  255. package/lib/typescript/src/dom/nodes/RenderNode.d.ts +2 -3
  256. package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +1 -1
  257. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +3 -1
  258. package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +3 -7
  259. package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +10 -11
  260. package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +11 -11
  261. package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +3 -3
  262. package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +15 -18
  263. package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +11 -12
  264. package/lib/typescript/src/dom/types/DeclarationContext.d.ts +29 -0
  265. package/lib/typescript/src/dom/types/DrawingContext.d.ts +18 -1
  266. package/lib/typescript/src/dom/types/Node.d.ts +4 -10
  267. package/lib/typescript/src/dom/types/SkDOM.d.ts +22 -23
  268. package/lib/typescript/src/dom/types/index.d.ts +1 -0
  269. package/lib/typescript/src/index.d.ts +1 -0
  270. package/lib/typescript/src/renderer/DrawingContext.d.ts +4 -3
  271. package/lib/typescript/src/renderer/HostComponents.d.ts +35 -35
  272. package/lib/typescript/src/renderer/Offscreen.d.ts +2 -0
  273. package/lib/typescript/src/skia/types/Surface/Surface.d.ts +4 -0
  274. package/lib/typescript/src/skia/types/Surface/SurfaceFactory.d.ts +6 -0
  275. package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
  276. package/lib/typescript/src/skia/web/JsiSkSurfaceFactory.d.ts +2 -1
  277. package/package.json +1 -1
  278. package/src/dom/nodes/DrawingNode.ts +5 -1
  279. package/src/dom/nodes/LayerNode.ts +13 -11
  280. package/src/dom/nodes/Node.ts +18 -41
  281. package/src/dom/nodes/PaintContext.ts +1 -0
  282. package/src/dom/nodes/PaintNode.ts +28 -18
  283. package/src/dom/nodes/RenderNode.ts +25 -183
  284. package/src/dom/nodes/drawings/BackdropFilterNode.ts +18 -11
  285. package/src/dom/nodes/drawings/Box.ts +6 -4
  286. package/src/dom/nodes/paint/BlendNode.ts +16 -63
  287. package/src/dom/nodes/paint/ColorFilters.ts +32 -55
  288. package/src/dom/nodes/paint/ImageFilters.ts +58 -53
  289. package/src/dom/nodes/paint/MaskFilters.ts +5 -7
  290. package/src/dom/nodes/paint/PathEffects.ts +37 -90
  291. package/src/dom/nodes/paint/Shaders.ts +31 -29
  292. package/src/dom/types/DeclarationContext.ts +105 -0
  293. package/src/dom/types/DrawingContext.ts +304 -1
  294. package/src/dom/types/Node.ts +4 -20
  295. package/src/dom/types/SkDOM.ts +22 -43
  296. package/src/dom/types/index.ts +1 -0
  297. package/src/index.ts +1 -0
  298. package/src/renderer/Canvas.tsx +3 -3
  299. package/src/renderer/DrawingContext.ts +4 -5
  300. package/src/renderer/HostComponents.ts +34 -53
  301. package/src/renderer/HostConfig.ts +1 -0
  302. package/src/renderer/Offscreen.tsx +24 -0
  303. package/src/renderer/Reconciler.tsx +0 -1
  304. package/src/skia/types/Surface/Surface.ts +5 -0
  305. package/src/skia/types/Surface/SurfaceFactory.ts +7 -0
  306. package/src/skia/web/JsiSkSurface.ts +4 -0
  307. package/src/skia/web/JsiSkSurfaceFactory.ts +21 -2
  308. package/src/views/SkiaBaseWebView.tsx +6 -2
  309. package/src/views/SkiaDomView.web.tsx +2 -13
  310. package/src/views/SkiaPictureView.web.tsx +0 -7
  311. package/src/views/SkiaView.web.tsx +0 -7
@@ -1 +1 @@
1
- {"version":3,"names":["inflate","Skia","box","dx","dy","tx","ty","RRectXY","XYWHRect","rect","x","y","width","height","rx","ry","deflate","BoxShadowNode","JsiDeclarationNode","constructor","ctx","props","DeclarationType","Unknown","NodeType","BoxShadow","materialize","BoxNode","JsiRenderNode","Box","renderNode","canvas","paint","defaultBox","opacity","getAlphaf","isRRect","shadows","_children","map","node","filter","n","shadow","inner","color","blur","spread","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","BlurStyle","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","ClipOp","Intersect","outer","drawDRRect","restore"],"sources":["Box.ts"],"sourcesContent":["import type { SkRRect, Skia } from \"../../../skia/types\";\nimport { BlurStyle, ClipOp, isRRect } from \"../../../skia/types\";\nimport type { DrawingContext } from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport type { BoxShadowProps, BoxProps } from \"../../types/Drawings\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport { JsiRenderNode } from \"../RenderNode\";\n\nconst inflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) =>\n Skia.RRectXY(\n Skia.XYWHRect(\n box.rect.x - dx + tx,\n box.rect.y - dy + ty,\n box.rect.width + 2 * dx,\n box.rect.height + 2 * dy\n ),\n box.rx + dx,\n box.ry + dy\n );\n\nconst deflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) => inflate(Skia, box, -dx, -dy, tx, ty);\n\nexport class BoxShadowNode extends JsiDeclarationNode<\n BoxShadowProps,\n BoxShadowProps\n> {\n constructor(ctx: NodeContext, props: BoxShadowProps) {\n super(ctx, DeclarationType.Unknown, NodeType.BoxShadow, props);\n }\n\n materialize() {\n return this.props;\n }\n}\n\nexport class BoxNode extends JsiRenderNode<BoxProps> {\n constructor(ctx: NodeContext, props: BoxProps) {\n super(ctx, NodeType.Box, props);\n }\n\n renderNode({ canvas, paint }: DrawingContext) {\n const { box: defaultBox } = this.props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox)\n ? defaultBox\n : this.Skia.RRectXY(defaultBox, 0, 0);\n const shadows = this._children\n .map((node) => {\n if (node instanceof BoxShadowNode) {\n return node.materialize();\n }\n return null;\n })\n .filter((n): n is BoxShadowProps => n !== null);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = this.Skia.Paint();\n lPaint.setColor(this.Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(\n inflate(this.Skia, box, spread, spread, dx, dy),\n lPaint\n );\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = this.Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = this.Skia.Paint();\n lPaint.setColor(this.Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(this.Skia, box, spread, spread, dx, dy);\n const outer = inflate(this.Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n }\n}\n"],"mappings":";;;;;;;AACA;;AAEA;;AAG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AKC,IAAN,EAAYC,GAAZ,EAAiByD,KAAK,CAACjD,CAAvB,EAA0BiD,KAAK,CAAChD,CAAhC,CAArB;MACAoB,MAAM,CAACqC,UAAP,CAAkBD,KAAlB,EAAyBvB,KAAzB,EAAgCI,MAAhC;MACAjB,MAAM,CAACsC,OAAP;IACD,CAlBH;EAmBD;;AAxDkD"}
1
+ {"version":3,"names":["inflate","Skia","box","dx","dy","tx","ty","RRectXY","XYWHRect","rect","x","y","width","height","rx","ry","deflate","BoxShadowNode","JsiDeclarationNode","constructor","ctx","props","DeclarationType","Unknown","NodeType","BoxShadow","decorate","_ctx","materialize","BoxNode","JsiRenderNode","Box","renderNode","canvas","paint","defaultBox","opacity","getAlphaf","isRRect","shadows","_children","map","node","filter","n","shadow","inner","color","blur","spread","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","BlurStyle","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","ClipOp","Intersect","outer","drawDRRect","restore"],"sources":["Box.ts"],"sourcesContent":["import type { SkRRect, Skia } from \"../../../skia/types\";\nimport { BlurStyle, ClipOp, isRRect } from \"../../../skia/types\";\nimport type { DrawingContext } from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport type { BoxShadowProps, BoxProps } from \"../../types/Drawings\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport { JsiRenderNode } from \"../RenderNode\";\nimport type { DeclarationContext } from \"../../types/DeclarationContext\";\n\nconst inflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) =>\n Skia.RRectXY(\n Skia.XYWHRect(\n box.rect.x - dx + tx,\n box.rect.y - dy + ty,\n box.rect.width + 2 * dx,\n box.rect.height + 2 * dy\n ),\n box.rx + dx,\n box.ry + dy\n );\n\nconst deflate = (\n Skia: Skia,\n box: SkRRect,\n dx: number,\n dy: number,\n tx = 0,\n ty = 0\n) => inflate(Skia, box, -dx, -dy, tx, ty);\n\nexport class BoxShadowNode extends JsiDeclarationNode<BoxShadowProps> {\n constructor(ctx: NodeContext, props: BoxShadowProps) {\n super(ctx, DeclarationType.Unknown, NodeType.BoxShadow, props);\n }\n\n decorate(_ctx: DeclarationContext) {\n // do nothing\n }\n\n materialize() {\n return this.props;\n }\n}\n\nexport class BoxNode extends JsiRenderNode<BoxProps> {\n constructor(ctx: NodeContext, props: BoxProps) {\n super(ctx, NodeType.Box, props);\n }\n\n renderNode({ canvas, paint }: DrawingContext) {\n const { box: defaultBox } = this.props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox)\n ? defaultBox\n : this.Skia.RRectXY(defaultBox, 0, 0);\n const shadows = this._children\n .map((node) => {\n if (node instanceof BoxShadowNode) {\n return node.materialize();\n }\n return null;\n })\n .filter((n): n is BoxShadowProps => n !== null);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = this.Skia.Paint();\n lPaint.setColor(this.Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(\n inflate(this.Skia, box, spread, spread, dx, dy),\n lPaint\n );\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = this.Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = this.Skia.Paint();\n lPaint.setColor(this.Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(this.Skia, box, spread, spread, dx, dy);\n const outer = inflate(this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AG9B,OAAO,CAAC,KAAKf,IAAN,EAAYC,GAAZ,EAAiB+C,MAAjB,EAAyBA,MAAzB,EAAiC9C,EAAjC,EAAqCC,EAArC,CAArB;MACA,MAAMiE,KAAK,GAAGrE,OAAO,CAAC,KAAKC,IAAN,EAAYC,GAAZ,EAAiB2D,KAAK,CAACnD,CAAvB,EAA0BmD,KAAK,CAAClD,CAAhC,CAArB;MACAsB,MAAM,CAACqC,UAAP,CAAkBD,KAAlB,EAAyBvB,KAAzB,EAAgCI,MAAhC;MACAjB,MAAM,CAACsC,OAAP;IACD,CAlBH;EAmBD;;AAxDkD"}
@@ -1,12 +1,8 @@
1
1
  import type { BlendProps } from "../../types/ImageFilters";
2
- import type { SkShader, SkImageFilter } from "../../../skia/types";
3
2
  import type { NodeContext } from "../Node";
4
3
  import { JsiDeclarationNode } from "../Node";
5
- import type { Node } from "../../types";
6
- export declare class BlendNode extends JsiDeclarationNode<BlendProps, SkShader | SkImageFilter> {
4
+ import type { DeclarationContext } from "../../types/DeclarationContext";
5
+ export declare class BlendNode extends JsiDeclarationNode<BlendProps> {
7
6
  constructor(ctx: NodeContext, props: BlendProps);
8
- private checkChild;
9
- addChild(child: Node<unknown>): void;
10
- insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;
11
- materialize(): SkImageFilter | SkShader;
7
+ decorate(ctx: DeclarationContext): void;
12
8
  }
@@ -13,66 +13,35 @@ var _Node = require("../Node");
13
13
 
14
14
  var _datatypes = require("../datatypes");
15
15
 
16
- var _ImageFilters = require("./ImageFilters");
17
-
18
- var _Shaders = require("./Shaders");
16
+ var _DeclarationContext = require("../../types/DeclarationContext");
19
17
 
20
18
  class BlendNode extends _Node.JsiDeclarationNode {
21
19
  constructor(ctx, props) {
22
20
  super(ctx, _NodeType.DeclarationType.ImageFilter, _NodeType.NodeType.Blend, props);
23
21
  }
24
22
 
25
- checkChild(child) {
26
- if (this._children.length > 0) {
27
- if (child.declarationType === _NodeType.DeclarationType.ImageFilter) {
28
- this.declarationType = _NodeType.DeclarationType.ImageFilter;
29
- } else {
30
- this.declarationType = _NodeType.DeclarationType.Shader;
31
- }
32
- }
33
- }
34
-
35
- addChild(child) {
36
- if (!(child instanceof _Node.JsiDeclarationNode) || child.declarationType !== _NodeType.DeclarationType.Shader && child.declarationType !== _NodeType.DeclarationType.ImageFilter) {
37
- throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);
38
- }
39
-
40
- this.checkChild(child);
41
- super.addChild(child);
42
- }
43
-
44
- insertChildBefore(child, before) {
45
- if (!(child instanceof _ImageFilters.ImageFilterDeclaration) || !(child instanceof _Shaders.ShaderDeclaration)) {
46
- throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);
47
- }
48
-
49
- this.checkChild(child);
50
- super.insertChildBefore(child, before);
51
- }
52
-
53
- materialize() {
23
+ decorate(ctx) {
24
+ this.decorateChildren(ctx);
54
25
  const {
55
26
  Skia
56
27
  } = this;
57
28
 
58
- const blend = _types.BlendMode[(0, _datatypes.enumKey)(this.props.mode)];
29
+ const blend = _types.BlendMode[(0, _datatypes.enumKey)(this.props.mode)]; // Blend ImageFilters
30
+
31
+
32
+ const imageFilters = ctx.imageFilters.popAll();
33
+
34
+ if (imageFilters.length > 0) {
35
+ const composer = Skia.ImageFilter.MakeBlend.bind(Skia.ImageFilter, blend);
36
+ ctx.imageFilters.push((0, _DeclarationContext.composeDeclarations)(imageFilters, composer));
37
+ } // Blend Shaders
59
38
 
60
- if (this.declarationType === _NodeType.DeclarationType.ImageFilter) {
61
- return this._children.reverse().reduce((inner, outer) => {
62
- if (inner === null) {
63
- return outer.materialize();
64
- }
65
39
 
66
- return Skia.ImageFilter.MakeBlend(blend, outer.materialize(), inner);
67
- }, null);
68
- } else {
69
- return this._children.reverse().reduce((inner, outer) => {
70
- if (inner === null) {
71
- return outer.materialize();
72
- }
40
+ const shaders = ctx.shaders.popAll();
73
41
 
74
- return Skia.Shader.MakeBlend(blend, outer.materialize(), inner);
75
- }, null);
42
+ if (shaders.length > 0) {
43
+ const composer = Skia.Shader.MakeBlend.bind(Skia.Shader, blend);
44
+ ctx.shaders.push((0, _DeclarationContext.composeDeclarations)(shaders, composer));
76
45
  }
77
46
  }
78
47
 
@@ -1 +1 @@
1
- {"version":3,"names":["BlendNode","JsiDeclarationNode","constructor","ctx","props","DeclarationType","ImageFilter","NodeType","Blend","checkChild","child","_children","length","declarationType","Shader","addChild","Error","type","insertChildBefore","before","ImageFilterDeclaration","ShaderDeclaration","materialize","Skia","blend","BlendMode","enumKey","mode","reverse","reduce","inner","outer","MakeBlend"],"sources":["BlendNode.ts"],"sourcesContent":["import type { BlendProps } from \"../../types/ImageFilters\";\nimport type { SkShader, SkImageFilter } from \"../../../skia/types\";\nimport { BlendMode } from \"../../../skia/types\";\nimport { DeclarationType, NodeType } from \"../../types/NodeType\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type { Node } from \"../../types\";\nimport { enumKey } from \"../datatypes\";\n\nimport { ImageFilterDeclaration } from \"./ImageFilters\";\nimport { ShaderDeclaration } from \"./Shaders\";\n\nexport class BlendNode extends JsiDeclarationNode<\n BlendProps,\n SkShader | SkImageFilter\n> {\n constructor(ctx: NodeContext, props: BlendProps) {\n super(ctx, DeclarationType.ImageFilter, NodeType.Blend, props);\n }\n\n private checkChild(\n child: ImageFilterDeclaration<unknown> | ShaderDeclaration<unknown>\n ) {\n if (this._children.length > 0) {\n if (child.declarationType === DeclarationType.ImageFilter) {\n this.declarationType = DeclarationType.ImageFilter;\n } else {\n this.declarationType = DeclarationType.Shader;\n }\n }\n }\n\n addChild(child: Node<unknown>) {\n if (\n !(child instanceof JsiDeclarationNode) ||\n (child.declarationType !== DeclarationType.Shader &&\n child.declarationType !== DeclarationType.ImageFilter)\n ) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n this.checkChild(child);\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void {\n if (\n !(child instanceof ImageFilterDeclaration) ||\n !(child instanceof ShaderDeclaration)\n ) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n this.checkChild(child);\n super.insertChildBefore(child, before);\n }\n\n materialize() {\n const { Skia } = this;\n const blend = BlendMode[enumKey(this.props.mode)];\n if (this.declarationType === DeclarationType.ImageFilter) {\n return (this._children as ImageFilterDeclaration<unknown>[])\n .reverse()\n .reduce<SkImageFilter | null>((inner, outer) => {\n if (inner === null) {\n return outer.materialize();\n }\n return Skia.ImageFilter.MakeBlend(blend, outer.materialize(), inner);\n }, null) as SkImageFilter;\n } else {\n return (this._children as ShaderDeclaration<unknown>[])\n .reverse()\n .reduce<SkShader | null>((inner, outer) => {\n if (inner === null) {\n return outer.materialize();\n }\n return Skia.Shader.MakeBlend(blend, outer.materialize(), inner);\n }, null) as SkShader;\n }\n }\n}\n"],"mappings":";;;;;;;AAEA;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AAEO,MAAMA,SAAN,SAAwBC,wBAAxB,CAGL;EACAC,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAsC;IAC/C,MAAMD,GAAN,EAAWE,yBAAA,CAAgBC,WAA3B,EAAwCC,kBAAA,CAASC,KAAjD,EAAwDJ,KAAxD;EACD;;EAEOK,UAAU,CAChBC,KADgB,EAEhB;IACA,IAAI,KAAKC,SAAL,CAAeC,MAAf,GAAwB,CAA5B,EAA+B;MAC7B,IAAIF,KAAK,CAACG,eAAN,KAA0BR,yBAAA,CAAgBC,WAA9C,EAA2D;QACzD,KAAKO,eAAL,GAAuBR,yBAAA,CAAgBC,WAAvC;MACD,CAFD,MAEO;QACL,KAAKO,eAAL,GAAuBR,yBAAA,CAAgBS,MAAvC;MACD;IACF;EACF;;EAEDC,QAAQ,CAACL,KAAD,EAAuB;IAC7B,IACE,EAAEA,KAAK,YAAYT,wBAAnB,KACCS,KAAK,CAACG,eAAN,KAA0BR,yBAAA,CAAgBS,MAA1C,IACCJ,KAAK,CAACG,eAAN,KA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,KAAK,CAACT,WAAN,EAAP;QACD;;QACD,OAAOC,IAAI,CAACT,MAAL,CAAYkB,SAAZ,CAAsBR,KAAtB,EAA6BO,KAAK,CAACT,WAAN,EAA7B,EAAkDQ,KAAlD,CAAP;MACD,CAPI,EAOF,IAPE,CAAP;IAQD;EACF;;AA9DD"}
1
+ {"version":3,"names":["BlendNode","JsiDeclarationNode","constructor","ctx","props","DeclarationType","ImageFilter","NodeType","Blend","decorate","decorateChildren","Skia","blend","BlendMode","enumKey","mode","imageFilters","popAll","length","composer","MakeBlend","bind","push","composeDeclarations","shaders","Shader"],"sources":["BlendNode.ts"],"sourcesContent":["import type { BlendProps } from \"../../types/ImageFilters\";\nimport { BlendMode } from \"../../../skia/types\";\nimport { DeclarationType, NodeType } from \"../../types/NodeType\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport { enumKey } from \"../datatypes\";\nimport type { DeclarationContext } from \"../../types/DeclarationContext\";\nimport { composeDeclarations } from \"../../types/DeclarationContext\";\n\nexport class BlendNode extends JsiDeclarationNode<BlendProps> {\n constructor(ctx: NodeContext, props: BlendProps) {\n super(ctx, DeclarationType.ImageFilter, NodeType.Blend, props);\n }\n\n decorate(ctx: DeclarationContext) {\n this.decorateChildren(ctx);\n const { Skia } = this;\n const blend = BlendMode[enumKey(this.props.mode)];\n // Blend ImageFilters\n const imageFilters = ctx.imageFilters.popAll();\n if (imageFilters.length > 0) {\n const composer = Skia.ImageFilter.MakeBlend.bind(Skia.ImageFilter, blend);\n ctx.imageFilters.push(composeDeclarations(imageFilters, composer));\n }\n // Blend Shaders\n const shaders = ctx.shaders.popAll();\n if (shaders.length > 0) {\n const composer = Skia.Shader.MakeBlend.bind(Skia.Shader, blend);\n ctx.shaders.push(composeDeclarations(shaders, composer));\n }\n }\n}\n"],"mappings":";;;;;;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AAEO,MAAMA,SAAN,SAAwBC,wBAAxB,CAAuD;EAC5DC,WAAW,CAACC,GAAD,EAAmBC,KAAnB,EAAsC;IAC/C,MAAMD,GAAN,EAAWE,yBAAA,CAAgBC,WAA3B,EAAwCC,kBAAA,CAASC,KAAjD,EAAwDJ,KAAxD;EACD;;EAEDK,QAAQ,CAACN,GAAD,EAA0B;IAChC,KAAKO,gBAAL,CAAsBP,GAAtB;IACA,MAAM;MAAEQ;IAAF,IAAW,IAAjB;;IACA,MAAMC,KAAK,GAAGC,gBAAA,CAAU,IAAAC,kBAAA,EAAQ,KAAKV,KAAL,CAAWW,IAAnB,CAAV,CAAd,CAHgC,CAIhC;;;IACA,MAAMC,YAAY,GAAGb,GAAG,CAACa,YAAJ,CAAiBC,MAAjB,EAArB;;IACA,IAAID,YAAY,CAACE,MAAb,GAAsB,CAA1B,EAA6B;MAC3B,MAAMC,QAAQ,GAAGR,IAAI,CAACL,WAAL,CAAiBc,SAAjB,CAA2BC,IAA3B,CAAgCV,IAAI,CAACL,WAArC,EAAkDM,KAAlD,CAAjB;MACAT,GAAG,CAACa,YAAJ,CAAiBM,IAAjB,CAAsB,IAAAC,uCAAA,EAAoBP,YAApB,EAAkCG,QAAlC,CAAtB;IACD,CAT+B,CAUhC;;;IACA,MAAMK,OAAO,GAAGrB,GAAG,CAACqB,OAAJ,CAAYP,MAAZ,EAAhB;;IACA,IAAIO,OAAO,CAACN,MAAR,GAAiB,CAArB,EAAwB;MACtB,MAAMC,QAAQ,GAAGR,IAAI,CAACc,MAAL,CAAYL,SAAZ,CAAsBC,IAAtB,CAA2BV,IAAI,CAACc,MAAhC,EAAwCb,KAAxC,CAAjB;MACAT,GAAG,CAACqB,OAAJ,CAAYF,IAAZ,CAAiB,IAAAC,uCAAA,EAAoBC,OAApB,EAA6BL,QAA7B,CAAjB;IACD;EACF;;AArB2D"}
@@ -1,36 +1,35 @@
1
1
  import type { SkColorFilter } from "../../../skia/types";
2
2
  import type { NodeContext } from "../Node";
3
3
  import { JsiDeclarationNode } from "../Node";
4
- import type { BlendColorFilterProps, MatrixColorFilterProps, Node } from "../../types";
4
+ import type { BlendColorFilterProps, MatrixColorFilterProps } from "../../types";
5
5
  import { NodeType } from "../../types";
6
6
  import type { LerpColorFilterProps } from "../../types/ColorFilters";
7
- export declare abstract class ColorFilterDeclaration<P, Nullable extends null | never = never> extends JsiDeclarationNode<P, SkColorFilter, Nullable> {
7
+ import type { DeclarationContext } from "../../types/DeclarationContext";
8
+ export declare abstract class ColorFilterDeclaration<P> extends JsiDeclarationNode<P> {
8
9
  constructor(ctx: NodeContext, type: NodeType, props: P);
9
- addChild(child: Node<unknown>): void;
10
- insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;
11
- compose(filter: SkColorFilter): SkColorFilter;
10
+ protected composeAndPush(ctx: DeclarationContext, cf1: SkColorFilter): void;
12
11
  }
13
12
  export declare class MatrixColorFilterNode extends ColorFilterDeclaration<MatrixColorFilterProps> {
14
13
  constructor(ctx: NodeContext, props: MatrixColorFilterProps);
15
- materialize(): SkColorFilter;
14
+ decorate(ctx: DeclarationContext): void;
16
15
  }
17
16
  export declare class BlendColorFilterNode extends ColorFilterDeclaration<BlendColorFilterProps> {
18
17
  constructor(ctx: NodeContext, props: BlendColorFilterProps);
19
- materialize(): SkColorFilter;
18
+ decorate(ctx: DeclarationContext): void;
20
19
  }
21
20
  export declare class LinearToSRGBGammaColorFilterNode extends ColorFilterDeclaration<null> {
22
21
  constructor(ctx: NodeContext);
23
- materialize(): SkColorFilter;
22
+ decorate(ctx: DeclarationContext): void;
24
23
  }
25
24
  export declare class SRGBToLinearGammaColorFilterNode extends ColorFilterDeclaration<null> {
26
25
  constructor(ctx: NodeContext);
27
- materialize(): SkColorFilter;
26
+ decorate(ctx: DeclarationContext): void;
28
27
  }
29
28
  export declare class LumaColorFilterNode extends ColorFilterDeclaration<null> {
30
29
  constructor(ctx: NodeContext);
31
- materialize(): SkColorFilter;
30
+ decorate(ctx: DeclarationContext): void;
32
31
  }
33
32
  export declare class LerpColorFilterNode extends ColorFilterDeclaration<LerpColorFilterProps> {
34
33
  constructor(ctx: NodeContext, props: LerpColorFilterProps);
35
- materialize(): SkColorFilter;
34
+ decorate(ctx: DeclarationContext): void;
36
35
  }
@@ -18,36 +18,13 @@ class ColorFilterDeclaration extends _Node.JsiDeclarationNode {
18
18
  super(ctx, _types2.DeclarationType.ColorFilter, type, props);
19
19
  }
20
20
 
21
- addChild(child) {
22
- if (!(child instanceof ColorFilterDeclaration)) {
23
- throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);
24
- }
25
-
26
- super.addChild(child);
27
- }
28
-
29
- insertChildBefore(child, before) {
30
- if (!(child instanceof ColorFilterDeclaration)) {
31
- throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);
32
- }
33
-
34
- super.insertChildBefore(child, before);
35
- }
36
-
37
- compose(filter) {
38
- const children = this._children;
39
-
40
- if (this._children.length === 0) {
41
- return filter;
42
- } else {
43
- return this.Skia.ColorFilter.MakeCompose(filter, children.reduce((acc, child) => {
44
- if (acc === null) {
45
- return child.materialize();
46
- }
47
-
48
- return this.Skia.ColorFilter.MakeCompose(acc, child.materialize());
49
- }, null));
50
- }
21
+ composeAndPush(ctx, cf1) {
22
+ ctx.save();
23
+ this.decorateChildren(ctx);
24
+ const cf2 = ctx.colorFilters.popAllAsOne();
25
+ ctx.restore();
26
+ const cf = cf2 ? this.Skia.ColorFilter.MakeCompose(cf1, cf2) : cf1;
27
+ ctx.colorFilters.push(cf);
51
28
  }
52
29
 
53
30
  }
@@ -59,12 +36,12 @@ class MatrixColorFilterNode extends ColorFilterDeclaration {
59
36
  super(ctx, _types2.NodeType.MatrixColorFilter, props);
60
37
  }
61
38
 
62
- materialize() {
39
+ decorate(ctx) {
63
40
  const {
64
41
  matrix
65
42
  } = this.props;
66
43
  const cf = this.Skia.ColorFilter.MakeMatrix(matrix);
67
- return this.compose(cf);
44
+ this.composeAndPush(ctx, cf);
68
45
  }
69
46
 
70
47
  }
@@ -76,13 +53,13 @@ class BlendColorFilterNode extends ColorFilterDeclaration {
76
53
  super(ctx, _types2.NodeType.BlendColorFilter, props);
77
54
  }
78
55
 
79
- materialize() {
56
+ decorate(ctx) {
80
57
  const {
81
58
  mode
82
59
  } = this.props;
83
60
  const color = this.Skia.Color(this.props.color);
84
61
  const cf = this.Skia.ColorFilter.MakeBlend(color, _types.BlendMode[(0, _Enum.enumKey)(mode)]);
85
- return this.compose(cf);
62
+ this.composeAndPush(ctx, cf);
86
63
  }
87
64
 
88
65
  }
@@ -94,9 +71,9 @@ class LinearToSRGBGammaColorFilterNode extends ColorFilterDeclaration {
94
71
  super(ctx, _types2.NodeType.LinearToSRGBGammaColorFilter, null);
95
72
  }
96
73
 
97
- materialize() {
74
+ decorate(ctx) {
98
75
  const cf = this.Skia.ColorFilter.MakeLinearToSRGBGamma();
99
- return this.compose(cf);
76
+ this.composeAndPush(ctx, cf);
100
77
  }
101
78
 
102
79
  }
@@ -108,9 +85,9 @@ class SRGBToLinearGammaColorFilterNode extends ColorFilterDeclaration {
108
85
  super(ctx, _types2.NodeType.SRGBToLinearGammaColorFilter, null);
109
86
  }
110
87
 
111
- materialize() {
88
+ decorate(ctx) {
112
89
  const cf = this.Skia.ColorFilter.MakeSRGBToLinearGamma();
113
- return this.compose(cf);
90
+ this.composeAndPush(ctx, cf);
114
91
  }
115
92
 
116
93
  }
@@ -122,9 +99,9 @@ class LumaColorFilterNode extends ColorFilterDeclaration {
122
99
  super(ctx, _types2.NodeType.LumaColorFilter, null);
123
100
  }
124
101
 
125
- materialize() {
102
+ decorate(ctx) {
126
103
  const cf = this.Skia.ColorFilter.MakeLumaColorFilter();
127
- return this.compose(cf);
104
+ this.composeAndPush(ctx, cf);
128
105
  }
129
106
 
130
107
  }
@@ -136,12 +113,21 @@ class LerpColorFilterNode extends ColorFilterDeclaration {
136
113
  super(ctx, _types2.NodeType.LerpColorFilter, props);
137
114
  }
138
115
 
139
- materialize() {
116
+ decorate(ctx) {
117
+ ctx.save();
118
+ this.decorateChildren(ctx);
140
119
  const {
141
120
  t
142
121
  } = this.props;
143
- const [first, second] = this.children();
144
- return this.Skia.ColorFilter.MakeLerp(t, first.materialize(), second.materialize());
122
+ const second = ctx.colorFilters.pop();
123
+ const first = ctx.colorFilters.pop();
124
+ ctx.restore();
125
+
126
+ if (!first || !second) {
127
+ throw new Error("LerpColorFilterNode: missing two color filters as children");
128
+ }
129
+
130
+ ctx.colorFilters.push(this.Skia.ColorFilter.MakeLerp(t, first, second));
145
131
  }
146
132
 
147
133
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ColorFilterDeclaration","JsiDeclarationNode","constructor","ctx","type","props","DeclarationType","ColorFilter","addChild","child","Error","insertChildBefore","before","compose","filter","children","_children","length","Skia","MakeCompose","reduce","acc","materialize","MatrixColorFilterNode","NodeType","MatrixColorFilter","matrix","cf","MakeMatrix","BlendColorFilterNode","BlendColorFilter","mode","color","Color","MakeBlend","BlendMode","enumKey","LinearToSRGBGammaColorFilterNode","LinearToSRGBGammaColorFilter","MakeLinearToSRGBGamma","SRGBToLinearGammaColorFilterNode","SRGBToLinearGammaColorFilter","MakeSRGBToLinearGamma","LumaColorFilterNode","LumaColorFilter","MakeLumaColorFilter","LerpColorFilterNode","LerpColorFilter","t","first","second","MakeLerp"],"sources":["ColorFilters.ts"],"sourcesContent":["import { BlendMode } from \"../../../skia/types\";\nimport type { SkColorFilter } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n Node,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes/Enum\";\nimport type { LerpColorFilterProps } from \"../../types/ColorFilters\";\n\nexport abstract class ColorFilterDeclaration<\n P,\n Nullable extends null | never = never\n> extends JsiDeclarationNode<P, SkColorFilter, Nullable> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.ColorFilter, type, props);\n }\n\n addChild(child: Node<unknown>) {\n if (!(child instanceof ColorFilterDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.addChild(child);\n }\n\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void {\n if (!(child instanceof ColorFilterDeclaration)) {\n throw new Error(`Cannot add child of type ${child.type} to ${this.type}`);\n }\n super.insertChildBefore(child, before);\n }\n\n compose(filter: SkColorFilter) {\n const children = this._children as ColorFilterDeclaration<unknown>[];\n if (this._children.length === 0) {\n return filter;\n } else {\n return this.Skia.ColorFilter.MakeCompose(\n filter,\n children.reduce<SkColorFilter | null>((acc, child) => {\n if (acc === null) {\n return child.materialize();\n }\n return this.Skia.ColorFilter.MakeCompose(acc, child.materialize());\n }, null) as SkColorFilter\n );\n }\n }\n}\n\nexport class MatrixColorFilterNode extends ColorFilterDeclaration<MatrixColorFilterProps> {\n constructor(ctx: NodeContext, props: MatrixColorFilterProps) {\n super(ctx, NodeType.MatrixColorFilter, props);\n }\n\n materialize() {\n const { matrix } = this.props;\n const cf = this.Skia.ColorFilter.MakeMatrix(matrix);\n return this.compose(cf);\n }\n}\n\nexport class BlendColorFilterNode extends ColorFilterDeclaration<BlendColorFilterProps> {\n constructor(ctx: NodeContext, props: BlendColorFilterProps) {\n super(ctx, NodeType.BlendColorFilter, props);\n }\n\n materialize() {\n const { mode } = this.props;\n const color = this.Skia.Color(this.props.color);\n const cf = this.Skia.ColorFilter.MakeBlend(color, BlendMode[enumKey(mode)]);\n return this.compose(cf);\n }\n}\n\nexport class LinearToSRGBGammaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.LinearToSRGBGammaColorFilter, null);\n }\n\n materialize() {\n const cf = this.Skia.ColorFilter.MakeLinearToSRGBGamma();\n return this.compose(cf);\n }\n}\n\nexport class SRGBToLinearGammaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.SRGBToLinearGammaColorFilter, null);\n }\n\n materialize() {\n const cf = this.Skia.ColorFilter.MakeSRGBToLinearGamma();\n return this.compose(cf);\n }\n}\n\nexport class LumaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.LumaColorFilter, null);\n }\n\n materialize() {\n const cf = this.Skia.ColorFilter.MakeLumaColorFilter();\n return this.compose(cf);\n }\n}\n\nexport class LerpColorFilterNode extends ColorFilterDeclaration<LerpColorFilterProps> {\n constructor(ctx: NodeContext, props: LerpColorFilterProps) {\n super(ctx, NodeType.LerpColorFilter, props);\n }\n\n materialize() {\n const { t } = this.props;\n const [first, second] = this.children() as JsiDeclarationNode<\n unknown,\n SkColorFilter\n >[];\n return this.Skia.ColorFilter.MakeLerp(\n t,\n first.materialize(),\n second.materialize()\n );\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAGA;;AAMA;;AACA;;AAGO,MAAeA,sBAAf,SAGGC,wBAHH,CAGkD;EACvDC,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;IACtD,MAAMF,GAAN,EAAWG,uBAAA,CAAgBC,WAA3B,EAAwCH,IAAxC,EAA8CC,KAA9C;EACD;;EAEDG,QAAQ,CAACC,KAAD,EAAuB;IAC7B,IAAI,EAAEA,KAAK,YAAYT,sBAAnB,CAAJ,EAAgD;MAC9C,MAAM,IAAIU,KAAJ,CAAW,4BAA2BD,KAAK,CAACL,IAAK,OAAM,KAAKA,IAAK,EAAjE,CAAN;IACD;;IACD,MAAMI,QAAN,CAAeC,KAAf;EACD;;EAEDE,iBAAiB,CAACF,KAAD,EAAuBG,MAAvB,EAAoD;IACnE,IAAI,EAAEH,KAAK,YAAYT,sBAAnB,CAAJ,EAAgD;MAC9C,MAAM,IAAIU,KAAJ,CAAW,4BAA2BD,KAAK,CAACL,IAAK,OAAM,KAAKA,IAAK,EAAjE,CAAN;IACD;;IACD,MAAMO,iBAAN,CAAwBF,KAAxB,EAA+BG,MAA/B;EACD;;EAEDC,OAAO,CAACC,MAA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AAMF,GAAN,EAAWqB,gBAAA,CAASuB,eAApB,EAAqC1C,KAArC;EACD;;EAEDiB,WAAW,GAAG;IACZ,MAAM;MAAE0B;IAAF,IAAQ,KAAK3C,KAAnB;IACA,MAAM,CAAC4C,KAAD,EAAQC,MAAR,IAAkB,KAAKnC,QAAL,EAAxB;IAIA,OAAO,KAAKG,IAAL,CAAUX,WAAV,CAAsB4C,QAAtB,CACLH,CADK,EAELC,KAAK,CAAC3B,WAAN,EAFK,EAGL4B,MAAM,CAAC5B,WAAP,EAHK,CAAP;EAKD;;AAhBmF"}
1
+ {"version":3,"names":["ColorFilterDeclaration","JsiDeclarationNode","constructor","ctx","type","props","DeclarationType","ColorFilter","composeAndPush","cf1","save","decorateChildren","cf2","colorFilters","popAllAsOne","restore","cf","Skia","MakeCompose","push","MatrixColorFilterNode","NodeType","MatrixColorFilter","decorate","matrix","MakeMatrix","BlendColorFilterNode","BlendColorFilter","mode","color","Color","MakeBlend","BlendMode","enumKey","LinearToSRGBGammaColorFilterNode","LinearToSRGBGammaColorFilter","MakeLinearToSRGBGamma","SRGBToLinearGammaColorFilterNode","SRGBToLinearGammaColorFilter","MakeSRGBToLinearGamma","LumaColorFilterNode","LumaColorFilter","MakeLumaColorFilter","LerpColorFilterNode","LerpColorFilter","t","second","pop","first","Error","MakeLerp"],"sources":["ColorFilters.ts"],"sourcesContent":["import type { SkColorFilter } from \"../../../skia/types\";\nimport { BlendMode } from \"../../../skia/types\";\nimport type { NodeContext } from \"../Node\";\nimport { JsiDeclarationNode } from \"../Node\";\nimport type {\n BlendColorFilterProps,\n MatrixColorFilterProps,\n} from \"../../types\";\nimport { DeclarationType, NodeType } from \"../../types\";\nimport { enumKey } from \"../datatypes/Enum\";\nimport type { LerpColorFilterProps } from \"../../types/ColorFilters\";\nimport type { DeclarationContext } from \"../../types/DeclarationContext\";\n\nexport abstract class ColorFilterDeclaration<P> extends JsiDeclarationNode<P> {\n constructor(ctx: NodeContext, type: NodeType, props: P) {\n super(ctx, DeclarationType.ColorFilter, type, props);\n }\n\n protected composeAndPush(ctx: DeclarationContext, cf1: SkColorFilter) {\n ctx.save();\n this.decorateChildren(ctx);\n const cf2 = ctx.colorFilters.popAllAsOne();\n ctx.restore();\n const cf = cf2 ? this.Skia.ColorFilter.MakeCompose(cf1, cf2) : cf1;\n ctx.colorFilters.push(cf);\n }\n}\n\nexport class MatrixColorFilterNode extends ColorFilterDeclaration<MatrixColorFilterProps> {\n constructor(ctx: NodeContext, props: MatrixColorFilterProps) {\n super(ctx, NodeType.MatrixColorFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { matrix } = this.props;\n const cf = this.Skia.ColorFilter.MakeMatrix(matrix);\n this.composeAndPush(ctx, cf);\n }\n}\n\nexport class BlendColorFilterNode extends ColorFilterDeclaration<BlendColorFilterProps> {\n constructor(ctx: NodeContext, props: BlendColorFilterProps) {\n super(ctx, NodeType.BlendColorFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n const { mode } = this.props;\n const color = this.Skia.Color(this.props.color);\n const cf = this.Skia.ColorFilter.MakeBlend(color, BlendMode[enumKey(mode)]);\n this.composeAndPush(ctx, cf);\n }\n}\n\nexport class LinearToSRGBGammaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.LinearToSRGBGammaColorFilter, null);\n }\n\n decorate(ctx: DeclarationContext) {\n const cf = this.Skia.ColorFilter.MakeLinearToSRGBGamma();\n this.composeAndPush(ctx, cf);\n }\n}\n\nexport class SRGBToLinearGammaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.SRGBToLinearGammaColorFilter, null);\n }\n\n decorate(ctx: DeclarationContext) {\n const cf = this.Skia.ColorFilter.MakeSRGBToLinearGamma();\n this.composeAndPush(ctx, cf);\n }\n}\n\nexport class LumaColorFilterNode extends ColorFilterDeclaration<null> {\n constructor(ctx: NodeContext) {\n super(ctx, NodeType.LumaColorFilter, null);\n }\n\n decorate(ctx: DeclarationContext) {\n const cf = this.Skia.ColorFilter.MakeLumaColorFilter();\n this.composeAndPush(ctx, cf);\n }\n}\n\nexport class LerpColorFilterNode extends ColorFilterDeclaration<LerpColorFilterProps> {\n constructor(ctx: NodeContext, props: LerpColorFilterProps) {\n super(ctx, NodeType.LerpColorFilter, props);\n }\n\n decorate(ctx: DeclarationContext) {\n ctx.save();\n this.decorateChildren(ctx);\n const { t } = this.props;\n const second = ctx.colorFilters.pop();\n const first = ctx.colorFilters.pop();\n ctx.restore();\n if (!first || !second) {\n throw new Error(\n \"LerpColorFilterNode: missing two color filters as children\"\n );\n }\n ctx.colorFilters.push(this.Skia.ColorFilter.MakeLerp(t, first, second));\n }\n}\n"],"mappings":";;;;;;;AACA;;AAEA;;AAKA;;AACA;;AAIO,MAAeA,sBAAf,SAAiDC,wBAAjD,CAAuE;EAC5EC,WAAW,CAACC,GAAD,EAAmBC,IAAnB,EAAmCC,KAAnC,EAA6C;IACtD,MAAMF,GAAN,EAAWG,uBAAA,CAAgBC,WAA3B,EAAwCH,IAAxC,EAA8CC,KAA9C;EACD;;EAESG,cAAc,CAACL,GAAD,EAA0BM,GAA1B,EAA8C;IACpEN,GAAG,CAACO,IAAJ;IACA,KAAKC,gBAAL,CAAsBR,GAAtB;IACA,MAAMS,GAAG,GAAGT,GAAG,CAACU,YAAJ,CAAiBC,WAAjB,EAAZ;IACAX,GAAG,CAACY,OAAJ;IACA,MAAMC,EAAE,GAAGJ,GAAG,GAAG,KAAKK,IAAL,CAAUV,WAAV,CAAsBW,WAAtB,CAAkCT,GAAlC,EAAuCG,GAAvC,CAAH,GAAiDH,GAA/D;IACAN,GAAG,CAACU,YAAJ,CAAiBM,IAAjB,CAAsBH,EAAtB;EACD;;AAZ2E;;;;AAevE,MAAMI,qBAAN,SAAoCpB,sBAApC,CAAmF;EACxFE,WAAW,CAACC,GAAD,EAAmBE,KAAnB,EAAkD;IAC3D,MAAMF,GAAN,EAAWkB,gBAAA,CAAS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AAV,CAAsB2C,QAAtB,CAA+BL,CAA/B,EAAkCG,KAAlC,EAAyCF,MAAzC,CAAtB;EACD;;AAlBmF"}
@@ -1,28 +1,28 @@
1
1
  import type { SkImageFilter } from "../../../skia/types";
2
- import type { BlendImageFilterProps, BlurImageFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps } from "../../types";
2
+ import type { BlendImageFilterProps, BlurImageFilterProps, DeclarationContext, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps } from "../../types";
3
3
  import { NodeType } from "../../types";
4
4
  import type { NodeContext } from "../Node";
5
5
  import { JsiDeclarationNode } from "../Node";
6
- export declare abstract class ImageFilterDeclaration<P, Nullable extends null | never = never> extends JsiDeclarationNode<P, SkImageFilter, Nullable> {
6
+ export declare abstract class ImageFilterDeclaration<P> extends JsiDeclarationNode<P> {
7
7
  constructor(ctx: NodeContext, type: NodeType, props: P);
8
- getOptionalChildInstance(index: number): any;
9
- getMandatoryChildInstance(index: number): any;
8
+ protected input(ctx: DeclarationContext): SkImageFilter | null;
9
+ protected composeAndPush(ctx: DeclarationContext, imgf1: SkImageFilter): void;
10
10
  }
11
11
  export declare class OffsetImageFilterNode extends ImageFilterDeclaration<OffsetImageFilterProps> {
12
12
  constructor(ctx: NodeContext, props: OffsetImageFilterProps);
13
- materialize(): SkImageFilter;
13
+ decorate(ctx: DeclarationContext): void;
14
14
  }
15
15
  export declare class DisplacementMapImageFilterNode extends ImageFilterDeclaration<DisplacementMapImageFilterProps> {
16
16
  constructor(ctx: NodeContext, props: DisplacementMapImageFilterProps);
17
- materialize(): SkImageFilter;
17
+ decorate(ctx: DeclarationContext): void;
18
18
  }
19
19
  export declare class BlurImageFilterNode extends ImageFilterDeclaration<BlurImageFilterProps> {
20
20
  constructor(ctx: NodeContext, props: BlurImageFilterProps);
21
- materialize(): SkImageFilter;
21
+ decorate(ctx: DeclarationContext): void;
22
22
  }
23
23
  export declare class DropShadowImageFilterNode extends ImageFilterDeclaration<DropShadowImageFilterProps> {
24
24
  constructor(ctx: NodeContext, props: DropShadowImageFilterProps);
25
- materialize(): SkImageFilter;
25
+ decorate(ctx: DeclarationContext): void;
26
26
  }
27
27
  export declare enum MorphologyOperator {
28
28
  Erode = 0,
@@ -30,13 +30,13 @@ export declare enum MorphologyOperator {
30
30
  }
31
31
  export declare class MorphologyImageFilterNode extends ImageFilterDeclaration<MorphologyImageFilterProps> {
32
32
  constructor(ctx: NodeContext, props: MorphologyImageFilterProps);
33
- materialize(): SkImageFilter;
33
+ decorate(ctx: DeclarationContext): void;
34
34
  }
35
35
  export declare class BlendImageFilterNode extends ImageFilterDeclaration<BlendImageFilterProps> {
36
36
  constructor(ctx: NodeContext, props: BlendImageFilterProps);
37
- materialize(): SkImageFilter;
37
+ decorate(ctx: DeclarationContext): void;
38
38
  }
39
39
  export declare class RuntimeShaderImageFilterNode extends ImageFilterDeclaration<RuntimeShaderImageFilterProps> {
40
40
  constructor(ctx: NodeContext, props: RuntimeShaderImageFilterProps);
41
- materialize(): SkImageFilter;
41
+ decorate(ctx: DeclarationContext): void;
42
42
  }