@shopify/react-native-skia 0.1.150 → 0.1.152

Sign up to get free protection for your applications and to get access to all the features.
Files changed (774) hide show
  1. package/android/CMakeLists.txt +4 -5
  2. package/android/cpp/jni/JniLoad.cpp +7 -5
  3. package/android/cpp/jni/JniSkiaManager.cpp +2 -15
  4. package/android/cpp/jni/include/JniSkiaBaseView.h +68 -0
  5. package/android/cpp/jni/include/JniSkiaDrawView.h +64 -47
  6. package/android/cpp/jni/include/JniSkiaManager.h +8 -10
  7. package/android/cpp/jni/include/JniSkiaPictureView.h +96 -0
  8. package/android/cpp/rnskia-android/{RNSkPlatformContextImpl.h → RNSkAndroidPlatformContext.h} +4 -4
  9. package/android/cpp/rnskia-android/RNSkAndroidView.h +100 -0
  10. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +91 -0
  11. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +39 -0
  12. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -6
  13. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +5 -4
  14. package/android/src/main/java/com/shopify/reactnative/skia/PlatformContext.java +5 -11
  15. package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
  16. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +143 -0
  17. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +17 -145
  18. package/android/src/main/java/com/shopify/reactnative/skia/{RNSkiaViewManager.java → SkiaDrawViewManager.java} +4 -15
  19. package/android/src/main/java/com/shopify/reactnative/skia/SkiaManager.java +1 -10
  20. package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +45 -0
  21. package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +64 -0
  22. package/cpp/jsi/JsiValueWrapper.h +11 -0
  23. package/cpp/rnskia/RNSkInfoParameter.h +4 -14
  24. package/cpp/rnskia/RNSkJsView.cpp +211 -0
  25. package/cpp/rnskia/RNSkJsView.h +115 -0
  26. package/cpp/rnskia/RNSkJsiViewApi.h +6 -6
  27. package/cpp/rnskia/RNSkManager.cpp +7 -7
  28. package/cpp/rnskia/RNSkManager.h +7 -7
  29. package/cpp/rnskia/RNSkPictureView.h +124 -0
  30. package/cpp/rnskia/RNSkView.h +287 -0
  31. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +38 -0
  32. package/ios/RNSkia-iOS/{RNSkDrawViewImpl.mm → RNSkMetalCanvasProvider.mm} +40 -23
  33. package/ios/RNSkia-iOS/{PlatformContext.h → RNSkiOSPlatformContext.h} +4 -4
  34. package/ios/RNSkia-iOS/{PlatformContext.mm → RNSkiOSPlatformContext.mm} +5 -5
  35. package/ios/RNSkia-iOS/RNSkiOSView.h +34 -0
  36. package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +19 -11
  37. package/ios/RNSkia-iOS/SkiaManager.mm +3 -3
  38. package/ios/RNSkia-iOS/SkiaPictureViewManager.h +8 -0
  39. package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +51 -0
  40. package/ios/RNSkia-iOS/SkiaUIView.h +26 -0
  41. package/ios/RNSkia-iOS/{SkiaDrawView.mm → SkiaUIView.mm} +29 -23
  42. package/lib/commonjs/animation/decay/decay.js.map +1 -1
  43. package/lib/commonjs/animation/decay/index.js.map +1 -1
  44. package/lib/commonjs/animation/decay/runDecay.js.map +1 -1
  45. package/lib/commonjs/animation/decay/types.js.map +1 -1
  46. package/lib/commonjs/animation/functions/index.js.map +1 -1
  47. package/lib/commonjs/animation/functions/interpolate.js.map +1 -1
  48. package/lib/commonjs/animation/functions/interpolateColors.js.map +1 -1
  49. package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
  50. package/lib/commonjs/animation/functions/interpolateVector.js.map +1 -1
  51. package/lib/commonjs/animation/index.js.map +1 -1
  52. package/lib/commonjs/animation/spring/Spring.js.map +1 -1
  53. package/lib/commonjs/animation/spring/functions/index.js.map +1 -1
  54. package/lib/commonjs/animation/spring/functions/spring.js.map +1 -1
  55. package/lib/commonjs/animation/spring/index.js.map +1 -1
  56. package/lib/commonjs/animation/spring/runSpring.js +1 -1
  57. package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
  58. package/lib/commonjs/animation/spring/types.js.map +1 -1
  59. package/lib/commonjs/animation/spring/useSpring.js +1 -1
  60. package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
  61. package/lib/commonjs/animation/timing/Easing.js.map +1 -1
  62. package/lib/commonjs/animation/timing/createTiming.js +2 -6
  63. package/lib/commonjs/animation/timing/createTiming.js.map +1 -1
  64. package/lib/commonjs/animation/timing/functions/bezier.js.map +1 -1
  65. package/lib/commonjs/animation/timing/functions/getResolvedParams.js +6 -10
  66. package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +1 -1
  67. package/lib/commonjs/animation/timing/functions/index.js.map +1 -1
  68. package/lib/commonjs/animation/timing/functions/timing.js.map +1 -1
  69. package/lib/commonjs/animation/timing/functions/types.js.map +1 -1
  70. package/lib/commonjs/animation/timing/index.js.map +1 -1
  71. package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
  72. package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
  73. package/lib/commonjs/animation/timing/useTiming.js +1 -3
  74. package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
  75. package/lib/commonjs/animation/types.js.map +1 -1
  76. package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
  77. package/lib/commonjs/dom/nodes/GroupNode.js.map +1 -1
  78. package/lib/commonjs/dom/nodes/JsiSkDOM.js +1 -1
  79. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  80. package/lib/commonjs/dom/nodes/Node.js.map +1 -1
  81. package/lib/commonjs/dom/nodes/PaintContext.js.map +1 -1
  82. package/lib/commonjs/dom/nodes/PaintNode.js.map +1 -1
  83. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  84. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  85. package/lib/commonjs/dom/nodes/datatypes/Color.js.map +1 -1
  86. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
  87. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  88. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +2 -2
  89. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  90. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
  91. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
  92. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  93. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
  94. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
  95. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  96. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  97. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +1 -1
  98. package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
  99. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +1 -1
  100. package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +1 -1
  101. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
  102. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +1 -1
  103. package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +1 -1
  104. package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +1 -1
  105. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
  106. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +1 -1
  107. package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +1 -1
  108. package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +1 -1
  109. package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -1
  110. package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +1 -1
  111. package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
  112. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
  113. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
  114. package/lib/commonjs/dom/nodes/index.js.map +1 -1
  115. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +1 -1
  116. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  117. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  118. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +1 -1
  119. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +1 -1
  120. package/lib/commonjs/dom/nodes/paint/Shaders.js +2 -4
  121. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  122. package/lib/commonjs/dom/nodes/paint/index.js.map +1 -1
  123. package/lib/commonjs/dom/types/ColorFilters.js.map +1 -1
  124. package/lib/commonjs/dom/types/Common.js.map +1 -1
  125. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  126. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  127. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
  128. package/lib/commonjs/dom/types/MaskFilters.js.map +1 -1
  129. package/lib/commonjs/dom/types/Node.js.map +1 -1
  130. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  131. package/lib/commonjs/dom/types/PathEffects.js.map +1 -1
  132. package/lib/commonjs/dom/types/Shaders.js.map +1 -1
  133. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  134. package/lib/commonjs/dom/types/index.js.map +1 -1
  135. package/lib/commonjs/external/index.js.map +1 -1
  136. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  137. package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +1 -1
  138. package/lib/commonjs/index.js.map +1 -1
  139. package/lib/commonjs/mock/index.js +6 -10
  140. package/lib/commonjs/mock/index.js.map +1 -1
  141. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  142. package/lib/commonjs/renderer/Container.js.map +1 -1
  143. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  144. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  145. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  146. package/lib/commonjs/renderer/HostConfig.js +0 -2
  147. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  148. package/lib/commonjs/renderer/components/Blend.js.map +1 -1
  149. package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
  150. package/lib/commonjs/renderer/components/Group.js.map +1 -1
  151. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  152. package/lib/commonjs/renderer/components/Paint.js +1 -1
  153. package/lib/commonjs/renderer/components/Paint.js.map +1 -1
  154. package/lib/commonjs/renderer/components/Picture.js.map +1 -1
  155. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js +1 -1
  156. package/lib/commonjs/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  157. package/lib/commonjs/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  158. package/lib/commonjs/renderer/components/backdrop/index.js.map +1 -1
  159. package/lib/commonjs/renderer/components/colorFilters/BlendColor.js.map +1 -1
  160. package/lib/commonjs/renderer/components/colorFilters/Lerp.js.map +1 -1
  161. package/lib/commonjs/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  162. package/lib/commonjs/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  163. package/lib/commonjs/renderer/components/colorFilters/Matrix.js.map +1 -1
  164. package/lib/commonjs/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  165. package/lib/commonjs/renderer/components/colorFilters/index.js.map +1 -1
  166. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  167. package/lib/commonjs/renderer/components/image/ImageSVG.js.map +1 -1
  168. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  169. package/lib/commonjs/renderer/components/image/index.js.map +1 -1
  170. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  171. package/lib/commonjs/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  172. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  173. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  174. package/lib/commonjs/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  175. package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
  176. package/lib/commonjs/renderer/components/imageFilters/index.js.map +1 -1
  177. package/lib/commonjs/renderer/components/index.js.map +1 -1
  178. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  179. package/lib/commonjs/renderer/components/maskFilters/index.js.map +1 -1
  180. package/lib/commonjs/renderer/components/pathEffects/Corner.js.map +1 -1
  181. package/lib/commonjs/renderer/components/pathEffects/Dash.js.map +1 -1
  182. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  183. package/lib/commonjs/renderer/components/pathEffects/Line2D.js.map +1 -1
  184. package/lib/commonjs/renderer/components/pathEffects/Path1D.js.map +1 -1
  185. package/lib/commonjs/renderer/components/pathEffects/Path2D.js.map +1 -1
  186. package/lib/commonjs/renderer/components/pathEffects/Sum.js.map +1 -1
  187. package/lib/commonjs/renderer/components/pathEffects/index.js.map +1 -1
  188. package/lib/commonjs/renderer/components/shaders/Color.js.map +1 -1
  189. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  190. package/lib/commonjs/renderer/components/shaders/LinearGradient.js.map +1 -1
  191. package/lib/commonjs/renderer/components/shaders/RadialGradient.js.map +1 -1
  192. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  193. package/lib/commonjs/renderer/components/shaders/ShaderLib.js.map +1 -1
  194. package/lib/commonjs/renderer/components/shaders/SweepGradient.js.map +1 -1
  195. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  196. package/lib/commonjs/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  197. package/lib/commonjs/renderer/components/shaders/index.js.map +1 -1
  198. package/lib/commonjs/renderer/components/shapes/Box.js.map +1 -1
  199. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  200. package/lib/commonjs/renderer/components/shapes/DiffRect.js.map +1 -1
  201. package/lib/commonjs/renderer/components/shapes/Fill.js.map +1 -1
  202. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  203. package/lib/commonjs/renderer/components/shapes/Line.js.map +1 -1
  204. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  205. package/lib/commonjs/renderer/components/shapes/Patch.js.map +1 -1
  206. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  207. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  208. package/lib/commonjs/renderer/components/shapes/Rect.js.map +1 -1
  209. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  210. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  211. package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
  212. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  213. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  214. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  215. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  216. package/lib/commonjs/renderer/components/text/index.js.map +1 -1
  217. package/lib/commonjs/renderer/index.js.map +1 -1
  218. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  219. package/lib/commonjs/renderer/processors/Animations/index.js.map +1 -1
  220. package/lib/commonjs/renderer/processors/index.js.map +1 -1
  221. package/lib/commonjs/renderer/processors/math/Coordinates.js.map +1 -1
  222. package/lib/commonjs/renderer/processors/math/Math.js.map +1 -1
  223. package/lib/commonjs/renderer/processors/math/Transforms.js.map +1 -1
  224. package/lib/commonjs/renderer/processors/math/index.js.map +1 -1
  225. package/lib/commonjs/renderer/typeddash.js.map +1 -1
  226. package/lib/commonjs/renderer/useCanvas.js.map +1 -1
  227. package/lib/commonjs/renderer/useContextBridge.js.map +1 -1
  228. package/lib/commonjs/skia/NativeSetup.js.map +1 -1
  229. package/lib/commonjs/skia/Skia.js.map +1 -1
  230. package/lib/commonjs/skia/Skia.web.js.map +1 -1
  231. package/lib/commonjs/skia/core/Data.js.map +1 -1
  232. package/lib/commonjs/skia/core/Font.js.map +1 -1
  233. package/lib/commonjs/skia/core/Image.js.map +1 -1
  234. package/lib/commonjs/skia/core/Matrix.js.map +1 -1
  235. package/lib/commonjs/skia/core/Picture.js.map +1 -1
  236. package/lib/commonjs/skia/core/RRect.js.map +1 -1
  237. package/lib/commonjs/skia/core/Rect.js.map +1 -1
  238. package/lib/commonjs/skia/core/SVG.js.map +1 -1
  239. package/lib/commonjs/skia/core/Typeface.js.map +1 -1
  240. package/lib/commonjs/skia/core/Vector.js +1 -1
  241. package/lib/commonjs/skia/core/Vector.js.map +1 -1
  242. package/lib/commonjs/skia/core/index.js.map +1 -1
  243. package/lib/commonjs/skia/index.js.map +1 -1
  244. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  245. package/lib/commonjs/skia/types/Color.js.map +1 -1
  246. package/lib/commonjs/skia/types/ColorFilter/ColorFilter.js.map +1 -1
  247. package/lib/commonjs/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
  248. package/lib/commonjs/skia/types/ColorFilter/index.js.map +1 -1
  249. package/lib/commonjs/skia/types/ContourMeasure.js.map +1 -1
  250. package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
  251. package/lib/commonjs/skia/types/Data/DataFactory.js.map +1 -1
  252. package/lib/commonjs/skia/types/Data/index.js.map +1 -1
  253. package/lib/commonjs/skia/types/Font/Font.js.map +1 -1
  254. package/lib/commonjs/skia/types/Font/index.js.map +1 -1
  255. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  256. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  257. package/lib/commonjs/skia/types/Image/index.js.map +1 -1
  258. package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
  259. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  260. package/lib/commonjs/skia/types/ImageFilter/index.js.map +1 -1
  261. package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
  262. package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
  263. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  264. package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
  265. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  266. package/lib/commonjs/skia/types/Paint/index.js.map +1 -1
  267. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  268. package/lib/commonjs/skia/types/Path/PathFactory.js.map +1 -1
  269. package/lib/commonjs/skia/types/Path/index.js.map +1 -1
  270. package/lib/commonjs/skia/types/PathEffect.js.map +1 -1
  271. package/lib/commonjs/skia/types/Picture/Picture.js.map +1 -1
  272. package/lib/commonjs/skia/types/Picture/PictureFactory.js.map +1 -1
  273. package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
  274. package/lib/commonjs/skia/types/Picture/index.js.map +1 -1
  275. package/lib/commonjs/skia/types/Point.js.map +1 -1
  276. package/lib/commonjs/skia/types/RRect.js.map +1 -1
  277. package/lib/commonjs/skia/types/RSXform.js.map +1 -1
  278. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  279. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  280. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
  281. package/lib/commonjs/skia/types/RuntimeEffect/index.js.map +1 -1
  282. package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
  283. package/lib/commonjs/skia/types/SVG/SVGFactory.js.map +1 -1
  284. package/lib/commonjs/skia/types/SVG/index.js.map +1 -1
  285. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  286. package/lib/commonjs/skia/types/Shader/ShaderFactory.js.map +1 -1
  287. package/lib/commonjs/skia/types/Shader/index.js.map +1 -1
  288. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  289. package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
  290. package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
  291. package/lib/commonjs/skia/types/Surface/index.js.map +1 -1
  292. package/lib/commonjs/skia/types/TextBlob.js.map +1 -1
  293. package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
  294. package/lib/commonjs/skia/types/Typeface/TypefaceFactory.js.map +1 -1
  295. package/lib/commonjs/skia/types/Typeface/index.js.map +1 -1
  296. package/lib/commonjs/skia/types/Vertices/Vertices.js.map +1 -1
  297. package/lib/commonjs/skia/types/Vertices/index.js.map +1 -1
  298. package/lib/commonjs/skia/types/index.js.map +1 -1
  299. package/lib/commonjs/skia/web/Host.js +1 -1
  300. package/lib/commonjs/skia/web/Host.js.map +1 -1
  301. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  302. package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -1
  303. package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
  304. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  305. package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
  306. package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  307. package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
  308. package/lib/commonjs/skia/web/JsiSkDataFactory.js.map +1 -1
  309. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  310. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  311. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  312. package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
  313. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  314. package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
  315. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  316. package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
  317. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  318. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  319. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  320. package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
  321. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  322. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  323. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  324. package/lib/commonjs/skia/web/JsiSkPictureFactory.js.map +1 -1
  325. package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
  326. package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
  327. package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
  328. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  329. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  330. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  331. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  332. package/lib/commonjs/skia/web/JsiSkSVGFactory.js.map +1 -1
  333. package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
  334. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  335. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  336. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  337. package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
  338. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  339. package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
  340. package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  341. package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
  342. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
  343. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  344. package/lib/commonjs/skia/web/index.js.map +1 -1
  345. package/lib/commonjs/values/api.js.map +1 -1
  346. package/lib/commonjs/values/api.web.js.map +1 -1
  347. package/lib/commonjs/values/hooks/index.js.map +1 -1
  348. package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
  349. package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
  350. package/lib/commonjs/values/hooks/useValue.js.map +1 -1
  351. package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
  352. package/lib/commonjs/values/index.js.map +1 -1
  353. package/lib/commonjs/values/selector.js.map +1 -1
  354. package/lib/commonjs/values/types.js.map +1 -1
  355. package/lib/commonjs/values/web/RNSkAnimation.js +2 -2
  356. package/lib/commonjs/values/web/RNSkAnimation.js.map +1 -1
  357. package/lib/commonjs/values/web/RNSkClockValue.js.map +1 -1
  358. package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
  359. package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
  360. package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
  361. package/lib/commonjs/values/web/RNSkValue.js.map +1 -1
  362. package/lib/commonjs/values/web/api.js.map +1 -1
  363. package/lib/commonjs/values/web/index.js.map +1 -1
  364. package/lib/commonjs/views/SkiaBaseWebView.js +213 -0
  365. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -0
  366. package/lib/commonjs/views/SkiaPictureView.js +112 -0
  367. package/lib/commonjs/views/SkiaPictureView.js.map +1 -0
  368. package/lib/commonjs/views/SkiaPictureView.web.js +31 -0
  369. package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -0
  370. package/lib/commonjs/views/SkiaView.js +2 -2
  371. package/lib/commonjs/views/SkiaView.js.map +1 -1
  372. package/lib/commonjs/views/SkiaView.web.js +14 -203
  373. package/lib/commonjs/views/SkiaView.web.js.map +1 -1
  374. package/lib/commonjs/views/api.js.map +1 -1
  375. package/lib/commonjs/views/index.js +13 -0
  376. package/lib/commonjs/views/index.js.map +1 -1
  377. package/lib/commonjs/views/types.js.map +1 -1
  378. package/lib/commonjs/views/useDrawCallback.js.map +1 -1
  379. package/lib/commonjs/views/useTouchHandler.js +6 -6
  380. package/lib/commonjs/views/useTouchHandler.js.map +1 -1
  381. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  382. package/lib/commonjs/web/WithSkiaWeb.js +1 -1
  383. package/lib/commonjs/web/WithSkiaWeb.js.map +1 -1
  384. package/lib/commonjs/web/index.js.map +1 -1
  385. package/lib/module/animation/decay/decay.js.map +1 -1
  386. package/lib/module/animation/decay/index.js.map +1 -1
  387. package/lib/module/animation/decay/runDecay.js.map +1 -1
  388. package/lib/module/animation/decay/types.js.map +1 -1
  389. package/lib/module/animation/functions/index.js.map +1 -1
  390. package/lib/module/animation/functions/interpolate.js.map +1 -1
  391. package/lib/module/animation/functions/interpolateColors.js.map +1 -1
  392. package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
  393. package/lib/module/animation/functions/interpolateVector.js.map +1 -1
  394. package/lib/module/animation/index.js.map +1 -1
  395. package/lib/module/animation/spring/Spring.js.map +1 -1
  396. package/lib/module/animation/spring/functions/index.js.map +1 -1
  397. package/lib/module/animation/spring/functions/spring.js.map +1 -1
  398. package/lib/module/animation/spring/index.js.map +1 -1
  399. package/lib/module/animation/spring/runSpring.js +1 -1
  400. package/lib/module/animation/spring/runSpring.js.map +1 -1
  401. package/lib/module/animation/spring/types.js.map +1 -1
  402. package/lib/module/animation/spring/useSpring.js +1 -1
  403. package/lib/module/animation/spring/useSpring.js.map +1 -1
  404. package/lib/module/animation/timing/Easing.js.map +1 -1
  405. package/lib/module/animation/timing/createTiming.js +2 -6
  406. package/lib/module/animation/timing/createTiming.js.map +1 -1
  407. package/lib/module/animation/timing/functions/bezier.js.map +1 -1
  408. package/lib/module/animation/timing/functions/getResolvedParams.js +6 -10
  409. package/lib/module/animation/timing/functions/getResolvedParams.js.map +1 -1
  410. package/lib/module/animation/timing/functions/index.js.map +1 -1
  411. package/lib/module/animation/timing/functions/timing.js.map +1 -1
  412. package/lib/module/animation/timing/functions/types.js.map +1 -1
  413. package/lib/module/animation/timing/index.js.map +1 -1
  414. package/lib/module/animation/timing/runTiming.js.map +1 -1
  415. package/lib/module/animation/timing/useLoop.js.map +1 -1
  416. package/lib/module/animation/timing/useTiming.js +1 -3
  417. package/lib/module/animation/timing/useTiming.js.map +1 -1
  418. package/lib/module/animation/types.js.map +1 -1
  419. package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
  420. package/lib/module/dom/nodes/GroupNode.js.map +1 -1
  421. package/lib/module/dom/nodes/JsiSkDOM.js +1 -1
  422. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  423. package/lib/module/dom/nodes/Node.js.map +1 -1
  424. package/lib/module/dom/nodes/PaintContext.js.map +1 -1
  425. package/lib/module/dom/nodes/PaintNode.js.map +1 -1
  426. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  427. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  428. package/lib/module/dom/nodes/datatypes/Color.js.map +1 -1
  429. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
  430. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  431. package/lib/module/dom/nodes/datatypes/Gradient.js +2 -2
  432. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  433. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
  434. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
  435. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  436. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
  437. package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
  438. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +1 -1
  439. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  440. package/lib/module/dom/nodes/drawings/CircleNode.js.map +1 -1
  441. package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +1 -1
  442. package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +1 -1
  443. package/lib/module/dom/nodes/drawings/FillNode.js.map +1 -1
  444. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
  445. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +1 -1
  446. package/lib/module/dom/nodes/drawings/LineNode.js.map +1 -1
  447. package/lib/module/dom/nodes/drawings/OvalNode.js.map +1 -1
  448. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
  449. package/lib/module/dom/nodes/drawings/PathNode.js.map +1 -1
  450. package/lib/module/dom/nodes/drawings/PictureNode.js.map +1 -1
  451. package/lib/module/dom/nodes/drawings/PointsNode.js.map +1 -1
  452. package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -1
  453. package/lib/module/dom/nodes/drawings/RectNode.js.map +1 -1
  454. package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
  455. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
  456. package/lib/module/dom/nodes/drawings/index.js.map +1 -1
  457. package/lib/module/dom/nodes/index.js.map +1 -1
  458. package/lib/module/dom/nodes/paint/BlendNode.js.map +1 -1
  459. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  460. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  461. package/lib/module/dom/nodes/paint/MaskFilters.js.map +1 -1
  462. package/lib/module/dom/nodes/paint/PathEffects.js.map +1 -1
  463. package/lib/module/dom/nodes/paint/Shaders.js +2 -4
  464. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  465. package/lib/module/dom/nodes/paint/index.js.map +1 -1
  466. package/lib/module/dom/types/ColorFilters.js.map +1 -1
  467. package/lib/module/dom/types/Common.js.map +1 -1
  468. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  469. package/lib/module/dom/types/Drawings.js.map +1 -1
  470. package/lib/module/dom/types/ImageFilters.js.map +1 -1
  471. package/lib/module/dom/types/MaskFilters.js.map +1 -1
  472. package/lib/module/dom/types/Node.js.map +1 -1
  473. package/lib/module/dom/types/NodeType.js.map +1 -1
  474. package/lib/module/dom/types/PathEffects.js.map +1 -1
  475. package/lib/module/dom/types/Shaders.js.map +1 -1
  476. package/lib/module/dom/types/SkDOM.js.map +1 -1
  477. package/lib/module/dom/types/index.js.map +1 -1
  478. package/lib/module/external/index.js.map +1 -1
  479. package/lib/module/external/reanimated/index.js.map +1 -1
  480. package/lib/module/external/reanimated/useSharedValueEffect.js.map +1 -1
  481. package/lib/module/index.js.map +1 -1
  482. package/lib/module/mock/index.js +6 -10
  483. package/lib/module/mock/index.js.map +1 -1
  484. package/lib/module/renderer/Canvas.js.map +1 -1
  485. package/lib/module/renderer/Container.js.map +1 -1
  486. package/lib/module/renderer/DependencyManager.js.map +1 -1
  487. package/lib/module/renderer/DrawingContext.js.map +1 -1
  488. package/lib/module/renderer/HostComponents.js.map +1 -1
  489. package/lib/module/renderer/HostConfig.js +0 -2
  490. package/lib/module/renderer/HostConfig.js.map +1 -1
  491. package/lib/module/renderer/components/Blend.js.map +1 -1
  492. package/lib/module/renderer/components/Drawing.js.map +1 -1
  493. package/lib/module/renderer/components/Group.js.map +1 -1
  494. package/lib/module/renderer/components/Mask.js.map +1 -1
  495. package/lib/module/renderer/components/Paint.js +1 -1
  496. package/lib/module/renderer/components/Paint.js.map +1 -1
  497. package/lib/module/renderer/components/Picture.js.map +1 -1
  498. package/lib/module/renderer/components/backdrop/BackdropBlur.js +1 -1
  499. package/lib/module/renderer/components/backdrop/BackdropBlur.js.map +1 -1
  500. package/lib/module/renderer/components/backdrop/BackdropFilter.js.map +1 -1
  501. package/lib/module/renderer/components/backdrop/index.js.map +1 -1
  502. package/lib/module/renderer/components/colorFilters/BlendColor.js.map +1 -1
  503. package/lib/module/renderer/components/colorFilters/Lerp.js.map +1 -1
  504. package/lib/module/renderer/components/colorFilters/LinearToSRGBGamma.js.map +1 -1
  505. package/lib/module/renderer/components/colorFilters/LumaColorFilter.js.map +1 -1
  506. package/lib/module/renderer/components/colorFilters/Matrix.js.map +1 -1
  507. package/lib/module/renderer/components/colorFilters/SRGBToLinearGamma.js.map +1 -1
  508. package/lib/module/renderer/components/colorFilters/index.js.map +1 -1
  509. package/lib/module/renderer/components/image/Image.js.map +1 -1
  510. package/lib/module/renderer/components/image/ImageSVG.js.map +1 -1
  511. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  512. package/lib/module/renderer/components/image/index.js.map +1 -1
  513. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  514. package/lib/module/renderer/components/imageFilters/DisplacementMap.js.map +1 -1
  515. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  516. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  517. package/lib/module/renderer/components/imageFilters/RuntimeShader.js.map +1 -1
  518. package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
  519. package/lib/module/renderer/components/imageFilters/index.js.map +1 -1
  520. package/lib/module/renderer/components/index.js.map +1 -1
  521. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  522. package/lib/module/renderer/components/maskFilters/index.js.map +1 -1
  523. package/lib/module/renderer/components/pathEffects/Corner.js.map +1 -1
  524. package/lib/module/renderer/components/pathEffects/Dash.js.map +1 -1
  525. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  526. package/lib/module/renderer/components/pathEffects/Line2D.js.map +1 -1
  527. package/lib/module/renderer/components/pathEffects/Path1D.js.map +1 -1
  528. package/lib/module/renderer/components/pathEffects/Path2D.js.map +1 -1
  529. package/lib/module/renderer/components/pathEffects/Sum.js.map +1 -1
  530. package/lib/module/renderer/components/pathEffects/index.js.map +1 -1
  531. package/lib/module/renderer/components/shaders/Color.js.map +1 -1
  532. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  533. package/lib/module/renderer/components/shaders/LinearGradient.js.map +1 -1
  534. package/lib/module/renderer/components/shaders/RadialGradient.js.map +1 -1
  535. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  536. package/lib/module/renderer/components/shaders/ShaderLib.js.map +1 -1
  537. package/lib/module/renderer/components/shaders/SweepGradient.js.map +1 -1
  538. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  539. package/lib/module/renderer/components/shaders/TwoPointConicalGradient.js.map +1 -1
  540. package/lib/module/renderer/components/shaders/index.js.map +1 -1
  541. package/lib/module/renderer/components/shapes/Box.js.map +1 -1
  542. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  543. package/lib/module/renderer/components/shapes/DiffRect.js.map +1 -1
  544. package/lib/module/renderer/components/shapes/Fill.js.map +1 -1
  545. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  546. package/lib/module/renderer/components/shapes/Line.js.map +1 -1
  547. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  548. package/lib/module/renderer/components/shapes/Patch.js.map +1 -1
  549. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  550. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  551. package/lib/module/renderer/components/shapes/Rect.js.map +1 -1
  552. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  553. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  554. package/lib/module/renderer/components/shapes/index.js.map +1 -1
  555. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  556. package/lib/module/renderer/components/text/Text.js.map +1 -1
  557. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  558. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  559. package/lib/module/renderer/components/text/index.js.map +1 -1
  560. package/lib/module/renderer/index.js.map +1 -1
  561. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  562. package/lib/module/renderer/processors/Animations/index.js.map +1 -1
  563. package/lib/module/renderer/processors/index.js.map +1 -1
  564. package/lib/module/renderer/processors/math/Coordinates.js.map +1 -1
  565. package/lib/module/renderer/processors/math/Math.js.map +1 -1
  566. package/lib/module/renderer/processors/math/Transforms.js.map +1 -1
  567. package/lib/module/renderer/processors/math/index.js.map +1 -1
  568. package/lib/module/renderer/typeddash.js.map +1 -1
  569. package/lib/module/renderer/useCanvas.js.map +1 -1
  570. package/lib/module/renderer/useContextBridge.js.map +1 -1
  571. package/lib/module/skia/NativeSetup.js.map +1 -1
  572. package/lib/module/skia/Skia.js.map +1 -1
  573. package/lib/module/skia/Skia.web.js.map +1 -1
  574. package/lib/module/skia/core/Data.js.map +1 -1
  575. package/lib/module/skia/core/Font.js.map +1 -1
  576. package/lib/module/skia/core/Image.js.map +1 -1
  577. package/lib/module/skia/core/Matrix.js.map +1 -1
  578. package/lib/module/skia/core/Picture.js.map +1 -1
  579. package/lib/module/skia/core/RRect.js.map +1 -1
  580. package/lib/module/skia/core/Rect.js.map +1 -1
  581. package/lib/module/skia/core/SVG.js.map +1 -1
  582. package/lib/module/skia/core/Typeface.js.map +1 -1
  583. package/lib/module/skia/core/Vector.js +1 -1
  584. package/lib/module/skia/core/Vector.js.map +1 -1
  585. package/lib/module/skia/core/index.js.map +1 -1
  586. package/lib/module/skia/index.js.map +1 -1
  587. package/lib/module/skia/types/Canvas.js.map +1 -1
  588. package/lib/module/skia/types/Color.js.map +1 -1
  589. package/lib/module/skia/types/ColorFilter/ColorFilter.js.map +1 -1
  590. package/lib/module/skia/types/ColorFilter/ColorFilterFactory.js.map +1 -1
  591. package/lib/module/skia/types/ColorFilter/index.js.map +1 -1
  592. package/lib/module/skia/types/ContourMeasure.js.map +1 -1
  593. package/lib/module/skia/types/Data/Data.js.map +1 -1
  594. package/lib/module/skia/types/Data/DataFactory.js.map +1 -1
  595. package/lib/module/skia/types/Data/index.js.map +1 -1
  596. package/lib/module/skia/types/Font/Font.js.map +1 -1
  597. package/lib/module/skia/types/Font/index.js.map +1 -1
  598. package/lib/module/skia/types/Image/Image.js.map +1 -1
  599. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  600. package/lib/module/skia/types/Image/index.js.map +1 -1
  601. package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
  602. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  603. package/lib/module/skia/types/ImageFilter/index.js.map +1 -1
  604. package/lib/module/skia/types/JsiInstance.js.map +1 -1
  605. package/lib/module/skia/types/MaskFilter.js.map +1 -1
  606. package/lib/module/skia/types/Matrix.js.map +1 -1
  607. package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
  608. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  609. package/lib/module/skia/types/Paint/index.js.map +1 -1
  610. package/lib/module/skia/types/Path/Path.js.map +1 -1
  611. package/lib/module/skia/types/Path/PathFactory.js.map +1 -1
  612. package/lib/module/skia/types/Path/index.js.map +1 -1
  613. package/lib/module/skia/types/PathEffect.js.map +1 -1
  614. package/lib/module/skia/types/Picture/Picture.js.map +1 -1
  615. package/lib/module/skia/types/Picture/PictureFactory.js.map +1 -1
  616. package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
  617. package/lib/module/skia/types/Picture/index.js.map +1 -1
  618. package/lib/module/skia/types/Point.js.map +1 -1
  619. package/lib/module/skia/types/RRect.js.map +1 -1
  620. package/lib/module/skia/types/RSXform.js.map +1 -1
  621. package/lib/module/skia/types/Rect.js.map +1 -1
  622. package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  623. package/lib/module/skia/types/RuntimeEffect/RuntimeEffectFactory.js.map +1 -1
  624. package/lib/module/skia/types/RuntimeEffect/index.js.map +1 -1
  625. package/lib/module/skia/types/SVG/SVG.js.map +1 -1
  626. package/lib/module/skia/types/SVG/SVGFactory.js.map +1 -1
  627. package/lib/module/skia/types/SVG/index.js.map +1 -1
  628. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  629. package/lib/module/skia/types/Shader/ShaderFactory.js.map +1 -1
  630. package/lib/module/skia/types/Shader/index.js.map +1 -1
  631. package/lib/module/skia/types/Skia.js.map +1 -1
  632. package/lib/module/skia/types/Surface/Surface.js.map +1 -1
  633. package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
  634. package/lib/module/skia/types/Surface/index.js.map +1 -1
  635. package/lib/module/skia/types/TextBlob.js.map +1 -1
  636. package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
  637. package/lib/module/skia/types/Typeface/TypefaceFactory.js.map +1 -1
  638. package/lib/module/skia/types/Typeface/index.js.map +1 -1
  639. package/lib/module/skia/types/Vertices/Vertices.js.map +1 -1
  640. package/lib/module/skia/types/Vertices/index.js.map +1 -1
  641. package/lib/module/skia/types/index.js.map +1 -1
  642. package/lib/module/skia/web/Host.js +1 -1
  643. package/lib/module/skia/web/Host.js.map +1 -1
  644. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  645. package/lib/module/skia/web/JsiSkColor.js.map +1 -1
  646. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  647. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  648. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  649. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  650. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  651. package/lib/module/skia/web/JsiSkDataFactory.js.map +1 -1
  652. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  653. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  654. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  655. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  656. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  657. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  658. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  659. package/lib/module/skia/web/JsiSkMatrix.js +1 -1
  660. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  661. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  662. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  663. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  664. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  665. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  666. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  667. package/lib/module/skia/web/JsiSkPictureFactory.js.map +1 -1
  668. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  669. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  670. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  671. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  672. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  673. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  674. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  675. package/lib/module/skia/web/JsiSkSVGFactory.js.map +1 -1
  676. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  677. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  678. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  679. package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  680. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  681. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  682. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  683. package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
  684. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  685. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
  686. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  687. package/lib/module/skia/web/index.js.map +1 -1
  688. package/lib/module/values/api.js.map +1 -1
  689. package/lib/module/values/api.web.js.map +1 -1
  690. package/lib/module/values/hooks/index.js.map +1 -1
  691. package/lib/module/values/hooks/useClockValue.js.map +1 -1
  692. package/lib/module/values/hooks/useComputedValue.js.map +1 -1
  693. package/lib/module/values/hooks/useValue.js.map +1 -1
  694. package/lib/module/values/hooks/useValueEffect.js.map +1 -1
  695. package/lib/module/values/index.js.map +1 -1
  696. package/lib/module/values/selector.js.map +1 -1
  697. package/lib/module/values/types.js.map +1 -1
  698. package/lib/module/values/web/RNSkAnimation.js +2 -2
  699. package/lib/module/values/web/RNSkAnimation.js.map +1 -1
  700. package/lib/module/values/web/RNSkClockValue.js.map +1 -1
  701. package/lib/module/values/web/RNSkComputedValue.js +1 -1
  702. package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
  703. package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
  704. package/lib/module/values/web/RNSkValue.js.map +1 -1
  705. package/lib/module/values/web/api.js.map +1 -1
  706. package/lib/module/values/web/index.js.map +1 -1
  707. package/lib/module/views/SkiaBaseWebView.js +198 -0
  708. package/lib/module/views/SkiaBaseWebView.js.map +1 -0
  709. package/lib/module/views/SkiaPictureView.js +94 -0
  710. package/lib/module/views/SkiaPictureView.js.map +1 -0
  711. package/lib/module/views/SkiaPictureView.web.js +19 -0
  712. package/lib/module/views/SkiaPictureView.web.js.map +1 -0
  713. package/lib/module/views/SkiaView.js +2 -2
  714. package/lib/module/views/SkiaView.js.map +1 -1
  715. package/lib/module/views/SkiaView.web.js +15 -201
  716. package/lib/module/views/SkiaView.web.js.map +1 -1
  717. package/lib/module/views/api.js.map +1 -1
  718. package/lib/module/views/index.js +1 -0
  719. package/lib/module/views/index.js.map +1 -1
  720. package/lib/module/views/types.js.map +1 -1
  721. package/lib/module/views/useDrawCallback.js.map +1 -1
  722. package/lib/module/views/useTouchHandler.js +6 -6
  723. package/lib/module/views/useTouchHandler.js.map +1 -1
  724. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  725. package/lib/module/web/WithSkiaWeb.js +1 -1
  726. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  727. package/lib/module/web/index.js.map +1 -1
  728. package/lib/typescript/src/animation/decay/runDecay.d.ts +1 -1
  729. package/lib/typescript/src/animation/spring/runSpring.d.ts +1 -1
  730. package/lib/typescript/src/animation/spring/useSpring.d.ts +1 -1
  731. package/lib/typescript/src/animation/timing/createTiming.d.ts +1 -1
  732. package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +1 -1
  733. package/lib/typescript/src/animation/timing/runTiming.d.ts +1 -1
  734. package/lib/typescript/src/animation/timing/useLoop.d.ts +1 -1
  735. package/lib/typescript/src/animation/timing/useTiming.d.ts +1 -1
  736. package/lib/typescript/src/mock/index.d.ts +1 -1
  737. package/lib/typescript/src/renderer/Canvas.d.ts +1 -1
  738. package/lib/typescript/src/renderer/HostConfig.d.ts +1 -1
  739. package/lib/typescript/src/renderer/components/Paint.d.ts +1 -1
  740. package/lib/typescript/src/renderer/components/backdrop/BackdropFilter.d.ts +1 -1
  741. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +4 -4
  742. package/lib/typescript/src/renderer/typeddash.d.ts +2 -2
  743. package/lib/typescript/src/skia/core/Font.d.ts +1 -1
  744. package/lib/typescript/src/skia/core/Vector.d.ts +2 -2
  745. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  746. package/lib/typescript/src/skia/web/JsiSkVerticesFactory.d.ts +2 -2
  747. package/lib/typescript/src/views/SkiaBaseWebView.d.ts +58 -0
  748. package/lib/typescript/src/views/SkiaPictureView.d.ts +27 -0
  749. package/lib/typescript/src/views/SkiaPictureView.web.d.ts +7 -0
  750. package/lib/typescript/src/views/SkiaView.d.ts +4 -4
  751. package/lib/typescript/src/views/SkiaView.web.d.ts +6 -53
  752. package/lib/typescript/src/views/index.d.ts +1 -0
  753. package/lib/typescript/src/views/types.d.ts +7 -2
  754. package/lib/typescript/src/web/LoadSkiaWeb.d.ts +2 -2
  755. package/package.json +6 -6
  756. package/src/renderer/HostConfig.ts +3 -4
  757. package/src/renderer/components/backdrop/BackdropFilter.tsx +1 -1
  758. package/src/renderer/processors/Animations/Animations.ts +11 -4
  759. package/src/renderer/typeddash.ts +3 -2
  760. package/src/values/web/RNSkComputedValue.ts +6 -1
  761. package/src/views/SkiaBaseWebView.tsx +177 -0
  762. package/src/views/SkiaPictureView.tsx +93 -0
  763. package/src/views/SkiaPictureView.web.tsx +23 -0
  764. package/src/views/SkiaView.tsx +6 -7
  765. package/src/views/SkiaView.web.tsx +18 -167
  766. package/src/views/index.ts +1 -0
  767. package/src/views/types.ts +9 -2
  768. package/android/cpp/jni/JniSkiaDrawView.cpp +0 -113
  769. package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +0 -73
  770. package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +0 -48
  771. package/cpp/rnskia/RNSkDrawView.cpp +0 -315
  772. package/cpp/rnskia/RNSkDrawView.h +0 -226
  773. package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +0 -52
  774. package/ios/RNSkia-iOS/SkiaDrawView.h +0 -23
