@shopify/react-native-skia 2.0.7 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/android/CMakeLists.txt +20 -1
  2. package/cpp/api/JsiSkApi.h +3 -0
  3. package/cpp/api/JsiSkImageFilterFactory.h +478 -39
  4. package/cpp/api/JsiSkSkottie.h +590 -0
  5. package/cpp/api/JsiSkottieFactory.h +65 -0
  6. package/cpp/api/recorder/Command.h +1 -0
  7. package/cpp/api/recorder/Convertor.h +32 -0
  8. package/cpp/api/recorder/Drawings.h +23 -0
  9. package/cpp/api/recorder/ImageFilters.h +20 -0
  10. package/cpp/api/recorder/JsiRecorder.h +6 -0
  11. package/cpp/api/recorder/RNRecorder.h +15 -0
  12. package/cpp/api/third_party/SkottieUtils.cpp +333 -0
  13. package/cpp/api/third_party/SkottieUtils.h +172 -0
  14. package/cpp/skia/modules/jsonreader/SkJSONReader.cpp +980 -0
  15. package/cpp/skia/modules/jsonreader/SkJSONReader.h +389 -0
  16. package/cpp/skia/modules/skottie/include/ExternalLayer.h +56 -0
  17. package/cpp/skia/modules/skottie/include/Skottie.h +313 -0
  18. package/cpp/skia/modules/skottie/include/SkottieProperty.h +190 -0
  19. package/cpp/skia/modules/skottie/include/SlotManager.h +113 -0
  20. package/cpp/skia/modules/skottie/include/TextShaper.h +200 -0
  21. package/cpp/skia/modules/skottie/src/SkottieValue.h +56 -0
  22. package/cpp/skia/modules/skottie/src/animator/Animator.h +89 -0
  23. package/cpp/skia/modules/skottie/src/text/Font.h +82 -0
  24. package/cpp/skia/modules/skottie/src/text/TextAdapter.h +155 -0
  25. package/cpp/skia/modules/skottie/src/text/TextAnimator.h +121 -0
  26. package/cpp/skia/modules/skottie/src/text/TextValue.h +28 -0
  27. package/cpp/skia/modules/sksg/include/SkSGClipEffect.h +61 -0
  28. package/cpp/skia/modules/sksg/include/SkSGColorFilter.h +135 -0
  29. package/cpp/skia/modules/sksg/include/SkSGDraw.h +57 -0
  30. package/cpp/skia/modules/sksg/include/SkSGEffectNode.h +50 -0
  31. package/cpp/skia/modules/sksg/include/SkSGGeometryEffect.h +181 -0
  32. package/cpp/skia/modules/sksg/include/SkSGGeometryNode.h +54 -0
  33. package/cpp/skia/modules/sksg/include/SkSGGradient.h +108 -0
  34. package/cpp/skia/modules/sksg/include/SkSGGroup.h +65 -0
  35. package/cpp/skia/modules/sksg/include/SkSGImage.h +59 -0
  36. package/cpp/skia/modules/sksg/include/SkSGInvalidationController.h +46 -0
  37. package/cpp/skia/modules/sksg/include/SkSGMaskEffect.h +65 -0
  38. package/cpp/skia/modules/sksg/include/SkSGMerge.h +74 -0
  39. package/cpp/skia/modules/sksg/include/SkSGNode.h +128 -0
  40. package/cpp/skia/modules/sksg/include/SkSGOpacityEffect.h +54 -0
  41. package/cpp/skia/modules/sksg/include/SkSGPaint.h +112 -0
  42. package/cpp/skia/modules/sksg/include/SkSGPath.h +68 -0
  43. package/cpp/skia/modules/sksg/include/SkSGPlane.h +47 -0
  44. package/cpp/skia/modules/sksg/include/SkSGRect.h +122 -0
  45. package/cpp/skia/modules/sksg/include/SkSGRenderEffect.h +283 -0
  46. package/cpp/skia/modules/sksg/include/SkSGRenderNode.h +157 -0
  47. package/cpp/skia/modules/sksg/include/SkSGScene.h +47 -0
  48. package/cpp/skia/modules/sksg/include/SkSGText.h +82 -0
  49. package/cpp/skia/modules/sksg/include/SkSGTransform.h +127 -0
  50. package/cpp/skia/src/base/SkArenaAlloc.h +371 -0
  51. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +15 -15
  52. package/lib/commonjs/dom/types/Drawings.d.ts +8 -1
  53. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  54. package/lib/commonjs/dom/types/NodeType.d.ts +3 -1
  55. package/lib/commonjs/dom/types/NodeType.js +4 -0
  56. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  57. package/lib/commonjs/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  58. package/lib/commonjs/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  59. package/lib/commonjs/renderer/__tests__/e2e/ImageFilter.spec.d.ts +1 -0
  60. package/lib/commonjs/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  61. package/lib/commonjs/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  62. package/lib/commonjs/renderer/__tests__/setup.d.ts +5 -0
  63. package/lib/commonjs/renderer/components/ImageFilter.d.ts +4 -0
  64. package/lib/commonjs/renderer/components/ImageFilter.js +13 -0
  65. package/lib/commonjs/renderer/components/ImageFilter.js.map +1 -0
  66. package/lib/commonjs/renderer/components/Skottie.d.ts +4 -0
  67. package/lib/commonjs/renderer/components/Skottie.js +13 -0
  68. package/lib/commonjs/renderer/components/Skottie.js.map +1 -0
  69. package/lib/commonjs/renderer/components/index.d.ts +2 -0
  70. package/lib/commonjs/renderer/components/index.js +22 -0
  71. package/lib/commonjs/renderer/components/index.js.map +1 -1
  72. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  73. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  74. package/lib/commonjs/skia/types/Matrix4.d.ts +11 -2
  75. package/lib/commonjs/skia/types/Matrix4.js +42 -1
  76. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  77. package/lib/commonjs/skia/types/Recorder.d.ts +2 -1
  78. package/lib/commonjs/skia/types/Recorder.js.map +1 -1
  79. package/lib/commonjs/skia/types/Skia.d.ts +2 -0
  80. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  81. package/lib/commonjs/skia/types/Skottie.d.ts +223 -0
  82. package/lib/commonjs/skia/types/Skottie.js +73 -0
  83. package/lib/commonjs/skia/types/Skottie.js.map +1 -0
  84. package/lib/commonjs/skia/types/index.d.ts +1 -0
  85. package/lib/commonjs/skia/types/index.js +11 -0
  86. package/lib/commonjs/skia/types/index.js.map +1 -1
  87. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  88. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +88 -19
  89. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  90. package/lib/commonjs/skia/web/JsiSkia.js +2 -0
  91. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  92. package/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +59 -0
  93. package/lib/commonjs/skia/web/JsiSkottieAnimation.js +243 -0
  94. package/lib/commonjs/skia/web/JsiSkottieAnimation.js.map +1 -0
  95. package/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +9 -0
  96. package/lib/commonjs/skia/web/JsiSkottieFactory.js +26 -0
  97. package/lib/commonjs/skia/web/JsiSkottieFactory.js.map +1 -0
  98. package/lib/commonjs/sksg/Elements.d.ts +3 -1
  99. package/lib/commonjs/sksg/Elements.js.map +1 -1
  100. package/lib/commonjs/sksg/Node.d.ts +1 -1
  101. package/lib/commonjs/sksg/Node.js +1 -1
  102. package/lib/commonjs/sksg/Node.js.map +1 -1
  103. package/lib/commonjs/sksg/Recorder/Core.d.ts +4 -2
  104. package/lib/commonjs/sksg/Recorder/Core.js +1 -0
  105. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
  106. package/lib/commonjs/sksg/Recorder/Player.js +2 -0
  107. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
  108. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  109. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +4 -0
  110. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  111. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +2 -1
  112. package/lib/commonjs/sksg/Recorder/Recorder.js +6 -0
  113. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
  114. package/lib/commonjs/sksg/Recorder/Visitor.js +3 -0
  115. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
  116. package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +2 -2
  117. package/lib/commonjs/sksg/Recorder/commands/Drawing.js +11 -4
  118. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
  119. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +12 -2
  120. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  121. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +15 -15
  122. package/lib/module/dom/types/Drawings.d.ts +8 -1
  123. package/lib/module/dom/types/Drawings.js.map +1 -1
  124. package/lib/module/dom/types/NodeType.d.ts +3 -1
  125. package/lib/module/dom/types/NodeType.js +4 -0
  126. package/lib/module/dom/types/NodeType.js.map +1 -1
  127. package/lib/module/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  128. package/lib/module/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  129. package/lib/module/renderer/__tests__/e2e/ImageFilter.spec.d.ts +1 -0
  130. package/lib/module/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  131. package/lib/module/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  132. package/lib/module/renderer/__tests__/setup.d.ts +5 -0
  133. package/lib/module/renderer/components/ImageFilter.d.ts +4 -0
  134. package/lib/module/renderer/components/ImageFilter.js +5 -0
  135. package/lib/module/renderer/components/ImageFilter.js.map +1 -0
  136. package/lib/module/renderer/components/Skottie.d.ts +4 -0
  137. package/lib/module/renderer/components/Skottie.js +5 -0
  138. package/lib/module/renderer/components/Skottie.js.map +1 -0
  139. package/lib/module/renderer/components/index.d.ts +2 -0
  140. package/lib/module/renderer/components/index.js +2 -0
  141. package/lib/module/renderer/components/index.js.map +1 -1
  142. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  143. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  144. package/lib/module/skia/types/Matrix4.d.ts +11 -2
  145. package/lib/module/skia/types/Matrix4.js +40 -0
  146. package/lib/module/skia/types/Matrix4.js.map +1 -1
  147. package/lib/module/skia/types/Recorder.d.ts +2 -1
  148. package/lib/module/skia/types/Recorder.js.map +1 -1
  149. package/lib/module/skia/types/Skia.d.ts +2 -0
  150. package/lib/module/skia/types/Skia.js.map +1 -1
  151. package/lib/module/skia/types/Skottie.d.ts +223 -0
  152. package/lib/module/skia/types/Skottie.js +74 -0
  153. package/lib/module/skia/types/Skottie.js.map +1 -0
  154. package/lib/module/skia/types/index.d.ts +1 -0
  155. package/lib/module/skia/types/index.js +1 -0
  156. package/lib/module/skia/types/index.js.map +1 -1
  157. package/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  158. package/lib/module/skia/web/JsiSkImageFilterFactory.js +88 -19
  159. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  160. package/lib/module/skia/web/JsiSkia.js +2 -0
  161. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  162. package/lib/module/skia/web/JsiSkottieAnimation.d.ts +59 -0
  163. package/lib/module/skia/web/JsiSkottieAnimation.js +236 -0
  164. package/lib/module/skia/web/JsiSkottieAnimation.js.map +1 -0
  165. package/lib/module/skia/web/JsiSkottieFactory.d.ts +9 -0
  166. package/lib/module/skia/web/JsiSkottieFactory.js +19 -0
  167. package/lib/module/skia/web/JsiSkottieFactory.js.map +1 -0
  168. package/lib/module/sksg/Elements.d.ts +3 -1
  169. package/lib/module/sksg/Elements.js.map +1 -1
  170. package/lib/module/sksg/Node.d.ts +1 -1
  171. package/lib/module/sksg/Node.js +1 -1
  172. package/lib/module/sksg/Node.js.map +1 -1
  173. package/lib/module/sksg/Recorder/Core.d.ts +4 -2
  174. package/lib/module/sksg/Recorder/Core.js +1 -0
  175. package/lib/module/sksg/Recorder/Core.js.map +1 -1
  176. package/lib/module/sksg/Recorder/Player.js +3 -1
  177. package/lib/module/sksg/Recorder/Player.js.map +1 -1
  178. package/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  179. package/lib/module/sksg/Recorder/ReanimatedRecorder.js +4 -0
  180. package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  181. package/lib/module/sksg/Recorder/Recorder.d.ts +2 -1
  182. package/lib/module/sksg/Recorder/Recorder.js +6 -0
  183. package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
  184. package/lib/module/sksg/Recorder/Visitor.js +3 -0
  185. package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
  186. package/lib/module/sksg/Recorder/commands/Drawing.d.ts +2 -2
  187. package/lib/module/sksg/Recorder/commands/Drawing.js +9 -2
  188. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
  189. package/lib/module/sksg/Recorder/commands/ImageFilters.js +12 -2
  190. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  191. package/lib/typescript/lib/commonjs/renderer/components/ImageFilter.d.ts +2 -0
  192. package/lib/typescript/lib/commonjs/renderer/components/Skottie.d.ts +2 -0
  193. package/lib/typescript/lib/commonjs/skia/types/Matrix4.d.ts +1 -0
  194. package/lib/typescript/lib/commonjs/skia/types/Skottie.d.ts +6 -0
  195. package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
  196. package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +2 -0
  197. package/lib/typescript/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +48 -0
  198. package/lib/typescript/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +6 -0
  199. package/lib/typescript/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
  200. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -0
  201. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +1 -1
  202. package/lib/typescript/lib/module/mock/index.d.ts +8 -0
  203. package/lib/typescript/lib/module/renderer/components/ImageFilter.d.ts +2 -0
  204. package/lib/typescript/lib/module/renderer/components/Skottie.d.ts +2 -0
  205. package/lib/typescript/lib/module/renderer/components/index.d.ts +2 -0
  206. package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -0
  207. package/lib/typescript/lib/module/skia/types/Matrix4.d.ts +1 -0
  208. package/lib/typescript/lib/module/skia/types/Skottie.d.ts +5 -0
  209. package/lib/typescript/lib/module/skia/types/index.d.ts +1 -0
  210. package/lib/typescript/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
  211. package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +2 -0
  212. package/lib/typescript/lib/module/skia/web/JsiSkottieAnimation.d.ts +47 -0
  213. package/lib/typescript/lib/module/skia/web/JsiSkottieFactory.d.ts +5 -0
  214. package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
  215. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +1 -0
  216. package/lib/typescript/lib/module/sksg/Recorder/commands/Drawing.d.ts +1 -1
  217. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +15 -15
  218. package/lib/typescript/src/dom/types/Drawings.d.ts +8 -1
  219. package/lib/typescript/src/dom/types/NodeType.d.ts +3 -1
  220. package/lib/typescript/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  221. package/lib/typescript/src/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  222. package/lib/typescript/src/renderer/__tests__/e2e/ImageFilter.spec.d.ts +1 -0
  223. package/lib/typescript/src/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  224. package/lib/typescript/src/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  225. package/lib/typescript/src/renderer/__tests__/setup.d.ts +5 -0
  226. package/lib/typescript/src/renderer/components/ImageFilter.d.ts +4 -0
  227. package/lib/typescript/src/renderer/components/Skottie.d.ts +4 -0
  228. package/lib/typescript/src/renderer/components/index.d.ts +2 -0
  229. package/lib/typescript/src/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  230. package/lib/typescript/src/skia/types/Matrix4.d.ts +11 -2
  231. package/lib/typescript/src/skia/types/Recorder.d.ts +2 -1
  232. package/lib/typescript/src/skia/types/Skia.d.ts +2 -0
  233. package/lib/typescript/src/skia/types/Skottie.d.ts +223 -0
  234. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  235. package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  236. package/lib/typescript/src/skia/web/JsiSkottieAnimation.d.ts +59 -0
  237. package/lib/typescript/src/skia/web/JsiSkottieFactory.d.ts +9 -0
  238. package/lib/typescript/src/sksg/Elements.d.ts +3 -1
  239. package/lib/typescript/src/sksg/Node.d.ts +1 -1
  240. package/lib/typescript/src/sksg/Recorder/Core.d.ts +4 -2
  241. package/lib/typescript/src/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  242. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +2 -1
  243. package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +2 -2
  244. package/libs/android/arm64-v8a/libjsonreader.a +0 -0
  245. package/libs/android/armeabi-v7a/libjsonreader.a +0 -0
  246. package/libs/android/x86/libjsonreader.a +0 -0
  247. package/libs/android/x86_64/libjsonreader.a +0 -0
  248. package/libs/apple/libpathops.xcframework/Info.plist +8 -8
  249. package/libs/apple/libskia.xcframework/Info.plist +14 -14
  250. package/libs/apple/libskottie.xcframework/Info.plist +14 -14
  251. package/libs/apple/libskparagraph.xcframework/Info.plist +16 -16
  252. package/libs/apple/libsksg.xcframework/Info.plist +5 -5
  253. package/libs/apple/libskshaper.xcframework/Info.plist +14 -14
  254. package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +14 -14
  255. package/libs/apple/libsvg.xcframework/Info.plist +14 -14
  256. package/package.json +1 -1
  257. package/react-native-skia.podspec +4 -2
  258. package/src/__tests__/snapshots/matrix4/camera-corner.png +0 -0
  259. package/src/__tests__/snapshots/matrix4/camera-offset.png +0 -0
  260. package/src/__tests__/snapshots/matrix4/camera-top-left-center.png +0 -0
  261. package/src/__tests__/snapshots/matrix4/camera-zoom-out.png +0 -0
  262. package/src/__tests__/snapshots/matrix4/full-rect.png +0 -0
  263. package/src/__tests__/snapshots/matrix4/rect.png +0 -0
  264. package/src/__tests__/snapshots/matrix4/scaled-rect.png +0 -0
  265. package/src/__tests__/snapshots/matrix4/test-perspective.png +0 -0
  266. package/src/__tests__/snapshots/matrix4/test-perspective2.png +0 -0
  267. package/src/dom/types/Drawings.ts +11 -0
  268. package/src/dom/types/NodeType.ts +4 -0
  269. package/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.tsx +492 -0
  270. package/src/renderer/__tests__/e2e/Camera.spec.tsx +475 -0
  271. package/src/renderer/__tests__/e2e/ImageFilter.spec.tsx +99 -0
  272. package/src/renderer/__tests__/e2e/LightingImageFilters.spec.tsx +1478 -0
  273. package/src/renderer/__tests__/e2e/Skottie.spec.tsx +440 -0
  274. package/src/renderer/__tests__/e2e/setup/skottie/basic_slots.json +1118 -0
  275. package/src/renderer/__tests__/e2e/setup/skottie/color-props.json +1 -0
  276. package/src/renderer/__tests__/e2e/setup/skottie/confetti.json +5899 -0
  277. package/src/renderer/__tests__/e2e/setup/skottie/drinks.json +43857 -0
  278. package/src/renderer/__tests__/e2e/setup/skottie/fingerprint.json +1 -0
  279. package/src/renderer/__tests__/e2e/setup/skottie/lego_loader.json +29540 -0
  280. package/src/renderer/__tests__/e2e/setup/skottie/new-drop.json +1 -0
  281. package/src/renderer/__tests__/e2e/setup/skottie/onboarding.json +1 -0
  282. package/src/renderer/__tests__/e2e/setup/skottie/text-layer.json +1 -0
  283. package/src/renderer/__tests__/setup.tsx +31 -0
  284. package/src/renderer/components/ImageFilter.tsx +8 -0
  285. package/src/renderer/components/Skottie.tsx +8 -0
  286. package/src/renderer/components/index.ts +2 -0
  287. package/src/skia/__tests__/assets/Avenir-Heavy.ttf +0 -0
  288. package/src/skia/types/ImageFilter/ImageFilterFactory.ts +391 -21
  289. package/src/skia/types/Matrix4.ts +108 -2
  290. package/src/skia/types/Recorder.ts +2 -0
  291. package/src/skia/types/Skia.ts +2 -0
  292. package/src/skia/types/Skottie.ts +266 -0
  293. package/src/skia/types/index.ts +1 -0
  294. package/src/skia/web/JsiSkImageFilterFactory.ts +266 -31
  295. package/src/skia/web/JsiSkia.ts +2 -0
  296. package/src/skia/web/JsiSkottieAnimation.ts +259 -0
  297. package/src/skia/web/JsiSkottieFactory.ts +25 -0
  298. package/src/sksg/Elements.tsx +4 -0
  299. package/src/sksg/Node.ts +1 -0
  300. package/src/sksg/Recorder/Core.ts +3 -0
  301. package/src/sksg/Recorder/Player.ts +3 -0
  302. package/src/sksg/Recorder/ReanimatedRecorder.ts +6 -0
  303. package/src/sksg/Recorder/Recorder.ts +5 -0
  304. package/src/sksg/Recorder/Visitor.ts +3 -0
  305. package/src/sksg/Recorder/commands/Drawing.ts +7 -3
  306. package/src/sksg/Recorder/commands/ImageFilters.ts +15 -2
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Copyright 2017 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGGroup_DEFINED
9
+ #define SkSGGroup_DEFINED
10
+
11
+ #include "include/core/SkRect.h"
12
+ #include "include/core/SkRefCnt.h"
13
+ #include "modules/sksg/include/SkSGRenderNode.h"
14
+
15
+ #include <cstddef>
16
+ #include <utility>
17
+ #include <vector>
18
+
19
+ class SkCanvas;
20
+ class SkMatrix;
21
+ struct SkPoint;
22
+
23
+ namespace sksg {
24
+ class InvalidationController;
25
+
26
+ /**
27
+ * Concrete node, grouping together multiple descendants.
28
+ */
29
+ class Group : public RenderNode {
30
+ public:
31
+ static sk_sp<Group> Make() {
32
+ return sk_sp<Group>(new Group(std::vector<sk_sp<RenderNode>>()));
33
+ }
34
+
35
+ static sk_sp<Group> Make(std::vector<sk_sp<RenderNode>> children) {
36
+ return sk_sp<Group>(new Group(std::move(children)));
37
+ }
38
+
39
+ void addChild(sk_sp<RenderNode>);
40
+ void removeChild(const sk_sp<RenderNode>&);
41
+
42
+ size_t size() const { return fChildren.size(); }
43
+ bool empty() const { return fChildren.empty(); }
44
+ void clear();
45
+
46
+ protected:
47
+ Group();
48
+ explicit Group(std::vector<sk_sp<RenderNode>>);
49
+ ~Group() override;
50
+
51
+ void onRender(SkCanvas*, const RenderContext*) const override;
52
+ const RenderNode* onNodeAt(const SkPoint&) const override;
53
+
54
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
55
+
56
+ private:
57
+ std::vector<sk_sp<RenderNode>> fChildren;
58
+ bool fRequiresIsolation = true;
59
+
60
+ using INHERITED = RenderNode;
61
+ };
62
+
63
+ } // namespace sksg
64
+
65
+ #endif // SkSGGroup_DEFINED
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Copyright 2018 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGImage_DEFINED
9
+ #define SkSGImage_DEFINED
10
+
11
+ #include "include/core/SkImage.h"
12
+ #include "include/core/SkRect.h"
13
+ #include "include/core/SkRefCnt.h"
14
+ #include "include/core/SkSamplingOptions.h"
15
+ #include "modules/sksg/include/SkSGNode.h"
16
+ #include "modules/sksg/include/SkSGRenderNode.h"
17
+
18
+ #include <utility>
19
+
20
+ class SkCanvas;
21
+ class SkMatrix;
22
+ struct SkPoint;
23
+
24
+ namespace sksg {
25
+ class InvalidationController;
26
+
27
+ /**
28
+ * Concrete rendering node, wrapping an SkImage.
29
+ *
30
+ */
31
+ class Image final : public RenderNode {
32
+ public:
33
+ static sk_sp<Image> Make(sk_sp<SkImage> image) {
34
+ return sk_sp<Image>(new Image(std::move(image)));
35
+ }
36
+
37
+ SG_ATTRIBUTE(Image , sk_sp<SkImage> , fImage )
38
+ SG_ATTRIBUTE(SamplingOptions, SkSamplingOptions, fSamplingOptions)
39
+ SG_ATTRIBUTE(AntiAlias , bool , fAntiAlias )
40
+
41
+ protected:
42
+ explicit Image(sk_sp<SkImage>);
43
+
44
+ void onRender(SkCanvas*, const RenderContext*) const override;
45
+ const RenderNode* onNodeAt(const SkPoint&) const override;
46
+
47
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
48
+
49
+ private:
50
+ SkSamplingOptions fSamplingOptions;
51
+ sk_sp<SkImage> fImage;
52
+ bool fAntiAlias = true;
53
+
54
+ using INHERITED = RenderNode;
55
+ };
56
+
57
+ } // namespace sksg
58
+
59
+ #endif // SkSGImage_DEFINED
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright 2017 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGInvalidationController_DEFINED
9
+ #define SkSGInvalidationController_DEFINED
10
+
11
+ #include "include/core/SkMatrix.h"
12
+ #include "include/core/SkRect.h"
13
+ #include "include/core/SkTypes.h"
14
+
15
+ #include <vector>
16
+
17
+ namespace sksg {
18
+
19
+ /**
20
+ * Receiver for invalidation events.
21
+ *
22
+ * Tracks dirty regions for repaint.
23
+ */
24
+ class InvalidationController {
25
+ public:
26
+ InvalidationController();
27
+ InvalidationController(const InvalidationController&) = delete;
28
+ InvalidationController& operator=(const InvalidationController&) = delete;
29
+
30
+ void inval(const SkRect&, const SkMatrix& ctm = SkMatrix::I());
31
+
32
+ const SkRect& bounds() const { return fBounds; }
33
+
34
+ auto begin() const { return fRects.cbegin(); }
35
+ auto end() const { return fRects.cend(); }
36
+
37
+ void reset();
38
+
39
+ private:
40
+ std::vector<SkRect> fRects;
41
+ SkRect fBounds;
42
+ };
43
+
44
+ } // namespace sksg
45
+
46
+ #endif // SkSGInvalidationController_DEFINED
@@ -0,0 +1,65 @@
1
+ /*
2
+ * Copyright 2018 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGMaskEffect_DEFINED
9
+ #define SkSGMaskEffect_DEFINED
10
+
11
+ #include "include/core/SkRect.h"
12
+ #include "include/core/SkRefCnt.h"
13
+ #include "modules/sksg/include/SkSGEffectNode.h"
14
+ #include "modules/sksg/include/SkSGRenderNode.h"
15
+
16
+ #include <cstdint>
17
+ #include <utility>
18
+
19
+ class SkCanvas;
20
+ class SkMatrix;
21
+ struct SkPoint;
22
+
23
+ namespace sksg {
24
+ class InvalidationController;
25
+
26
+ /**
27
+ * Concrete Effect node, applying a mask to its descendants.
28
+ *
29
+ */
30
+ class MaskEffect final : public EffectNode {
31
+ public:
32
+ enum class Mode : uint32_t {
33
+ kAlphaNormal,
34
+ kAlphaInvert,
35
+ kLumaNormal,
36
+ kLumaInvert,
37
+ };
38
+
39
+ static sk_sp<MaskEffect> Make(sk_sp<RenderNode> child, sk_sp<RenderNode> mask,
40
+ Mode mode = Mode::kAlphaNormal) {
41
+ return (child && mask)
42
+ ? sk_sp<MaskEffect>(new MaskEffect(std::move(child), std::move(mask), mode))
43
+ : nullptr;
44
+ }
45
+
46
+ ~MaskEffect() override;
47
+
48
+ protected:
49
+ MaskEffect(sk_sp<RenderNode>, sk_sp<RenderNode> mask, Mode);
50
+
51
+ void onRender(SkCanvas*, const RenderContext*) const override;
52
+ const RenderNode* onNodeAt(const SkPoint&) const override;
53
+
54
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
55
+
56
+ private:
57
+ const sk_sp<RenderNode> fMaskNode;
58
+ const Mode fMaskMode;
59
+
60
+ using INHERITED = EffectNode;
61
+ };
62
+
63
+ } // namespace sksg
64
+
65
+ #endif // SkSGMaskEffect_DEFINED
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Copyright 2017 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGMerge_DEFINED
9
+ #define SkSGMerge_DEFINED
10
+
11
+ #include "include/core/SkPath.h"
12
+ #include "include/core/SkRect.h"
13
+ #include "include/core/SkRefCnt.h"
14
+ #include "modules/sksg/include/SkSGGeometryNode.h"
15
+
16
+ #include <utility>
17
+ #include <vector>
18
+
19
+ class SkCanvas;
20
+ class SkMatrix;
21
+ class SkPaint;
22
+ struct SkPoint;
23
+
24
+ namespace sksg {
25
+ class InvalidationController;
26
+
27
+ /**
28
+ * Concrete Geometry node, combining other geometries based on Mode.
29
+ */
30
+ class Merge final : public GeometryNode {
31
+ public:
32
+ enum class Mode {
33
+ // Append path mode.
34
+ kMerge,
35
+
36
+ // SkPathOp ops.
37
+ kUnion,
38
+ kIntersect,
39
+ kDifference,
40
+ kReverseDifference,
41
+ kXOR,
42
+ };
43
+
44
+ struct Rec {
45
+ sk_sp<GeometryNode> fGeo;
46
+ Mode fMode;
47
+ };
48
+
49
+ static sk_sp<Merge> Make(std::vector<Rec>&& recs) {
50
+ return sk_sp<Merge>(new Merge(std::move(recs)));
51
+ }
52
+
53
+ ~Merge() override;
54
+
55
+ protected:
56
+ void onClip(SkCanvas*, bool antiAlias) const override;
57
+ void onDraw(SkCanvas*, const SkPaint&) const override;
58
+ bool onContains(const SkPoint&) const override;
59
+
60
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
61
+ SkPath onAsPath() const override;
62
+
63
+ private:
64
+ Merge(std::vector<Rec>&& recs);
65
+
66
+ const std::vector<Rec> fRecs;
67
+ SkPath fMerged;
68
+
69
+ using INHERITED = GeometryNode;
70
+ };
71
+
72
+ } // namespace sksg
73
+
74
+ #endif // SkSGMerge_DEFINED
@@ -0,0 +1,128 @@
1
+ /*
2
+ * Copyright 2017 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGNode_DEFINED
9
+ #define SkSGNode_DEFINED
10
+
11
+ #include "include/core/SkRect.h"
12
+ #include "include/core/SkRefCnt.h"
13
+ #include "include/private/base/SkAssert.h"
14
+
15
+ #include <cstdint>
16
+ #include <vector>
17
+
18
+ class SkMatrix;
19
+
20
+ namespace sksg {
21
+
22
+ class InvalidationController;
23
+
24
+ /**
25
+ * Base class for all scene graph nodes.
26
+ *
27
+ * Handles ingress edge management for the DAG (i.e. node -> "parent" node mapping),
28
+ * and invalidation.
29
+ *
30
+ * Note: egress edges are only implemented/supported in container subclasses
31
+ * (e.g. Group, Effect, Draw).
32
+ */
33
+ class Node : public SkRefCnt {
34
+ public:
35
+ // Traverse the DAG and revalidate any dependant/invalidated nodes.
36
+ // Returns the bounding box for the DAG fragment.
37
+ const SkRect& revalidate(InvalidationController*, const SkMatrix&);
38
+
39
+ // Tag this node for invalidation and optional damage.
40
+ void invalidate(bool damage = true);
41
+
42
+ protected:
43
+ enum InvalTraits {
44
+ // Nodes with this trait never generate direct damage -- instead,
45
+ // the damage bubbles up to ancestors.
46
+ kBubbleDamage_Trait = 1 << 0,
47
+
48
+ // Nodes with this trait obscure the descendants' damage and always override it.
49
+ kOverrideDamage_Trait = 1 << 1,
50
+ };
51
+
52
+ explicit Node(uint32_t invalTraits);
53
+ ~Node() override;
54
+
55
+ const SkRect& bounds() const {
56
+ SkASSERT(!this->hasInval());
57
+ return fBounds;
58
+ }
59
+
60
+ bool hasInval() const { return fFlags & kInvalidated_Flag; }
61
+
62
+ // Dispatched on revalidation. Subclasses are expected to recompute/cache their properties
63
+ // and return their bounding box in local coordinates.
64
+ virtual SkRect onRevalidate(InvalidationController*, const SkMatrix& ctm) = 0;
65
+
66
+ // Register/unregister |this| to receive invalidation events from a descendant.
67
+ void observeInval(const sk_sp<Node>&);
68
+ void unobserveInval(const sk_sp<Node>&);
69
+
70
+ private:
71
+ enum Flags {
72
+ kInvalidated_Flag = 1 << 0, // the node or its descendants require revalidation
73
+ kDamage_Flag = 1 << 1, // the node contributes damage during revalidation
74
+ kObserverArray_Flag = 1 << 2, // the node has more than one inval observer
75
+ kInTraversal_Flag = 1 << 3, // the node is part of a traversal (cycle detection)
76
+ };
77
+
78
+ template <typename Func>
79
+ void forEachInvalObserver(Func&&) const;
80
+
81
+ class ScopedFlag;
82
+
83
+ union {
84
+ Node* fInvalObserver;
85
+ std::vector<Node*>* fInvalObserverArray;
86
+ };
87
+ SkRect fBounds;
88
+ const uint32_t fInvalTraits : 2;
89
+ uint32_t fFlags : 4; // Internal flags.
90
+ uint32_t fNodeFlags : 8; // Accessible from select subclasses.
91
+ // Free bits : 18;
92
+
93
+ friend class NodePriv;
94
+ friend class RenderNode; // node flags access
95
+
96
+ using INHERITED = SkRefCnt;
97
+ };
98
+
99
+ // Helper for defining attribute getters/setters in subclasses.
100
+ #define SG_ATTRIBUTE(attr_name, attr_type, attr_container) \
101
+ const attr_type& get##attr_name() const { return attr_container; } \
102
+ void set##attr_name(const attr_type& v) { \
103
+ if (attr_container == v) return; \
104
+ attr_container = v; \
105
+ this->invalidate(); \
106
+ } \
107
+ void set##attr_name(attr_type&& v) { \
108
+ if (attr_container == v) return; \
109
+ attr_container = std::move(v); \
110
+ this->invalidate(); \
111
+ }
112
+
113
+ #define SG_MAPPED_ATTRIBUTE(attr_name, attr_type, attr_container) \
114
+ attr_type get##attr_name() const { return attr_container.get##attr_name(); } \
115
+ void set##attr_name(const attr_type& v) { \
116
+ if (attr_container.get##attr_name() == v) return; \
117
+ attr_container.set##attr_name(v); \
118
+ this->invalidate(); \
119
+ } \
120
+ void set##attr_name(attr_type&& v) { \
121
+ if (attr_container.get##attr_name() == v) return; \
122
+ attr_container.set##attr_name(std::move(v)); \
123
+ this->invalidate(); \
124
+ }
125
+
126
+ } // namespace sksg
127
+
128
+ #endif // SkSGNode_DEFINED
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Copyright 2018 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGOpacityEffect_DEFINED
9
+ #define SkSGOpacityEffect_DEFINED
10
+
11
+ #include "include/core/SkRect.h"
12
+ #include "include/core/SkRefCnt.h"
13
+ #include "modules/sksg/include/SkSGEffectNode.h"
14
+ #include "modules/sksg/include/SkSGNode.h"
15
+ #include "modules/sksg/include/SkSGRenderNode.h"
16
+
17
+ #include <utility>
18
+
19
+ class SkCanvas;
20
+ class SkMatrix;
21
+ struct SkPoint;
22
+
23
+ namespace sksg {
24
+ class InvalidationController;
25
+
26
+ /**
27
+ * Concrete Effect node, applying opacity to its descendants.
28
+ *
29
+ */
30
+ class OpacityEffect final : public EffectNode {
31
+ public:
32
+ static sk_sp<OpacityEffect> Make(sk_sp<RenderNode> child, float opacity = 1) {
33
+ return child ? sk_sp<OpacityEffect>(new OpacityEffect(std::move(child), opacity)) : nullptr;
34
+ }
35
+
36
+ SG_ATTRIBUTE(Opacity, float, fOpacity)
37
+
38
+ protected:
39
+ OpacityEffect(sk_sp<RenderNode>, float);
40
+
41
+ void onRender(SkCanvas*, const RenderContext*) const override;
42
+ const RenderNode* onNodeAt(const SkPoint&) const override;
43
+
44
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
45
+
46
+ private:
47
+ float fOpacity;
48
+
49
+ using INHERITED = EffectNode;
50
+ };
51
+
52
+ } // namespace sksg
53
+
54
+ #endif // SkSGOpacityEffect_DEFINED
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Copyright 2017 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGPaint_DEFINED
9
+ #define SkSGPaint_DEFINED
10
+
11
+ #include "include/core/SkBlendMode.h"
12
+ #include "include/core/SkColor.h"
13
+ #include "include/core/SkPaint.h"
14
+ #include "include/core/SkRect.h"
15
+ #include "include/core/SkRefCnt.h"
16
+ #include "include/core/SkScalar.h"
17
+ #include "modules/sksg/include/SkSGNode.h"
18
+
19
+ class SkMatrix;
20
+
21
+ namespace skottie::internal {
22
+ class AnimationBuilder;
23
+ } // namespace skottie::internal
24
+
25
+ namespace sksg {
26
+ class InvalidationController;
27
+ class Shader;
28
+
29
+ /**
30
+ * Base class for nodes which provide a 'paint' (as opposed to geometry) for
31
+ * drawing (e.g. colors, gradients, patterns).
32
+ *
33
+ * Roughly equivalent to Skia's SkPaint.
34
+ */
35
+ class PaintNode : public Node {
36
+ public:
37
+ SkPaint makePaint() const;
38
+
39
+ SG_ATTRIBUTE(AntiAlias , bool , fAntiAlias )
40
+ SG_ATTRIBUTE(Opacity , SkScalar , fOpacity )
41
+ SG_ATTRIBUTE(BlendMode , SkBlendMode , fBlendMode )
42
+ SG_ATTRIBUTE(StrokeWidth, SkScalar , fStrokeWidth)
43
+ SG_ATTRIBUTE(StrokeMiter, SkScalar , fStrokeMiter)
44
+ SG_ATTRIBUTE(Style , SkPaint::Style, fStyle )
45
+ SG_ATTRIBUTE(StrokeJoin , SkPaint::Join , fStrokeJoin )
46
+ SG_ATTRIBUTE(StrokeCap , SkPaint::Cap , fStrokeCap )
47
+
48
+ protected:
49
+ PaintNode();
50
+
51
+ virtual void onApplyToPaint(SkPaint*) const = 0;
52
+
53
+ private:
54
+ SkScalar fOpacity = 1,
55
+ fStrokeWidth = 1,
56
+ fStrokeMiter = 4;
57
+ bool fAntiAlias = false;
58
+ SkBlendMode fBlendMode = SkBlendMode::kSrcOver;
59
+ SkPaint::Style fStyle = SkPaint::kFill_Style;
60
+ SkPaint::Join fStrokeJoin = SkPaint::kMiter_Join;
61
+ SkPaint::Cap fStrokeCap = SkPaint::kButt_Cap;
62
+
63
+ using INHERITED = Node;
64
+ };
65
+
66
+ /**
67
+ * Concrete Paint node, wrapping an SkColor.
68
+ */
69
+ class Color : public PaintNode {
70
+ public:
71
+ static sk_sp<Color> Make(SkColor c);
72
+
73
+ SG_ATTRIBUTE(Color, SkColor, fColor)
74
+
75
+ protected:
76
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
77
+
78
+ void onApplyToPaint(SkPaint*) const override;
79
+
80
+ private:
81
+ explicit Color(SkColor);
82
+
83
+ SkColor fColor;
84
+
85
+ friend class skottie::internal::AnimationBuilder;
86
+ };
87
+
88
+ /**
89
+ * Shader-based paint.
90
+ */
91
+ class ShaderPaint final : public PaintNode {
92
+ public:
93
+ ~ShaderPaint() override;
94
+
95
+ static sk_sp<ShaderPaint> Make(sk_sp<Shader>);
96
+
97
+ protected:
98
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
99
+
100
+ void onApplyToPaint(SkPaint*) const override;
101
+
102
+ private:
103
+ explicit ShaderPaint(sk_sp<Shader>);
104
+
105
+ const sk_sp<Shader> fShader;
106
+
107
+ using INHERITED = PaintNode;
108
+ };
109
+
110
+ } // namespace sksg
111
+
112
+ #endif // SkSGPaint_DEFINED
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Copyright 2017 Google Inc.
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SkSGPath_DEFINED
9
+ #define SkSGPath_DEFINED
10
+
11
+ #include "include/core/SkPath.h"
12
+ #include "include/core/SkRect.h"
13
+ #include "include/core/SkRefCnt.h"
14
+ #include "modules/sksg/include/SkSGGeometryNode.h"
15
+ #include "modules/sksg/include/SkSGNode.h"
16
+
17
+ class SkCanvas;
18
+ class SkMatrix;
19
+ class SkPaint;
20
+ enum class SkPathFillType;
21
+ struct SkPoint;
22
+
23
+ namespace sksg {
24
+ class InvalidationController;
25
+
26
+ /**
27
+ * Concrete Geometry node, wrapping an SkPath.
28
+ */
29
+ class Path : public GeometryNode {
30
+ public:
31
+ static sk_sp<Path> Make() { return sk_sp<Path>(new Path(SkPath())); }
32
+ static sk_sp<Path> Make(const SkPath& r) { return sk_sp<Path>(new Path(r)); }
33
+
34
+ SG_ATTRIBUTE(Path, SkPath, fPath)
35
+
36
+ // Temporarily inlined for SkPathFillType staging
37
+ // SG_MAPPED_ATTRIBUTE(FillType, SkPathFillType, fPath)
38
+
39
+ SkPathFillType getFillType() const {
40
+ return fPath.getFillType();
41
+ }
42
+
43
+ void setFillType(SkPathFillType fillType) {
44
+ if (fillType != fPath.getFillType()) {
45
+ fPath.setFillType(fillType);
46
+ this->invalidate();
47
+ }
48
+ }
49
+
50
+ protected:
51
+ void onClip(SkCanvas*, bool antiAlias) const override;
52
+ void onDraw(SkCanvas*, const SkPaint&) const override;
53
+ bool onContains(const SkPoint&) const override;
54
+
55
+ SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
56
+ SkPath onAsPath() const override;
57
+
58
+ private:
59
+ explicit Path(const SkPath&);
60
+
61
+ SkPath fPath;
62
+
63
+ using INHERITED = GeometryNode;
64
+ };
65
+
66
+ } // namespace sksg
67
+
68
+ #endif // SkSGPath_DEFINED