@shopify/react-native-skia 0.1.163 → 0.1.165

Sign up to get free protection for your applications and to get access to all the features.
Files changed (303) hide show
  1. package/cpp/api/JsiSkPaint.h +6 -0
  2. package/cpp/api/JsiSkRuntimeEffect.h +7 -2
  3. package/cpp/jsi/JsiHostObject.h +25 -25
  4. package/cpp/rnskia/RNSkDomView.cpp +1 -1
  5. package/cpp/rnskia/RNSkPlatformContext.h +2 -6
  6. package/cpp/rnskia/dom/base/DrawingContext.cpp +23 -41
  7. package/cpp/rnskia/dom/base/DrawingContext.h +6 -19
  8. package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +12 -2
  9. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +4 -4
  10. package/cpp/rnskia/dom/base/JsiDomNode.h +68 -10
  11. package/cpp/rnskia/dom/base/JsiDomRenderNode.h +26 -61
  12. package/cpp/rnskia/dom/base/NodeProp.h +2 -1
  13. package/cpp/rnskia/dom/base/NodePropsContainer.h +10 -0
  14. package/cpp/rnskia/dom/nodes/JsiBlendNode.h +1 -2
  15. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +3 -6
  16. package/cpp/rnskia/dom/nodes/JsiBoxNode.h +2 -4
  17. package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +1 -2
  18. package/cpp/rnskia/dom/nodes/JsiCircleNode.h +2 -5
  19. package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +4 -8
  20. package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +2 -5
  21. package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +2 -7
  22. package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +4 -8
  23. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +20 -38
  24. package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -1
  25. package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +2 -4
  26. package/cpp/rnskia/dom/nodes/JsiLineNode.h +2 -7
  27. package/cpp/rnskia/dom/nodes/JsiOvalNode.h +1 -3
  28. package/cpp/rnskia/dom/nodes/JsiPaintNode.h +2 -3
  29. package/cpp/rnskia/dom/nodes/JsiPatchNode.h +4 -8
  30. package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +14 -28
  31. package/cpp/rnskia/dom/nodes/JsiPathNode.h +6 -16
  32. package/cpp/rnskia/dom/nodes/JsiPictureNode.h +1 -2
  33. package/cpp/rnskia/dom/nodes/JsiPointsNode.h +2 -5
  34. package/cpp/rnskia/dom/nodes/JsiRRectNode.h +1 -2
  35. package/cpp/rnskia/dom/nodes/JsiRectNode.h +1 -2
  36. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +37 -69
  37. package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +3 -6
  38. package/cpp/rnskia/dom/nodes/JsiTextNode.h +4 -8
  39. package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +1 -2
  40. package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +2 -4
  41. package/cpp/rnskia/dom/props/CircleProp.h +2 -0
  42. package/cpp/rnskia/dom/props/ColorProp.h +9 -4
  43. package/cpp/rnskia/dom/props/ImageProps.h +3 -2
  44. package/cpp/rnskia/dom/props/PaintProps.h +15 -7
  45. package/cpp/rnskia/dom/props/RectProp.h +11 -4
  46. package/cpp/rnskia/dom/props/TransformProp.h +0 -2
  47. package/cpp/rnskia/dom/props/UniformsProp.h +86 -123
  48. package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -6
  49. package/cpp/utils/RNSkLog.h +1 -1
  50. package/lib/commonjs/dom/nodes/RenderNode.js +12 -16
  51. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  52. package/lib/commonjs/dom/nodes/datatypes/Circle.js +6 -1
  53. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  54. package/lib/commonjs/dom/nodes/datatypes/Rect.js +3 -3
  55. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  56. package/lib/commonjs/dom/nodes/datatypes/index.js +0 -13
  57. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
  58. package/lib/commonjs/dom/nodes/drawings/Box.js +6 -6
  59. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  60. package/lib/commonjs/dom/nodes/drawings/ImageNode.js +2 -2
  61. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
  62. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +3 -7
  63. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
  64. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +1 -1
  65. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
  66. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +1 -3
  67. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  68. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +1 -1
  69. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  70. package/lib/commonjs/dom/nodes/paint/Shaders.js +1 -3
  71. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  72. package/lib/commonjs/dom/types/Common.js.map +1 -1
  73. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  74. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  75. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  76. package/lib/commonjs/renderer/components/Mask.js +2 -6
  77. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  78. package/lib/commonjs/renderer/components/image/Image.js +0 -5
  79. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  80. package/lib/commonjs/renderer/components/image/ImageShader.js +20 -10
  81. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  82. package/lib/commonjs/renderer/components/imageFilters/Blur.js +10 -5
  83. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  84. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +10 -5
  85. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  86. package/lib/commonjs/renderer/components/imageFilters/Offset.js +12 -6
  87. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  88. package/lib/commonjs/renderer/components/maskFilters/Blur.js +12 -6
  89. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  90. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +10 -5
  91. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  92. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +14 -7
  93. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  94. package/lib/commonjs/renderer/components/shaders/Shader.js +10 -5
  95. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  96. package/lib/commonjs/renderer/components/shaders/Turbulence.js +14 -7
  97. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  98. package/lib/commonjs/renderer/components/shapes/Circle.js +0 -6
  99. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  100. package/lib/commonjs/renderer/components/shapes/FitBox.js +1 -4
  101. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  102. package/lib/commonjs/renderer/components/shapes/Oval.js +0 -4
  103. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  104. package/lib/commonjs/renderer/components/shapes/Path.js +12 -6
  105. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  106. package/lib/commonjs/renderer/components/shapes/Points.js +10 -5
  107. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  108. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +0 -3
  109. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  110. package/lib/commonjs/renderer/components/shapes/Vertices.js +10 -5
  111. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  112. package/lib/commonjs/renderer/components/text/Glyphs.js +12 -6
  113. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  114. package/lib/commonjs/renderer/components/text/Text.js +12 -6
  115. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  116. package/lib/commonjs/renderer/components/text/TextBlob.js +12 -6
  117. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  118. package/lib/commonjs/renderer/components/text/TextPath.js +10 -5
  119. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  120. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  121. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  122. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  123. package/lib/commonjs/skia/types/Shader/Shader.js +3 -2
  124. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  125. package/lib/commonjs/skia/web/JsiSkPaint.js +4 -0
  126. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  127. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -1
  128. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  129. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
  130. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  131. package/lib/commonjs/web/LoadSkiaWeb.js +1 -1
  132. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  133. package/lib/module/dom/nodes/RenderNode.js +12 -16
  134. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  135. package/lib/module/dom/nodes/datatypes/Circle.js +8 -1
  136. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  137. package/lib/module/dom/nodes/datatypes/Rect.js +7 -3
  138. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  139. package/lib/module/dom/nodes/datatypes/index.js +0 -1
  140. package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
  141. package/lib/module/dom/nodes/drawings/Box.js +6 -5
  142. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  143. package/lib/module/dom/nodes/drawings/ImageNode.js +4 -2
  144. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
  145. package/lib/module/dom/nodes/drawings/PatchNode.js +4 -8
  146. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
  147. package/lib/module/dom/nodes/drawings/VerticesNode.js +2 -2
  148. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
  149. package/lib/module/dom/nodes/paint/ColorFilters.js +1 -2
  150. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  151. package/lib/module/dom/nodes/paint/ImageFilters.js +2 -2
  152. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  153. package/lib/module/dom/nodes/paint/Shaders.js +1 -2
  154. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  155. package/lib/module/dom/types/Common.js.map +1 -1
  156. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  157. package/lib/module/dom/types/Drawings.js.map +1 -1
  158. package/lib/module/renderer/DrawingContext.js.map +1 -1
  159. package/lib/module/renderer/components/Mask.js +2 -6
  160. package/lib/module/renderer/components/Mask.js.map +1 -1
  161. package/lib/module/renderer/components/image/Image.js +0 -5
  162. package/lib/module/renderer/components/image/Image.js.map +1 -1
  163. package/lib/module/renderer/components/image/ImageShader.js +20 -10
  164. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  165. package/lib/module/renderer/components/imageFilters/Blur.js +10 -5
  166. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  167. package/lib/module/renderer/components/imageFilters/Morphology.js +10 -5
  168. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  169. package/lib/module/renderer/components/imageFilters/Offset.js +12 -6
  170. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  171. package/lib/module/renderer/components/maskFilters/Blur.js +12 -6
  172. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  173. package/lib/module/renderer/components/pathEffects/Discrete.js +10 -5
  174. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  175. package/lib/module/renderer/components/shaders/FractalNoise.js +14 -7
  176. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  177. package/lib/module/renderer/components/shaders/Shader.js +10 -5
  178. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  179. package/lib/module/renderer/components/shaders/Turbulence.js +14 -7
  180. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  181. package/lib/module/renderer/components/shapes/Circle.js +0 -6
  182. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  183. package/lib/module/renderer/components/shapes/FitBox.js +1 -4
  184. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  185. package/lib/module/renderer/components/shapes/Oval.js +0 -4
  186. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  187. package/lib/module/renderer/components/shapes/Path.js +12 -6
  188. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  189. package/lib/module/renderer/components/shapes/Points.js +10 -5
  190. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  191. package/lib/module/renderer/components/shapes/RoundedRect.js +0 -3
  192. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  193. package/lib/module/renderer/components/shapes/Vertices.js +10 -5
  194. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  195. package/lib/module/renderer/components/text/Glyphs.js +12 -6
  196. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  197. package/lib/module/renderer/components/text/Text.js +12 -6
  198. package/lib/module/renderer/components/text/Text.js.map +1 -1
  199. package/lib/module/renderer/components/text/TextBlob.js +12 -6
  200. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  201. package/lib/module/renderer/components/text/TextPath.js +10 -5
  202. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  203. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  204. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  205. package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  206. package/lib/module/skia/types/Shader/Shader.js +3 -2
  207. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  208. package/lib/module/skia/web/JsiSkPaint.js +4 -0
  209. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  210. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -1
  211. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  212. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
  213. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  214. package/lib/module/web/LoadSkiaWeb.js +1 -1
  215. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  216. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -1
  217. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +0 -1
  218. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +1 -1
  219. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +1 -1
  220. package/lib/typescript/src/dom/types/Common.d.ts +4 -4
  221. package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -1
  222. package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
  223. package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -5
  224. package/lib/typescript/src/renderer/components/Mask.d.ts +3 -9
  225. package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -8
  226. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -12
  227. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -7
  228. package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -7
  229. package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -8
  230. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -8
  231. package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -7
  232. package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -9
  233. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -7
  234. package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -9
  235. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -9
  236. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -7
  237. package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +1 -7
  238. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -8
  239. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -7
  240. package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +1 -6
  241. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -7
  242. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -8
  243. package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -8
  244. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -8
  245. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -7
  246. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +5 -0
  247. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +4 -0
  248. package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +4 -0
  249. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  250. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  251. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +3 -1
  252. package/package.json +1 -1
  253. package/src/dom/nodes/RenderNode.ts +11 -21
  254. package/src/dom/nodes/datatypes/Circle.ts +1 -1
  255. package/src/dom/nodes/datatypes/Rect.ts +3 -3
  256. package/src/dom/nodes/datatypes/index.ts +0 -1
  257. package/src/dom/nodes/drawings/Box.ts +7 -4
  258. package/src/dom/nodes/drawings/ImageNode.ts +2 -1
  259. package/src/dom/nodes/drawings/PatchNode.ts +4 -18
  260. package/src/dom/nodes/drawings/VerticesNode.ts +2 -2
  261. package/src/dom/nodes/paint/ColorFilters.ts +1 -2
  262. package/src/dom/nodes/paint/ImageFilters.ts +2 -2
  263. package/src/dom/nodes/paint/Shaders.ts +1 -2
  264. package/src/dom/types/Common.ts +4 -4
  265. package/src/dom/types/DrawingContext.ts +0 -1
  266. package/src/dom/types/Drawings.ts +1 -1
  267. package/src/renderer/DrawingContext.ts +5 -5
  268. package/src/renderer/components/Mask.tsx +8 -8
  269. package/src/renderer/components/image/Image.tsx +0 -6
  270. package/src/renderer/components/image/ImageShader.tsx +24 -12
  271. package/src/renderer/components/imageFilters/Blur.tsx +6 -7
  272. package/src/renderer/components/imageFilters/Morphology.tsx +6 -7
  273. package/src/renderer/components/imageFilters/Offset.tsx +7 -8
  274. package/src/renderer/components/maskFilters/Blur.tsx +7 -8
  275. package/src/renderer/components/pathEffects/Discrete.tsx +6 -9
  276. package/src/renderer/components/shaders/FractalNoise.tsx +18 -9
  277. package/src/renderer/components/shaders/Shader.tsx +6 -7
  278. package/src/renderer/components/shaders/Turbulence.tsx +15 -9
  279. package/src/renderer/components/shapes/Circle.tsx +0 -4
  280. package/src/renderer/components/shapes/FitBox.tsx +2 -6
  281. package/src/renderer/components/shapes/Oval.tsx +0 -5
  282. package/src/renderer/components/shapes/Path.tsx +7 -8
  283. package/src/renderer/components/shapes/Points.tsx +6 -7
  284. package/src/renderer/components/shapes/RoundedRect.tsx +0 -4
  285. package/src/renderer/components/shapes/Vertices.tsx +6 -7
  286. package/src/renderer/components/text/Glyphs.tsx +7 -8
  287. package/src/renderer/components/text/Text.tsx +7 -8
  288. package/src/renderer/components/text/TextBlob.tsx +7 -8
  289. package/src/renderer/components/text/TextPath.tsx +6 -7
  290. package/src/renderer/processors/Animations/Animations.ts +9 -3
  291. package/src/skia/types/Paint/Paint.ts +5 -0
  292. package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +5 -0
  293. package/src/skia/types/Shader/Shader.ts +5 -3
  294. package/src/skia/web/JsiSkPaint.ts +4 -0
  295. package/src/skia/web/JsiSkRuntimeEffect.ts +5 -1
  296. package/src/skia/web/JsiSkRuntimeEffectFactory.ts +1 -1
  297. package/src/web/LoadSkiaWeb.tsx +1 -1
  298. package/lib/commonjs/dom/nodes/datatypes/Color.js +0 -27
  299. package/lib/commonjs/dom/nodes/datatypes/Color.js.map +0 -1
  300. package/lib/module/dom/nodes/datatypes/Color.js +0 -11
  301. package/lib/module/dom/nodes/datatypes/Color.js.map +0 -1
  302. package/lib/typescript/src/dom/nodes/datatypes/Color.d.ts +0 -7
  303. package/src/dom/nodes/datatypes/Color.ts +0 -15