@@ -18,6 +18,7 @@ enum JsiWrapperValueType
18
18
  Object,
19
19
  Function,
20
20
  Array,
21
+ HostObject,
21
22
  Unknown
22
23
  };
23
24
 
@@ -64,6 +65,10 @@ public:
64
65
  _type = JsiWrapperValueType::Array;
65
66
  _arrayValue = std::make_shared<jsi::Array>(_objectValue->asArray(runtime));
66
67
  _objectValue = nullptr;
68
+ } else if (_objectValue->isHostObject(runtime)) {
69
+ _type = JsiWrapperValueType::HostObject;
70
+ _hostObjectValue = _objectValue->asHostObject(runtime);
71
+ _objectValue = nullptr;
67
72
  }
68
73
  } else {
69
74
  throw std::runtime_error("Could not store jsi::Value of provided type");
@@ -110,6 +115,11 @@ public:
110
115
  return _objectValue;
111
116
  }
112
117
 
118
+ std::shared_ptr<jsi::HostObject> getAsHostObject() {
119
+ assert(_type == JsiWrapperValueType::HostObject);
120
+ return _hostObjectValue;
121
+ }
122
+
113
123
  JsiWrapperValueType getType() { return _type; }
114
124
 
115
125
  private:
@@ -121,6 +131,7 @@ private:
121
131
  std::shared_ptr<jsi::Object> _objectValue;
