@shopify/react-native-skia 1.11.9-next.1 → 1.11.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/android/CMakeLists.txt +153 -30
  2. package/android/build.gradle +1 -1
  3. package/cpp/skia/include/codec/SkCodec.h +2 -7
  4. package/cpp/skia/include/config/SkUserConfig.h +0 -11
  5. package/cpp/skia/include/core/SkCanvas.h +7 -11
  6. package/cpp/skia/include/core/SkColor.h +0 -10
  7. package/cpp/skia/include/core/SkColorSpace.h +2 -184
  8. package/cpp/skia/include/core/SkColorType.h +32 -114
  9. package/cpp/skia/include/core/SkFontScanner.h +8 -5
  10. package/cpp/skia/include/core/SkFontStyle.h +1 -1
  11. package/cpp/skia/include/core/SkMaskFilter.h +8 -0
  12. package/cpp/skia/include/core/SkMilestone.h +1 -1
  13. package/cpp/skia/include/core/SkPath.h +1 -1
  14. package/cpp/skia/include/core/SkRRect.h +1 -3
  15. package/cpp/skia/include/core/SkShader.h +3 -3
  16. package/cpp/skia/include/core/SkString.h +8 -8
  17. package/cpp/skia/include/core/SkSurface.h +0 -14
  18. package/cpp/skia/include/core/SkTypeface.h +7 -24
  19. package/cpp/skia/include/effects/SkGradientShader.h +1 -6
  20. package/cpp/skia/include/effects/SkRuntimeEffect.h +0 -1
  21. package/cpp/skia/include/encode/SkPngEncoder.h +0 -14
  22. package/cpp/skia/include/gpu/GpuTypes.h +0 -9
  23. package/cpp/skia/include/gpu/ganesh/GrContextOptions.h +133 -135
  24. package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +0 -5
  25. package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkarounds.h +3 -3
  26. package/cpp/skia/include/gpu/ganesh/GrTypes.h +9 -14
  27. package/cpp/skia/include/gpu/graphite/Context.h +2 -25
  28. package/cpp/skia/include/gpu/graphite/ContextOptions.h +5 -23
  29. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +1 -20
  30. package/cpp/skia/include/gpu/graphite/Image.h +0 -1
  31. package/cpp/skia/include/gpu/graphite/Recorder.h +0 -6
  32. package/cpp/skia/include/gpu/graphite/Recording.h +1 -3
  33. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +36 -4
  34. package/cpp/skia/include/gpu/graphite/precompile/Precompile.h +2 -3
  35. package/cpp/skia/include/pathops/SkPathOps.h +1 -9
  36. package/cpp/skia/include/ports/SkFontMgr_FontConfigInterface.h +0 -3
  37. package/cpp/skia/include/private/SkPathRef.h +21 -15
  38. package/cpp/skia/include/private/base/SkAttributes.h +10 -16
  39. package/cpp/skia/include/private/base/SkMutex.h +0 -8
  40. package/cpp/skia/include/private/base/SkTArray.h +1 -1
  41. package/cpp/skia/include/private/base/SkTDArray.h +1 -1
  42. package/cpp/skia/include/private/base/SkTemplates.h +11 -24
  43. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +1 -1
  44. package/cpp/skia/include/sksl/SkSLDebugTrace.h +3 -0
  45. package/cpp/skia/modules/skcms/src/Transform_inl.h +20 -20
  46. package/cpp/skia/modules/skcms/src/skcms_Transform.h +3 -4
  47. package/cpp/skia/modules/skcms/src/skcms_public.h +15 -19
  48. package/cpp/skia/modules/skresources/include/SkResources.h +1 -3
  49. package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
  50. package/cpp/skia/modules/svg/include/SkSVGContainer.h +1 -1
  51. package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +1 -1
  52. package/cpp/skia/modules/svg/include/SkSVGImage.h +2 -2
  53. package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
  54. package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
  55. package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
  56. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +0 -2
  57. package/cpp/skia/modules/svg/include/SkSVGShape.h +0 -1
  58. package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
  59. package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +0 -4
  60. package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
  61. package/cpp/skia/src/core/SkLRUCache.h +13 -19
  62. package/cpp/skia/src/core/SkTHash.h +4 -50
  63. package/cpp/skia/src/gpu/ganesh/gl/GrGLDefines.h +0 -1
  64. package/lib/commonjs/external/reanimated/textures.js +3 -4
  65. package/lib/commonjs/external/reanimated/textures.js.map +1 -1
  66. package/lib/commonjs/headless/index.d.ts +1 -1
  67. package/lib/commonjs/headless/index.js +2 -2
  68. package/lib/commonjs/headless/index.js.map +1 -1
  69. package/lib/commonjs/renderer/Canvas.d.ts +2 -2
  70. package/lib/commonjs/renderer/Canvas.js +28 -11
  71. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  72. package/lib/commonjs/renderer/Offscreen.d.ts +2 -2
  73. package/lib/commonjs/renderer/Offscreen.js +4 -4
  74. package/lib/commonjs/renderer/Offscreen.js.map +1 -1
  75. package/lib/commonjs/renderer/__tests__/setup.d.ts +5 -5
  76. package/lib/commonjs/sksg/Container.d.ts +1 -3
  77. package/lib/commonjs/sksg/Container.js +1 -7
  78. package/lib/commonjs/sksg/Container.js.map +1 -1
  79. package/lib/commonjs/sksg/HostConfig.d.ts +1 -1
  80. package/lib/commonjs/sksg/HostConfig.js +6 -36
  81. package/lib/commonjs/sksg/HostConfig.js.map +1 -1
  82. package/lib/commonjs/sksg/HostConfig2.d.ts +19 -0
  83. package/lib/commonjs/sksg/HostConfig2.js +159 -0
  84. package/lib/commonjs/sksg/HostConfig2.js.map +1 -0
  85. package/lib/commonjs/sksg/Reconciler.d.ts +2 -3
  86. package/lib/commonjs/sksg/Reconciler.js +6 -16
  87. package/lib/commonjs/sksg/Reconciler.js.map +1 -1
  88. package/lib/module/Platform/Platform.web.js +1 -1
  89. package/lib/module/Platform/Platform.web.js.map +1 -1
  90. package/lib/module/dom/nodes/datatypes/Circle.js +2 -1
  91. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  92. package/lib/module/dom/nodes/datatypes/Gradient.js +3 -3
  93. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  94. package/lib/module/dom/nodes/datatypes/Rect.js +5 -3
  95. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  96. package/lib/module/external/reanimated/buffers.js +2 -1
  97. package/lib/module/external/reanimated/buffers.js.map +1 -1
  98. package/lib/module/external/reanimated/textures.js +4 -5
  99. package/lib/module/external/reanimated/textures.js.map +1 -1
  100. package/lib/module/external/reanimated/useAnimatedImageValue.js +1 -1
  101. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  102. package/lib/module/external/reanimated/useVideo.js +23 -10
  103. package/lib/module/external/reanimated/useVideo.js.map +1 -1
  104. package/lib/module/headless/index.d.ts +1 -1
  105. package/lib/module/headless/index.js +2 -2
  106. package/lib/module/headless/index.js.map +1 -1
  107. package/lib/module/renderer/Canvas.d.ts +2 -2
  108. package/lib/module/renderer/Canvas.js +28 -10
  109. package/lib/module/renderer/Canvas.js.map +1 -1
  110. package/lib/module/renderer/Offscreen.d.ts +2 -2
  111. package/lib/module/renderer/Offscreen.js +4 -4
  112. package/lib/module/renderer/Offscreen.js.map +1 -1
  113. package/lib/module/renderer/__tests__/setup.d.ts +5 -5
  114. package/lib/module/skia/core/Vector.js +1 -1
  115. package/lib/module/skia/core/Vector.js.map +1 -1
  116. package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js +4 -1
  117. package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js.map +1 -1
  118. package/lib/module/skia/web/Host.js +7 -1
  119. package/lib/module/skia/web/Host.js.map +1 -1
  120. package/lib/module/skia/web/JsiSkAnimatedImage.js +6 -3
  121. package/lib/module/skia/web/JsiSkAnimatedImage.js.map +1 -1
  122. package/lib/module/skia/web/JsiSkCanvas.js +6 -3
  123. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  124. package/lib/module/skia/web/JsiSkColorFilter.js +6 -3
  125. package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
  126. package/lib/module/skia/web/JsiSkContourMeasure.js +6 -3
  127. package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
  128. package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -3
  129. package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
  130. package/lib/module/skia/web/JsiSkData.js +6 -3
  131. package/lib/module/skia/web/JsiSkData.js.map +1 -1
  132. package/lib/module/skia/web/JsiSkFont.js +6 -3
  133. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  134. package/lib/module/skia/web/JsiSkImage.js +12 -8
  135. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  136. package/lib/module/skia/web/JsiSkImageFilter.js +6 -3
  137. package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
  138. package/lib/module/skia/web/JsiSkMaskFilter.js +6 -3
  139. package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
  140. package/lib/module/skia/web/JsiSkMatrix.js +8 -5
  141. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  142. package/lib/module/skia/web/JsiSkPaint.js +6 -3
  143. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  144. package/lib/module/skia/web/JsiSkParagraphBuilder.js +3 -2
  145. package/lib/module/skia/web/JsiSkParagraphBuilder.js.map +1 -1
  146. package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js +1 -1
  147. package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
  148. package/lib/module/skia/web/JsiSkParagraphStyle.js +15 -15
  149. package/lib/module/skia/web/JsiSkParagraphStyle.js.map +1 -1
  150. package/lib/module/skia/web/JsiSkPath.js +6 -3
  151. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  152. package/lib/module/skia/web/JsiSkPathEffect.js +6 -3
  153. package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
  154. package/lib/module/skia/web/JsiSkPicture.js +6 -3
  155. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  156. package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -3
  157. package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
  158. package/lib/module/skia/web/JsiSkPoint.js +6 -3
  159. package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
  160. package/lib/module/skia/web/JsiSkRRect.js +6 -3
  161. package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
  162. package/lib/module/skia/web/JsiSkRSXform.js +6 -3
  163. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  164. package/lib/module/skia/web/JsiSkRect.js +6 -3
  165. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  166. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -3
  167. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  168. package/lib/module/skia/web/JsiSkSVG.js +8 -5
  169. package/lib/module/skia/web/JsiSkSVG.js.map +1 -1
  170. package/lib/module/skia/web/JsiSkShader.js +6 -3
  171. package/lib/module/skia/web/JsiSkShader.js.map +1 -1
  172. package/lib/module/skia/web/JsiSkSurface.js +6 -3
  173. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  174. package/lib/module/skia/web/JsiSkTextBlob.js +6 -3
  175. package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
  176. package/lib/module/skia/web/JsiSkTypeface.js +6 -3
  177. package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
  178. package/lib/module/skia/web/JsiSkTypefaceFontProvider.js +4 -1
  179. package/lib/module/skia/web/JsiSkTypefaceFontProvider.js.map +1 -1
  180. package/lib/module/skia/web/JsiSkVertices.js +6 -3
  181. package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
  182. package/lib/module/skia/web/JsiVideo.js +5 -2
  183. package/lib/module/skia/web/JsiVideo.js.map +1 -1
  184. package/lib/module/sksg/Container.d.ts +1 -3
  185. package/lib/module/sksg/Container.js +8 -11
  186. package/lib/module/sksg/Container.js.map +1 -1
  187. package/lib/module/sksg/HostConfig.d.ts +1 -1
  188. package/lib/module/sksg/HostConfig.js +7 -36
  189. package/lib/module/sksg/HostConfig.js.map +1 -1
  190. package/lib/module/sksg/HostConfig2.d.ts +19 -0
  191. package/lib/module/sksg/HostConfig2.js +152 -0
  192. package/lib/module/sksg/HostConfig2.js.map +1 -0
  193. package/lib/module/sksg/Reconciler.d.ts +2 -3
  194. package/lib/module/sksg/Reconciler.js +11 -16
  195. package/lib/module/sksg/Reconciler.js.map +1 -1
  196. package/lib/module/sksg/Recorder/ReanimatedRecorder.js +5 -1
  197. package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  198. package/lib/module/sksg/Recorder/Recorder.js +6 -3
  199. package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
  200. package/lib/module/sksg/Recorder/Visitor.js +1 -1
  201. package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
  202. package/lib/module/sksg/Recorder/commands/Drawing.js +4 -2
  203. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
  204. package/lib/module/sksg/Recorder/commands/Shaders.js +3 -2
  205. package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -1
  206. package/lib/module/views/SkiaBaseWebView.js +12 -9
  207. package/lib/module/views/SkiaBaseWebView.js.map +1 -1
  208. package/lib/module/views/SkiaPictureView.js +5 -1
  209. package/lib/module/views/SkiaPictureView.js.map +1 -1
  210. package/lib/module/views/SkiaPictureView.web.js +4 -1
  211. package/lib/module/views/SkiaPictureView.web.js.map +1 -1
  212. package/lib/module/web/LoadSkiaWeb.js +2 -1
  213. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  214. package/lib/module/web/WithSkiaWeb.js +1 -1
  215. package/lib/module/web/WithSkiaWeb.js.map +1 -1
  216. package/lib/typescript/lib/commonjs/headless/index.d.ts +1 -1
  217. package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +1 -9
  218. package/lib/typescript/lib/commonjs/renderer/Offscreen.d.ts +2 -2
  219. package/lib/typescript/lib/commonjs/sksg/Container.d.ts +0 -3
  220. package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +4 -21
  221. package/lib/typescript/lib/commonjs/sksg/HostConfig2.d.ts +44 -0
  222. package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +2 -9
  223. package/lib/typescript/lib/module/headless/index.d.ts +1 -1
  224. package/lib/typescript/lib/module/renderer/Canvas.d.ts +1 -9
  225. package/lib/typescript/lib/module/renderer/Offscreen.d.ts +2 -2
  226. package/lib/typescript/lib/module/skia/web/CanvasKitWebGLBufferImpl.d.ts +2 -2
  227. package/lib/typescript/lib/module/skia/web/JsiSkAnimatedImage.d.ts +0 -1
  228. package/lib/typescript/lib/module/skia/web/JsiSkCanvas.d.ts +0 -1
  229. package/lib/typescript/lib/module/skia/web/JsiSkColorFilter.d.ts +0 -1
  230. package/lib/typescript/lib/module/skia/web/JsiSkContourMeasure.d.ts +0 -1
  231. package/lib/typescript/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +0 -1
  232. package/lib/typescript/lib/module/skia/web/JsiSkData.d.ts +0 -1
  233. package/lib/typescript/lib/module/skia/web/JsiSkFont.d.ts +0 -1
  234. package/lib/typescript/lib/module/skia/web/JsiSkImage.d.ts +0 -1
  235. package/lib/typescript/lib/module/skia/web/JsiSkImageFilter.d.ts +0 -1
  236. package/lib/typescript/lib/module/skia/web/JsiSkMaskFilter.d.ts +0 -1
  237. package/lib/typescript/lib/module/skia/web/JsiSkMatrix.d.ts +0 -1
  238. package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +0 -1
  239. package/lib/typescript/lib/module/skia/web/JsiSkPath.d.ts +0 -1
  240. package/lib/typescript/lib/module/skia/web/JsiSkPathEffect.d.ts +0 -1
  241. package/lib/typescript/lib/module/skia/web/JsiSkPicture.d.ts +0 -1
  242. package/lib/typescript/lib/module/skia/web/JsiSkPictureRecorder.d.ts +0 -1
  243. package/lib/typescript/lib/module/skia/web/JsiSkPoint.d.ts +0 -1
  244. package/lib/typescript/lib/module/skia/web/JsiSkRRect.d.ts +0 -1
  245. package/lib/typescript/lib/module/skia/web/JsiSkRSXform.d.ts +0 -1
  246. package/lib/typescript/lib/module/skia/web/JsiSkRect.d.ts +0 -1
  247. package/lib/typescript/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +0 -1
  248. package/lib/typescript/lib/module/skia/web/JsiSkSVG.d.ts +0 -1
  249. package/lib/typescript/lib/module/skia/web/JsiSkShader.d.ts +0 -1
  250. package/lib/typescript/lib/module/skia/web/JsiSkSurface.d.ts +0 -1
  251. package/lib/typescript/lib/module/skia/web/JsiSkTextBlob.d.ts +0 -1
  252. package/lib/typescript/lib/module/skia/web/JsiSkTypeface.d.ts +0 -1
  253. package/lib/typescript/lib/module/skia/web/JsiSkTypefaceFontProvider.d.ts +0 -1
  254. package/lib/typescript/lib/module/skia/web/JsiSkVertices.d.ts +0 -1
  255. package/lib/typescript/lib/module/skia/web/JsiVideo.d.ts +2 -2
  256. package/lib/typescript/lib/module/sksg/Container.d.ts +12 -7
  257. package/lib/typescript/lib/module/sksg/HostConfig.d.ts +4 -20
  258. package/lib/typescript/lib/module/sksg/HostConfig2.d.ts +43 -0
  259. package/lib/typescript/lib/module/sksg/Reconciler.d.ts +17 -18
  260. package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +0 -1
  261. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +2 -5
  262. package/lib/typescript/lib/module/views/SkiaBaseWebView.d.ts +11 -12
  263. package/lib/typescript/lib/module/views/SkiaPictureView.d.ts +2 -2
  264. package/lib/typescript/lib/module/views/SkiaPictureView.web.d.ts +1 -1
  265. package/lib/typescript/src/headless/index.d.ts +1 -1
  266. package/lib/typescript/src/renderer/Canvas.d.ts +2 -2
  267. package/lib/typescript/src/renderer/Offscreen.d.ts +2 -2
  268. package/lib/typescript/src/renderer/__tests__/setup.d.ts +5 -5
  269. package/lib/typescript/src/sksg/Container.d.ts +1 -3
  270. package/lib/typescript/src/sksg/HostConfig.d.ts +1 -1
  271. package/lib/typescript/src/sksg/HostConfig2.d.ts +19 -0
  272. package/lib/typescript/src/sksg/Reconciler.d.ts +2 -3
  273. package/package.json +9 -10
  274. package/src/external/reanimated/textures.tsx +4 -5
  275. package/src/headless/index.ts +2 -2
  276. package/src/renderer/Canvas.tsx +81 -57
  277. package/src/renderer/Offscreen.tsx +4 -4
  278. package/src/renderer/__tests__/Data.spec.tsx +10 -9
  279. package/src/renderer/__tests__/Drawings.spec.tsx +11 -11
  280. package/src/renderer/__tests__/FitBox.spec.tsx +10 -10
  281. package/src/renderer/__tests__/Glyphs.spec.tsx +2 -2
  282. package/src/renderer/__tests__/Image.spec.tsx +2 -2
  283. package/src/renderer/__tests__/Paths.spec.tsx +8 -8
  284. package/src/renderer/__tests__/Picture.spec.tsx +12 -10
  285. package/src/renderer/__tests__/Simple.spec.tsx +6 -6
  286. package/src/renderer/__tests__/Surfaces.spec.tsx +2 -2
  287. package/src/renderer/__tests__/Text.spec.tsx +12 -12
  288. package/src/renderer/__tests__/Transform.spec.tsx +8 -8
  289. package/src/renderer/__tests__/documentation/Group.spec.tsx +12 -12
  290. package/src/renderer/__tests__/documentation/getting-started/HelloWorld.spec.tsx +2 -2
  291. package/src/renderer/__tests__/documentation/paint/Overview.spec.tsx +8 -8
  292. package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx +4 -4
  293. package/src/renderer/__tests__/e2e/Atlas.spec.tsx +3 -3
  294. package/src/renderer/__tests__/e2e/Offscreen.spec.tsx +1 -1
  295. package/src/renderer/__tests__/examples/BlendModes.spec.tsx +4 -4
  296. package/src/renderer/__tests__/setup.tsx +13 -13
  297. package/src/sksg/Container.ts +1 -9
  298. package/src/sksg/HostConfig.ts +7 -37
  299. package/src/sksg/HostConfig2.ts +247 -0
  300. package/src/sksg/Reconciler.ts +6 -17
  301. package/src/sksg/__tests__/Simple.spec.tsx +8 -8
  302. package/cpp/skia/include/gpu/graphite/LogPriority.h +0 -36
  303. package/cpp/skia/include/gpu/graphite/PrecompileContext.h +0 -52
  304. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypesUtils.h +0 -48