@@ -18,12 +18,6 @@
18
18
 
19
19
  namespace RNSkia {
20
20
 
21
- static PropId PropNameOrigin = JsiPropId::get("origin");
22
- static PropId PropNameOpacity = JsiPropId::get("opacity");
23
- static PropId PropNameClip = JsiPropId::get("clip");
24
- static PropId PropNameInvertClip = JsiPropId::get("invertClip");
25
- static PropId PropNameLayer = JsiPropId::get("layer");
26
-
27
21
  class JsiDomRenderNode : public JsiDomNode {
28
22
  public:
29
23
  JsiDomRenderNode(std::shared_ptr<RNSkPlatformContext> context,
@@ -32,7 +26,7 @@ public:
32
26
 
33
27
  void render(DrawingContext *context) {
34
28
  #if SKIA_DOM_DEBUG
35
- printDebugInfo(context, "Begin Render");
29
+ printDebugInfo("Begin Render");
36
30
  #endif
37
31
 
38
32
  // Ensure we have a local drawing context inheriting from the parent context
@@ -50,27 +44,27 @@ public:
50
44
  if (_layerProp->isSet()) {
51
45
  if (_layerProp->isBool()) {
52
46
  #if SKIA_DOM_DEBUG
53
- printDebugInfo(context, "canvas->saveLayer()");
47
+ printDebugInfo("canvas->saveLayer()");
54
48
  #endif
55
49
  _localContext->getCanvas()->saveLayer(
56
50
  SkCanvas::SaveLayerRec(nullptr, nullptr, nullptr, 0));
57
51
  } else {
58
52
  #if SKIA_DOM_DEBUG
59
- printDebugInfo(context, "canvas->saveLayer(paint)");
53
+ printDebugInfo("canvas->saveLayer(paint)");
60
54
  #endif
61
55
  _localContext->getCanvas()->saveLayer(SkCanvas::SaveLayerRec(
62
56
  nullptr, _layerProp->getDerivedValue().get(), nullptr, 0));
63
57
  }
64
58
  } else {
65
59
  #if SKIA_DOM_DEBUG
66
- printDebugInfo(context, "canvas->save()");
60
+ printDebugInfo("canvas->save()");
67
61
  #endif
68
62
  _localContext->getCanvas()->save();
69
63
  }
70
64
 
71
65
  if (_originProp->isSet()) {
72
66
  #if SKIA_DOM_DEBUG
73
- printDebugInfo(context, "canvas->translate(origin)");
67
+ printDebugInfo("canvas->translate(origin)");
74
68
  #endif
75
69
  // Handle origin
76
70
  _localContext->getCanvas()->translate(
@@ -81,10 +75,9 @@ public:
81
75
  if (shouldTransform) {
82
76
  #if SKIA_DOM_DEBUG
83
77
  printDebugInfo(
84
- context,
85
78
  "canvas->concat(" +
86
- std::string(_matrixProp->isSet() ? "matrix" : "transform") +
87
- std::string(")"));
79
+ std::string(_matrixProp->isSet() ? "matrix" : "transform") +
80
+ std::string(")"));
88
81
  #endif
89
82
  auto matrix = _matrixProp->isSet() ? _matrixProp->getDerivedValue()
90
83
  : _transformProp->getDerivedValue();
@@ -101,7 +94,7 @@ public:
101
94
 
102
95
  if (_originProp->isSet()) {
103
96
  #if SKIA_DOM_DEBUG
104
- printDebugInfo(context, "canvas->translate(-origin)");
97
+ printDebugInfo("canvas->translate(-origin)");
105
98
  #endif
106
99
  // Handle origin
107
100
  _localContext->getCanvas()->translate(
@@ -124,13 +117,13 @@ public:
124
117
  // Restore if needed
125
118
  if (shouldSave) {
126
119
  #if SKIA_DOM_DEBUG
127
- printDebugInfo(context, "canvas->restore()");
120
+ printDebugInfo("canvas->restore()");
128
121
  #endif
129
122
  _localContext->getCanvas()->restore();
130
123
  }
131
124
 
132
125
  #if SKIA_DOM_DEBUG
133
- printDebugInfo(context, "End Render");
126
+ printDebugInfo("End Render");
134
127
  #endif
135
128
  }
136
129
 
@@ -158,41 +151,19 @@ public:
158
151
 
159
152
  protected:
160
153
  /**
161
- Override to implement rendering where the current state of the drawing
162
- context is correctly set.
163
- */
164
- virtual void renderNode(DrawingContext *context) = 0;
165
-
166
- /**
167
- Removes a child
168
- */
169
- void removeChild(std::shared_ptr<JsiDomNode> child) override {
170
- JsiDomNode::removeChild(child);
171
- if (_localContext != nullptr) {
172
- _localContext->markAsChanged();
173
- }
174
- }
175
-
176
- /**
177
- Validates that only declaration nodes can be children
154
+ Invalidates and marks then context as changed.
178
155
  */
179
- void addChild(std::shared_ptr<JsiDomNode> child) override {
180
- JsiDomNode::addChild(child);
156
+ void invalidateContext() override {
181
157
  if (_localContext != nullptr) {
182
158
  _localContext->markAsChanged();
183
159
  }
184
160
  }
185
161
 
186
162
  /**
187
- Validates that only declaration nodes can be children
163
+ Override to implement rendering where the current state of the drawing
164
+ context is correctly set.
188
165
  */
189
- void insertChildBefore(std::shared_ptr<JsiDomNode> child,
190
- std::shared_ptr<JsiDomNode> before) override {
191
- JsiDomNode::insertChildBefore(child, before);
192
- if (_localContext != nullptr) {
193
- _localContext->markAsChanged();
194
- }
195
- }
166
+ virtual void renderNode(DrawingContext *context) = 0;
196
167
 
197
168
  /**
198
169
  Define common properties for all render nodes
@@ -200,20 +171,14 @@ protected:
200
171
  void defineProperties(NodePropsContainer *container) override {
201
172
  JsiDomNode::defineProperties(container);
202
173
 
203
- _paintProps = container->defineProperty(std::make_shared<PaintProps>());
204
-
205
- _matrixProp =
206
- container->defineProperty(std::make_shared<MatrixProp>(PropNameMatrix));
207
- _transformProp = container->defineProperty(
208
- std::make_shared<TransformProp>(PropNameTransform));
209
- _originProp =
210
- container->defineProperty(std::make_shared<PointProp>(PropNameOrigin));
211
- _clipProp =
212
- container->defineProperty(std::make_shared<ClipProp>(PropNameClip));
213
- _invertClip = container->defineProperty(
214
- std::make_shared<NodeProp>(PropNameInvertClip));
215
- _layerProp =
216
- container->defineProperty(std::make_shared<LayerProp>(PropNameLayer));
174
+ _paintProps = container->defineProperty<PaintProps>();
175
+
176
+ _matrixProp = container->defineProperty<MatrixProp>("matrix");
177
+ _transformProp = container->defineProperty<TransformProp>("transform");
178
+ _originProp = container->defineProperty<PointProp>("origin");
179
+ _clipProp = container->defineProperty<ClipProp>("clip");
180
+ _invertClip = container->defineProperty<NodeProp>("invertClip");
181
+ _layerProp = container->defineProperty<LayerProp>("layer");
217
182
  }
218
183
 
219
184
  private:
@@ -224,17 +189,17 @@ private:
224
189
  auto op = invert ? SkClipOp::kDifference : SkClipOp::kIntersect;
225
190
  if (_clipProp->getRect() != nullptr) {
226
191
  #if SKIA_DOM_DEBUG
227
- printDebugInfo(context, "canvas->clipRect()");
192
+ printDebugInfo("canvas->clipRect()");
228
193
  #endif
229
194
  canvas->clipRect(*_clipProp->getRect(), op, true);
230
195
  } else if (_clipProp->getRRect() != nullptr) {
231
196
  #if SKIA_DOM_DEBUG
232
- printDebugInfo(context, "canvas->clipRRect()");
197
+ printDebugInfo("canvas->clipRRect()");
233
198
  #endif
234
199
  canvas->clipRRect(*_clipProp->getRRect(), op, true);
235
200
  } else if (_clipProp->getPath() != nullptr) {
236
201
  #if SKIA_DOM_DEBUG
237
- printDebugInfo(context, "canvas->clipPath()");
202
+ printDebugInfo("canvas->clipPath()");
238
203
  #endif
239
204
  canvas->clipPath(*_clipProp->getPath(), op, true);
240
205
  }
@@ -19,7 +19,8 @@ public:
19
19
  /**
20
20
  Constructs a new optional dom node properrty
21
21
  */
22
- explicit NodeProp(PropId name) : _name(name), BaseNodeProp() {}
22
+ explicit NodeProp(const std::string &name)
23
+ : _name(JsiPropId::get(name)), BaseNodeProp() {}
23
24
 
24
25
  /**
25
26
  Reads JS value and swaps out with a new value
@@ -110,6 +110,16 @@ public:
110
110
  return prop.get();
111
111
  }
112
112
 
113
+ /**
114
+ Defines a property that will be updated with the container changes.
115
+ */
116
+ template <class _Tp, class... _Args,
117
+ class = std::_EnableIf<!std::is_array<_Tp>::value>>
118
+ _Tp *defineProperty(_Args &&...__args) {
119
+ return defineProperty(
120
+ std::make_shared<_Tp>(std::forward<_Args>(__args)...));
121
+ }
122
+
113
123
  private:
114
124
  std::vector<std::shared_ptr<BaseNodeProp>> _properties;
115
125
  std::map<PropId, std::vector<NodeProp *>> _mappedProperties;
@@ -70,8 +70,7 @@ protected:
70
70
 
71
71
  void defineProperties(NodePropsContainer *container) override {
72
72
  JsiBaseDomDeclarationNode::defineProperties(container);
73
- _blendProp = container->defineProperty(
74
- std::make_shared<BlendModeProp>(JsiPropId::get("mode")));
73
+ _blendProp = container->defineProperty<BlendModeProp>("mode");
75
74
  _blendProp->require();
76
75
  }
77
76
 
@@ -44,12 +44,9 @@ protected:
44
44
  void defineProperties(NodePropsContainer *container) override {
45
45
  JsiBaseDomDeclarationNode::defineProperties(container);
46
46
 
47
- _style = container->defineProperty(
48
- std::make_shared<NodeProp>(JsiPropId::get("style")));
49
- _respectCTM = container->defineProperty(
50
- std::make_shared<NodeProp>(JsiPropId::get("respectCTM")));
51
- _blur = container->defineProperty(
52
- std::make_shared<NodeProp>(JsiPropId::get("blur")));
47
+ _style = container->defineProperty<NodeProp>("style");
48
+ _respectCTM = container->defineProperty<NodeProp>("respectCTM");
49
+ _blur = container->defineProperty<NodeProp>("blur");
53
50
 
54
51
  _blur->require();
55
52
  }
@@ -76,10 +76,8 @@ protected:
76
76
 
77
77
  void defineProperties(NodePropsContainer *container) override {
78
78
  JsiDomRenderNode::defineProperties(container);
79
- _rrectProp = container->defineProperty(
80
- std::make_shared<RRectProp>(JsiPropId::get("box")));
81
- _rectProp = container->defineProperty(
82
- std::make_shared<RectProp>(JsiPropId::get("box")));
79
+ _rrectProp = container->defineProperty<RRectProp>("box");
80
+ _rectProp = container->defineProperty<RectProp>("box");
83
81
  }
84
82
 
85
83
  private:
@@ -22,8 +22,7 @@ protected:
22
22
 
23
23
  void defineProperties(NodePropsContainer *container) override {
24
24
  JsiBaseDomDeclarationNode::defineProperties(container);
25
- _boxShadowProps =
26
- container->defineProperty(std::make_shared<BoxShadowProps>());
25
+ _boxShadowProps = container->defineProperty<BoxShadowProps>();
27
26
  }
28
27
 
29
28
  private:
@@ -22,11 +22,8 @@ protected:
22
22
 
23
23
  void defineProperties(NodePropsContainer *container) override {
24
24
  JsiDomDrawingNode::defineProperties(container);
25
- _circleProp = container->defineProperty(std::make_shared<CircleProp>());
26
- _radiusProp =
27
- container->defineProperty(std::make_shared<NodeProp>(PropNameR));
28
-
29
- _circleProp->require();
25
+ _circleProp = container->defineProperty<CircleProp>();
26
+ _radiusProp = container->defineProperty<NodeProp>("r");
30
27
  _radiusProp->require();
31
28
  }
32
29
 
@@ -77,8 +77,7 @@ protected:
77
77
 
78
78
  void defineProperties(NodePropsContainer *container) override {
79
79
  JsiBaseDomDeclarationNode::defineProperties(container);
80
- _matrixProp = container->defineProperty(
81
- std::make_shared<NodeProp>(JsiPropId::get("matrix")));
80
+ _matrixProp = container->defineProperty<NodeProp>("matrix");
82
81
  _matrixProp->require();
83
82
  }
84
83
 
@@ -103,10 +102,8 @@ protected:
103
102
 
104
103
  void defineProperties(NodePropsContainer *container) override {
105
104
  JsiBaseDomDeclarationNode::defineProperties(container);
106
- _blendModeProp = container->defineProperty(
107
- std::make_shared<BlendModeProp>(JsiPropId::get("mode")));
108
- _colorProp = container->defineProperty(
109
- std::make_shared<ColorProp>(JsiPropId::get("color")));
105
+ _blendModeProp = container->defineProperty<BlendModeProp>("mode");
106
+ _colorProp = container->defineProperty<ColorProp>("color");
110
107
 
111
108
  _blendModeProp->require();
112
109
  _colorProp->require();
@@ -180,8 +177,7 @@ protected:
180
177
 
181
178
  void defineProperties(NodePropsContainer *container) override {
182
179
  JsiBaseDomDeclarationNode::defineProperties(container);
183
- _tProp = container->defineProperty(
184
- std::make_shared<NodeProp>(JsiPropId::get("t")));
180
+ _tProp = container->defineProperty<NodeProp>("t");
185
181
  _tProp->require();
186
182
  }
187
183
 
@@ -28,7 +28,6 @@ protected:
28
28
  float scaledWidth = context->getScaledWidth();
29
29
  float scaledHeight = context->getScaledHeight();
30
30
  auto paint = context->getPaint();
31
- auto opacity = context->getOpacity();
32
31
  auto platformContext = getContext();
33
32
  auto requestRedraw = context->getRequestRedraw();
34
33
 
@@ -44,7 +43,7 @@ protected:
44
43
  }
45
44
 
46
45
  // Run rendering on the javascript thread
47
- getContext()->runOnJavascriptThread([this, platformContext, opacity,
46
+ getContext()->runOnJavascriptThread([this, platformContext,
48
47
  requestRedraw, scaledWidth,
49
48
  scaledHeight]() {
50
49
  // Get the runtime
@@ -65,7 +64,6 @@ protected:
65
64
  *runtime, "paint",
66
65
  jsi::Object::createFromHostObject(*runtime, this->_jsiPaint));
67
66
 
68
- jsiCtx.setProperty(*runtime, "opacity", opacity);
69
67
  jsiCtx.setProperty(
70
68
  *runtime, "canvas",
71
69
  jsi::Object::createFromHostObject(*runtime, jsiCanvas));
@@ -100,8 +98,7 @@ protected:
100
98
  std::bind(&JsiCustomDrawingNode::notifyPictureNeeded, this,
101
99
  std::placeholders::_1);
102
100
 
103
- _drawingProp = container->defineProperty(
104
- std::make_shared<DrawingProp>(JsiPropId::get("drawing"), cb));
101
+ _drawingProp = container->defineProperty<DrawingProp>("drawing", cb);
105
102
  }
106
103
 
107
104
  private:
@@ -7,9 +7,6 @@
7
7
 
8
8
  namespace RNSkia {
9
9
 
10
- static PropId PropNameInner = JsiPropId::get("inner");
11
- static PropId PropNameOuter = JsiPropId::get("outer");
12
-
13
10
  class JsiDiffRectNode : public JsiDomDrawingNode,
14
11
  public JsiDomNodeCtor<JsiDiffRectNode> {
15
12
  public:
@@ -25,10 +22,8 @@ protected:
25
22
 
26
23
  void defineProperties(NodePropsContainer *container) override {
27
24
  JsiDomDrawingNode::defineProperties(container);
28
- _innerRectProp =
29
- container->defineProperty(std::make_shared<RRectProp>(PropNameInner));
30
- _outerRectProp =
31
- container->defineProperty(std::make_shared<RRectProp>(PropNameOuter));
25
+ _innerRectProp = container->defineProperty<RRectProp>("inner");
26
+ _outerRectProp = container->defineProperty<RRectProp>("outer");
32
27
 
33
28
  _innerRectProp->require();
34
29
  _outerRectProp->require();
@@ -31,14 +31,10 @@ protected:
31
31
  void defineProperties(NodePropsContainer *container) override {
32
32
  JsiDomDrawingNode::defineProperties(container);
33
33
 
34
- _fontProp = container->defineProperty(
35
- std::make_shared<FontProp>(JsiPropId::get("font")));
36
- _glyphsProp = container->defineProperty(
37
- std::make_shared<GlyphsProp>(JsiPropId::get("glyphs")));
38
- _xProp = container->defineProperty(
39
- std::make_shared<NodeProp>(JsiPropId::get("x")));
40
- _yProp = container->defineProperty(
41
- std::make_shared<NodeProp>(JsiPropId::get("y")));
34
+ _fontProp = container->defineProperty<FontProp>("font");
35
+ _glyphsProp = container->defineProperty<GlyphsProp>("glyphs");
36
+ _xProp = container->defineProperty<NodeProp>("x");
37
+ _yProp = container->defineProperty<NodeProp>("y");
42
38
 
43
39
  _fontProp->require();
44
40
  _glyphsProp->require();
@@ -94,8 +94,7 @@ protected:
94
94
 
95
95
  void defineProperties(NodePropsContainer *container) override {
96
96
  JsiBaseDomDeclarationNode::defineProperties(container);
97
- _blendModeProp = container->defineProperty(
98
- std::make_shared<BlendModeProp>(JsiPropId::get("mode")));
97
+ _blendModeProp = container->defineProperty<BlendModeProp>("mode");
99
98
  _blendModeProp->require();
100
99
  }
101
100
 
@@ -154,19 +153,13 @@ protected:
154
153
 
155
154
  void defineProperties(NodePropsContainer *container) override {
156
155
  JsiBaseDomDeclarationNode::defineProperties(container);
157
- _dxProp = container->defineProperty(
158
- std::make_shared<NodeProp>(JsiPropId::get("dx")));
159
- _dyProp = container->defineProperty(
160
- std::make_shared<NodeProp>(JsiPropId::get("dy")));
161
- _blurProp = container->defineProperty(
162
- std::make_shared<NodeProp>(JsiPropId::get("blur")));
163
- _colorProp = container->defineProperty(
164
- std::make_shared<ColorProp>(JsiPropId::get("color")));
165
-
166
- _innerProp = container->defineProperty(
167
- std::make_shared<NodeProp>(JsiPropId::get("inner")));
168
- _shadowOnlyProp = container->defineProperty(
169
- std::make_shared<NodeProp>(JsiPropId::get("shadowOnly")));
156
+ _dxProp = container->defineProperty<NodeProp>("dx");
157
+ _dyProp = container->defineProperty<NodeProp>("dy");
158
+ _blurProp = container->defineProperty<NodeProp>("blur");
159
+ _colorProp = container->defineProperty<ColorProp>("color");
160
+
161
+ _innerProp = container->defineProperty<NodeProp>("inner");
162
+ _shadowOnlyProp = container->defineProperty<NodeProp>("shadowOnly");
170
163
 
171
164
  _dxProp->require();
172
165
  _dyProp->require();
@@ -212,12 +205,9 @@ protected:
212
205
 
213
206
  void defineProperties(NodePropsContainer *container) override {
214
207
  JsiBaseDomDeclarationNode::defineProperties(container);
215
- _channelXProp = container->defineProperty(
216
- std::make_shared<NodeProp>(JsiPropId::get("channelX")));
217
- _channelYProp = container->defineProperty(
218
- std::make_shared<NodeProp>(JsiPropId::get("channelY")));
219
- _scaleProp = container->defineProperty(
220
- std::make_shared<NodeProp>(JsiPropId::get("scale")));
208
+ _channelXProp = container->defineProperty<NodeProp>("channelX");
209
+ _channelYProp = container->defineProperty<NodeProp>("channelY");
210
+ _scaleProp = container->defineProperty<NodeProp>("scale");
221
211
 
222
212
  _channelXProp->require();
223
213
  _channelYProp->require();
@@ -266,10 +256,8 @@ protected:
266
256
 
267
257
  void defineProperties(NodePropsContainer *container) override {
268
258
  JsiBaseDomDeclarationNode::defineProperties(container);
269
- _blurProp = container->defineProperty(
270
- std::make_shared<RadiusProp>(JsiPropId::get("blur")));
271
- _tileModeProp = container->defineProperty(
272
- std::make_shared<TileModeProp>(JsiPropId::get("mode")));
259
+ _blurProp = container->defineProperty<RadiusProp>("blur");
260
+ _tileModeProp = container->defineProperty<TileModeProp>("mode");
273
261
 
274
262
  _blurProp->require();
275
263
  }
@@ -302,10 +290,8 @@ protected:
302
290
 
303
291
  void defineProperties(NodePropsContainer *container) override {
304
292
  JsiBaseDomDeclarationNode::defineProperties(container);
305
- _xProp = container->defineProperty(
306
- std::make_shared<NodeProp>(JsiPropId::get("x")));
307
- _yProp = container->defineProperty(
308
- std::make_shared<NodeProp>(JsiPropId::get("y")));
293
+ _xProp = container->defineProperty<NodeProp>("x");
294
+ _yProp = container->defineProperty<NodeProp>("y");
309
295
 
310
296
  _xProp->require();
311
297
  _yProp->require();
@@ -346,10 +332,8 @@ protected:
346
332
 
347
333
  void defineProperties(NodePropsContainer *container) override {
348
334
  JsiBaseDomDeclarationNode::defineProperties(container);
349
- _operatorProp = container->defineProperty(
350
- std::make_shared<NodeProp>(JsiPropId::get("operator")));
351
- _radiusProp = container->defineProperty(
352
- std::make_shared<RadiusProp>(JsiPropId::get("radius")));
335
+ _operatorProp = container->defineProperty<NodeProp>("operator");
336
+ _radiusProp = container->defineProperty<RadiusProp>("radius");
353
337
 
354
338
  _operatorProp->require();
355
339
  _radiusProp->require();
@@ -398,18 +382,16 @@ protected:
398
382
 
399
383
  void defineProperties(NodePropsContainer *container) override {
400
384
  JsiBaseDomDeclarationNode::defineProperties(container);
401
- _sourceProp = container->defineProperty(
402
- std::make_shared<NodeProp>(JsiPropId::get("source")));
385
+ _sourceProp = container->defineProperty<NodeProp>("source");
403
386
  _uniformsProp =
404
- container->defineProperty(std::make_shared<SimpleUniformsProp>(
405
- JsiPropId::get("uniforms"), _sourceProp));
387
+ container->defineProperty<UniformsProp>("uniforms", _sourceProp);
406
388
 
407
389
  _sourceProp->require();
408
390
  }
409
391
 
410
392
  private:
411
393
  NodeProp *_sourceProp;
412
- SimpleUniformsProp *_uniformsProp;
394
+ UniformsProp *_uniformsProp;
413
395
  };
414
396
 
415
397
  } // namespace RNSkia
@@ -23,7 +23,7 @@ protected:
23
23
 
24
24
  void defineProperties(NodePropsContainer *container) override {
25
25
  JsiDomDrawingNode::defineProperties(container);
26
- _imageProps = container->defineProperty(std::make_shared<ImageProps>());
26
+ _imageProps = container->defineProperty<ImageProps>();
27
27
  _imageProps->require();
28
28
  }
29
29
 
@@ -28,10 +28,8 @@ protected:
28
28
 
29
29
  void defineProperties(NodePropsContainer *container) override {
30
30
  JsiDomDrawingNode::defineProperties(container);
31
- _svgDomProp = container->defineProperty(
32
- std::make_shared<SvgProp>(JsiPropId::get("svg")));
33
- _rectProp = container->defineProperty(
34
- std::make_shared<RectProps>(JsiPropId::get("rect")));
31
+ _svgDomProp = container->defineProperty<SvgProp>("svg");
32
+ _rectProp = container->defineProperty<RectProps>("rect");
35
33
 
36
34
  _svgDomProp->require();
37
35
  }
@@ -7,9 +7,6 @@
7
7
 
8
8
  namespace RNSkia {
9
9
 
10
- static PropId PropNamePoint1 = JsiPropId::get("p1");
11
- static PropId PropNamePoint2 = JsiPropId::get("p2");
12
-
13
10
  class JsiLineNode : public JsiDomDrawingNode,
14
11
  public JsiDomNodeCtor<JsiLineNode> {
15
12
  public:
@@ -26,10 +23,8 @@ protected:
26
23
 
27
24
  void defineProperties(NodePropsContainer *container) override {
28
25
  JsiDomDrawingNode::defineProperties(container);
29
- _p1Prop =
30
- container->defineProperty(std::make_shared<PointProp>(PropNamePoint1));
31
- _p2Prop =
32
- container->defineProperty(std::make_shared<PointProp>(PropNamePoint2));
26
+ _p1Prop = container->defineProperty<PointProp>("p1");
27
+ _p2Prop = container->defineProperty<PointProp>("p2");
33
28
 
34
29
  _p1Prop->require();
35
30
  _p2Prop->require();
@@ -15,15 +15,13 @@ public:
15
15
 
16
16
  protected:
17
17
  void draw(DrawingContext *context) override {
18
- RNSkLogger::logToConsole(context->getDebugDescription());
19
18
  context->getCanvas()->drawOval(*_rectProp->getDerivedValue(),
20
19
  *context->getPaint());
21
20
  }
22
21
 
23
22
  void defineProperties(NodePropsContainer *container) override {
24
23
  JsiDomDrawingNode::defineProperties(container);
25
- _rectProp =
26
- container->defineProperty(std::make_shared<RectProps>(PropNameRect));
24
+ _rectProp = container->defineProperty<RectProps>("rect");
27
25
  _rectProp->require();
28
26
  }
29
27
 
@@ -64,9 +64,8 @@ protected:
64
64
  void defineProperties(NodePropsContainer *container) override {
65
65
  JsiBaseDomDeclarationNode::defineProperties(container);
66
66
 
67
- _paintProps = container->defineProperty(std::make_shared<PaintProps>());
68
- _opacityProp =
69
- container->defineProperty(std::make_shared<NodeProp>(PropNameOpacity));
67
+ _paintProps = container->defineProperty<PaintProps>();
68
+ _opacityProp = container->defineProperty<NodeProp>("opacity");
70
69
  }
71
70
 
72
71
  private:
@@ -32,14 +32,10 @@ protected:
32
32
 
33
33
  void defineProperties(NodePropsContainer *container) override {
34
34
  JsiDomDrawingNode::defineProperties(container);
35
- _colorsProp = container->defineProperty(
36
- std::make_shared<ColorsProp>(JsiPropId::get("colors")));
37
- _textureProp = container->defineProperty(
38
- std::make_shared<PointsProp>(JsiPropId::get("texture")));
39
- _blendModeProp = container->defineProperty(
40
- std::make_shared<BlendModeProp>(JsiPropId::get("blendMode")));
41
- _patchProp = container->defineProperty(
42
- std::make_shared<BezierProp>(JsiPropId::get("patch")));
35
+ _colorsProp = container->defineProperty<ColorsProp>("colors");
36
+ _textureProp = container->defineProperty<PointsProp>("texture");
37
+ _blendModeProp = container->defineProperty<BlendModeProp>("blendMode");
38
+ _patchProp = container->defineProperty<BezierProp>("patch");
43
39
 
44
40
  _patchProp->require();
45
41
  }