122
132
  std::shared_ptr<jsi::Function> _functionValue;
123
133
  std::shared_ptr<jsi::Array> _arrayValue;
134
+ std::shared_ptr<jsi::HostObject> _hostObjectValue;
124
135
 
125
136
  JsiWrapperValueType _type;
126
137
  };
@@ -9,6 +9,7 @@
9
9
  #include <jsi/jsi.h>
10
10
 
11
11
  #include <JsiHostObject.h>
12
+ #include <RNSkView.h>
12
13
 
13
14
  namespace RNSkia {
14
15
 
@@ -16,17 +17,6 @@ using namespace facebook;
16
17
  using namespace RNJsi;
17
18
  using namespace std::chrono;
18
19
 
19
- enum RNSkTouchType { Start, Active, End, Cancelled };
20
-
21
- using RNSkTouchPoint = struct {
22
- double x;
23
- double y;
24
- double force;
25
- RNSkTouchType type;
26
- size_t id;
27
- long timestamp;
28
- };
29
-
30
20
  class RNSkInfoObject : public JsiHostObject {
31
21
  public:
32
22
  JSI_PROPERTY_GET(width) { return _width; }
@@ -77,7 +67,7 @@ public:
77
67
 
78
68
  void endDrawOperation() { _touchesCache.clear(); }
79
69
 
80
- void updateTouches(std::vector<RNSkTouchPoint>&& touches) {
70
+ void updateTouches(std::vector<RNSkTouchInfo>& touches) {
81
71
  std::lock_guard<std::mutex> lock(_mutex);
82
72
  // Add timestamp
83
73
  auto ms = std::chrono::duration_cast<milliseconds>(
@@ -95,8 +85,8 @@ private:
95
85
  int _width;
96
86
  int _height;
97
87
  double _timestamp;
98
- std::vector<std::vector<RNSkTouchPoint>> _currentTouches;
99
- std::vector<std::vector<RNSkTouchPoint>> _touchesCache;
88
+ std::vector<std::vector<RNSkTouchInfo>> _currentTouches;
89
+ std::vector<std::vector<RNSkTouchInfo>> _touchesCache;
100
90
  std::mutex _mutex;
101
91
  };
102
92
  } // namespace RNSkia
@@ -0,0 +1,211 @@
1
+ #include "RNSkJsView.h"
2
+
3
+ namespace RNSkia
4
+ {
5
+
6
+ RNSkJsRenderer::RNSkJsRenderer(std::function<void()> requestRedraw,
7
+ std::shared_ptr<RNSkPlatformContext> context) :
8
+ RNSkRenderer(requestRedraw),
9
+ _jsiCanvas(std::make_shared<JsiSkCanvas>(context)),
10
+ _platformContext(std::move(context)),
11
+ _infoObject(std::make_shared<RNSkInfoObject>()),
12
+ _jsDrawingLock(std::make_shared<std::timed_mutex>()),
13
+ _gpuDrawingLock(std::make_shared<std::timed_mutex>()),
14
+ _jsTimingInfo("SKIA/JS"),
15
+ _gpuTimingInfo("SKIA/GPU") {
16
+ }
17
+
18
+ bool RNSkJsRenderer::tryRender(std::shared_ptr<RNSkCanvasProvider> canvasProvider) {
19
+ // We render on the javascript thread.
20
+ if(_jsDrawingLock->try_lock()) {
21
+ _platformContext->runOnJavascriptThread([weakSelf = weak_from_this(), canvasProvider](){
22
+ auto self = weakSelf.lock();
23
+ if(self) {
24
+ self->performDraw(canvasProvider);
25
+ }
26
+ });
27
+ return true;
28
+ } else {
29
+ #ifdef DEBUG
30
+ _jsTimingInfo.markSkipped();
31
+ #endif
32
+ return false;
33
+ }
34
+ };
35
+
36
+ void RNSkJsRenderer::renderImmediate(std::shared_ptr<RNSkCanvasProvider> canvasProvider) {
37
+ milliseconds ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
38
+ canvasProvider->renderToCanvas([&](SkCanvas* canvas) {
39
+ // Create jsi canvas
40
+ auto jsiCanvas = std::make_shared<JsiSkCanvas>(_platformContext);
41
+ jsiCanvas->setCanvas(canvas);
42
+
43
+ drawInJsiCanvas(std::move(jsiCanvas),
44
+ canvasProvider->getScaledWidth(),
45
+ canvasProvider->getScaledHeight(),
46
+ ms.count() / 1000);
47
+ });
48
+ };
49
+
50
+ void RNSkJsRenderer::setDrawCallback(std::shared_ptr<jsi::Function> drawCallback) {
51
+ _drawCallback = drawCallback;
52
+ }
53
+
54
+ std::shared_ptr<RNSkInfoObject> RNSkJsRenderer::getInfoObject() {
55
+ return _infoObject;
56
+ }
57
+
58
+ void RNSkJsRenderer::performDraw(std::shared_ptr<RNSkCanvasProvider> canvasProvider) {
59
+ // Start timing
60
+ _jsTimingInfo.beginTiming();
61
+
62
+ // Record the drawing operations on the JS thread so that we can
63
+ // move the actual drawing onto the render thread later
64
+ SkPictureRecorder recorder;
65
+ SkRTreeFactory factory;
66
+ SkCanvas* canvas = recorder.beginRecording(canvasProvider->getScaledWidth(),
67
+ canvasProvider->getScaledHeight(),
68
+ &factory);
69
+
70
+ _jsiCanvas->setCanvas(canvas);
71
+
72
+ // Get current milliseconds
73
+ milliseconds ms = duration_cast<milliseconds>(
74
+ system_clock::now().time_since_epoch());
75
+
76
+ try {
77
+ // Perform the javascript drawing
78
+ drawInJsiCanvas(_jsiCanvas,
79
+ canvasProvider->getScaledWidth(),
80
+ canvasProvider->getScaledHeight(),
81
+ ms.count() / 1000.0);
82
+
83
+ } catch(...) {
84
+ _jsTimingInfo.stopTiming();
85
+ _jsDrawingLock->unlock();
86
+ throw;
87
+ }
88
+
89
+ // Finish drawing operations
90
+ auto p = recorder.finishRecordingAsPicture();
91
+
92
+ _jsiCanvas->setCanvas(nullptr);
93
+
94
+ // Calculate duration
95
+ _jsTimingInfo.stopTiming();
96
+
97
+ if(_gpuDrawingLock->try_lock()) {
98
+
99
+ // Post drawing message to the render thread where the picture recorded
100
+ // will be sent to the GPU/backend for rendering to screen.
101
+ auto gpuLock = _gpuDrawingLock;
102
+ _platformContext->runOnRenderThread([weakSelf = weak_from_this(), p = std::move(p), gpuLock, canvasProvider]() {
103
+ auto self = weakSelf.lock();
104
+ if (self) {
105
+ // Draw the picture recorded on the real GPU canvas
106
+ self->_gpuTimingInfo.beginTiming();
107
+
108
+ canvasProvider->renderToCanvas([p = std::move(p)](SkCanvas* canvas) {
109
+ canvas->drawPicture(p);
110
+ });
111
+
112
+ self->_gpuTimingInfo.stopTiming();
113
+ }
114
+ // Unlock GPU drawing
115
+ gpuLock->unlock();
116
+ });
117
+ } else {
118
+ #ifdef DEBUG
119
+ _gpuTimingInfo.markSkipped();
120
+ #endif
121
+ // Request a new redraw since the last frame was skipped.
122
+ _requestRedraw();
123
+ }
124
+
125
+ // Unlock JS drawing
126
+ _jsDrawingLock->unlock();
127
+ }
128
+
129
+ void RNSkJsRenderer::callJsDrawCallback(std::shared_ptr<JsiSkCanvas> jsiCanvas,
130
+ int width,
131
+ int height,
132
+ double timestamp) {
133
+
134
+ if(_drawCallback == nullptr) {
135
+ return;
136
+ }
137
+
138
+ // Reset timing info
139
+ _jsTimingInfo.reset();
140
+ _gpuTimingInfo.reset();
141
+
142
+ auto runtime = _platformContext->getJsRuntime();
143
+
144
+ // Update info parameter
145
+ _infoObject->beginDrawOperation(width, height, timestamp);
146
+
147
+ // Set up arguments array
148
+ std::vector<jsi::Value> args(2);
149
+ args[0] = jsi::Object::createFromHostObject(*runtime, jsiCanvas);
150
+ args[1] = jsi::Object::createFromHostObject(*runtime, _infoObject);
151
+
152
+ // To be able to call the drawing function we'll wrap it once again
153
+ _drawCallback->call(*runtime,
154
+ static_cast<const jsi::Value *>(args.data()),
155
+ (size_t)2);
156
+
157
+ // Reset touches
158
+ _infoObject->endDrawOperation();
159
+
160
+ // Draw debug overlays
161
+ if (getShowDebugOverlays()) {
162
+
163
+ // Display average rendering timer
164
+ auto jsAvg = _jsTimingInfo.getAverage();
165
+ //auto jsFps = _jsTimingInfo.getFps();
166
+
167
+ auto gpuAvg = _gpuTimingInfo.getAverage();
168
+ //auto gpuFps = _gpuTimingInfo.getFps();
169
+
170
+ auto total = jsAvg + gpuAvg;
171
+
172
+ // Build string
173
+ std::ostringstream stream;
174
+ stream << "js: " << jsAvg << "ms gpu: " << gpuAvg << "ms " << " total: " << total << "ms";
175
+
176
+ std::string debugString = stream.str();
177
+
178
+ // Set up debug font/paints
179
+ auto font = SkFont();
180
+ font.setSize(14);
181
+ auto paint = SkPaint();
182
+ paint.setColor(SkColors::kRed);
183
+ jsiCanvas->getCanvas()->drawSimpleText(
184
+ debugString.c_str(), debugString.size(), SkTextEncoding::kUTF8, 8,
185
+ 18, font, paint);
186
+ }
187
+ }
188
+
189
+ void RNSkJsRenderer::drawInJsiCanvas(std::shared_ptr<JsiSkCanvas> jsiCanvas,
190
+ int width,
191
+ int height,
192
+ double time) {
193
+
194
+ // Call the draw drawCallback and perform js based drawing
195
+ auto skCanvas = jsiCanvas->getCanvas();
196
+ if (_drawCallback != nullptr && skCanvas != nullptr) {
197
+ // Make sure to scale correctly
198
+ auto pd = _platformContext->getPixelDensity();
199
+ skCanvas->save();
200
+ skCanvas->scale(pd, pd);
201
+
202
+ // Call draw function.
203
+ callJsDrawCallback(jsiCanvas, width / pd, height / pd, time);
204
+
205
+ // Restore and flush canvas
206
+ skCanvas->restore();
207
+ skCanvas->flush();
208
+ }
209
+ }
210
+
211
+ } // Namespace RNSkia
@@ -0,0 +1,115 @@
1
+ #pragma once
2
+
3
+ #include <functional>
4
+ #include <memory>
5
+ #include <mutex>
6
+ #include <vector>
7
+ #include <string>
8
+
9
+ #include <jsi/jsi.h>
10
+
11
+ #include <JsiValueWrapper.h>
12
+ #include <RNSkView.h>
13
+
14
+ #include <RNSkInfoParameter.h>
15
+ #include <RNSkPlatformContext.h>
16
+ #include <RNSkTimingInfo.h>
17
+ #include <RNSkLog.h>
18
+ #include <JsiSkCanvas.h>
19
+
20
+ #pragma clang diagnostic push
21
+ #pragma clang diagnostic ignored "-Wdocumentation"
22
+
23
+ #include <SkCanvas.h>
24
+ #include <SkBBHFactory.h>
25
+ #include <SkPictureRecorder.h>
26
+
27
+ #pragma clang diagnostic pop
28
+
29
+ class SkPicture;
30
+ class SkRect;
31
+ class SkImage;
32
+
33
+ namespace RNSkia {
34
+ class JsiSkCanvas;
35
+ using namespace facebook;
36
+
37
+ class RNSkJsRenderer:
38
+ public RNSkRenderer,
39
+ public std::enable_shared_from_this<RNSkJsRenderer> {
40
+ public:
41
+ RNSkJsRenderer(std::function<void()> requestRedraw,
42
+ std::shared_ptr<RNSkPlatformContext> context);
43
+
44
+ bool tryRender(std::shared_ptr<RNSkCanvasProvider> canvasProvider) override;
45
+
46
+ void renderImmediate(std::shared_ptr<RNSkCanvasProvider> canvasProvider) override;
47
+
48
+ void setDrawCallback(std::shared_ptr<jsi::Function> drawCallback);
49
+
50
+ std::shared_ptr<RNSkInfoObject> getInfoObject();
51
+
52
+ private:
53
+ void performDraw(std::shared_ptr<RNSkCanvasProvider> canvasProvider);
54
+
55
+ void callJsDrawCallback(std::shared_ptr<JsiSkCanvas> jsiCanvas,
56
+ int width,
57
+ int height,
58
+ double timestamp);
59
+
60
+ void drawInJsiCanvas(std::shared_ptr<JsiSkCanvas> jsiCanvas,
61
+ int width,
62
+ int height,
63
+ double time);
64
+
65
+ std::shared_ptr<RNSkPlatformContext> _platformContext;
66
+ std::shared_ptr<jsi::Function> _drawCallback;
67
+ std::shared_ptr<JsiSkCanvas> _jsiCanvas;
68
+ std::shared_ptr<std::timed_mutex> _jsDrawingLock;
69
+ std::shared_ptr<std::timed_mutex> _gpuDrawingLock;
70
+ std::shared_ptr<RNSkInfoObject> _infoObject;
71
+ RNSkTimingInfo _jsTimingInfo;
72
+ RNSkTimingInfo _gpuTimingInfo;
73
+ };
74
+
75
+ class RNSkJsView: public RNSkView {
76
+ public:
77
+ /**
78
+ * Constructor
79
+ */
80
+ RNSkJsView(std::shared_ptr<RNSkPlatformContext> context,
81
+ std::shared_ptr<RNSkCanvasProvider> canvasProvider):
82
+ RNSkView(context,
83
+ canvasProvider,
84
+ std::make_shared<RNSkJsRenderer>(std::bind(&RNSkJsView::requestRedraw, this), context)) {}
85
+
86
+ void updateTouchState(std::vector<RNSkTouchInfo>& touches) override {
87
+ std::static_pointer_cast<RNSkJsRenderer>(getRenderer())->getInfoObject()->updateTouches(touches);
88
+ RNSkView::updateTouchState(touches);
89
+ }
90
+
91
+ void setJsiProperties(std::unordered_map<std::string, JsiValueWrapper> &props) override {
92
+ for(auto& prop: props) {
93
+ if(prop.first == "drawCallback") {
94
+ if(prop.second.isUndefinedOrNull()) {
95
+ // Clear drawcallback
96
+ std::static_pointer_cast<RNSkJsRenderer>(getRenderer())->setDrawCallback(nullptr);
97
+ return;
98
+ } else if (prop.second.getType() != JsiWrapperValueType::Function) {
99
+ // We expect a function for the draw callback custom property
100
+ throw std::runtime_error("Expected a function for the drawCallback custom property.");
101
+ }
102
+
103
+ // Save callback
104
+ std::static_pointer_cast<RNSkJsRenderer>(getRenderer())->setDrawCallback(prop.second.getAsFunction());
105
+
106
+ // Request redraw
107
+ requestRedraw();
108
+
109
+ } else {
110
+ RNSkView::setJsiProperties(props);
111
+ }
112
+ }
113
+ }
114
+ };
115
+ } // namespace RNSkia
@@ -8,7 +8,7 @@
8
8
 
9
9
  #include <JsiHostObject.h>
10
10
  #include <JsiValueWrapper.h>
11
- #include <RNSkDrawView.h>
11
+ #include <RNSkView.h>
12
12
  #include <RNSkPlatformContext.h>
13
13
  #include <RNSkValue.h>
14
14
  #include <jsi/jsi.h>
@@ -20,7 +20,7 @@ using RNSkViewInfo = struct RNSkViewInfo {
20
20
  RNSkViewInfo() {
21
21
  view = nullptr;
22
22
  }
23
- std::shared_ptr<RNSkDrawView> view;
23
+ std::shared_ptr<RNSkView> view;
24
24
  std::unordered_map<std::string, JsiValueWrapper> props;
25
25
  };
26
26
 
@@ -243,7 +243,7 @@ public:
243
243
  // Unregister all views
244
244
  auto tempList = _viewInfos;
245
245
  for (const auto& info : tempList) {
246
- unregisterSkiaDrawView(info.first);
246
+ unregisterSkiaView(info.first);
247
247
  }
248
248
  std::lock_guard<std::mutex> lock(_mutex);
249
249
  _viewInfos.clear();
@@ -254,7 +254,7 @@ public:
254
254
  * @param nativeId Id of view to register
255
255
  * @param view View to register
256
256
  */
257
- void registerSkiaDrawView(size_t nativeId, std::shared_ptr<RNSkDrawView> view) {
257
+ void registerSkiaView(size_t nativeId, std::shared_ptr<RNSkView> view) {
258
258
  auto info = getEnsuredViewInfo(nativeId);
259
259
  std::lock_guard<std::mutex> lock(_mutex);
260
260
  info->view = view;
@@ -267,7 +267,7 @@ public:
267
267
  * Unregisters a Skia draw view
268
268
  * @param nativeId View id
269
269
  */
270
- void unregisterSkiaDrawView(size_t nativeId) {
270
+ void unregisterSkiaView(size_t nativeId) {
271
271
  if (_viewInfos.count(nativeId) == 0) {
272
272
  return;
273
273
  }
@@ -284,7 +284,7 @@ public:
284
284
  removed due to ex. a transition). The view can be set to a nullptr
285
285
  or a valid view, effectively toggling the view's availability.
286
286
  */
287
- void setSkiaDrawView(size_t nativeId, std::shared_ptr<RNSkDrawView> view) {
287
+ void setSkiaView(size_t nativeId, std::shared_ptr<RNSkView> view) {
288
288
  if (_viewInfos.find(nativeId) == _viewInfos.end()) {
289
289
  return;
290
290
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  #include <JsiSkApi.h>
9
9
  #include <RNSkJsiViewApi.h>
10
- #include <RNSkDrawView.h>
10
+ #include <RNSkView.h>
11
11
  #include <RNSkValueApi.h>
12
12
 
13
13
  namespace RNSkia {
@@ -45,19 +45,19 @@ void RNSkManager::invalidate() {
45
45
  _platformContext->invalidate();
46
46
  }
47
47
 
48
- void RNSkManager::registerSkiaDrawView(size_t nativeId, std::shared_ptr<RNSkDrawView> view) {
48
+ void RNSkManager::registerSkiaView(size_t nativeId, std::shared_ptr<RNSkView> view) {
49
49
  if (!_isInvalidated && _viewApi != nullptr)
50
- _viewApi->registerSkiaDrawView(nativeId, view);
50
+ _viewApi->registerSkiaView(nativeId, view);
51
51
  }
52
52
 
53
- void RNSkManager::unregisterSkiaDrawView(size_t nativeId) {
53
+ void RNSkManager::unregisterSkiaView(size_t nativeId) {
54
54
  if (!_isInvalidated && _viewApi != nullptr)
55
- _viewApi->unregisterSkiaDrawView(nativeId);
55
+ _viewApi->unregisterSkiaView(nativeId);
56
56
  }
57
57
 
58
- void RNSkManager::setSkiaDrawView(size_t nativeId, std::shared_ptr<RNSkDrawView> view) {
58
+ void RNSkManager::setSkiaView(size_t nativeId, std::shared_ptr<RNSkView> view) {
59
59
  if (!_isInvalidated && _viewApi != nullptr)
60
- _viewApi->setSkiaDrawView(nativeId, view);
60
+ _viewApi->setSkiaView(nativeId, view);
61
61
  }
62
62
 
63
63
  void RNSkManager::installBindings() {
@@ -12,7 +12,7 @@ namespace facebook {
12
12
  }
13
13
 
14
14
  namespace RNSkia {
15
- class RNSkDrawView;
15
+ class RNSkView;
16
16
  class RNSkJsiViewApi;
17
17
  using namespace facebook;
18
18
 
@@ -37,24 +37,24 @@ public:
37
37
  void invalidate();
38
38
 
39
39
  /**
40
- * Registers a RNSkDrawView with the given native id
40
+ * Registers a RNSkView with the given native id
41
41
  * @param nativeId Native view id
42
42
  * @param view View to register
43
43
  */
44
- void registerSkiaDrawView(size_t nativeId, std::shared_ptr<RNSkDrawView> view);
44
+ void registerSkiaView(size_t nativeId, std::shared_ptr<RNSkView> view);
45
45
 
46
46
  /**
47
- * Unregisters the RNSkDrawView from the list of registered views
47
+ * Unregisters the RNSkView from the list of registered views
48
48
  * @param nativeId Native view Id
49
49
  */
50
- void unregisterSkiaDrawView(size_t nativeId);
50
+ void unregisterSkiaView(size_t nativeId);
51
51
 
52
52
  /**
53
53
  Sets the view pointed to by nativeId to the provided value.
54
54
  Used when we want to remove a view without unregistering it
55
55
  - this happens typically on iOS.
56
56
  */
57
- void setSkiaDrawView(size_t nativeId, std::shared_ptr<RNSkDrawView> view);
57
+ void setSkiaView(size_t nativeId, std::shared_ptr<RNSkView> view);
58
58
 
59
59
  /**
60
60
  * @return The platform context
@@ -66,7 +66,7 @@ public:
66
66
  private:
67
67
  /**
68
68
  * Installs the javascript methods for registering/unregistering draw
69
- * callbacks for RNSkDrawViews. Called on installation of the parent native
69
+ * callbacks for RNSkViews. Called on installation of the parent native
70
70
  * module.
71
71
  */
72
72
  void installBindings();
@@ -0,0 +1,124 @@
1
+ #pragma once
2
+
3
+ #include <functional>
4
+ #include <memory>
5
+ #include <mutex>
6
+ #include <vector>
7
+ #include <string>
8
+
9
+ #include <jsi/jsi.h>
10
+
11
+ #include <JsiValueWrapper.h>
12
+ #include <RNSkView.h>
13
+
14
+ #include <RNSkInfoParameter.h>
15
+ #include <RNSkPlatformContext.h>
16
+ #include <RNSkTimingInfo.h>
17
+ #include <RNSkLog.h>
18
+ #include <JsiSkPicture.h>
19
+
20
+ #pragma clang diagnostic push
21
+ #pragma clang diagnostic ignored "-Wdocumentation"
22
+
23
+ #include <SkCanvas.h>
24
+ #include <SkBBHFactory.h>
25
+ #include <SkPictureRecorder.h>
26
+
27
+ #pragma clang diagnostic pop
28
+
29
+ class SkPicture;
30
+ class SkRect;
31
+ class SkImage;
32
+
33
+ namespace RNSkia {
34
+
35
+ using namespace facebook;
36
+
37
+ class RNSkPictureRenderer:
38
+ public RNSkRenderer,
39
+ public std::enable_shared_from_this<RNSkPictureRenderer> {
40
+ public:
41
+ RNSkPictureRenderer(std::function<void()> requestRedraw,
42
+ std::shared_ptr<RNSkPlatformContext> context):
43
+ RNSkRenderer(requestRedraw),
44
+ _platformContext(context) {}
45
+
46
+ bool tryRender(std::shared_ptr<RNSkCanvasProvider> canvasProvider) override {
47
+ performDraw(canvasProvider);
48
+ return true;
49
+ }
50
+
51
+ void renderImmediate(std::shared_ptr<RNSkCanvasProvider> canvasProvider) override {
52
+ performDraw(canvasProvider);
53
+ }
54
+
55
+ void setPicture(std::shared_ptr<jsi::HostObject> picture) {
56
+ if(picture == nullptr) {
57
+ _picture = nullptr;
58
+ return;
59
+ }
60
+
61
+ _picture = std::dynamic_pointer_cast<JsiSkPicture>(picture);
62
+ _requestRedraw();
63
+ }
64
+
65
+ private:
66
+ void performDraw(std::shared_ptr<RNSkCanvasProvider> canvasProvider) {
67
+ if(_picture == nullptr) {
68
+ return;
69
+ }
70
+
71
+ canvasProvider->renderToCanvas([=](SkCanvas* canvas){
72
+ // Make sure to scale correctly
73
+ auto pd = _platformContext->getPixelDensity();
74
+ canvas->save();
75
+ canvas->scale(pd, pd);
76
+
77
+ canvas->drawPicture(_picture->getObject());
78
+
79
+ // Restore and flush canvas
80
+ canvas->restore();
81
+ canvas->flush();
82
+ });
83
+ }
84
+
85
+ std::shared_ptr<RNSkPlatformContext> _platformContext;
86
+ std::shared_ptr<JsiSkPicture> _picture;
87
+ };
88
+
89
+ class RNSkPictureView: public RNSkView {
90
+ public:
91
+ /**
92
+ * Constructor
93
+ */
94
+ RNSkPictureView(std::shared_ptr<RNSkPlatformContext> context,
95
+ std::shared_ptr<RNSkCanvasProvider> canvasProvider):
96
+ RNSkView(context,
97
+ canvasProvider,
98
+ std::make_shared<RNSkPictureRenderer>(std::bind(&RNSkPictureView::requestRedraw, this), context)) {}
99
+
100
+ void setJsiProperties(std::unordered_map<std::string, JsiValueWrapper> &props) override {
101
+ for(auto& prop: props) {
102
+ if(prop.first == "picture") {
103
+ if(prop.second.isUndefinedOrNull()) {
104
+ // Clear picture
105
+ std::static_pointer_cast<RNSkPictureRenderer>(getRenderer())->setPicture(nullptr);
106
+ return;
107
+ } else if (prop.second.getType() != JsiWrapperValueType::HostObject) {
108
+ // We expect a function for the picture custom property
109
+ throw std::runtime_error("Expected an object for the picture custom property.");
110
+ }
111
+
112
+ // Save picture
113
+ std::static_pointer_cast<RNSkPictureRenderer>(getRenderer())->setPicture(prop.second.getAsHostObject());
114
+
115
+ // Request redraw
116
+ requestRedraw();
117
+
118
+ } else {
119
+ RNSkView::setJsiProperties(props);
120
+ }
121
+ }
122
+ }
123
+ };
124
+ } // namespace RNSkia