@shopify/react-native-skia 1.8.0 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (390) hide show
  1. package/cpp/api/JsiSkPaint.h +8 -1
  2. package/lib/commonjs/dom/types/Common.d.ts +6 -4
  3. package/lib/commonjs/dom/types/Common.js.map +1 -1
  4. package/lib/commonjs/dom/types/ImageFilters.d.ts +1 -1
  5. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
  6. package/lib/commonjs/dom/types/Node.d.ts +0 -2
  7. package/lib/commonjs/dom/types/Node.js.map +1 -1
  8. package/lib/commonjs/external/reanimated/index.d.ts +0 -1
  9. package/lib/commonjs/external/reanimated/index.js +0 -11
  10. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  11. package/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
  12. package/lib/commonjs/external/reanimated/renderHelpers.js +5 -43
  13. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  14. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +1 -8
  15. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
  16. package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
  17. package/lib/commonjs/skia/core/AnimatedImage.js +1 -1
  18. package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
  19. package/lib/commonjs/skia/core/Data.d.ts +1 -1
  20. package/lib/commonjs/skia/core/Data.js +2 -8
  21. package/lib/commonjs/skia/core/Data.js.map +1 -1
  22. package/lib/commonjs/skia/types/Paint/Paint.d.ts +1 -0
  23. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  24. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  25. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -0
  26. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  27. package/lib/commonjs/sksg/Container.d.ts +3 -2
  28. package/lib/commonjs/sksg/Container.js +32 -26
  29. package/lib/commonjs/sksg/Container.js.map +1 -1
  30. package/lib/commonjs/sksg/HostConfig.d.ts +2 -2
  31. package/lib/commonjs/sksg/HostConfig.js +7 -25
  32. package/lib/commonjs/sksg/HostConfig.js.map +1 -1
  33. package/lib/commonjs/sksg/Node.d.ts +19 -0
  34. package/lib/commonjs/sksg/Node.js +78 -0
  35. package/lib/commonjs/sksg/Node.js.map +1 -0
  36. package/lib/commonjs/sksg/Reconciler.d.ts +1 -1
  37. package/lib/commonjs/sksg/Recorder/Core.d.ts +79 -0
  38. package/lib/commonjs/sksg/Recorder/Core.js +110 -0
  39. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -0
  40. package/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +18 -0
  41. package/lib/commonjs/sksg/Recorder/DrawingContext.js +105 -0
  42. package/lib/commonjs/sksg/Recorder/DrawingContext.js.map +1 -0
  43. package/lib/commonjs/sksg/Recorder/Player.d.ts +3 -0
  44. package/lib/commonjs/sksg/Recorder/Player.js +127 -0
  45. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -0
  46. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +50 -0
  47. package/lib/commonjs/sksg/Recorder/Recorder.js +288 -0
  48. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -0
  49. package/lib/commonjs/sksg/Recorder/Recording.d.ts +7 -0
  50. package/lib/commonjs/sksg/Recorder/Recording.js +12 -0
  51. package/lib/commonjs/sksg/Recorder/Recording.js.map +1 -0
  52. package/lib/commonjs/sksg/Recorder/Visitor.d.ts +5 -0
  53. package/lib/commonjs/sksg/Recorder/Visitor.js +293 -0
  54. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -0
  55. package/lib/commonjs/sksg/Recorder/commands/Box.d.ts +13 -0
  56. package/lib/commonjs/sksg/Recorder/commands/Box.js +71 -0
  57. package/lib/commonjs/sksg/Recorder/commands/Box.js.map +1 -0
  58. package/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +3 -0
  59. package/lib/commonjs/sksg/Recorder/commands/CTM.js +79 -0
  60. package/lib/commonjs/sksg/Recorder/commands/CTM.js.map +1 -0
  61. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  62. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js +76 -0
  63. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js.map +1 -0
  64. package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +24 -0
  65. package/lib/commonjs/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
  66. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -0
  67. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  68. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +183 -0
  69. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -0
  70. package/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +4 -0
  71. package/lib/commonjs/sksg/Recorder/commands/Paint.js +70 -0
  72. package/lib/commonjs/sksg/Recorder/commands/Paint.js.map +1 -0
  73. package/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  74. package/lib/commonjs/sksg/Recorder/commands/PathEffects.js +137 -0
  75. package/lib/commonjs/sksg/Recorder/commands/PathEffects.js.map +1 -0
  76. package/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +5 -0
  77. package/lib/commonjs/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +58 -15
  78. package/lib/commonjs/sksg/Recorder/commands/Shaders.js.map +1 -0
  79. package/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  80. package/lib/commonjs/sksg/{nodes/utils.js → utils.js} +12 -2
  81. package/lib/commonjs/sksg/utils.js.map +1 -0
  82. package/lib/module/dom/types/Common.d.ts +6 -4
  83. package/lib/module/dom/types/Common.js.map +1 -1
  84. package/lib/module/dom/types/ImageFilters.d.ts +1 -1
  85. package/lib/module/dom/types/ImageFilters.js.map +1 -1
  86. package/lib/module/dom/types/Node.d.ts +0 -2
  87. package/lib/module/dom/types/Node.js.map +1 -1
  88. package/lib/module/external/reanimated/index.d.ts +0 -1
  89. package/lib/module/external/reanimated/index.js +0 -1
  90. package/lib/module/external/reanimated/index.js.map +1 -1
  91. package/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
  92. package/lib/module/external/reanimated/renderHelpers.js +4 -42
  93. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  94. package/lib/module/external/reanimated/useAnimatedImageValue.js +1 -8
  95. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  96. package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
  97. package/lib/module/skia/core/AnimatedImage.js +1 -1
  98. package/lib/module/skia/core/AnimatedImage.js.map +1 -1
  99. package/lib/module/skia/core/Data.d.ts +1 -1
  100. package/lib/module/skia/core/Data.js +2 -8
  101. package/lib/module/skia/core/Data.js.map +1 -1
  102. package/lib/module/skia/types/Paint/Paint.d.ts +1 -0
  103. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  104. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  105. package/lib/module/skia/web/JsiSkPaint.js +3 -0
  106. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  107. package/lib/module/sksg/Container.d.ts +3 -2
  108. package/lib/module/sksg/Container.js +30 -24
  109. package/lib/module/sksg/Container.js.map +1 -1
  110. package/lib/module/sksg/HostConfig.d.ts +2 -2
  111. package/lib/module/sksg/HostConfig.js +7 -25
  112. package/lib/module/sksg/HostConfig.js.map +1 -1
  113. package/lib/module/sksg/Node.d.ts +19 -0
  114. package/lib/module/sksg/Node.js +67 -0
  115. package/lib/module/sksg/Node.js.map +1 -0
  116. package/lib/module/sksg/Reconciler.d.ts +1 -1
  117. package/lib/module/sksg/Recorder/Core.d.ts +79 -0
  118. package/lib/module/sksg/Recorder/Core.js +101 -0
  119. package/lib/module/sksg/Recorder/Core.js.map +1 -0
  120. package/lib/module/sksg/Recorder/DrawingContext.d.ts +18 -0
  121. package/lib/module/sksg/Recorder/DrawingContext.js +98 -0
  122. package/lib/module/sksg/Recorder/DrawingContext.js.map +1 -0
  123. package/lib/module/sksg/Recorder/Player.d.ts +3 -0
  124. package/lib/module/sksg/Recorder/Player.js +120 -0
  125. package/lib/module/sksg/Recorder/Player.js.map +1 -0
  126. package/lib/module/sksg/Recorder/Recorder.d.ts +50 -0
  127. package/lib/module/sksg/Recorder/Recorder.js +281 -0
  128. package/lib/module/sksg/Recorder/Recorder.js.map +1 -0
  129. package/lib/module/sksg/Recorder/Recording.d.ts +7 -0
  130. package/lib/module/sksg/Recorder/Recording.js +5 -0
  131. package/lib/module/sksg/Recorder/Recording.js.map +1 -0
  132. package/lib/module/sksg/Recorder/Visitor.d.ts +5 -0
  133. package/lib/module/sksg/Recorder/Visitor.js +285 -0
  134. package/lib/module/sksg/Recorder/Visitor.js.map +1 -0
  135. package/lib/module/sksg/Recorder/commands/Box.d.ts +13 -0
  136. package/lib/module/sksg/Recorder/commands/Box.js +63 -0
  137. package/lib/module/sksg/Recorder/commands/Box.js.map +1 -0
  138. package/lib/module/sksg/Recorder/commands/CTM.d.ts +3 -0
  139. package/lib/module/sksg/Recorder/commands/CTM.js +72 -0
  140. package/lib/module/sksg/Recorder/commands/CTM.js.map +1 -0
  141. package/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  142. package/lib/module/sksg/Recorder/commands/ColorFilters.js +67 -0
  143. package/lib/module/sksg/Recorder/commands/ColorFilters.js.map +1 -0
  144. package/lib/module/sksg/Recorder/commands/Drawing.d.ts +24 -0
  145. package/lib/module/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
  146. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -0
  147. package/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  148. package/lib/module/sksg/{nodes/imageFilters.js → Recorder/commands/ImageFilters.js} +87 -95
  149. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -0
  150. package/lib/module/sksg/Recorder/commands/Paint.d.ts +4 -0
  151. package/lib/module/sksg/Recorder/commands/Paint.js +62 -0
  152. package/lib/module/sksg/Recorder/commands/Paint.js.map +1 -0
  153. package/lib/module/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  154. package/lib/module/sksg/Recorder/commands/PathEffects.js +128 -0
  155. package/lib/module/sksg/Recorder/commands/PathEffects.js.map +1 -0
  156. package/lib/module/sksg/Recorder/commands/Shaders.d.ts +5 -0
  157. package/lib/module/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +63 -13
  158. package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -0
  159. package/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  160. package/lib/module/sksg/{nodes/utils.js → utils.js} +10 -1
  161. package/lib/module/sksg/utils.js.map +1 -0
  162. package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
  163. package/lib/typescript/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
  164. package/lib/typescript/lib/commonjs/skia/core/Data.d.ts +1 -1
  165. package/lib/typescript/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  166. package/lib/typescript/lib/commonjs/sksg/Container.d.ts +4 -0
  167. package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +1 -3
  168. package/lib/typescript/lib/commonjs/sksg/Node.d.ts +14 -0
  169. package/lib/typescript/lib/commonjs/sksg/Recorder/Core.d.ts +5 -0
  170. package/lib/typescript/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +17 -0
  171. package/lib/typescript/lib/commonjs/sksg/Recorder/Player.d.ts +2 -0
  172. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +45 -0
  173. package/lib/typescript/lib/commonjs/sksg/Recorder/Recording.d.ts +5 -0
  174. package/lib/typescript/lib/commonjs/sksg/Recorder/Visitor.d.ts +27 -0
  175. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Box.d.ts +3 -0
  176. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +2 -0
  177. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +4 -0
  178. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +6 -0
  179. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +14 -0
  180. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +4 -0
  181. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +3 -0
  182. package/lib/typescript/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
  183. package/lib/typescript/lib/module/external/reanimated/index.d.ts +0 -1
  184. package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
  185. package/lib/typescript/lib/module/mock/index.d.ts +1 -1
  186. package/lib/typescript/lib/module/skia/core/AnimatedImage.d.ts +1 -1
  187. package/lib/typescript/lib/module/skia/core/Data.d.ts +1 -1
  188. package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  189. package/lib/typescript/lib/module/sksg/Container.d.ts +4 -0
  190. package/lib/typescript/lib/module/sksg/HostConfig.d.ts +1 -3
  191. package/lib/typescript/lib/module/sksg/Node.d.ts +13 -0
  192. package/lib/typescript/lib/module/sksg/Recorder/Core.d.ts +4 -0
  193. package/lib/typescript/lib/module/sksg/Recorder/DrawingContext.d.ts +16 -0
  194. package/lib/typescript/lib/module/sksg/Recorder/Player.d.ts +1 -0
  195. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +44 -0
  196. package/lib/typescript/lib/module/sksg/Recorder/Recording.d.ts +4 -0
  197. package/lib/typescript/lib/module/sksg/Recorder/Visitor.d.ts +26 -0
  198. package/lib/typescript/lib/module/sksg/Recorder/commands/Box.d.ts +2 -0
  199. package/lib/typescript/lib/module/sksg/Recorder/commands/CTM.d.ts +1 -0
  200. package/lib/typescript/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +3 -0
  201. package/lib/typescript/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +5 -0
  202. package/lib/typescript/lib/module/sksg/Recorder/commands/Paint.d.ts +13 -0
  203. package/lib/typescript/lib/module/sksg/Recorder/commands/PathEffects.d.ts +3 -0
  204. package/lib/typescript/lib/module/sksg/Recorder/commands/Shaders.d.ts +2 -0
  205. package/lib/typescript/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
  206. package/lib/typescript/src/dom/types/Common.d.ts +6 -4
  207. package/lib/typescript/src/dom/types/ImageFilters.d.ts +1 -1
  208. package/lib/typescript/src/dom/types/Node.d.ts +0 -2
  209. package/lib/typescript/src/external/reanimated/index.d.ts +0 -1
  210. package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +0 -1
  211. package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
  212. package/lib/typescript/src/skia/core/Data.d.ts +1 -1
  213. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +1 -0
  214. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  215. package/lib/typescript/src/sksg/Container.d.ts +3 -2
  216. package/lib/typescript/src/sksg/HostConfig.d.ts +2 -2
  217. package/lib/typescript/src/sksg/Node.d.ts +19 -0
  218. package/lib/typescript/src/sksg/Reconciler.d.ts +1 -1
  219. package/lib/typescript/src/sksg/Recorder/Core.d.ts +79 -0
  220. package/lib/typescript/src/sksg/Recorder/DrawingContext.d.ts +18 -0
  221. package/lib/typescript/src/sksg/Recorder/Player.d.ts +3 -0
  222. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +50 -0
  223. package/lib/typescript/src/sksg/Recorder/Recording.d.ts +7 -0
  224. package/lib/typescript/src/sksg/Recorder/Visitor.d.ts +5 -0
  225. package/lib/typescript/src/sksg/Recorder/commands/Box.d.ts +13 -0
  226. package/lib/typescript/src/sksg/Recorder/commands/CTM.d.ts +3 -0
  227. package/lib/typescript/src/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  228. package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +24 -0
  229. package/lib/typescript/src/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  230. package/lib/typescript/src/sksg/Recorder/commands/Paint.d.ts +4 -0
  231. package/lib/typescript/src/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  232. package/lib/typescript/src/sksg/Recorder/commands/Shaders.d.ts +5 -0
  233. package/lib/typescript/src/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  234. package/package.json +1 -1
  235. package/src/__tests__/snapshots/image-filter/test-shadow.png +0 -0
  236. package/src/dom/types/Common.ts +7 -5
  237. package/src/dom/types/ImageFilters.ts +2 -1
  238. package/src/dom/types/Node.ts +0 -4
  239. package/src/external/reanimated/index.ts +0 -1
  240. package/src/external/reanimated/renderHelpers.ts +4 -44
  241. package/src/external/reanimated/useAnimatedImageValue.ts +4 -15
  242. package/src/renderer/__tests__/e2e/ColorFilters.spec.tsx +15 -0
  243. package/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.tsx +23 -2
  244. package/src/renderer/__tests__/e2e/ImageFilters.spec.tsx +91 -2
  245. package/src/renderer/__tests__/setup.tsx +1 -1
  246. package/src/skia/core/AnimatedImage.ts +2 -3
  247. package/src/skia/core/Data.ts +3 -9
  248. package/src/skia/types/Paint/Paint.ts +2 -0
  249. package/src/skia/web/JsiSkPaint.ts +4 -0
  250. package/src/sksg/Container.ts +35 -29
  251. package/src/sksg/HostConfig.ts +5 -50
  252. package/src/sksg/Node.ts +105 -0
  253. package/src/sksg/Recorder/Core.ts +171 -0
  254. package/src/sksg/Recorder/DrawingContext.ts +130 -0
  255. package/src/sksg/Recorder/Player.ts +160 -0
  256. package/src/sksg/Recorder/Recorder.ts +259 -0
  257. package/src/sksg/Recorder/Recording.ts +13 -0
  258. package/src/sksg/Recorder/Visitor.ts +324 -0
  259. package/src/sksg/Recorder/commands/Box.ts +63 -0
  260. package/src/sksg/Recorder/commands/CTM.ts +72 -0
  261. package/src/sksg/Recorder/commands/ColorFilters.ts +87 -0
  262. package/src/sksg/{nodes/drawings.ts → Recorder/commands/Drawing.ts} +29 -65
  263. package/src/sksg/Recorder/commands/ImageFilters.ts +255 -0
  264. package/src/sksg/Recorder/commands/Paint.ts +77 -0
  265. package/src/sksg/Recorder/commands/PathEffects.ts +169 -0
  266. package/src/sksg/{nodes/shaders.ts → Recorder/commands/Shaders.ts} +100 -26
  267. package/src/sksg/{nodes/utils.ts → utils.ts} +14 -1
  268. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  269. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +0 -24
  270. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +0 -1
  271. package/lib/commonjs/sksg/DeclarationContext.d.ts +0 -56
  272. package/lib/commonjs/sksg/DeclarationContext.js +0 -77
  273. package/lib/commonjs/sksg/DeclarationContext.js.map +0 -1
  274. package/lib/commonjs/sksg/DrawingContext.d.ts +0 -13
  275. package/lib/commonjs/sksg/DrawingContext.js +0 -172
  276. package/lib/commonjs/sksg/DrawingContext.js.map +0 -1
  277. package/lib/commonjs/sksg/__tests__/Declarations.spec.d.ts +0 -1
  278. package/lib/commonjs/sksg/__tests__/MockDeclaration.d.ts +0 -57
  279. package/lib/commonjs/sksg/nodes/Node.d.ts +0 -7
  280. package/lib/commonjs/sksg/nodes/Node.js +0 -6
  281. package/lib/commonjs/sksg/nodes/Node.js.map +0 -1
  282. package/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -10
  283. package/lib/commonjs/sksg/nodes/colorFilters.js +0 -79
  284. package/lib/commonjs/sksg/nodes/colorFilters.js.map +0 -1
  285. package/lib/commonjs/sksg/nodes/context.d.ts +0 -3
  286. package/lib/commonjs/sksg/nodes/context.js +0 -394
  287. package/lib/commonjs/sksg/nodes/context.js.map +0 -1
  288. package/lib/commonjs/sksg/nodes/drawings.d.ts +0 -30
  289. package/lib/commonjs/sksg/nodes/drawings.js.map +0 -1
  290. package/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -17
  291. package/lib/commonjs/sksg/nodes/imageFilters.js +0 -197
  292. package/lib/commonjs/sksg/nodes/imageFilters.js.map +0 -1
  293. package/lib/commonjs/sksg/nodes/index.d.ts +0 -3
  294. package/lib/commonjs/sksg/nodes/index.js +0 -39
  295. package/lib/commonjs/sksg/nodes/index.js.map +0 -1
  296. package/lib/commonjs/sksg/nodes/paint.d.ts +0 -3
  297. package/lib/commonjs/sksg/nodes/paint.js +0 -81
  298. package/lib/commonjs/sksg/nodes/paint.js.map +0 -1
  299. package/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -11
  300. package/lib/commonjs/sksg/nodes/pathEffects.js +0 -111
  301. package/lib/commonjs/sksg/nodes/pathEffects.js.map +0 -1
  302. package/lib/commonjs/sksg/nodes/shaders.d.ts +0 -11
  303. package/lib/commonjs/sksg/nodes/shaders.js.map +0 -1
  304. package/lib/commonjs/sksg/nodes/utils.js.map +0 -1
  305. package/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  306. package/lib/module/external/reanimated/useDerivedValueOnJS.js +0 -16
  307. package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +0 -1
  308. package/lib/module/sksg/DeclarationContext.d.ts +0 -56
  309. package/lib/module/sksg/DeclarationContext.js +0 -69
  310. package/lib/module/sksg/DeclarationContext.js.map +0 -1
  311. package/lib/module/sksg/DrawingContext.d.ts +0 -13
  312. package/lib/module/sksg/DrawingContext.js +0 -165
  313. package/lib/module/sksg/DrawingContext.js.map +0 -1
  314. package/lib/module/sksg/__tests__/Declarations.spec.d.ts +0 -1
  315. package/lib/module/sksg/__tests__/MockDeclaration.d.ts +0 -57
  316. package/lib/module/sksg/nodes/Node.d.ts +0 -7
  317. package/lib/module/sksg/nodes/Node.js +0 -2
  318. package/lib/module/sksg/nodes/Node.js.map +0 -1
  319. package/lib/module/sksg/nodes/colorFilters.d.ts +0 -10
  320. package/lib/module/sksg/nodes/colorFilters.js +0 -66
  321. package/lib/module/sksg/nodes/colorFilters.js.map +0 -1
  322. package/lib/module/sksg/nodes/context.d.ts +0 -3
  323. package/lib/module/sksg/nodes/context.js +0 -387
  324. package/lib/module/sksg/nodes/context.js.map +0 -1
  325. package/lib/module/sksg/nodes/drawings.d.ts +0 -30
  326. package/lib/module/sksg/nodes/drawings.js.map +0 -1
  327. package/lib/module/sksg/nodes/imageFilters.d.ts +0 -17
  328. package/lib/module/sksg/nodes/imageFilters.js.map +0 -1
  329. package/lib/module/sksg/nodes/index.d.ts +0 -3
  330. package/lib/module/sksg/nodes/index.js +0 -4
  331. package/lib/module/sksg/nodes/index.js.map +0 -1
  332. package/lib/module/sksg/nodes/paint.d.ts +0 -3
  333. package/lib/module/sksg/nodes/paint.js +0 -74
  334. package/lib/module/sksg/nodes/paint.js.map +0 -1
  335. package/lib/module/sksg/nodes/pathEffects.d.ts +0 -11
  336. package/lib/module/sksg/nodes/pathEffects.js +0 -97
  337. package/lib/module/sksg/nodes/pathEffects.js.map +0 -1
  338. package/lib/module/sksg/nodes/shaders.d.ts +0 -11
  339. package/lib/module/sksg/nodes/shaders.js.map +0 -1
  340. package/lib/module/sksg/nodes/utils.js.map +0 -1
  341. package/lib/typescript/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -2
  342. package/lib/typescript/lib/commonjs/sksg/DeclarationContext.d.ts +0 -53
  343. package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +0 -22
  344. package/lib/typescript/lib/commonjs/sksg/nodes/Node.d.ts +0 -1
  345. package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -8
  346. package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +0 -2
  347. package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -12
  348. package/lib/typescript/lib/commonjs/sksg/nodes/index.d.ts +0 -1
  349. package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +0 -2
  350. package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -9
  351. package/lib/typescript/lib/commonjs/sksg/nodes/shaders.d.ts +0 -10
  352. package/lib/typescript/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  353. package/lib/typescript/lib/module/sksg/DeclarationContext.d.ts +0 -52
  354. package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +0 -21
  355. package/lib/typescript/lib/module/sksg/nodes/Node.d.ts +0 -1
  356. package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +0 -7
  357. package/lib/typescript/lib/module/sksg/nodes/context.d.ts +0 -1
  358. package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +0 -11
  359. package/lib/typescript/lib/module/sksg/nodes/index.d.ts +0 -3
  360. package/lib/typescript/lib/module/sksg/nodes/paint.d.ts +0 -1
  361. package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +0 -8
  362. package/lib/typescript/lib/module/sksg/nodes/shaders.d.ts +0 -9
  363. package/lib/typescript/src/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  364. package/lib/typescript/src/sksg/DeclarationContext.d.ts +0 -56
  365. package/lib/typescript/src/sksg/DrawingContext.d.ts +0 -13
  366. package/lib/typescript/src/sksg/__tests__/Declarations.spec.d.ts +0 -1
  367. package/lib/typescript/src/sksg/__tests__/MockDeclaration.d.ts +0 -57
  368. package/lib/typescript/src/sksg/nodes/Node.d.ts +0 -7
  369. package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +0 -10
  370. package/lib/typescript/src/sksg/nodes/context.d.ts +0 -3
  371. package/lib/typescript/src/sksg/nodes/drawings.d.ts +0 -30
  372. package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +0 -17
  373. package/lib/typescript/src/sksg/nodes/index.d.ts +0 -3
  374. package/lib/typescript/src/sksg/nodes/paint.d.ts +0 -3
  375. package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +0 -11
  376. package/lib/typescript/src/sksg/nodes/shaders.d.ts +0 -11
  377. package/src/external/reanimated/useDerivedValueOnJS.ts +0 -20
  378. package/src/sksg/DeclarationContext.ts +0 -85
  379. package/src/sksg/DrawingContext.ts +0 -226
  380. package/src/sksg/__tests__/Declarations.spec.tsx +0 -235
  381. package/src/sksg/__tests__/MockDeclaration.ts +0 -138
  382. package/src/sksg/nodes/Node.ts +0 -8
  383. package/src/sksg/nodes/colorFilters.ts +0 -79
  384. package/src/sksg/nodes/context.ts +0 -412
  385. package/src/sksg/nodes/imageFilters.ts +0 -235
  386. package/src/sksg/nodes/index.ts +0 -3
  387. package/src/sksg/nodes/paint.ts +0 -75
  388. package/src/sksg/nodes/pathEffects.ts +0 -118
  389. /package/lib/typescript/lib/commonjs/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
  390. /package/lib/typescript/lib/module/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