@@ -9,9 +9,9 @@ import { Circle, FitBox, Rect, Image, Group, fitbox } from "../components";
9
9
  import { drawOnNode, width, height, importSkia } from "./setup";
10
10
 
11
11
  describe("FitBox", () => {
12
- it("Should scale the rectangle in half", async () => {
12
+ it("Should scale the rectangle in half", () => {
13
13
  const { Skia } = importSkia();
14
- const surface = await drawOnNode(
14
+ const surface = drawOnNode(
15
15
  <FitBox
16
16
  src={Skia.XYWHRect(0, 0, width, height)}
17
17
  dst={Skia.XYWHRect(width / 4, height / 4, width / 2, height / 2)}
@@ -21,9 +21,9 @@ describe("FitBox", () => {
21
21
  );
22
22
  processResult(surface, "snapshots/drawings/lightblue-rect.png");
23
23
  });
24
- it("Should take the bottom right quarter of the circle and scale to the full canvas", async () => {
24
+ it("Should take the bottom right quarter of the circle and scale to the full canvas", () => {
25
25
  const { Skia } = importSkia();
26
- const surface = await drawOnNode(
26
+ const surface = drawOnNode(
27
27
  <FitBox
28
28
  src={Skia.XYWHRect(width / 2, height / 2, width / 2, height / 2)}
29
29
  dst={Skia.XYWHRect(0, 0, width, height)}
@@ -38,7 +38,7 @@ describe("FitBox", () => {
38
38
  );
39
39
  processResult(surface, "snapshots/drawings/lightblue-quarter-circle.png");
40
40
  });
41
- it("Should scale the image (1)", async () => {
41
+ it("Should scale the image (1)", () => {
42
42
  const { Skia, rect } = importSkia();
43
43
  const image = Skia.Image.MakeImageFromEncoded(
44
44
  Skia.Data.fromBytes(
@@ -47,7 +47,7 @@ describe("FitBox", () => {
47
47
  )
48
48
  )
49
49
  )!;
50
- const surface = await drawOnNode(
50
+ const surface = drawOnNode(
51
51
  <Group
52
52
  transform={fitbox(
53
53
  "cover",
@@ -66,7 +66,7 @@ describe("FitBox", () => {
66
66
  );
67
67
  processResult(surface, "snapshots/drawings/scaled-image.png");
68
68
  });
69
- it("Should scale the image (2)", async () => {
69
+ it("Should scale the image (2)", () => {
70
70
  const { Skia, rect } = importSkia();
71
71
  const image = Skia.Image.MakeImageFromEncoded(
72
72
  Skia.Data.fromBytes(
@@ -76,7 +76,7 @@ describe("FitBox", () => {
76
76
  )
77
77
  )!;
78
78
  const screen = rect(256, 128, 256, 512);
79
- const surface = await drawOnNode(
79
+ const surface = drawOnNode(
80
80
  <Group>
81
81
  <Image
82
82
  image={image}
@@ -95,7 +95,7 @@ describe("FitBox", () => {
95
95
  );
96
96
  processResult(surface, "snapshots/drawings/scaled-image2.png");
97
97
  });
98
- it("Should rotate and scale the image", async () => {
98
+ it("Should rotate and scale the image", () => {
99
99
  const { Skia, rect } = importSkia();
100
100
  const image = Skia.Image.MakeImageFromEncoded(
101
101
  Skia.Data.fromBytes(
@@ -107,7 +107,7 @@ describe("FitBox", () => {
107
107
  const screen = rect(256, 128, 256, 512);
108
108
  const imageRect = rect(0, 0, image.width(), image.height());
109
109
  const transform = fitbox("contain", imageRect, screen, 270);
110
- const surface = await drawOnNode(
110
+ const surface = drawOnNode(
111
111
  <Group>
112
112
  <Image
113
113
  image={image}
@@ -25,7 +25,7 @@ describe("Glyphs", () => {
25
25
  font = Skia.Font(tf!, 64);
26
26
  expect(font !== null).toBe(true);
27
27
  });
28
- it("Should draw glyphs in lightblue", async () => {
28
+ it("Should draw glyphs in lightblue", () => {
29
29
  const { Skia } = importSkia();
30
30
  const ids = font.getGlyphIDs("ab");
31
31
  const glyphs = [
@@ -38,7 +38,7 @@ describe("Glyphs", () => {
38
38
  ),
39
39
  },
40
40
  ];
41
- const surface = await drawOnNode(
41
+ const surface = drawOnNode(
42
42
  <Glyphs x={0} y={0} font={font} glyphs={glyphs} color="lightblue" />
43
43
  );
44
44
  processResult(surface, "snapshots/glyphs/simple.png");
@@ -9,7 +9,7 @@ import { Fill, ImageShader, Shader } from "../components";
9
9
  import { drawOnNode, width, height, importSkia } from "./setup";
10
10
 
11
11
  describe("Test Image Component", () => {
12
- it("Should display the image with a filter", async () => {
12
+ it("Should display the image with a filter", () => {
13
13
  const { Skia } = importSkia();
14
14
  const image = Skia.Image.MakeImageFromEncoded(
15
15
  Skia.Data.fromBytes(
@@ -26,7 +26,7 @@ half4 main(float2 xy) {
26
26
  xy.x += sin(xy.y / r) * 4;
27
27
  return image.eval(xy).rbga;
28
28
  }`)!;
29
- const surface = await drawOnNode(
29
+ const surface = drawOnNode(
30
30
  <Fill>
31
31
  <Shader source={filter} uniforms={{ r: 50 }}>
32
32
  <ImageShader
@@ -8,7 +8,7 @@ import { drawOnNode, width, importSkia } from "./setup";
8
8
  const size = width;
9
9
 
10
10
  describe("Path Examples", () => {
11
- it("Should draw an arc", async () => {
11
+ it("Should draw an arc", () => {
12
12
  const { Skia } = importSkia();
13
13
  const path = Skia.Path.Make();
14
14
  const arcRect = {
@@ -18,11 +18,11 @@ describe("Path Examples", () => {
18
18
  height: size,
19
19
  };
20
20
  path.addArc(arcRect, 45, 270);
21
- const surface = await drawOnNode(<Path path={path} color="lightblue" />);
21
+ const surface = drawOnNode(<Path path={path} color="lightblue" />);
22
22
  processResult(surface, "snapshots/paths/arc.png");
23
23
  });
24
24
 
25
- it("Should draw an oval", async () => {
25
+ it("Should draw an oval", () => {
26
26
  const { Skia } = importSkia();
27
27
  const path = Skia.Path.Make();
28
28
  const rct = {
@@ -32,11 +32,11 @@ describe("Path Examples", () => {
32
32
  height: size,
33
33
  };
34
34
  path.addOval(rct);
35
- const surface = await drawOnNode(<Path path={path} color="lightblue" />);
35
+ const surface = drawOnNode(<Path path={path} color="lightblue" />);
36
36
  processResult(surface, "snapshots/paths/oval.png");
37
37
  });
38
38
 
39
- it("Should draw an rounded rectangle", async () => {
39
+ it("Should draw an rounded rectangle", () => {
40
40
  const { Skia } = importSkia();
41
41
  const path = Skia.Path.Make();
42
42
  path.addRRect({
@@ -49,11 +49,11 @@ describe("Path Examples", () => {
49
49
  rx: size / 4,
50
50
  ry: size / 4,
51
51
  });
52
- const surface = await drawOnNode(<Path path={path} color="lightblue" />);
52
+ const surface = drawOnNode(<Path path={path} color="lightblue" />);
53
53
  processResult(surface, "snapshots/paths/rrect.png");
54
54
  });
55
55
 
56
- it("Should draw a polygon", async () => {
56
+ it("Should draw a polygon", () => {
57
57
  const { Skia, vec } = importSkia();
58
58
  const path = Skia.Path.Make();
59
59
  const r = size / 4;
@@ -67,7 +67,7 @@ describe("Path Examples", () => {
67
67
  true
68
68
  );
69
69
 
70
- const surface = await drawOnNode(
70
+ const surface = drawOnNode(
71
71
  <Path path={path} strokeWidth={4} style="stroke" color="lightblue" />
72
72
  );
73
73
  processResult(surface, "snapshots/paths/poly.png");
@@ -4,7 +4,7 @@ import { processResult } from "../../__tests__/setup";
4
4
  import { Fill, Picture, Group } from "../components";
5
5
 
6
6
  import type { EmptyProps } from "./setup";
7
- import { importSkia, mountCanvas, wait, width } from "./setup";
7
+ import { wait, importSkia, mountCanvas, width } from "./setup";
8
8
 
9
9
  const CheckPicture = ({}: EmptyProps) => {
10
10
  const { createPicture, Skia } = importSkia();
@@ -22,7 +22,9 @@ const CheckPicture = ({}: EmptyProps) => {
22
22
  paint.setColor(Skia.Color(color));
23
23
  canvas.drawCircle(r, r, r, paint);
24
24
  }),
25
- [Skia, color, createPicture, r]
25
+ // In a non-test environment, createPicture and Skia will be top-level, not part of the array
26
+ // eslint-disable-next-line react-hooks/exhaustive-deps
27
+ [color]
26
28
  );
27
29
  return (
28
30
  <Group>
@@ -61,20 +63,20 @@ const CheckPicture2 = ({}: EmptyProps) => {
61
63
 
62
64
  describe("Picture", () => {
63
65
  it("should respect dependency array", async () => {
64
- const { surface, draw } = await mountCanvas(<CheckPicture />);
65
- await draw();
66
+ const { surface, draw } = mountCanvas(<CheckPicture />);
67
+ draw();
66
68
  processResult(surface, "snapshots/pictures/green.png");
67
- await wait(1000);
68
- await draw();
69
+ await wait(32);
70
+ draw();
69
71
  processResult(surface, "snapshots/pictures/red.png");
70
72
  });
71
73
 
72
74
  it("should not redraw if there are no dependency", async () => {
73
- const { surface, draw } = await mountCanvas(<CheckPicture2 />);
74
- await draw();
75
+ const { surface, draw } = mountCanvas(<CheckPicture2 />);
76
+ draw();
75
77
  processResult(surface, "snapshots/pictures/green.png");
76
- await wait(1000);
77
- await draw();
78
+ await wait(32);
79
+ draw();
78
80
  processResult(surface, "snapshots/pictures/green.png");
79
81
  });
80
82
  });
@@ -12,8 +12,8 @@ describe("Renderer", () => {
12
12
  it("Loads renderer without Skia", () => {
13
13
  expect(SkiaRenderer).toBeDefined();
14
14
  });
15
- it("Light blue rectangle", async () => {
16
- const surface = await drawOnNode(
15
+ it("Light blue rectangle", () => {
16
+ const surface = drawOnNode(
17
17
  <Rect
18
18
  x={(width - size) / 2}
19
19
  y={(width - size) / 2}
@@ -24,10 +24,10 @@ describe("Renderer", () => {
24
24
  );
25
25
  processResult(surface, "snapshots/drawings/lightblue-rect.png");
26
26
  });
27
- it("Scaled light blue rectangle", async () => {
27
+ it("Scaled light blue rectangle", () => {
28
28
  const scale = 2;
29
29
  const scaled = size / scale;
30
- const surface = await drawOnNode(
30
+ const surface = drawOnNode(
31
31
  <Group transform={[{ scale }]} origin={center}>
32
32
  <Rect
33
33
  x={(width - scaled) / 2}
@@ -40,7 +40,7 @@ describe("Renderer", () => {
40
40
  );
41
41
  processResult(surface, "snapshots/drawings/lightblue-rect.png");
42
42
  });
43
- it("Points", async () => {
43
+ it("Points", () => {
44
44
  const { vec } = importSkia();
45
45
  const c = { x: width / 2, y: size / 2 + 16 };
46
46
  const S = 25;
@@ -69,7 +69,7 @@ describe("Renderer", () => {
69
69
  ];
70
70
 
71
71
  const cubics = [...c1, ...c2, ...c3, ...c4];
72
- const surface = await drawOnNode(
72
+ const surface = drawOnNode(
73
73
  <Group color="#61DAFB" style="stroke" strokeWidth={3}>
74
74
  <Points mode="polygon" points={cubics} />
75
75
  <Line p1={c} p2={vec(size, 0)} />
@@ -51,11 +51,11 @@ describe("Surface", () => {
51
51
  surface.dispose();
52
52
  }
53
53
  });
54
- it("A raster surface shouldn't leak (3)", async () => {
54
+ it("A raster surface shouldn't leak (3)", () => {
55
55
  for (let i = 0; i < 10; i++) {
56
56
  //const t = performance.now();
57
57
  const r = 128;
58
- const surface = await drawOnNode(
58
+ const surface = drawOnNode(
59
59
  <>
60
60
  <Group blendMode="multiply">
61
61
  <Circle cx={r} cy={r} r={r} color="cyan" />
@@ -16,9 +16,9 @@ import {
16
16
  } from "./setup";
17
17
 
18
18
  describe("Test different text examples", () => {
19
- it("Should draw Hello World", async () => {
19
+ it("Should draw Hello World", () => {
20
20
  const font = loadFont("skia/__tests__/assets/Roboto-Medium.ttf");
21
- const surface = await drawOnNode(
21
+ const surface = drawOnNode(
22
22
  <>
23
23
  <Fill color="white" />
24
24
  <Text x={0} y={fontSize} font={font} text="Hello World" />
@@ -27,13 +27,13 @@ describe("Test different text examples", () => {
27
27
  processResult(surface, docPath("text/hello-world.png"));
28
28
  });
29
29
 
30
- it("Should draw Hello World vertically", async () => {
30
+ it("Should draw Hello World vertically", () => {
31
31
  const font = loadFont("skia/__tests__/assets/Roboto-Medium.ttf");
32
32
  const { Skia } = importSkia();
33
33
  const glyphs = font
34
34
  .getGlyphIDs("Hello World!")
35
35
  .map((id, i) => ({ id, pos: Skia.Point(0, (i + 1) * fontSize) }));
36
- const surface = await drawOnNode(
36
+ const surface = drawOnNode(
37
37
  <>
38
38
  <Fill color="white" />
39
39
  <Glyphs font={font} glyphs={glyphs} />
@@ -42,13 +42,13 @@ describe("Test different text examples", () => {
42
42
  processResult(surface, docPath("text/hello-world-vertical.png"));
43
43
  });
44
44
 
45
- it("Should render the text around a circle", async () => {
45
+ it("Should render the text around a circle", () => {
46
46
  const font = loadFont("skia/__tests__/assets/Roboto-Medium.ttf");
47
47
  const { Skia } = importSkia();
48
48
  const path = Skia.Path.Make();
49
49
  const r = width / 2;
50
50
  path.addCircle(r, r, r / 2);
51
- const surface = await drawOnNode(
51
+ const surface = drawOnNode(
52
52
  <>
53
53
  <Fill color="white" />
54
54
  <Group transform={[{ rotate: Math.PI }]} origin={Skia.Point(r, r)}>
@@ -59,11 +59,11 @@ describe("Test different text examples", () => {
59
59
  processResult(surface, docPath("text/text-path.png"));
60
60
  });
61
61
 
62
- it("Should render a text blob", async () => {
62
+ it("Should render a text blob", () => {
63
63
  const font = loadFont("skia/__tests__/assets/Roboto-Medium.ttf");
64
64
  const { Skia } = importSkia();
65
65
  const blob = Skia.TextBlob.MakeFromText("Hello World!", font);
66
- const surface = await drawOnNode(
66
+ const surface = drawOnNode(
67
67
  <>
68
68
  <Fill color="white" />
69
69
  <TextBlob blob={blob} y={fontSize} x={0} />
@@ -72,7 +72,7 @@ describe("Test different text examples", () => {
72
72
  processResult(surface, docPath("text/text-blob.png"));
73
73
  });
74
74
 
75
- it("Should render text with Emojis", async () => {
75
+ it("Should render text with Emojis", () => {
76
76
  const { Skia } = importSkia();
77
77
  const data = Skia.Data.fromBytes(
78
78
  fs.readFileSync(
@@ -85,7 +85,7 @@ describe("Test different text examples", () => {
85
85
  const tf = Skia.Typeface.MakeFreeTypeFaceFromData(data)!;
86
86
  expect(tf).toBeTruthy();
87
87
  const emojiFont = Skia.Font(tf, fontSize);
88
- const surface = await drawOnNode(
88
+ const surface = drawOnNode(
89
89
  <>
90
90
  <Fill color="white" />
91
91
  <Text text="🙋🌎" font={emojiFont} y={fontSize} x={0} />
@@ -94,7 +94,7 @@ describe("Test different text examples", () => {
94
94
  processResult(surface, docPath("text/text-emoji.png"));
95
95
  });
96
96
 
97
- it("Should calculate chinese text width correctly", async () => {
97
+ it("Should calculate chinese text width correctly", () => {
98
98
  const { Skia } = importSkia();
99
99
  const data = Skia.Data.fromBytes(
100
100
  fs.readFileSync(
@@ -109,7 +109,7 @@ describe("Test different text examples", () => {
109
109
  const font = Skia.Font(tf, fontSize);
110
110
  const text = "欢迎";
111
111
  const padding = 16;
112
- const surface = await drawOnNode(
112
+ const surface = drawOnNode(
113
113
  <>
114
114
  <Text
115
115
  text={text}
@@ -10,18 +10,18 @@ describe("Renderer", () => {
10
10
  it("Loads renderer without Skia", () => {
11
11
  expect(SkiaRenderer).toBeDefined();
12
12
  });
13
- it("Scale with origin", async () => {
13
+ it("Scale with origin", () => {
14
14
  const { Skia } = importSkia();
15
15
  const size = width;
16
16
  const origin = Skia.Point(size / 2, size / 2);
17
- const surface = await drawOnNode(
17
+ const surface = drawOnNode(
18
18
  <Group transform={[{ scale: 0.5 }]} origin={origin}>
19
19
  <Rect x={0} y={0} width={size} height={size} color="lightblue" />
20
20
  </Group>
21
21
  );
22
22
  processResult(surface, "snapshots/transform/scale-origin.png");
23
23
  });
24
- it("Scale with origin using a matrix", async () => {
24
+ it("Scale with origin using a matrix", () => {
25
25
  const { Skia } = importSkia();
26
26
  const size = width;
27
27
  const matrix = Skia.Matrix();
@@ -31,32 +31,32 @@ describe("Renderer", () => {
31
31
  .scale(0.5)
32
32
  .translate(-origin.x, -origin.y);
33
33
  expect(matrix.get()).toStrictEqual([0.5, 0, 192, 0, 0.5, 192, 0, 0, 1]);
34
- const surface = await drawOnNode(
34
+ const surface = drawOnNode(
35
35
  <Group matrix={matrix}>
36
36
  <Rect x={0} y={0} width={size} height={size} color="lightblue" />
37
37
  </Group>
38
38
  );
39
39
  processResult(surface, "snapshots/transform/scale-origin.png");
40
40
  });
41
- it("Scale with matrix and origin", async () => {
41
+ it("Scale with matrix and origin", () => {
42
42
  const { Skia } = importSkia();
43
43
  const size = width;
44
44
  const matrix = Skia.Matrix();
45
45
  const origin = Skia.Point(size / 2, size / 2);
46
46
  matrix.scale(0.5);
47
- const surface = await drawOnNode(
47
+ const surface = drawOnNode(
48
48
  <Group matrix={matrix} origin={origin}>
49
49
  <Rect x={0} y={0} width={size} height={size} color="lightblue" />
50
50
  </Group>
51
51
  );
52
52
  processResult(surface, "snapshots/transform/scale-origin.png");
53
53
  });
54
- it("Should rotate a rectangle to 180deg", async () => {
54
+ it("Should rotate a rectangle to 180deg", () => {
55
55
  const { Skia } = importSkia();
56
56
  const size = width;
57
57
  const origin = Skia.Point(size / 2, size / 2);
58
58
  const w = size / 4;
59
- const surface = await drawOnNode(
59
+ const surface = drawOnNode(
60
60
  <Group transform={[{ rotate: Math.PI }]} origin={origin}>
61
61
  <Rect
62
62
  x={origin.x - w / 2}
@@ -51,12 +51,12 @@ const TestRasterization = () => {
51
51
  };
52
52
 
53
53
  describe("Group", () => {
54
- it("Should use a rectangle as a clip", async () => {
54
+ it("Should use a rectangle as a clip", () => {
55
55
  const image = loadImage("skia/__tests__/assets/oslo.jpg");
56
56
  const { rect } = importSkia();
57
57
  expect(image).toBeTruthy();
58
58
  const rct = rect(padding, padding, size - padding * 2, size - padding * 2);
59
- const surface = await drawOnNode(
59
+ const surface = drawOnNode(
60
60
  <>
61
61
  <Fill color="lightblue" />
62
62
  <Group clip={rct}>
@@ -73,7 +73,7 @@ describe("Group", () => {
73
73
  );
74
74
  processResult(surface, docPath("group/clip-rect.png"));
75
75
  });
76
- it("Should use a rounded rectangle as a clip", async () => {
76
+ it("Should use a rounded rectangle as a clip", () => {
77
77
  const image = loadImage("skia/__tests__/assets/oslo.jpg");
78
78
  const { rect, rrect } = importSkia();
79
79
  expect(image).toBeTruthy();
@@ -82,7 +82,7 @@ describe("Group", () => {
82
82
  r,
83
83
  r
84
84
  );
85
- const surface = await drawOnNode(
85
+ const surface = drawOnNode(
86
86
  <Group clip={rct}>
87
87
  <Image
88
88
  image={image}
@@ -96,7 +96,7 @@ describe("Group", () => {
96
96
  );
97
97
  processResult(surface, docPath("group/clip-rrect.png"));
98
98
  });
99
- it("Should use a path as a clip", async () => {
99
+ it("Should use a path as a clip", () => {
100
100
  const image = loadImage("skia/__tests__/assets/oslo.jpg");
101
101
  const { processTransform2d, Skia } = importSkia();
102
102
  expect(image).toBeTruthy();
@@ -105,7 +105,7 @@ describe("Group", () => {
105
105
  )!;
106
106
  expect(star).toBeTruthy();
107
107
  star.transform(processTransform2d([{ scale: 3 }]));
108
- const surface = await drawOnNode(
108
+ const surface = drawOnNode(
109
109
  <Group clip={star}>
110
110
  <Image
111
111
  image={image}
@@ -119,7 +119,7 @@ describe("Group", () => {
119
119
  );
120
120
  processResult(surface, docPath("group/clip-path.png"));
121
121
  });
122
- it("Should invert a clip", async () => {
122
+ it("Should invert a clip", () => {
123
123
  const image = loadImage("skia/__tests__/assets/oslo.jpg");
124
124
  const { processTransform2d, Skia } = importSkia();
125
125
  expect(image).toBeTruthy();
@@ -128,7 +128,7 @@ describe("Group", () => {
128
128
  )!;
129
129
  expect(star).toBeTruthy();
130
130
  star.transform(processTransform2d([{ scale: 3 }]));
131
- const surface = await drawOnNode(
131
+ const surface = drawOnNode(
132
132
  <Group clip={star} invertClip>
133
133
  <Image
134
134
  image={image}
@@ -142,7 +142,7 @@ describe("Group", () => {
142
142
  );
143
143
  processResult(surface, docPath("group/invert-clip.png"));
144
144
  });
145
- it("Should scale an SVG Path properly", async () => {
145
+ it("Should scale an SVG Path properly", () => {
146
146
  const { rect, Skia } = importSkia();
147
147
  const svgPath =
148
148
  // eslint-disable-next-line max-len
@@ -151,7 +151,7 @@ describe("Group", () => {
151
151
  expect(path).toBeTruthy();
152
152
  const src = path.computeTightBounds();
153
153
  const strokeWidth = 30 * PIXEL_RATIO;
154
- const surface = await drawOnNode(
154
+ const surface = drawOnNode(
155
155
  <FitBox src={src} dst={rect(0, 0, width, height)}>
156
156
  <Path
157
157
  path={path}
@@ -164,8 +164,8 @@ describe("Group", () => {
164
164
  );
165
165
  processResult(surface, docPath("group/scale-path.png"));
166
166
  });
167
- it("Should use saveLayer() properly", async () => {
168
- const surface = await drawOnNode(<TestRasterization />);
167
+ it("Should use saveLayer() properly", () => {
168
+ const surface = drawOnNode(<TestRasterization />);
169
169
  processResult(surface, docPath("group/rasterize.png"));
170
170
  });
171
171
  });
@@ -35,8 +35,8 @@ describe("Getting Started / Hello World", () => {
35
35
  docPath("getting-started/hello-world/blend-modes.png")
36
36
  );
37
37
  });
38
- it("Hello world with the declarative API", async () => {
39
- const surface = await drawOnNode(
38
+ it("Hello world with the declarative API", () => {
39
+ const surface = drawOnNode(
40
40
  <Group blendMode="multiply">
41
41
  <Circle cx={r} cy={r} r={r} color="cyan" />
42
42
  <Circle cx={size - r} cy={r} r={r} color="magenta" />
@@ -19,12 +19,12 @@ const TestPaintAssignment = () => {
19
19
  };
20
20
 
21
21
  describe("Paint", () => {
22
- it("should draw the color fill and strokes properly", async () => {
22
+ it("should draw the color fill and strokes properly", () => {
23
23
  const { vec } = importSkia();
24
24
  const strokeWidth = 10 * PIXEL_RATIO;
25
25
  const c = vec(width / 2, height / 2);
26
26
  const r = (width - strokeWidth) / 2;
27
- const surface = await drawOnNode(
27
+ const surface = drawOnNode(
28
28
  <>
29
29
  <Circle c={c} r={r} color="red">
30
30
  <Paint color="lightblue" />
@@ -36,10 +36,10 @@ describe("Paint", () => {
36
36
  processResult(surface, docPath("paint/stroke.png"));
37
37
  });
38
38
 
39
- it("should use paint inheritance properly", async () => {
39
+ it("should use paint inheritance properly", () => {
40
40
  const r = width / 6;
41
41
  const strokeWidth = 10 * PIXEL_RATIO;
42
- const surface = await drawOnNode(
42
+ const surface = drawOnNode(
43
43
  <Group color="lightblue">
44
44
  <Circle cx={r} cy={r} r={r} />
45
45
  <Group style="stroke" strokeWidth={strokeWidth}>
@@ -50,17 +50,17 @@ describe("Paint", () => {
50
50
  processResult(surface, docPath("paint/inheritance.png"));
51
51
  });
52
52
 
53
- it("should use paint assignement properly", async () => {
54
- const surface = await drawOnNode(<TestPaintAssignment />);
53
+ it("should use paint assignement properly", () => {
54
+ const surface = drawOnNode(<TestPaintAssignment />);
55
55
  processResult(surface, docPath("paint/assignement.png"));
56
56
  });
57
57
 
58
- it("should use the opacity property properly", async () => {
58
+ it("should use the opacity property properly", () => {
59
59
  const { vec } = importSkia();
60
60
  const strokeWidth = 30 * PIXEL_RATIO;
61
61
  const r = width / 2 - strokeWidth / 2;
62
62
  const c = vec(width / 2, height / 2);
63
- const surface = await drawOnNode(
63
+ const surface = drawOnNode(
64
64
  <Group opacity={0.5}>
65
65
  <Circle c={c} r={r} color="red" />
66
66
  <Circle
@@ -5,11 +5,11 @@ import { docPath, processResult } from "../../../../__tests__/setup";
5
5
  import { Box, BoxShadow, Fill } from "../../../components";
6
6
 
7
7
  describe("Box", () => {
8
- it("should draw a box with inner and outer shadow", async () => {
8
+ it("should draw a box with inner and outer shadow", () => {
9
9
  const { rect, rrect } = importSkia();
10
10
  const size = width / 2;
11
11
  const d = 10 * PIXEL_RATIO;
12
- const surface = await drawOnNode(
12
+ const surface = drawOnNode(
13
13
  <>
14
14
  <Fill color="#add8e6" />
15
15
  <Box
@@ -29,9 +29,9 @@ describe("Box", () => {
29
29
  );
30
30
  processResult(surface, docPath("box/shadows.png"));
31
31
  });
32
- it("should draw a box with red stroke", async () => {
32
+ it("should draw a box with red stroke", () => {
33
33
  const size = width / 2;
34
- const surface = await drawOnNode(
34
+ const surface = drawOnNode(
35
35
  <>
36
36
  <Box
37
37
  box={{ width: size, height: size, x: 1, y: 1 }}
@@ -168,7 +168,7 @@ describe("Atlas", () => {
168
168
  width: size.width + strokeWidth,
169
169
  height: size.height + strokeWidth,
170
170
  };
171
- const texture = await drawAsImage(
171
+ const texture = drawAsImage(
172
172
  <Group>
173
173
  <Rect
174
174
  rect={rect(strokeWidth / 2, strokeWidth / 2, size.width, size.height)}
@@ -211,7 +211,7 @@ describe("Atlas", () => {
211
211
  width: size.width + strokeWidth,
212
212
  height: size.height + strokeWidth,
213
213
  };
214
- const texture = await drawAsImage(
214
+ const texture = drawAsImage(
215
215
  <Group>
216
216
  <Rect
217
217
  rect={rect(strokeWidth / 2, strokeWidth / 2, size.width, size.height)}
@@ -283,7 +283,7 @@ describe("Atlas", () => {
283
283
  width: size.width + strokeWidth,
284
284
  height: size.height + strokeWidth,
285
285
  };
286
- const texture = await drawAsImage(
286
+ const texture = drawAsImage(
287
287
  <Group>
288
288
  <Rect
289
289
  rect={rect(strokeWidth / 2, strokeWidth / 2, size.width, size.height)}
@@ -100,7 +100,7 @@ describe("Offscreen Drawings", () => {
100
100
  const { width, height } = surface;
101
101
  const { drawAsImage } = importSkia();
102
102
  const r = width / 2;
103
- const image = await drawAsImage(
103
+ const image = drawAsImage(
104
104
  <Circle r={r} cx={r} cy={r} color="lightblue" />,
105
105
  { width, height }
106
106
  );