@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,394 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.draw = draw;
7
- var _types = require("../../dom/types");
8
- var _DeclarationContext = require("../DeclarationContext");
9
- var _drawings = require("./drawings");
10
- var _colorFilters = require("./colorFilters");
11
- var _imageFilters = require("./imageFilters");
12
- var _utils = require("./utils");
13
- var _shaders = require("./shaders");
14
- var _paint = require("./paint");
15
- var _pathEffects = require("./pathEffects");
16
- /* eslint-disable @typescript-eslint/no-explicit-any */
17
-
18
- function processDeclarations(ctx, node) {
19
- "worklet";
20
-
21
- const processChildren = () => node.children.forEach(child => processDeclarations(ctx, child));
22
- const {
23
- type
24
- } = node;
25
- const props = (0, _utils.materialize)(node.props);
26
- switch (type) {
27
- // Mask Filter
28
- case _types.NodeType.BlurMaskFilter:
29
- {
30
- (0, _imageFilters.declareBlurMaskFilter)(ctx, props);
31
- break;
32
- }
33
- // Color Filters
34
- case _types.NodeType.LerpColorFilter:
35
- {
36
- processChildren();
37
- (0, _colorFilters.declareLerpColorFilter)(ctx, props);
38
- break;
39
- }
40
- case _types.NodeType.Blend:
41
- {
42
- processChildren();
43
- (0, _imageFilters.declareBlend)(ctx, props);
44
- break;
45
- }
46
- case _types.NodeType.BlendColorFilter:
47
- {
48
- const cf = (0, _colorFilters.makeBlendColorFilter)(ctx, props);
49
- (0, _colorFilters.composeColorFilters)(ctx, cf, processChildren);
50
- break;
51
- }
52
- case _types.NodeType.SRGBToLinearGammaColorFilter:
53
- {
54
- const cf = (0, _colorFilters.makeSRGBToLinearGammaColorFilter)(ctx);
55
- (0, _colorFilters.composeColorFilters)(ctx, cf, processChildren);
56
- break;
57
- }
58
- case _types.NodeType.LinearToSRGBGammaColorFilter:
59
- {
60
- const cf = (0, _colorFilters.makeLinearToSRGBGammaColorFilter)(ctx);
61
- (0, _colorFilters.composeColorFilters)(ctx, cf, processChildren);
62
- break;
63
- }
64
- case _types.NodeType.MatrixColorFilter:
65
- {
66
- const cf = (0, _colorFilters.makeMatrixColorFilter)(ctx, props);
67
- (0, _colorFilters.composeColorFilters)(ctx, cf, processChildren);
68
- break;
69
- }
70
- case _types.NodeType.LumaColorFilter:
71
- {
72
- const cf = (0, _colorFilters.makeLumaColorFilter)(ctx);
73
- (0, _colorFilters.composeColorFilters)(ctx, cf, processChildren);
74
- break;
75
- }
76
- // Shaders
77
- case _types.NodeType.Shader:
78
- {
79
- processChildren();
80
- (0, _shaders.declareShader)(ctx, props);
81
- break;
82
- }
83
- case _types.NodeType.ImageShader:
84
- {
85
- (0, _shaders.declareImageShader)(ctx, props);
86
- break;
87
- }
88
- case _types.NodeType.ColorShader:
89
- {
90
- (0, _shaders.declareColorShader)(ctx, props);
91
- break;
92
- }
93
- case _types.NodeType.Turbulence:
94
- {
95
- (0, _shaders.declareTurbulenceShader)(ctx, props);
96
- break;
97
- }
98
- case _types.NodeType.FractalNoise:
99
- {
100
- (0, _shaders.declareFractalNoiseShader)(ctx, props);
101
- break;
102
- }
103
- case _types.NodeType.LinearGradient:
104
- {
105
- (0, _shaders.declareLinearGradientShader)(ctx, props);
106
- break;
107
- }
108
- case _types.NodeType.RadialGradient:
109
- {
110
- (0, _shaders.declareRadialGradientShader)(ctx, props);
111
- break;
112
- }
113
- case _types.NodeType.SweepGradient:
114
- {
115
- (0, _shaders.declareSweepGradientShader)(ctx, props);
116
- break;
117
- }
118
- case _types.NodeType.TwoPointConicalGradient:
119
- {
120
- (0, _shaders.declareTwoPointConicalGradientShader)(ctx, props);
121
- break;
122
- }
123
- // Image Filters
124
- case _types.NodeType.BlurImageFilter:
125
- {
126
- const imgf = (0, _imageFilters.makeBlurImageFilter)(ctx, props);
127
- (0, _imageFilters.composeImageFilters)(ctx, imgf, processChildren);
128
- break;
129
- }
130
- case _types.NodeType.OffsetImageFilter:
131
- {
132
- const imgf = (0, _imageFilters.makeOffsetImageFilter)(ctx, props);
133
- (0, _imageFilters.composeImageFilters)(ctx, imgf, processChildren);
134
- break;
135
- }
136
- case _types.NodeType.DisplacementMapImageFilter:
137
- {
138
- processChildren();
139
- (0, _imageFilters.declareDisplacementMapImageFilter)(ctx, props);
140
- break;
141
- }
142
- case _types.NodeType.DropShadowImageFilter:
143
- {
144
- const imgf = (0, _imageFilters.makeDropShadowImageFilter)(ctx, props);
145
- (0, _imageFilters.composeImageFilters)(ctx, imgf, processChildren);
146
- break;
147
- }
148
- case _types.NodeType.MorphologyImageFilter:
149
- {
150
- const imgf = (0, _imageFilters.makeMorphologyImageFilter)(ctx, props);
151
- (0, _imageFilters.composeImageFilters)(ctx, imgf, processChildren);
152
- break;
153
- }
154
- case _types.NodeType.BlendImageFilter:
155
- {
156
- processChildren();
157
- (0, _imageFilters.declareBlendImageFilter)(ctx, props);
158
- break;
159
- }
160
- case _types.NodeType.RuntimeShaderImageFilter:
161
- {
162
- const imgf = (0, _imageFilters.makeRuntimeShaderImageFilter)(ctx, props);
163
- (0, _imageFilters.composeImageFilters)(ctx, imgf, processChildren);
164
- break;
165
- }
166
- // Path Effects
167
- case _types.NodeType.SumPathEffect:
168
- {
169
- processChildren();
170
- (0, _pathEffects.declareSumPathEffect)(ctx);
171
- break;
172
- }
173
- case _types.NodeType.CornerPathEffect:
174
- {
175
- const pf = (0, _pathEffects.makeCornerPathEffect)(ctx, props);
176
- (0, _pathEffects.composePathEffects)(ctx, pf, processChildren);
177
- break;
178
- }
179
- case _types.NodeType.Path1DPathEffect:
180
- {
181
- const pf = (0, _pathEffects.makePath1DPathEffect)(ctx, props);
182
- (0, _pathEffects.composePathEffects)(ctx, pf, processChildren);
183
- break;
184
- }
185
- case _types.NodeType.Path2DPathEffect:
186
- {
187
- const pf = (0, _pathEffects.makePath2DPathEffect)(ctx, props);
188
- (0, _pathEffects.composePathEffects)(ctx, pf, processChildren);
189
- break;
190
- }
191
- case _types.NodeType.Line2DPathEffect:
192
- {
193
- const pf = (0, _pathEffects.makeLine2DPathEffect)(ctx, props);
194
- (0, _pathEffects.composePathEffects)(ctx, pf, processChildren);
195
- break;
196
- }
197
- case _types.NodeType.DashPathEffect:
198
- {
199
- const pf = (0, _pathEffects.makeDashPathEffect)(ctx, props);
200
- (0, _pathEffects.composePathEffects)(ctx, pf, processChildren);
201
- break;
202
- }
203
- case _types.NodeType.DiscretePathEffect:
204
- {
205
- const pf = (0, _pathEffects.makeDiscretePathEffect)(ctx, props);
206
- (0, _pathEffects.composePathEffects)(ctx, pf, processChildren);
207
- break;
208
- }
209
- // Paint
210
- case _types.NodeType.Paint:
211
- processChildren();
212
- (0, _paint.declarePaint)(ctx, props);
213
- break;
214
- default:
215
- console.log("Unknown declaration node: ", type);
216
- }
217
- }
218
- const preProcessContext = (ctx, props, node) => {
219
- "worklet";
220
-
221
- const shouldRestoreMatrix = ctx.processMatrixAndClipping(props, props.layer);
222
- const declCtx = (0, _DeclarationContext.createDeclarationContext)(ctx.Skia);
223
- node.children.forEach(child => {
224
- if (child.isDeclaration) {
225
- processDeclarations(declCtx, child);
226
- }
227
- });
228
- const shouldRestorePaint = ctx.processPaint(props, declCtx);
229
- return {
230
- shouldRestoreMatrix,
231
- shouldRestorePaint,
232
- extraPaints: declCtx.paints.popAll()
233
- };
234
- };
235
- const drawBackdropFilter = (ctx, node) => {
236
- "worklet";
237
-
238
- const {
239
- canvas,
240
- Skia
241
- } = ctx;
242
- const child = node.children[0];
243
- let imageFilter = null;
244
- if (child.isDeclaration) {
245
- const declCtx = (0, _DeclarationContext.createDeclarationContext)(ctx.Skia);
246
- processDeclarations(declCtx, child);
247
- const imgf = declCtx.imageFilters.pop();
248
- if (imgf) {
249
- imageFilter = imgf;
250
- } else {
251
- const cf = declCtx.colorFilters.pop();
252
- if (cf) {
253
- imageFilter = Skia.ImageFilter.MakeColorFilter(cf, null);
254
- }
255
- }
256
- }
257
- canvas.saveLayer(undefined, null, imageFilter);
258
- canvas.restore();
259
- };
260
- function draw(ctx, node) {
261
- "worklet";
262
-
263
- // Special mixed nodes
264
- if (node.type === _types.NodeType.BackdropFilter) {
265
- drawBackdropFilter(ctx, node);
266
- return;
267
- }
268
- if (node.type === _types.NodeType.Layer) {
269
- let hasLayer = false;
270
- const [layer, ...children] = node.children;
271
- if (layer.isDeclaration) {
272
- const declCtx = (0, _DeclarationContext.createDeclarationContext)(ctx.Skia);
273
- processDeclarations(declCtx, layer);
274
- const paint = declCtx.paints.pop();
275
- if (paint) {
276
- hasLayer = true;
277
- ctx.canvas.saveLayer(paint);
278
- }
279
- }
280
- children.map(child => {
281
- if (!child.isDeclaration) {
282
- draw(ctx, child);
283
- }
284
- });
285
- if (hasLayer) {
286
- ctx.canvas.restore();
287
- }
288
- return;
289
- }
290
- const {
291
- type,
292
- props: rawProps,
293
- children
294
- } = node;
295
- // Regular nodes
296
- const props = (0, _utils.materialize)(rawProps);
297
- const {
298
- shouldRestoreMatrix,
299
- shouldRestorePaint,
300
- extraPaints
301
- } = preProcessContext(ctx, props, node);
302
- const paints = [ctx.getPaint(), ...extraPaints];
303
- paints.forEach(paint => {
304
- const lctx = {
305
- paint,
306
- Skia: ctx.Skia,
307
- canvas: ctx.canvas
308
- };
309
- switch (type) {
310
- case _types.NodeType.Box:
311
- (0, _drawings.drawBox)(lctx, props, node.children);
312
- break;
313
- case _types.NodeType.Image:
314
- (0, _drawings.drawImage)(lctx, props);
315
- break;
316
- case _types.NodeType.Points:
317
- (0, _drawings.drawPoints)(lctx, props);
318
- break;
319
- case _types.NodeType.Path:
320
- (0, _drawings.drawPath)(lctx, props);
321
- break;
322
- case _types.NodeType.Rect:
323
- (0, _drawings.drawRect)(lctx, props);
324
- break;
325
- case _types.NodeType.RRect:
326
- (0, _drawings.drawRRect)(lctx, props);
327
- break;
328
- case _types.NodeType.Oval:
329
- (0, _drawings.drawOval)(lctx, props);
330
- break;
331
- case _types.NodeType.Line:
332
- (0, _drawings.drawLine)(lctx, props);
333
- break;
334
- case _types.NodeType.Patch:
335
- (0, _drawings.drawPatch)(lctx, props);
336
- break;
337
- case _types.NodeType.Vertices:
338
- (0, _drawings.drawVertices)(lctx, props);
339
- break;
340
- case _types.NodeType.DiffRect:
341
- (0, _drawings.drawDiffRect)(lctx, props);
342
- break;
343
- case _types.NodeType.Text:
344
- (0, _drawings.drawText)(lctx, props);
345
- break;
346
- case _types.NodeType.TextPath:
347
- (0, _drawings.drawTextPath)(lctx, props);
348
- break;
349
- case _types.NodeType.TextBlob:
350
- (0, _drawings.drawTextBlob)(lctx, props);
351
- break;
352
- case _types.NodeType.Glyphs:
353
- (0, _drawings.drawGlyphs)(lctx, props);
354
- break;
355
- case _types.NodeType.Picture:
356
- (0, _drawings.drawPicture)(lctx, props);
357
- break;
358
- case _types.NodeType.ImageSVG:
359
- (0, _drawings.drawImageSVG)(lctx, props);
360
- break;
361
- case _types.NodeType.Paragraph:
362
- (0, _drawings.drawParagraph)(lctx, props);
363
- break;
364
- case _types.NodeType.Atlas:
365
- (0, _drawings.drawAtlas)(lctx, props);
366
- break;
367
- case _types.NodeType.Circle:
368
- (0, _drawings.drawCircle)(lctx, props);
369
- break;
370
- case _types.NodeType.Fill:
371
- (0, _drawings.drawFill)(lctx, props);
372
- break;
373
- case _types.NodeType.Group:
374
- // TODO: do nothing
375
- break;
376
- default:
377
- if (!node.isDeclaration) {
378
- console.warn(`Unsupported node type: ${type}`);
379
- }
380
- }
381
- });
382
- children.forEach(child => {
383
- if (!child.isDeclaration) {
384
- draw(ctx, child);
385
- }
386
- });
387
- if (shouldRestoreMatrix) {
388
- ctx.canvas.restore();
389
- }
390
- if (shouldRestorePaint) {
391
- ctx.restore();
392
- }
393
- }
394
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_types","require","_DeclarationContext","_drawings","_colorFilters","_imageFilters","_utils","_shaders","_paint","_pathEffects","processDeclarations","ctx","node","processChildren","children","forEach","child","type","props","materialize","NodeType","BlurMaskFilter","declareBlurMaskFilter","LerpColorFilter","declareLerpColorFilter","Blend","declareBlend","BlendColorFilter","cf","makeBlendColorFilter","composeColorFilters","SRGBToLinearGammaColorFilter","makeSRGBToLinearGammaColorFilter","LinearToSRGBGammaColorFilter","makeLinearToSRGBGammaColorFilter","MatrixColorFilter","makeMatrixColorFilter","LumaColorFilter","makeLumaColorFilter","Shader","declareShader","ImageShader","declareImageShader","ColorShader","declareColorShader","Turbulence","declareTurbulenceShader","FractalNoise","declareFractalNoiseShader","LinearGradient","declareLinearGradientShader","RadialGradient","declareRadialGradientShader","SweepGradient","declareSweepGradientShader","TwoPointConicalGradient","declareTwoPointConicalGradientShader","BlurImageFilter","imgf","makeBlurImageFilter","composeImageFilters","OffsetImageFilter","makeOffsetImageFilter","DisplacementMapImageFilter","declareDisplacementMapImageFilter","DropShadowImageFilter","makeDropShadowImageFilter","MorphologyImageFilter","makeMorphologyImageFilter","BlendImageFilter","declareBlendImageFilter","RuntimeShaderImageFilter","makeRuntimeShaderImageFilter","SumPathEffect","declareSumPathEffect","CornerPathEffect","pf","makeCornerPathEffect","composePathEffects","Path1DPathEffect","makePath1DPathEffect","Path2DPathEffect","makePath2DPathEffect","Line2DPathEffect","makeLine2DPathEffect","DashPathEffect","makeDashPathEffect","DiscretePathEffect","makeDiscretePathEffect","Paint","declarePaint","console","log","preProcessContext","shouldRestoreMatrix","processMatrixAndClipping","layer","declCtx","createDeclarationContext","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","drawBox","Image","drawImage","Points","drawPoints","Path","drawPath","Rect","drawRect","RRect","drawRRect","Oval","drawOval","Line","drawLine","Patch","drawPatch","Vertices","drawVertices","DiffRect","drawDiffRect","Text","drawText","TextPath","drawTextPath","TextBlob","drawTextBlob","Glyphs","drawGlyphs","Picture","drawPicture","ImageSVG","drawImageSVG","Paragraph","drawParagraph","Atlas","drawAtlas","Circle","drawCircle","Fill","drawFill","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":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,mBAAA,GAAAD,OAAA;AAMA,IAAAE,SAAA,GAAAF,OAAA;AAuBA,IAAAG,aAAA,GAAAH,OAAA;AASA,IAAAI,aAAA,GAAAJ,OAAA;AAYA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAWA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AApEA;;AA+EA,SAASS,mBAAmBA,CAACC,GAAuB,EAAEC,IAAe,EAAE;EACrE,SAAS;;EACT,MAAMC,eAAe,GAAGA,CAAA,KACtBD,IAAI,CAACE,QAAQ,CAACC,OAAO,CAAEC,KAAK,IAAKN,mBAAmB,CAACC,GAAG,EAAEK,KAAK,CAAC,CAAC;EACnE,MAAM;IAAEC;EAAK,CAAC,GAAGL,IAAI;EACrB,MAAMM,KAAK,GAAG,IAAAC,kBAAW,EAACP,IAAI,CAACM,KAAK,CAAC;EACrC,QAAQD,IAAI;IACV;IACA,KAAKG,eAAQ,CAACC,cAAc;MAAE;QAC5B,IAAAC,mCAAqB,EAACX,GAAG,EAAEO,KAAK,CAAC;QACjC;MACF;IACA;IACA,KAAKE,eAAQ,CAACG,eAAe;MAAE;QAC7BV,eAAe,CAAC,CAAC;QACjB,IAAAW,oCAAsB,EAACb,GAAG,EAAEO,KAAK,CAAC;QAClC;MACF;IACA,KAAKE,eAAQ,CAACK,KAAK;MAAE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QACrB;MACF,KAAKE,eAAQ,CAACoJ,KAAK;QACjB;QACA;MACF;QACE,IAAI,CAAC5J,IAAI,CAACwF,aAAa,EAAE;UACvBT,OAAO,CAAC8E,IAAI,CAAC,0BAA0BxJ,IAAI,EAAE,CAAC;QAChD;IACJ;EACF,CAAC,CAAC;EACFH,QAAQ,CAACC,OAAO,CAAEC,KAAK,IAAK;IAC1B,IAAI,CAACA,KAAK,CAACoF,aAAa,EAAE;MACxBiB,IAAI,CAAC1G,GAAG,EAAEK,KAAK,CAAC;IAClB;EACF,CAAC,CAAC;EACF,IAAI8E,mBAAmB,EAAE;IACvBnF,GAAG,CAACgG,MAAM,CAACS,OAAO,CAAC,CAAC;EACtB;EACA,IAAIf,kBAAkB,EAAE;IACtB1F,GAAG,CAACyG,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":["_nodes","require","_processors","_types","_utils","drawLine","ctx","props","p1","p2","canvas","x","y","paint","exports","drawOval","rect","processRect","Skia","drawBox","children","box","defaultBox","opacity","getAlphaf","isRRect","RRectXY","shadows","map","node","type","NodeType","BoxShadow","materialize","filter","n","shadow","inner","color","blur","spread","dx","dy","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","BlurStyle","Normal","drawRRect","inflate","delta","Point","Math","abs","save","clipRRect","ClipOp","Intersect","deflate","outer","drawDRRect","restore","drawImage","image","_props$fit","fit","src","dst","fitRects","width","height","drawImageRect","drawPoints","points","mode","PointMode","enumKey","drawVertices","textures","colors","indices","blendMode","vertexMode","VertexMode","Triangles","vertices","MakeVertices","c","undefined","defaultBlendMode","BlendMode","DstOver","SrcOver","blend","drawDiffRect","drawTextPath","path","processPath","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","saturate","hasStartOffset","hasEndOffset","hasStrokeOptions","hasFillType","willMutatePath","pristinePath","copy","setFillType","FillType","trim","drawRect","processRRect","blob","drawGlyphs","glyphs","reduce","acc","glyph","id","positions","drawImageSVG","svg","translate","drawSvg","drawParagraph","paragraph","layout","drawPicture","picture","drawAtlas","sprites","transforms","drawCircle","processCircle","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,IAAAA,MAAA,GAAAC,OAAA;AAmCA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,MAAA,GAAAF,OAAA;AAWA,IAAAG,MAAA,GAAAH,OAAA;AAQO,MAAMI,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;AAACC,OAAA,CAAAT,QAAA,GAAAA,QAAA;AAEK,MAAMU,QAAQ,GAAGA,CAACT,GAAwB,EAAEC,KAAgB,KAAK;EACtE,SAAS;;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7F,MAAM;IAAEE;EAAU,CAAC,GAAG/E,KAAK;EAC/D,MAAM2F,KAAK,GAAGZ,SAAS,GAAGS,gBAAS,CAAC,IAAAd,cAAO,EAACK,SAAS,CAAC,CAAC,GAAGO,SAAS;EACnE,IAAIzB,KAAK,EAAE;IACT9D,GAAG,CAACI,MAAM,CAACqK,SAAS,CAAC3G,KAAK,EAAE4G,OAAO,EAAEC,UAAU,EAAE3K,GAAG,CAACO,KAAK,EAAEqF,KAAK,EAAEd,MAAM,CAAC;EAC5E;AACF,CAAC;AAACtE,OAAA,CAAAiK,SAAA,GAAAA,SAAA;AAEK,MAAMG,UAAU,GAAGA,CAAC5K,GAAwB,EAAEC,KAAkB,KAAK;EAC1E,SAAS;;EACT,MAAM;IAAEqF;EAAE,CAAC,GAAG,IAAAuF,oBAAa,EAAC5K,KAAK,CAAC;EAClC,MAAM;IAAE6K;EAAE,CAAC,GAAG7K,KAAK;EACnBD,GAAG,CAACI,MAAM,CAACwK,UAAU,CAACtF,CAAC,CAACjF,CAAC,EAAEiF,CAAC,CAAChF,CAAC,EAAEwK,CAAC,EAAE9K,GAAG,CAACO,KAAK,CAAC;AAC/C,CAAC;AAACC,OAAA,CAAAoK,UAAA,GAAAA,UAAA;AAEK,MAAMG,QAAQ,GAAGA,CACtB/K,GAAwB,EACxBgL,MAAwB,KACrB;EACH,SAAS;;EACThL,GAAG,CAACI,MAAM,CAAC6K,SAAS,CAACjL,GAAG,CAACO,KAAK,CAAC;AACjC,CAAC;AAACC,OAAA,CAAAuK,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- import type { BlendImageFilterProps, BlendProps, 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;