@@ -1,387 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { NodeType } from "../../dom/types";
3
- import { createDeclarationContext } from "../DeclarationContext";
4
- import { drawAtlas, drawBox, drawCircle, drawDiffRect, drawFill, drawGlyphs, drawImage, drawImageSVG, drawLine, drawOval, drawParagraph, drawPatch, drawPath, drawPicture, drawPoints, drawRect, drawRRect, drawText, drawTextBlob, drawTextPath, drawVertices } from "./drawings";
5
- import { composeColorFilters, declareLerpColorFilter, makeBlendColorFilter, makeLinearToSRGBGammaColorFilter, makeLumaColorFilter, makeMatrixColorFilter, makeSRGBToLinearGammaColorFilter } from "./colorFilters";
6
- import { composeImageFilters, declareBlend, declareBlendImageFilter, declareBlurMaskFilter, declareDisplacementMapImageFilter, makeBlurImageFilter, makeDropShadowImageFilter, makeMorphologyImageFilter, makeOffsetImageFilter, makeRuntimeShaderImageFilter } from "./imageFilters";
7
- import { materialize } from "./utils";
8
- import { declareColorShader, declareFractalNoiseShader, declareImageShader, declareLinearGradientShader, declareRadialGradientShader, declareShader, declareSweepGradientShader, declareTurbulenceShader, declareTwoPointConicalGradientShader } from "./shaders";
9
- import { declarePaint } from "./paint";
10
- import { composePathEffects, declareSumPathEffect, makeCornerPathEffect, makeDashPathEffect, makeDiscretePathEffect, makeLine2DPathEffect, makePath1DPathEffect, makePath2DPathEffect } from "./pathEffects";
11
- function processDeclarations(ctx, node) {
12
- "worklet";
13
-
14
- const processChildren = () => node.children.forEach(child => processDeclarations(ctx, child));
15
- const {
16
- type
17
- } = node;
18
- const props = materialize(node.props);
19
- switch (type) {
20
- // Mask Filter
21
- case NodeType.BlurMaskFilter:
22
- {
23
- declareBlurMaskFilter(ctx, props);
24
- break;
25
- }
26
- // Color Filters
27
- case NodeType.LerpColorFilter:
28
- {
29
- processChildren();
30
- declareLerpColorFilter(ctx, props);
31
- break;
32
- }
33
- case NodeType.Blend:
34
- {
35
- processChildren();
36
- declareBlend(ctx, props);
37
- break;
38
- }
39
- case NodeType.BlendColorFilter:
40
- {
41
- const cf = makeBlendColorFilter(ctx, props);
42
- composeColorFilters(ctx, cf, processChildren);
43
- break;
44
- }
45
- case NodeType.SRGBToLinearGammaColorFilter:
46
- {
47
- const cf = makeSRGBToLinearGammaColorFilter(ctx);
48
- composeColorFilters(ctx, cf, processChildren);
49
- break;
50
- }
51
- case NodeType.LinearToSRGBGammaColorFilter:
52
- {
53
- const cf = makeLinearToSRGBGammaColorFilter(ctx);
54
- composeColorFilters(ctx, cf, processChildren);
55
- break;
56
- }
57
- case NodeType.MatrixColorFilter:
58
- {
59
- const cf = makeMatrixColorFilter(ctx, props);
60
- composeColorFilters(ctx, cf, processChildren);
61
- break;
62
- }
63
- case NodeType.LumaColorFilter:
64
- {
65
- const cf = makeLumaColorFilter(ctx);
66
- composeColorFilters(ctx, cf, processChildren);
67
- break;
68
- }
69
- // Shaders
70
- case NodeType.Shader:
71
- {
72
- processChildren();
73
- declareShader(ctx, props);
74
- break;
75
- }
76
- case NodeType.ImageShader:
77
- {
78
- declareImageShader(ctx, props);
79
- break;
80
- }
81
- case NodeType.ColorShader:
82
- {
83
- declareColorShader(ctx, props);
84
- break;
85
- }
86
- case NodeType.Turbulence:
87
- {
88
- declareTurbulenceShader(ctx, props);
89
- break;
90
- }
91
- case NodeType.FractalNoise:
92
- {
93
- declareFractalNoiseShader(ctx, props);
94
- break;
95
- }
96
- case NodeType.LinearGradient:
97
- {
98
- declareLinearGradientShader(ctx, props);
99
- break;
100
- }
101
- case NodeType.RadialGradient:
102
- {
103
- declareRadialGradientShader(ctx, props);
104
- break;
105
- }
106
- case NodeType.SweepGradient:
107
- {
108
- declareSweepGradientShader(ctx, props);
109
- break;
110
- }
111
- case NodeType.TwoPointConicalGradient:
112
- {
113
- declareTwoPointConicalGradientShader(ctx, props);
114
- break;
115
- }
116
- // Image Filters
117
- case NodeType.BlurImageFilter:
118
- {
119
- const imgf = makeBlurImageFilter(ctx, props);
120
- composeImageFilters(ctx, imgf, processChildren);
121
- break;
122
- }
123
- case NodeType.OffsetImageFilter:
124
- {
125
- const imgf = makeOffsetImageFilter(ctx, props);
126
- composeImageFilters(ctx, imgf, processChildren);
127
- break;
128
- }
129
- case NodeType.DisplacementMapImageFilter:
130
- {
131
- processChildren();
132
- declareDisplacementMapImageFilter(ctx, props);
133
- break;
134
- }
135
- case NodeType.DropShadowImageFilter:
136
- {
137
- const imgf = makeDropShadowImageFilter(ctx, props);
138
- composeImageFilters(ctx, imgf, processChildren);
139
- break;
140
- }
141
- case NodeType.MorphologyImageFilter:
142
- {
143
- const imgf = makeMorphologyImageFilter(ctx, props);
144
- composeImageFilters(ctx, imgf, processChildren);
145
- break;
146
- }
147
- case NodeType.BlendImageFilter:
148
- {
149
- processChildren();
150
- declareBlendImageFilter(ctx, props);
151
- break;
152
- }
153
- case NodeType.RuntimeShaderImageFilter:
154
- {
155
- const imgf = makeRuntimeShaderImageFilter(ctx, props);
156
- composeImageFilters(ctx, imgf, processChildren);
157
- break;
158
- }
159
- // Path Effects
160
- case NodeType.SumPathEffect:
161
- {
162
- processChildren();
163
- declareSumPathEffect(ctx);
164
- break;
165
- }
166
- case NodeType.CornerPathEffect:
167
- {
168
- const pf = makeCornerPathEffect(ctx, props);
169
- composePathEffects(ctx, pf, processChildren);
170
- break;
171
- }
172
- case NodeType.Path1DPathEffect:
173
- {
174
- const pf = makePath1DPathEffect(ctx, props);
175
- composePathEffects(ctx, pf, processChildren);
176
- break;
177
- }
178
- case NodeType.Path2DPathEffect:
179
- {
180
- const pf = makePath2DPathEffect(ctx, props);
181
- composePathEffects(ctx, pf, processChildren);
182
- break;
183
- }
184
- case NodeType.Line2DPathEffect:
185
- {
186
- const pf = makeLine2DPathEffect(ctx, props);
187
- composePathEffects(ctx, pf, processChildren);
188
- break;
189
- }
190
- case NodeType.DashPathEffect:
191
- {
192
- const pf = makeDashPathEffect(ctx, props);
193
- composePathEffects(ctx, pf, processChildren);
194
- break;
195
- }
196
- case NodeType.DiscretePathEffect:
197
- {
198
- const pf = makeDiscretePathEffect(ctx, props);
199
- composePathEffects(ctx, pf, processChildren);
200
- break;
201
- }
202
- // Paint
203
- case NodeType.Paint:
204
- processChildren();
205
- declarePaint(ctx, props);
206
- break;
207
- default:
208
- console.log("Unknown declaration node: ", type);
209
- }
210
- }
211
- const preProcessContext = (ctx, props, node) => {
212
- "worklet";
213
-
214
- const shouldRestoreMatrix = ctx.processMatrixAndClipping(props, props.layer);
215
- const declCtx = createDeclarationContext(ctx.Skia);
216
- node.children.forEach(child => {
217
- if (child.isDeclaration) {
218
- processDeclarations(declCtx, child);
219
- }
220
- });
221
- const shouldRestorePaint = ctx.processPaint(props, declCtx);
222
- return {
223
- shouldRestoreMatrix,
224
- shouldRestorePaint,
225
- extraPaints: declCtx.paints.popAll()
226
- };
227
- };
228
- const drawBackdropFilter = (ctx, node) => {
229
- "worklet";
230
-
231
- const {
232
- canvas,
233
- Skia
234
- } = ctx;
235
- const child = node.children[0];
236
- let imageFilter = null;
237
- if (child.isDeclaration) {
238
- const declCtx = createDeclarationContext(ctx.Skia);
239
- processDeclarations(declCtx, child);
240
- const imgf = declCtx.imageFilters.pop();
241
- if (imgf) {
242
- imageFilter = imgf;
243
- } else {
244
- const cf = declCtx.colorFilters.pop();
245
- if (cf) {
246
- imageFilter = Skia.ImageFilter.MakeColorFilter(cf, null);
247
- }
248
- }
249
- }
250
- canvas.saveLayer(undefined, null, imageFilter);
251
- canvas.restore();
252
- };
253
- export function draw(ctx, node) {
254
- "worklet";
255
-
256
- // Special mixed nodes
257
- if (node.type === NodeType.BackdropFilter) {
258
- drawBackdropFilter(ctx, node);
259
- return;
260
- }
261
- if (node.type === NodeType.Layer) {
262
- let hasLayer = false;
263
- const [layer, ...children] = node.children;
264
- if (layer.isDeclaration) {
265
- const declCtx = createDeclarationContext(ctx.Skia);
266
- processDeclarations(declCtx, layer);
267
- const paint = declCtx.paints.pop();
268
- if (paint) {
269
- hasLayer = true;
270
- ctx.canvas.saveLayer(paint);
271
- }
272
- }
273
- children.map(child => {
274
- if (!child.isDeclaration) {
275
- draw(ctx, child);
276
- }
277
- });
278
- if (hasLayer) {
279
- ctx.canvas.restore();
280
- }
281
- return;
282
- }
283
- const {
284
- type,
285
- props: rawProps,
286
- children
287
- } = node;
288
- // Regular nodes
289
- const props = materialize(rawProps);
290
- const {
291
- shouldRestoreMatrix,
292
- shouldRestorePaint,
293
- extraPaints
294
- } = preProcessContext(ctx, props, node);
295
- const paints = [ctx.getPaint(), ...extraPaints];
296
- paints.forEach(paint => {
297
- const lctx = {
298
- paint,
299
- Skia: ctx.Skia,
300
- canvas: ctx.canvas
301
- };
302
- switch (type) {
303
- case NodeType.Box:
304
- drawBox(lctx, props, node.children);
305
- break;
306
- case NodeType.Image:
307
- drawImage(lctx, props);
308
- break;
309
- case NodeType.Points:
310
- drawPoints(lctx, props);
311
- break;
312
- case NodeType.Path:
313
- drawPath(lctx, props);
314
- break;
315
- case NodeType.Rect:
316
- drawRect(lctx, props);
317
- break;
318
- case NodeType.RRect:
319
- drawRRect(lctx, props);
320
- break;
321
- case NodeType.Oval:
322
- drawOval(lctx, props);
323
- break;
324
- case NodeType.Line:
325
- drawLine(lctx, props);
326
- break;
327
- case NodeType.Patch:
328
- drawPatch(lctx, props);
329
- break;
330
- case NodeType.Vertices:
331
- drawVertices(lctx, props);
332
- break;
333
- case NodeType.DiffRect:
334
- drawDiffRect(lctx, props);
335
- break;
336
- case NodeType.Text:
337
- drawText(lctx, props);
338
- break;
339
- case NodeType.TextPath:
340
- drawTextPath(lctx, props);
341
- break;
342
- case NodeType.TextBlob:
343
- drawTextBlob(lctx, props);
344
- break;
345
- case NodeType.Glyphs:
346
- drawGlyphs(lctx, props);
347
- break;
348
- case NodeType.Picture:
349
- drawPicture(lctx, props);
350
- break;
351
- case NodeType.ImageSVG:
352
- drawImageSVG(lctx, props);
353
- break;
354
- case NodeType.Paragraph:
355
- drawParagraph(lctx, props);
356
- break;
357
- case NodeType.Atlas:
358
- drawAtlas(lctx, props);
359
- break;
360
- case NodeType.Circle:
361
- drawCircle(lctx, props);
362
- break;
363
- case NodeType.Fill:
364
- drawFill(lctx, props);
365
- break;
366
- case NodeType.Group:
367
- // TODO: do nothing
368
- break;
369
- default:
370
- if (!node.isDeclaration) {
371
- console.warn(`Unsupported node type: ${type}`);
372
- }
373
- }
374
- });
375
- children.forEach(child => {
376
- if (!child.isDeclaration) {
377
- draw(ctx, child);
378
- }
379
- });
380
- if (shouldRestoreMatrix) {
381
- ctx.canvas.restore();
382
- }
383
- if (shouldRestorePaint) {
384
- ctx.restore();
385
- }
386
- }
387
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NodeType","createDeclarationContext","drawAtlas","drawBox","drawCircle","drawDiffRect","drawFill","drawGlyphs","drawImage","drawImageSVG","drawLine","drawOval","drawParagraph","drawPatch","drawPath","drawPicture","drawPoints","drawRect","drawRRect","drawText","drawTextBlob","drawTextPath","drawVertices","composeColorFilters","declareLerpColorFilter","makeBlendColorFilter","makeLinearToSRGBGammaColorFilter","makeLumaColorFilter","makeMatrixColorFilter","makeSRGBToLinearGammaColorFilter","composeImageFilters","declareBlend","declareBlendImageFilter","declareBlurMaskFilter","declareDisplacementMapImageFilter","makeBlurImageFilter","makeDropShadowImageFilter","makeMorphologyImageFilter","makeOffsetImageFilter","makeRuntimeShaderImageFilter","materialize","declareColorShader","declareFractalNoiseShader","declareImageShader","declareLinearGradientShader","declareRadialGradientShader","declareShader","declareSweepGradientShader","declareTurbulenceShader","declareTwoPointConicalGradientShader","declarePaint","composePathEffects","declareSumPathEffect","makeCornerPathEffect","makeDashPathEffect","makeDiscretePathEffect","makeLine2DPathEffect","makePath1DPathEffect","makePath2DPathEffect","processDeclarations","ctx","node","processChildren","children","forEach","child","type","props","BlurMaskFilter","LerpColorFilter","Blend","BlendColorFilter","cf","SRGBToLinearGammaColorFilter","LinearToSRGBGammaColorFilter","MatrixColorFilter","LumaColorFilter","Shader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","BlurImageFilter","imgf","OffsetImageFilter","DisplacementMapImageFilter","DropShadowImageFilter","MorphologyImageFilter","BlendImageFilter","RuntimeShaderImageFilter","SumPathEffect","CornerPathEffect","pf","Path1DPathEffect","Path2DPathEffect","Line2DPathEffect","DashPathEffect","DiscretePathEffect","Paint","console","log","preProcessContext","shouldRestoreMatrix","processMatrixAndClipping","layer","declCtx","Skia","isDeclaration","shouldRestorePaint","processPaint","extraPaints","paints","popAll","drawBackdropFilter","canvas","imageFilter","imageFilters","pop","colorFilters","ImageFilter","MakeColorFilter","saveLayer","undefined","restore","draw","BackdropFilter","Layer","hasLayer","paint","map","rawProps","getPaint","lctx","Box","Image","Points","Path","Rect","RRect","Oval","Line","Patch","Vertices","DiffRect","Text","TextPath","TextBlob","Glyphs","Picture","ImageSVG","Paragraph","Atlas","Circle","Fill","Group","warn"],"sources":["context.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { NodeType } from \"../../dom/types\";\nimport type { DrawingNodeProps } from \"../../dom/types\";\nimport type { DrawingContext } from \"../DrawingContext\";\nimport type { SkImageFilter } from \"../../skia/types\";\nimport {\n createDeclarationContext,\n type DeclarationContext,\n} from \"../DeclarationContext\";\n\nimport type { Node } from \"./Node\";\nimport {\n drawAtlas,\n drawBox,\n drawCircle,\n drawDiffRect,\n drawFill,\n drawGlyphs,\n drawImage,\n drawImageSVG,\n drawLine,\n drawOval,\n drawParagraph,\n drawPatch,\n drawPath,\n drawPicture,\n drawPoints,\n drawRect,\n drawRRect,\n drawText,\n drawTextBlob,\n drawTextPath,\n drawVertices,\n} from \"./drawings\";\nimport {\n composeColorFilters,\n declareLerpColorFilter,\n makeBlendColorFilter,\n makeLinearToSRGBGammaColorFilter,\n makeLumaColorFilter,\n makeMatrixColorFilter,\n makeSRGBToLinearGammaColorFilter,\n} from \"./colorFilters\";\nimport {\n composeImageFilters,\n declareBlend,\n declareBlendImageFilter,\n declareBlurMaskFilter,\n declareDisplacementMapImageFilter,\n makeBlurImageFilter,\n makeDropShadowImageFilter,\n makeMorphologyImageFilter,\n makeOffsetImageFilter,\n makeRuntimeShaderImageFilter,\n} from \"./imageFilters\";\nimport { materialize } from \"./utils\";\nimport {\n declareColorShader,\n declareFractalNoiseShader,\n declareImageShader,\n declareLinearGradientShader,\n declareRadialGradientShader,\n declareShader,\n declareSweepGradientShader,\n declareTurbulenceShader,\n declareTwoPointConicalGradientShader,\n} from \"./shaders\";\nimport { declarePaint } from \"./paint\";\nimport {\n composePathEffects,\n declareSumPathEffect,\n makeCornerPathEffect,\n makeDashPathEffect,\n makeDiscretePathEffect,\n makeLine2DPathEffect,\n makePath1DPathEffect,\n makePath2DPathEffect,\n} from \"./pathEffects\";\n\nfunction processDeclarations(ctx: DeclarationContext, node: Node<any>) {\n \"worklet\";\n const processChildren = () =>\n node.children.forEach((child) => processDeclarations(ctx, child));\n const { type } = node;\n const props = materialize(node.props);\n switch (type) {\n // Mask Filter\n case NodeType.BlurMaskFilter: {\n declareBlurMaskFilter(ctx, props);\n break;\n }\n // Color Filters\n case NodeType.LerpColorFilter: {\n processChildren();\n declareLerpColorFilter(ctx, props);\n break;\n }\n case NodeType.Blend: {\n processChildren();\n declareBlend(ctx, props);\n break;\n }\n case NodeType.BlendColorFilter: {\n const cf = makeBlendColorFilter(ctx, props);\n composeColorFilters(ctx, cf, processChildren);\n break;\n }\n case NodeType.SRGBToLinearGammaColorFilter: {\n const cf = makeSRGBToLinearGammaColorFilter(ctx);\n composeColorFilters(ctx, cf, processChildren);\n break;\n }\n case NodeType.LinearToSRGBGammaColorFilter: {\n const cf = makeLinearToSRGBGammaColorFilter(ctx);\n composeColorFilters(ctx, cf, processChildren);\n break;\n }\n case NodeType.MatrixColorFilter: {\n const cf = makeMatrixColorFilter(ctx, props);\n composeColorFilters(ctx, cf, processChildren);\n break;\n }\n case NodeType.LumaColorFilter: {\n const cf = makeLumaColorFilter(ctx);\n composeColorFilters(ctx, cf, processChildren);\n break;\n }\n // Shaders\n case NodeType.Shader: {\n processChildren();\n declareShader(ctx, props);\n break;\n }\n case NodeType.ImageShader: {\n declareImageShader(ctx, props);\n break;\n }\n case NodeType.ColorShader: {\n declareColorShader(ctx, props);\n break;\n }\n case NodeType.Turbulence: {\n declareTurbulenceShader(ctx, props);\n break;\n }\n case NodeType.FractalNoise: {\n declareFractalNoiseShader(ctx, props);\n break;\n }\n case NodeType.LinearGradient: {\n declareLinearGradientShader(ctx, props);\n break;\n }\n case NodeType.RadialGradient: {\n declareRadialGradientShader(ctx, props);\n break;\n }\n case NodeType.SweepGradient: {\n declareSweepGradientShader(ctx, props);\n break;\n }\n case NodeType.TwoPointConicalGradient: {\n declareTwoPointConicalGradientShader(ctx, props);\n break;\n }\n // Image Filters\n case NodeType.BlurImageFilter: {\n const imgf = makeBlurImageFilter(ctx, props);\n composeImageFilters(ctx, imgf, processChildren);\n break;\n }\n case NodeType.OffsetImageFilter: {\n const imgf = makeOffsetImageFilter(ctx, props);\n composeImageFilters(ctx, imgf, processChildren);\n break;\n }\n case NodeType.DisplacementMapImageFilter: {\n processChildren();\n declareDisplacementMapImageFilter(ctx, props);\n break;\n }\n case NodeType.DropShadowImageFilter: {\n const imgf = makeDropShadowImageFilter(ctx, props);\n composeImageFilters(ctx, imgf, processChildren);\n break;\n }\n case NodeType.MorphologyImageFilter: {\n const imgf = makeMorphologyImageFilter(ctx, props);\n composeImageFilters(ctx, imgf, processChildren);\n break;\n }\n case NodeType.BlendImageFilter: {\n processChildren();\n declareBlendImageFilter(ctx, props);\n break;\n }\n case NodeType.RuntimeShaderImageFilter: {\n const imgf = makeRuntimeShaderImageFilter(ctx, props);\n composeImageFilters(ctx, imgf, processChildren);\n break;\n }\n // Path Effects\n case NodeType.SumPathEffect: {\n processChildren();\n declareSumPathEffect(ctx);\n break;\n }\n case NodeType.CornerPathEffect: {\n const pf = makeCornerPathEffect(ctx, props);\n composePathEffects(ctx, pf, processChildren);\n break;\n }\n case NodeType.Path1DPathEffect: {\n const pf = makePath1DPathEffect(ctx, props);\n composePathEffects(ctx, pf, processChildren);\n break;\n }\n case NodeType.Path2DPathEffect: {\n const pf = makePath2DPathEffect(ctx, props);\n composePathEffects(ctx, pf, processChildren);\n break;\n }\n case NodeType.Line2DPathEffect: {\n const pf = makeLine2DPathEffect(ctx, props);\n composePathEffects(ctx, pf, processChildren);\n break;\n }\n case NodeType.DashPathEffect: {\n const pf = makeDashPathEffect(ctx, props);\n composePathEffects(ctx, pf, processChildren);\n break;\n }\n case NodeType.DiscretePathEffect: {\n const pf = makeDiscretePathEffect(ctx, props);\n composePathEffects(ctx, pf, processChildren);\n break;\n }\n // Paint\n case NodeType.Paint:\n processChildren();\n declarePaint(ctx, props);\n break;\n default:\n console.log(\"Unknown declaration node: \", type);\n }\n}\n\nconst preProcessContext = (\n ctx: DrawingContext,\n props: DrawingNodeProps,\n node: Node<any>\n) => {\n \"worklet\";\n const shouldRestoreMatrix = ctx.processMatrixAndClipping(props, props.layer);\n const declCtx = createDeclarationContext(ctx.Skia);\n node.children.forEach((child) => {\n if (child.isDeclaration) {\n processDeclarations(declCtx, child);\n }\n });\n const shouldRestorePaint = ctx.processPaint(props, declCtx);\n return {\n shouldRestoreMatrix,\n shouldRestorePaint,\n extraPaints: declCtx.paints.popAll(),\n };\n};\n\nconst drawBackdropFilter = (ctx: DrawingContext, node: Node) => {\n \"worklet\";\n const { canvas, Skia } = ctx;\n const child = node.children[0];\n let imageFilter: SkImageFilter | null = null;\n if (child.isDeclaration) {\n const declCtx = createDeclarationContext(ctx.Skia);\n processDeclarations(declCtx, child);\n const imgf = declCtx.imageFilters.pop();\n if (imgf) {\n imageFilter = imgf;\n } else {\n const cf = declCtx.colorFilters.pop();\n if (cf) {\n imageFilter = Skia.ImageFilter.MakeColorFilter(cf, null);\n }\n }\n }\n canvas.saveLayer(undefined, null, imageFilter);\n canvas.restore();\n};\n\nexport function draw(ctx: DrawingContext, node: Node<any>) {\n \"worklet\";\n // Special mixed nodes\n if (node.type === NodeType.BackdropFilter) {\n drawBackdropFilter(ctx, node);\n return;\n }\n if (node.type === NodeType.Layer) {\n let hasLayer = false;\n const [layer, ...children] = node.children;\n if (layer.isDeclaration) {\n const declCtx = createDeclarationContext(ctx.Skia);\n processDeclarations(declCtx, layer);\n const paint = declCtx.paints.pop();\n if (paint) {\n hasLayer = true;\n ctx.canvas.saveLayer(paint);\n }\n }\n children.map((child) => {\n if (!child.isDeclaration) {\n draw(ctx, child);\n }\n });\n if (hasLayer) {\n ctx.canvas.restore();\n }\n return;\n }\n const { type, props: rawProps, children } = node;\n // Regular nodes\n const props = materialize(rawProps);\n const { shouldRestoreMatrix, shouldRestorePaint, extraPaints } =\n preProcessContext(ctx, props, node);\n const paints = [ctx.getPaint(), ...extraPaints];\n paints.forEach((paint) => {\n const lctx = { paint, Skia: ctx.Skia, canvas: ctx.canvas };\n switch (type) {\n case NodeType.Box:\n drawBox(lctx, props, node.children);\n break;\n case NodeType.Image:\n drawImage(lctx, props);\n break;\n case NodeType.Points:\n drawPoints(lctx, props);\n break;\n case NodeType.Path:\n drawPath(lctx, props);\n break;\n case NodeType.Rect:\n drawRect(lctx, props);\n break;\n case NodeType.RRect:\n drawRRect(lctx, props);\n break;\n case NodeType.Oval:\n drawOval(lctx, props);\n break;\n case NodeType.Line:\n drawLine(lctx, props);\n break;\n case NodeType.Patch:\n drawPatch(lctx, props);\n break;\n case NodeType.Vertices:\n drawVertices(lctx, props);\n break;\n case NodeType.DiffRect:\n drawDiffRect(lctx, props);\n break;\n case NodeType.Text:\n drawText(lctx, props);\n break;\n case NodeType.TextPath:\n drawTextPath(lctx, props);\n break;\n case NodeType.TextBlob:\n drawTextBlob(lctx, props);\n break;\n case NodeType.Glyphs:\n drawGlyphs(lctx, props);\n break;\n case NodeType.Picture:\n drawPicture(lctx, props);\n break;\n case NodeType.ImageSVG:\n drawImageSVG(lctx, props);\n break;\n case NodeType.Paragraph:\n drawParagraph(lctx, props);\n break;\n case NodeType.Atlas:\n drawAtlas(lctx, props);\n break;\n case NodeType.Circle:\n drawCircle(lctx, props);\n break;\n case NodeType.Fill:\n drawFill(lctx, props);\n break;\n case NodeType.Group:\n // TODO: do nothing\n break;\n default:\n if (!node.isDeclaration) {\n console.warn(`Unsupported node type: ${type}`);\n }\n }\n });\n children.forEach((child) => {\n if (!child.isDeclaration) {\n draw(ctx, child);\n }\n });\n if (shouldRestoreMatrix) {\n ctx.canvas.restore();\n }\n if (shouldRestorePaint) {\n ctx.restore();\n }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,QAAQ,iBAAiB;AAI1C,SACEC,wBAAwB,QAEnB,uBAAuB;AAG9B,SACEC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,YAAY,EACZC,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,QAAQ,EACRC,aAAa,EACbC,SAAS,EACTC,QAAQ,EACRC,WAAW,EACXC,UAAU,EACVC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,YAAY,EACZC,YAAY,EACZC,YA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GAAG,EAAEK,KAAK,CAAC;IAClB;EACF,CAAC,CAAC;EACF,IAAIyC,mBAAmB,EAAE;IACvB9C,GAAG,CAAC0D,MAAM,CAACS,OAAO,CAAC,CAAC;EACtB;EACA,IAAIf,kBAAkB,EAAE;IACtBpD,GAAG,CAACmE,OAAO,CAAC,CAAC;EACf;AACF","ignoreList":[]}
@@ -1,30 +0,0 @@
1
- import type { AtlasProps, BoxProps, CircleProps, DiffRectProps, DrawingNodeProps, GlyphsProps, ImageProps, ImageSVGProps, LineProps, OvalProps, ParagraphProps, PatchProps, PathProps, PictureProps, PointsProps, RectProps, RoundedRectProps, TextBlobProps, TextPathProps, TextProps, VerticesProps } from "../../dom/types";
2
- import type { SkCanvas, SkPaint, Skia } from "../../skia/types";
3
- import type { Node } from "./Node";
4
- interface LocalDrawingContext {
5
- Skia: Skia;
6
- canvas: SkCanvas;
7
- paint: SkPaint;
8
- }
9
- export declare const drawLine: (ctx: LocalDrawingContext, props: LineProps) => void;
10
- export declare const drawOval: (ctx: LocalDrawingContext, props: OvalProps) => void;
11
- export declare const drawBox: (ctx: LocalDrawingContext, props: BoxProps, children: Node<any>[]) => void;
12
- export declare const drawImage: (ctx: LocalDrawingContext, props: ImageProps) => void;
13
- export declare const drawPoints: (ctx: LocalDrawingContext, props: PointsProps) => void;
14
- export declare const drawVertices: (ctx: LocalDrawingContext, props: VerticesProps) => void;
15
- export declare const drawDiffRect: (ctx: LocalDrawingContext, props: DiffRectProps) => void;
16
- export declare const drawTextPath: (ctx: LocalDrawingContext, props: TextPathProps) => void;
17
- export declare const drawText: (ctx: LocalDrawingContext, props: TextProps) => void;
18
- export declare const drawPatch: (ctx: LocalDrawingContext, props: PatchProps) => void;
19
- export declare const drawPath: (ctx: LocalDrawingContext, props: PathProps) => void;
20
- export declare const drawRect: (ctx: LocalDrawingContext, props: RectProps) => void;
21
- export declare const drawRRect: (ctx: LocalDrawingContext, props: RoundedRectProps) => void;
22
- export declare const drawTextBlob: (ctx: LocalDrawingContext, props: TextBlobProps) => void;
23
- export declare const drawGlyphs: (ctx: LocalDrawingContext, props: GlyphsProps) => void;
24
- export declare const drawImageSVG: (ctx: LocalDrawingContext, props: ImageSVGProps) => void;
25
- export declare const drawParagraph: (ctx: LocalDrawingContext, props: ParagraphProps) => void;
26
- export declare const drawPicture: (ctx: LocalDrawingContext, props: PictureProps) => void;
27
- export declare const drawAtlas: (ctx: LocalDrawingContext, props: AtlasProps) => void;
28
- export declare const drawCircle: (ctx: LocalDrawingContext, props: CircleProps) => void;
29
- export declare const drawFill: (ctx: LocalDrawingContext, _props: DrawingNodeProps) => void;
30
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"names":["deflate","enumKey","fitRects","inflate","NodeType","processCircle","processPath","processRect","processRRect","saturate","BlendMode","BlurStyle","ClipOp","FillType","isRRect","PointMode","VertexMode","materialize","drawLine","ctx","props","p1","p2","canvas","x","y","paint","drawOval","rect","Skia","drawBox","children","box","defaultBox","opacity","getAlphaf","RRectXY","shadows","map","node","type","BoxShadow","filter","n","shadow","inner","color","blur","spread","dx","dy","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","Intersect","outer","drawDRRect","restore","drawImage","image","_props$fit","fit","src","dst","width","height","drawImageRect","drawPoints","points","mode","drawVertices","textures","colors","indices","blendMode","vertexMode","Triangles","vertices","MakeVertices","c","undefined","defaultBlendMode","DstOver","SrcOver","blend","drawDiffRect","drawTextPath","path","font","initialOffset","text","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","substring","p","t","getPosTan","adjustedX","adjustedY","push","RSXform","derived","TextBlob","MakeFromRSXform","drawTextBlob","drawText","drawPatch","texture","patch","pos","c2","c1","drawPath","start","trimStart","end","trimEnd","fillType","stroke","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","hasFillType","willMutatePath","pristinePath","copy","setFillType","trim","drawRect","blob","drawGlyphs","glyphs","reduce","acc","glyph","id","positions","drawImageSVG","svg","translate","drawSvg","drawParagraph","paragraph","layout","drawPicture","picture","drawAtlas","sprites","transforms","drawCircle","r","drawFill","_props","drawPaint"],"sources":["drawings.ts"],"sourcesContent":["import {\n deflate,\n enumKey,\n fitRects,\n inflate,\n NodeType,\n processCircle,\n processPath,\n processRect,\n processRRect,\n} from \"../../dom/nodes\";\nimport type {\n AtlasProps,\n BoxProps,\n BoxShadowProps,\n CircleProps,\n DiffRectProps,\n DrawingNodeProps,\n GlyphsProps,\n ImageProps,\n ImageSVGProps,\n LineProps,\n OvalProps,\n ParagraphProps,\n PatchProps,\n PathProps,\n PictureProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextBlobProps,\n TextPathProps,\n TextProps,\n VerticesProps,\n} from \"../../dom/types\";\nimport { saturate } from \"../../renderer/processors\";\nimport type {\n SkCanvas,\n SkPaint,\n SkPoint,\n SkRSXform,\n Skia,\n} from \"../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ClipOp,\n FillType,\n isRRect,\n PointMode,\n VertexMode,\n} from \"../../skia/types\";\n\nimport type { Node } from \"./Node\";\nimport { materialize } from \"./utils\";\n\ninterface LocalDrawingContext {\n Skia: Skia;\n canvas: SkCanvas;\n paint: SkPaint;\n}\n\nexport const drawLine = (ctx: LocalDrawingContext, props: LineProps) => {\n \"worklet\";\n const { p1, p2 } = props;\n ctx.canvas.drawLine(p1.x, p1.y, p2.x, p2.y, ctx.paint);\n};\n\nexport const drawOval = (ctx: LocalDrawingContext, props: OvalProps) => {\n \"worklet\";\n const rect = processRect(ctx.Skia, props);\n ctx.canvas.drawOval(rect, ctx.paint);\n};\n\nexport const drawBox = (\n ctx: LocalDrawingContext,\n props: BoxProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n children: Node<any>[]\n) => {\n \"worklet\";\n const { paint, Skia, canvas } = ctx;\n const { box: defaultBox } = props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox) ? defaultBox : Skia.RRectXY(defaultBox, 0, 0);\n const shadows = children\n .map((node) => {\n if (node.type === NodeType.BoxShadow) {\n return materialize(node.props);\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 = Skia.Paint();\n lPaint.setColor(Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(inflate(Skia, box, spread, spread, dx, dy), lPaint);\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 = Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = Skia.Paint();\n lPaint.setColor(Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(Skia, box, spread, spread, dx, dy);\n const outer = inflate(Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n};\n\nexport const drawImage = (ctx: LocalDrawingContext, props: ImageProps) => {\n \"worklet\";\n const { image } = props;\n if (image) {\n const fit = props.fit ?? \"contain\";\n const rect = processRect(ctx.Skia, props);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n ctx.canvas.drawImageRect(image, src, dst, ctx.paint);\n }\n};\n\nexport const drawPoints = (ctx: LocalDrawingContext, props: PointsProps) => {\n \"worklet\";\n const { points, mode } = props;\n ctx.canvas.drawPoints(PointMode[enumKey(mode)], points, ctx.paint);\n};\n\nexport const drawVertices = (\n ctx: LocalDrawingContext,\n props: VerticesProps\n) => {\n \"worklet\";\n const { mode, textures, colors, indices, blendMode } = props;\n const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;\n const vertices = ctx.Skia.MakeVertices(\n vertexMode,\n props.vertices,\n textures,\n colors ? colors.map((c) => ctx.Skia.Color(c)) : undefined,\n indices\n );\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n\n ctx.canvas.drawVertices(vertices, blend, ctx.paint);\n};\n\nexport const drawDiffRect = (\n ctx: LocalDrawingContext,\n props: DiffRectProps\n) => {\n \"worklet\";\n const { outer, inner } = props;\n ctx.canvas.drawDRRect(outer, inner, ctx.paint);\n};\n\nexport const drawTextPath = (\n ctx: LocalDrawingContext,\n props: TextPathProps\n) => {\n \"worklet\";\n const path = processPath(ctx.Skia, props.path);\n const { font, initialOffset } = props;\n if (font) {\n let { text } = props;\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids);\n const rsx: SkRSXform[] = [];\n const meas = ctx.Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const [p, t] = cont.getPosTan(dist);\n const adjustedX = p.x - (width / 2) * t.x;\n const adjustedY = p.y - (width / 2) * t.y;\n rsx.push(ctx.Skia.RSXform(t.x, t.y, adjustedX, adjustedY));\n dist += width / 2;\n }\n const derived = ctx.Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n ctx.canvas.drawTextBlob(derived, 0, 0, ctx.paint);\n }\n};\n\nexport const drawText = (ctx: LocalDrawingContext, props: TextProps) => {\n \"worklet\";\n const { text, x, y, font } = props;\n if (font != null) {\n ctx.canvas.drawText(text, x, y, ctx.paint, font);\n }\n};\n\nexport const drawPatch = (ctx: LocalDrawingContext, props: PatchProps) => {\n \"worklet\";\n const { texture, blendMode, patch } = props;\n const defaultBlendMode = props.colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n\n const points = [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ];\n const colors = props.colors\n ? props.colors.map((c) => ctx.Skia.Color(c))\n : undefined;\n ctx.canvas.drawPatch(points, colors, texture, mode, ctx.paint);\n};\n\nexport const drawPath = (ctx: LocalDrawingContext, props: PathProps) => {\n \"worklet\";\n const {\n start: trimStart,\n end: trimEnd,\n fillType,\n stroke,\n ...pathProps\n } = props;\n const start = saturate(trimStart);\n const end = saturate(trimEnd);\n const hasStartOffset = start !== 0;\n const hasEndOffset = end !== 1;\n const hasStrokeOptions = stroke !== undefined;\n const hasFillType = !!fillType;\n const willMutatePath =\n hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;\n const pristinePath = processPath(ctx.Skia, pathProps.path);\n const path = willMutatePath ? pristinePath.copy() : pristinePath;\n if (hasFillType) {\n path.setFillType(FillType[enumKey(fillType)]);\n }\n if (hasStrokeOptions) {\n path.stroke(stroke);\n }\n if (hasStartOffset || hasEndOffset) {\n path.trim(start, end, false);\n }\n ctx.canvas.drawPath(path, ctx.paint);\n};\n\nexport const drawRect = (ctx: LocalDrawingContext, props: RectProps) => {\n \"worklet\";\n const derived = processRect(ctx.Skia, props);\n ctx.canvas.drawRect(derived, ctx.paint);\n};\n\nexport const drawRRect = (\n ctx: LocalDrawingContext,\n props: RoundedRectProps\n) => {\n \"worklet\";\n const derived = processRRect(ctx.Skia, props);\n ctx.canvas.drawRRect(derived, ctx.paint);\n};\n\nexport const drawTextBlob = (\n ctx: LocalDrawingContext,\n props: TextBlobProps\n) => {\n \"worklet\";\n const { blob, x, y } = props;\n ctx.canvas.drawTextBlob(blob, x, y, ctx.paint);\n};\n\ninterface ProcessedGlyphs {\n glyphs: number[];\n positions: SkPoint[];\n}\n\nexport const drawGlyphs = (ctx: LocalDrawingContext, props: GlyphsProps) => {\n \"worklet\";\n const derived = props.glyphs.reduce<ProcessedGlyphs>(\n (acc, glyph) => {\n const { id, pos } = glyph;\n acc.glyphs.push(id);\n acc.positions.push(pos);\n return acc;\n },\n { glyphs: [], positions: [] }\n );\n const { glyphs, positions } = derived;\n const { x, y, font } = props;\n if (font) {\n ctx.canvas.drawGlyphs(glyphs, positions, x, y, font, ctx.paint);\n }\n};\n\nexport const drawImageSVG = (\n ctx: LocalDrawingContext,\n props: ImageSVGProps\n) => {\n \"worklet\";\n const { canvas } = ctx;\n const { svg } = props;\n const { x, y, width, height } = props.rect\n ? props.rect\n : { x: props.x, y: props.y, width: props.width, height: props.height };\n if (svg === null) {\n return;\n }\n canvas.save();\n if (x && y) {\n canvas.translate(x, y);\n }\n canvas.drawSvg(svg, width, height);\n canvas.restore();\n};\n\nexport const drawParagraph = (\n ctx: LocalDrawingContext,\n props: ParagraphProps\n) => {\n \"worklet\";\n const { paragraph, x, y, width } = props;\n if (paragraph) {\n paragraph.layout(width);\n paragraph.paint(ctx.canvas, x, y);\n }\n};\n\nexport const drawPicture = (ctx: LocalDrawingContext, props: PictureProps) => {\n \"worklet\";\n const { picture } = props;\n ctx.canvas.drawPicture(picture);\n};\n\nexport const drawAtlas = (ctx: LocalDrawingContext, props: AtlasProps) => {\n \"worklet\";\n const { image, sprites, transforms, colors, blendMode } = props;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;\n if (image) {\n ctx.canvas.drawAtlas(image, sprites, transforms, ctx.paint, blend, colors);\n }\n};\n\nexport const drawCircle = (ctx: LocalDrawingContext, props: CircleProps) => {\n \"worklet\";\n const { c } = processCircle(props);\n const { r } = props;\n ctx.canvas.drawCircle(c.x, c.y, r, ctx.paint);\n};\n\nexport const drawFill = (\n ctx: LocalDrawingContext,\n _props: DrawingNodeProps\n) => {\n \"worklet\";\n ctx.canvas.drawPaint(ctx.paint);\n};\n"],"mappings":"AAAA,SACEA,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,YAAY,QACP,iBAAiB;AAyBxB,SAASC,QAAQ,QAAQ,2BAA2B;AAQpD,SACEC,SAAS,EACTC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,SAAS,EACTC,UAAU,QACL,kBAAkB;AAGzB,SAASC,WAAW,QAAQ,SAAS;AAQrC,OAAO,MAAMC,QAAQ,GAAGA,CAACC,GAAwB,EAAEC,KAAgB,KAAK;EACtE,SAAS;;EACT,MAAM;IAAEC,EAAE;IAAEC;EAAG,CAAC,GAAGF,KAAK;EACxBD,GAAG,CAACI,MAAM,CAACL,QAAQ,CAACG,EAAE,CAACG,CAAC,EAAEH,EAAE,CAACI,CAAC,EAAEH,EAAE,CAACE,CAAC,EAAEF,EAAE,CAACG,CAAC,EAAEN,GAAG,CAACO,KAAK,CAAC;AACxD,CAAC;AAED,OAAO,MAAMC,QAAQ,GAAGA,CAACR,GAAwB,EAAEC,KAAgB,KAAK;EACtE,SAAS;;EACT,MAAMQ,IAAI,GAAGrB,WAAW,CAACY,GAAG,CAACU,IAAI,EAAET,KAAK,CAAC;EACzCD,GAAG,CAACI,MAAM,CAACI,QAAQ,CAACC,IAAI,EAAET,GAAG,CAACO,KAAK,CAAC;AACtC,CAAC;AAED,OAAO,MAAMI,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lendProps, BlurImageFilterProps, BlurMaskFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps } from "../../dom/types";
2
- import type { SkImageFilter } from "../../skia/types";
3
- import type { DeclarationContext } from "../DeclarationContext";
4
- export declare enum MorphologyOperator {
5
- Erode = 0,
6
- Dilate = 1
7
- }
8
- export declare const declareBlend: (ctx: DeclarationContext, props: BlendProps) => void;
9
- export declare const composeImageFilters: (ctx: DeclarationContext, imgf1: SkImageFilter, processChildren: () => void) => void;
10
- export declare const makeOffsetImageFilter: (ctx: DeclarationContext, props: OffsetImageFilterProps) => SkImageFilter;
11
- export declare const declareDisplacementMapImageFilter: (ctx: DeclarationContext, props: DisplacementMapImageFilterProps) => void;
12
- export declare const makeBlurImageFilter: (ctx: DeclarationContext, props: BlurImageFilterProps) => SkImageFilter;
13
- export declare const makeDropShadowImageFilter: (ctx: DeclarationContext, props: DropShadowImageFilterProps) => SkImageFilter;
14
- export declare const makeMorphologyImageFilter: (ctx: DeclarationContext, props: MorphologyImageFilterProps) => SkImageFilter;
15
- export declare const makeRuntimeShaderImageFilter: (ctx: DeclarationContext, props: RuntimeShaderImageFilterProps) => SkImageFilter;
16
- export declare const declareBlendImageFilter: (ctx: DeclarationContext, props: BlendImageFilterProps) => void;
17
- export declare const declareBlurMaskFilter: (ctx: DeclarationContext, props: BlurMaskFilterProps) => void;
@@ -1 +0,0 @@
1
- {"version":3,"names":["enumKey","processRadius","BlendMode","BlurStyle","ColorChannel","processUniforms","TileMode","composeDeclarations","MorphologyOperator","Black","Float32Array","of","MakeInnerShadow","Skia","shadowOnly","dx","dy","sigmaX","sigmaY","color","input","sourceGraphic","ImageFilter","MakeColorFilter","ColorFilter","MakeBlend","Dst","sourceAlpha","SrcIn","f1","SrcOut","f2","MakeOffset","f3","MakeBlur","Decal","f4","MakeCompose","SrcOver","declareBlend","ctx","props","blend","mode","imageFilters","popAll","length","composer","bind","push","shaders","Shader","composeImageFilters","imgf1","processChildren","save","colorFilters","imgf2","popAllAsOne","cf","restore","_imgf","imgf","_ctx$imageFilters$pop","pop","makeOffsetImageFilter","x","y","declareDisplacementMapImageFilter","channelX","channelY","scale","shader","Error","map","MakeShader","MakeDisplacementMap","makeBlurImageFilter","blur","sigma","makeDropShadowImageFilter","cl","inner","Color","factory","MakeDropShadowOnly","MakeDropShadow","makeMorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","makeRuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader","declareBlendImageFilter","a","b","declareBlurMaskFilter","style","respectCTM","mf","MaskFilter","maskFilters"],"sources":["imageFilters.ts"],"sourcesContent":["import { enumKey, processRadius } from \"../../dom/nodes\";\nimport type {\n BlendImageFilterProps,\n BlendProps,\n BlurImageFilterProps,\n BlurMaskFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../dom/types\";\nimport type { SkColor, Skia, SkImageFilter } from \"../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../skia/types\";\nimport type { DeclarationContext } from \"../DeclarationContext\";\nimport { composeDeclarations } from \"../DeclarationContext\";\n\nexport enum MorphologyOperator {\n Erode,\n Dilate,\n}\n\nconst Black = Float32Array.of(0, 0, 0, 1);\n\nconst MakeInnerShadow = (\n Skia: Skia,\n shadowOnly: boolean | undefined,\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null\n) => {\n \"worklet\";\n const sourceGraphic = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.Dst),\n null\n );\n const sourceAlpha = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn),\n null\n );\n const f1 = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut),\n null\n );\n const f2 = Skia.ImageFilter.MakeOffset(dx, dy, f1);\n const f3 = Skia.ImageFilter.MakeBlur(sigmaX, sigmaY, TileMode.Decal, f2);\n const f4 = Skia.ImageFilter.MakeBlend(BlendMode.SrcIn, sourceAlpha, f3);\n if (shadowOnly) {\n return f4;\n }\n return Skia.ImageFilter.MakeCompose(\n input,\n Skia.ImageFilter.MakeBlend(BlendMode.SrcOver, sourceGraphic, f4)\n );\n};\n\nexport const declareBlend = (ctx: DeclarationContext, props: BlendProps) => {\n \"worklet\";\n const { Skia } = ctx;\n const blend = BlendMode[enumKey(props.mode as BlendProps[\"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\nexport const composeImageFilters = (\n ctx: DeclarationContext,\n imgf1: SkImageFilter,\n processChildren: () => void\n) => {\n \"worklet\";\n const { Skia } = ctx;\n ctx.imageFilters.save();\n ctx.colorFilters.save();\n processChildren();\n let imgf2 = ctx.imageFilters.popAllAsOne();\n const cf = ctx.colorFilters.popAllAsOne();\n ctx.imageFilters.restore();\n ctx.colorFilters.restore();\n if (cf) {\n imgf2 = Skia.ImageFilter.MakeCompose(\n imgf2 ?? null,\n Skia.ImageFilter.MakeColorFilter(cf, null)\n );\n }\n const imgf = imgf2 ? Skia.ImageFilter.MakeCompose(imgf1, imgf2) : imgf1;\n ctx.imageFilters.push(imgf);\n};\n\nconst input = (ctx: DeclarationContext) => {\n \"worklet\";\n return ctx.imageFilters.pop() ?? null;\n};\n\nexport const makeOffsetImageFilter = (\n ctx: DeclarationContext,\n props: OffsetImageFilterProps\n) => {\n \"worklet\";\n const { x, y } = props;\n return ctx.Skia.ImageFilter.MakeOffset(x, y, null);\n};\n\nexport const declareDisplacementMapImageFilter = (\n ctx: DeclarationContext,\n props: DisplacementMapImageFilterProps\n) => {\n \"worklet\";\n const { channelX, channelY, scale } = props;\n const shader = ctx.shaders.pop();\n if (!shader) {\n throw new Error(\"DisplacementMap expects a shader as child\");\n }\n const map = ctx.Skia.ImageFilter.MakeShader(shader, null);\n const imgf = ctx.Skia.ImageFilter.MakeDisplacementMap(\n ColorChannel[enumKey(channelX)],\n ColorChannel[enumKey(channelY)],\n scale,\n map,\n input(ctx)\n );\n ctx.imageFilters.push(imgf);\n};\n\nexport const makeBlurImageFilter = (\n ctx: DeclarationContext,\n props: BlurImageFilterProps\n) => {\n \"worklet\";\n const { mode, blur } = props;\n const sigma = processRadius(ctx.Skia, blur);\n const imgf = ctx.Skia.ImageFilter.MakeBlur(\n sigma.x,\n sigma.y,\n TileMode[enumKey(mode)],\n input(ctx)\n );\n return imgf;\n};\n\nexport const makeDropShadowImageFilter = (\n ctx: DeclarationContext,\n props: DropShadowImageFilterProps\n) => {\n \"worklet\";\n const { dx, dy, blur, shadowOnly, color: cl, inner } = props;\n const color = ctx.Skia.Color(cl);\n let factory;\n if (inner) {\n factory = MakeInnerShadow.bind(null, ctx.Skia, shadowOnly);\n } else {\n factory = shadowOnly\n ? ctx.Skia.ImageFilter.MakeDropShadowOnly.bind(ctx.Skia.ImageFilter)\n : ctx.Skia.ImageFilter.MakeDropShadow.bind(ctx.Skia.ImageFilter);\n }\n const imgf = factory(dx, dy, blur, blur, color, input(ctx));\n return imgf;\n};\n\nexport const makeMorphologyImageFilter = (\n ctx: DeclarationContext,\n props: MorphologyImageFilterProps\n) => {\n \"worklet\";\n const { operator } = props;\n const r = processRadius(ctx.Skia, props.radius);\n let imgf;\n if (MorphologyOperator[enumKey(operator)] === MorphologyOperator.Erode) {\n imgf = ctx.Skia.ImageFilter.MakeErode(r.x, r.y, input(ctx));\n } else {\n imgf = ctx.Skia.ImageFilter.MakeDilate(r.x, r.y, input(ctx));\n }\n return imgf;\n};\n\nexport const makeRuntimeShaderImageFilter = (\n ctx: DeclarationContext,\n props: RuntimeShaderImageFilterProps\n) => {\n \"worklet\";\n const { source, uniforms } = props;\n const rtb = ctx.Skia.RuntimeShaderBuilder(source);\n if (uniforms) {\n processUniforms(source, uniforms, rtb);\n }\n const imgf = ctx.Skia.ImageFilter.MakeRuntimeShader(rtb, null, input(ctx));\n return imgf;\n};\n\nexport const declareBlendImageFilter = (\n ctx: DeclarationContext,\n props: BlendImageFilterProps\n) => {\n \"worklet\";\n const { mode } = props;\n const a = ctx.imageFilters.pop();\n const b = ctx.imageFilters.pop();\n if (!a || !b) {\n throw new Error(\"BlendImageFilter requires two image filters\");\n }\n const imgf = ctx.Skia.ImageFilter.MakeBlend(mode, a, b);\n ctx.imageFilters.push(imgf);\n};\n\nexport const declareBlurMaskFilter = (\n ctx: DeclarationContext,\n props: BlurMaskFilterProps\n) => {\n \"worklet\";\n const { blur, style, respectCTM } = props;\n const mf = ctx.Skia.MaskFilter.MakeBlur(\n BlurStyle[enumKey(style)],\n blur,\n respectCTM\n );\n ctx.maskFilters.push(mf);\n};\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,aAAa,QAAQ,iBAAiB;AAaxD,SACEC,SAAS,EACTC,SAAS,EACTC,YAAY,EACZC,eAAe,EACfC,QAAQ,QACH,kBAAkB;AAEzB,SAASC,mBAAmB,QAAQ,uBAAuB;AAE3D,WAAYC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAK9B,MAAMC,KAAK,GAAGC,YAAY,CAACC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAEzC,MAAMC,eAAe,GA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AAuB,EACvBC,KAA0B,KACvB;EACH,SAAS;;EACT,MAAM;IAAEqC,IAAI;IAAE0B,KAAK;IAAEC;EAAW,CAAC,GAAGhE,KAAK;EACzC,MAAMiE,EAAE,GAAGlE,GAAG,CAAC3B,IAAI,CAAC8F,UAAU,CAACzE,QAAQ,CACrC/B,SAAS,CAACH,OAAO,CAACwG,KAAK,CAAC,CAAC,EACzB1B,IAAI,EACJ2B,UACF,CAAC;EACDjE,GAAG,CAACoE,WAAW,CAAC3D,IAAI,CAACyD,EAAE,CAAC;AAC1B,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- export * from "./Node";
2
- export * from "./context";
3
- export * from "./utils";
@@ -1,4 +0,0 @@
1
- export * from "./Node";
2
- export * from "./context";
3
- export * from "./utils";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Node\";\nexport * from \"./context\";\nexport * from \"./utils\";\n"],"mappings":"AAAA,cAAc,QAAQ;AACtB,cAAc,WAAW;AACzB,cAAc,SAAS","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { PaintProps } from "../../dom/types";
2
- import type { DeclarationContext } from "../DeclarationContext";
3
- export declare const declarePaint: (ctx: DeclarationContext, props: PaintProps) => void;