@shopify/react-native-skia 0.1.234 → 0.1.236

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 (262) hide show
  1. package/cpp/api/JsiSkTypefaceFactory.h +2 -1
  2. package/cpp/skia/include/android/AHardwareBufferUtils.h +23 -0
  3. package/cpp/skia/include/android/GrAHardwareBufferUtils.h +2 -0
  4. package/cpp/skia/include/android/graphite/SurfaceAndroid.h +59 -0
  5. package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
  6. package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
  7. package/cpp/skia/include/codec/SkCodec.h +21 -3
  8. package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
  9. package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
  10. package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
  11. package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
  12. package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
  13. package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
  14. package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
  15. package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
  16. package/cpp/skia/include/config/SkUserConfig.h +3 -1
  17. package/cpp/skia/include/core/SkCanvas.h +66 -37
  18. package/cpp/skia/include/core/SkColorFilter.h +5 -2
  19. package/cpp/skia/include/core/SkContourMeasure.h +1 -0
  20. package/cpp/skia/include/core/SkDocument.h +1 -0
  21. package/cpp/skia/include/core/SkFont.h +14 -24
  22. package/cpp/skia/include/core/SkFontArguments.h +1 -1
  23. package/cpp/skia/include/core/SkFontMetrics.h +1 -1
  24. package/cpp/skia/include/core/SkFontMgr.h +0 -7
  25. package/cpp/skia/include/core/SkGraphics.h +13 -0
  26. package/cpp/skia/include/core/SkMesh.h +9 -13
  27. package/cpp/skia/include/core/SkMilestone.h +1 -1
  28. package/cpp/skia/include/core/SkPathMeasure.h +2 -0
  29. package/cpp/skia/include/core/SkSerialProcs.h +29 -11
  30. package/cpp/skia/include/core/SkSize.h +3 -3
  31. package/cpp/skia/include/core/SkStream.h +3 -13
  32. package/cpp/skia/include/core/SkSurface.h +6 -3
  33. package/cpp/skia/include/core/SkSurfaceProps.h +2 -4
  34. package/cpp/skia/include/core/SkTraceMemoryDump.h +15 -0
  35. package/cpp/skia/include/core/SkTypeface.h +8 -56
  36. package/cpp/skia/include/core/SkTypes.h +8 -0
  37. package/cpp/skia/include/core/SkVertices.h +1 -1
  38. package/cpp/skia/include/docs/SkMultiPictureDocument.h +53 -0
  39. package/cpp/skia/include/docs/SkPDFDocument.h +11 -0
  40. package/cpp/skia/include/effects/SkGradientShader.h +9 -0
  41. package/cpp/skia/include/effects/SkRuntimeEffect.h +3 -7
  42. package/cpp/skia/include/gpu/GrBackendSemaphore.h +33 -47
  43. package/cpp/skia/include/gpu/GrBackendSurface.h +2 -3
  44. package/cpp/skia/include/gpu/GrContextOptions.h +0 -6
  45. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +44 -28
  46. package/cpp/skia/include/gpu/GrDirectContext.h +12 -31
  47. package/cpp/skia/include/gpu/GrTypes.h +1 -16
  48. package/cpp/skia/include/gpu/MutableTextureState.h +35 -80
  49. package/cpp/skia/include/gpu/ShaderErrorHandler.h +11 -1
  50. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +2 -2
  51. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
  52. package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +3 -2
  53. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
  54. package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +30 -0
  55. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  56. package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -0
  57. package/cpp/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h +6 -0
  58. package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +3 -3
  59. package/cpp/skia/include/gpu/graphite/BackendTexture.h +39 -27
  60. package/cpp/skia/include/gpu/graphite/Context.h +39 -13
  61. package/cpp/skia/include/gpu/graphite/ContextOptions.h +2 -0
  62. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +2 -1
  63. package/cpp/skia/include/gpu/graphite/Image.h +106 -87
  64. package/cpp/skia/include/gpu/graphite/Recorder.h +24 -3
  65. package/cpp/skia/include/gpu/graphite/Surface.h +7 -2
  66. package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +41 -2
  67. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +11 -6
  68. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -2
  69. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +6 -6
  70. package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -0
  71. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  72. package/cpp/skia/include/gpu/vk/GrVkTypes.h +1 -44
  73. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
  74. package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +25 -0
  75. package/cpp/skia/include/gpu/vk/VulkanTypes.h +44 -0
  76. package/cpp/skia/include/ports/SkFontConfigInterface.h +3 -6
  77. package/cpp/skia/include/private/SkEncodedInfo.h +5 -0
  78. package/cpp/skia/include/private/SkExif.h +102 -0
  79. package/cpp/skia/include/private/SkGainmapInfo.h +11 -1
  80. package/cpp/skia/include/private/base/SkAssert.h +16 -0
  81. package/cpp/skia/include/private/base/SkDeque.h +2 -7
  82. package/cpp/skia/include/private/base/SkLoadUserConfig.h +1 -1
  83. package/cpp/skia/include/private/base/SkTArray.h +69 -28
  84. package/cpp/skia/include/private/base/SkThreadAnnotations.h +18 -5
  85. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +26 -30
  86. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +4 -3
  87. package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
  88. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +8 -6
  89. package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +29 -0
  90. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +12 -9
  91. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +16 -11
  92. package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -2
  93. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
  94. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
  95. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
  96. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
  97. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
  98. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +9 -2
  99. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +31 -3
  100. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10624 -5716
  101. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +2 -1
  102. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +2 -1
  103. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +28 -1
  104. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +2 -1
  105. package/cpp/skia/include/utils/mac/SkCGUtils.h +23 -11
  106. package/cpp/skia/modules/skcms/skcms.h +2 -410
  107. package/cpp/skia/modules/skcms/src/Transform_inl.h +831 -704
  108. package/cpp/skia/modules/skcms/src/skcms_Transform.h +161 -0
  109. package/cpp/skia/modules/skcms/src/skcms_internals.h +136 -0
  110. package/cpp/skia/modules/skcms/src/skcms_public.h +404 -0
  111. package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
  112. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -0
  113. package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -2
  114. package/cpp/skia/modules/skparagraph/include/TextStyle.h +4 -3
  115. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -3
  116. package/cpp/skia/modules/skresources/include/SkResources.h +28 -17
  117. package/cpp/skia/modules/skunicode/include/SkUnicode.h +12 -0
  118. package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -1
  119. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +4 -1
  120. package/cpp/skia/src/base/SkUTF.h +7 -0
  121. package/cpp/skia/src/core/SkTHash.h +20 -8
  122. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +3 -2
  123. package/lib/commonjs/dom/nodes/JsiSkDOM.js +56 -57
  124. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  125. package/lib/commonjs/external/reanimated/index.d.ts +1 -0
  126. package/lib/commonjs/external/reanimated/index.js +13 -0
  127. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  128. package/lib/commonjs/external/reanimated/interpolators.js +13 -1
  129. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  130. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +1 -0
  131. package/lib/commonjs/external/reanimated/moduleWrapper.js +5 -3
  132. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  133. package/lib/commonjs/external/reanimated/textures.d.ts +5 -0
  134. package/lib/commonjs/external/reanimated/textures.js +52 -0
  135. package/lib/commonjs/external/reanimated/textures.js.map +1 -0
  136. package/lib/commonjs/headless/index.js +1 -1
  137. package/lib/commonjs/headless/index.js.map +1 -1
  138. package/lib/commonjs/mock/index.js +3 -0
  139. package/lib/commonjs/mock/index.js.map +1 -1
  140. package/lib/commonjs/renderer/Canvas.js +1 -1
  141. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  142. package/lib/commonjs/renderer/Container.d.ts +1 -1
  143. package/lib/commonjs/renderer/Container.js +2 -1
  144. package/lib/commonjs/renderer/Container.js.map +1 -1
  145. package/lib/commonjs/renderer/Offscreen.d.ts +1 -0
  146. package/lib/commonjs/renderer/Offscreen.js +18 -5
  147. package/lib/commonjs/renderer/Offscreen.js.map +1 -1
  148. package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
  149. package/lib/commonjs/renderer/Reconciler.js +7 -4
  150. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  151. package/lib/commonjs/skia/types/Matrix4.d.ts +2 -2
  152. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  153. package/lib/commonjs/skia/types/Shader/Shader.d.ts +1 -1
  154. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  155. package/lib/module/dom/nodes/JsiSkDOM.d.ts +3 -2
  156. package/lib/module/dom/nodes/JsiSkDOM.js +56 -56
  157. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  158. package/lib/module/external/reanimated/index.d.ts +1 -0
  159. package/lib/module/external/reanimated/index.js +1 -0
  160. package/lib/module/external/reanimated/index.js.map +1 -1
  161. package/lib/module/external/reanimated/interpolators.js +13 -1
  162. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  163. package/lib/module/external/reanimated/moduleWrapper.d.ts +1 -0
  164. package/lib/module/external/reanimated/moduleWrapper.js +3 -2
  165. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  166. package/lib/module/external/reanimated/textures.d.ts +5 -0
  167. package/lib/module/external/reanimated/textures.js +35 -0
  168. package/lib/module/external/reanimated/textures.js.map +1 -0
  169. package/lib/module/headless/index.js +1 -1
  170. package/lib/module/headless/index.js.map +1 -1
  171. package/lib/module/mock/index.js +3 -0
  172. package/lib/module/mock/index.js.map +1 -1
  173. package/lib/module/renderer/Canvas.js +1 -1
  174. package/lib/module/renderer/Canvas.js.map +1 -1
  175. package/lib/module/renderer/Container.d.ts +1 -1
  176. package/lib/module/renderer/Container.js +2 -1
  177. package/lib/module/renderer/Container.js.map +1 -1
  178. package/lib/module/renderer/Offscreen.d.ts +1 -0
  179. package/lib/module/renderer/Offscreen.js +11 -3
  180. package/lib/module/renderer/Offscreen.js.map +1 -1
  181. package/lib/module/renderer/Reconciler.d.ts +1 -1
  182. package/lib/module/renderer/Reconciler.js +7 -4
  183. package/lib/module/renderer/Reconciler.js.map +1 -1
  184. package/lib/module/skia/types/Matrix4.d.ts +2 -2
  185. package/lib/module/skia/types/Matrix4.js.map +1 -1
  186. package/lib/module/skia/types/Shader/Shader.d.ts +1 -1
  187. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  188. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +3 -2
  189. package/lib/typescript/src/external/reanimated/index.d.ts +1 -0
  190. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +1 -0
  191. package/lib/typescript/src/external/reanimated/textures.d.ts +5 -0
  192. package/lib/typescript/src/renderer/Container.d.ts +1 -1
  193. package/lib/typescript/src/renderer/Offscreen.d.ts +1 -0
  194. package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
  195. package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
  196. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  197. package/libs/android/arm64-v8a/libskia.a +0 -0
  198. package/libs/android/arm64-v8a/libskottie.a +0 -0
  199. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  200. package/libs/android/arm64-v8a/libsksg.a +0 -0
  201. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  202. package/libs/android/arm64-v8a/libskunicode.a +0 -0
  203. package/libs/android/arm64-v8a/libsvg.a +0 -0
  204. package/libs/android/armeabi-v7a/libskia.a +0 -0
  205. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  206. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  207. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  208. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  209. package/libs/android/armeabi-v7a/libskunicode.a +0 -0
  210. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  211. package/libs/android/x86/libskia.a +0 -0
  212. package/libs/android/x86/libskottie.a +0 -0
  213. package/libs/android/x86/libskparagraph.a +0 -0
  214. package/libs/android/x86/libsksg.a +0 -0
  215. package/libs/android/x86/libskshaper.a +0 -0
  216. package/libs/android/x86/libskunicode.a +0 -0
  217. package/libs/android/x86/libsvg.a +0 -0
  218. package/libs/android/x86_64/libskia.a +0 -0
  219. package/libs/android/x86_64/libskottie.a +0 -0
  220. package/libs/android/x86_64/libskparagraph.a +0 -0
  221. package/libs/android/x86_64/libsksg.a +0 -0
  222. package/libs/android/x86_64/libskshaper.a +0 -0
  223. package/libs/android/x86_64/libskunicode.a +0 -0
  224. package/libs/android/x86_64/libsvg.a +0 -0
  225. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  226. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  227. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  228. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  229. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  230. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  231. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  232. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  233. package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
  234. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  235. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  236. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  237. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  238. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  239. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  240. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  241. package/package.json +1 -1
  242. package/src/dom/nodes/JsiSkDOM.ts +55 -56
  243. package/src/external/reanimated/index.ts +1 -0
  244. package/src/external/reanimated/interpolators.ts +15 -2
  245. package/src/external/reanimated/moduleWrapper.ts +1 -0
  246. package/src/external/reanimated/textures.tsx +50 -0
  247. package/src/headless/index.ts +1 -1
  248. package/src/mock/index.ts +3 -0
  249. package/src/renderer/Canvas.tsx +1 -1
  250. package/src/renderer/Container.tsx +3 -2
  251. package/src/renderer/Offscreen.tsx +12 -3
  252. package/src/renderer/Reconciler.tsx +5 -2
  253. package/src/skia/types/Matrix4.ts +2 -2
  254. package/src/skia/types/Shader/Shader.ts +6 -1
  255. package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -142
  256. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +0 -107
  257. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +0 -32
  258. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +0 -83
  259. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +0 -47
  260. package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +0 -57
  261. package/cpp/skia/include/utils/SkBase64.h +0 -53
  262. package/cpp/skia/modules/skcms/skcms_internal.h +0 -56
@@ -19,7 +19,7 @@ public:
19
19
  FontArguments& operator=(const FontArguments&) = default;
20
20
  FontArguments& operator=(FontArguments&&) = default;
21
21
 
22
- sk_sp<SkTypeface> CloneTypeface(sk_sp<SkTypeface> typeface) const;
22
+ sk_sp<SkTypeface> CloneTypeface(const sk_sp<SkTypeface>& typeface) const;
23
23
 
24
24
  friend bool operator==(const FontArguments& a, const FontArguments& b);
25
25
  friend bool operator!=(const FontArguments& a, const FontArguments& b);
@@ -7,6 +7,7 @@
7
7
  #include <set>
8
8
  #include "include/core/SkFontMgr.h"
9
9
  #include "include/core/SkRefCnt.h"
10
+ #include "include/core/SkSpan.h"
10
11
  #include "modules/skparagraph/include/FontArguments.h"
11
12
  #include "modules/skparagraph/include/ParagraphCache.h"
12
13
  #include "modules/skparagraph/include/TextStyle.h"
@@ -36,6 +37,7 @@ public:
36
37
  std::vector<sk_sp<SkTypeface>> findTypefaces(const std::vector<SkString>& familyNames, SkFontStyle fontStyle, const std::optional<FontArguments>& fontArgs);
37
38
 
38
39
  sk_sp<SkTypeface> defaultFallback(SkUnichar unicode, SkFontStyle fontStyle, const SkString& locale);
40
+ sk_sp<SkTypeface> defaultEmojiFallback(SkUnichar emojiStart, SkFontStyle fontStyle, const SkString& locale);
39
41
  sk_sp<SkTypeface> defaultFallback();
40
42
 
41
43
  void disableFontFallback();
@@ -241,8 +241,8 @@ public:
241
241
  virtual bool getClosestUTF16GlyphInfoAt(SkScalar dx, SkScalar dy, GlyphInfo* glyphInfo) = 0;
242
242
 
243
243
  struct FontInfo {
244
- FontInfo(const SkFont font, const TextRange textRange)
245
- : fFont(font), fTextRange(textRange) { }
244
+ FontInfo(const SkFont& font, const TextRange textRange)
245
+ : fFont(font), fTextRange(textRange) {}
246
246
  virtual ~FontInfo() = default;
247
247
  FontInfo(const FontInfo& ) = default;
248
248
  SkFont fFont;
@@ -113,7 +113,7 @@ enum class PlaceholderAlignment {
113
113
  };
114
114
 
115
115
  struct FontFeature {
116
- FontFeature(const SkString name, int value) : fName(name), fValue(value) {}
116
+ FontFeature(SkString name, int value) : fName(std::move(name)), fValue(value) {}
117
117
  bool operator==(const FontFeature& that) const {
118
118
  return fName == that.fName && fValue == that.fValue;
119
119
  }
@@ -178,7 +178,8 @@ public:
178
178
  fForeground = std::move(paint);
179
179
  }
180
180
  // DEPRECATED: prefer `setForegroundPaint`.
181
- void setForegroundColor(SkPaint paint) { setForegroundPaint(paint); }
181
+ void setForegroundColor(SkPaint paint) { setForegroundPaint(std::move(paint)); }
182
+
182
183
  // Set the foreground to a paint ID. This is intended for use by clients
183
184
  // that implement a custom ParagraphPainter that can not accept an SkPaint.
184
185
  void setForegroundPaintID(ParagraphPainter::PaintID paintID) {
@@ -200,7 +201,7 @@ public:
200
201
  fBackground = std::move(paint);
201
202
  }
202
203
  // DEPRECATED: prefer `setBackgroundPaint`.
203
- void setBackgroundColor(SkPaint paint) { setBackgroundPaint(paint); }
204
+ void setBackgroundColor(SkPaint paint) { setBackgroundPaint(std::move(paint)); }
204
205
  void setBackgroundPaintID(ParagraphPainter::PaintID paintID) {
205
206
  fHasBackground = true;
206
207
  fBackground = paintID;
@@ -47,9 +47,7 @@ public:
47
47
  sk_sp<SkFontStyleSet> onMatchFamily(const char familyName[]) const override;
48
48
 
49
49
  sk_sp<SkFontStyleSet> onCreateStyleSet(int) const override { return nullptr; }
50
- sk_sp<SkTypeface> onMatchFamilyStyle(const char[], const SkFontStyle&) const override {
51
- return nullptr;
52
- }
50
+ sk_sp<SkTypeface> onMatchFamilyStyle(const char familyName[], const SkFontStyle& pattern) const override;
53
51
  sk_sp<SkTypeface> onMatchFamilyStyleCharacter(const char[], const SkFontStyle&,
54
52
  const char*[], int,
55
53
  SkUnichar) const override {
@@ -87,29 +87,32 @@ public:
87
87
  virtual FrameData getFrameData(float t);
88
88
  };
89
89
 
90
+ enum class ImageDecodeStrategy {
91
+ // Images are decoded on-the-fly, at rasterization time.
92
+ // Large images may cause jank as decoding is expensive (and can thrash internal caches).
93
+ kLazyDecode,
94
+ // Force-decode all images upfront, at the cost of potentially more RAM and slower
95
+ // animation build times.
96
+ kPreDecode,
97
+ };
98
+
90
99
  class MultiFrameImageAsset final : public ImageAsset {
91
100
  public:
92
- /**
93
- * By default, images are decoded on-the-fly, at rasterization time.
94
- * Large images may cause jank as decoding is expensive (and can thrash internal caches).
95
- *
96
- * Pass |predecode| true to force-decode all images upfront, at the cost of potentially more RAM
97
- * and slower animation build times.
98
- */
99
- static sk_sp<MultiFrameImageAsset> Make(sk_sp<SkData>, bool predecode = false);
101
+ static sk_sp<MultiFrameImageAsset> Make(sk_sp<SkData>,
102
+ ImageDecodeStrategy = ImageDecodeStrategy::kLazyDecode);
100
103
 
101
104
  bool isMultiFrame() override;
102
105
 
103
106
  sk_sp<SkImage> getFrame(float t) override;
104
107
 
105
108
  private:
106
- explicit MultiFrameImageAsset(std::unique_ptr<SkAnimCodecPlayer>, bool predecode);
109
+ explicit MultiFrameImageAsset(std::unique_ptr<SkAnimCodecPlayer>, ImageDecodeStrategy);
107
110
 
108
111
  sk_sp<SkImage> generateFrame(float t);
109
112
 
110
113
  std::unique_ptr<SkAnimCodecPlayer> fPlayer;
111
114
  sk_sp<SkImage> fCachedFrame;
112
- bool fPreDecode;
115
+ ImageDecodeStrategy fStrategy;
113
116
 
114
117
  using INHERITED = ImageAsset;
115
118
  };
@@ -200,17 +203,18 @@ public:
200
203
 
201
204
  class FileResourceProvider final : public ResourceProvider {
202
205
  public:
203
- static sk_sp<FileResourceProvider> Make(SkString base_dir, bool predecode = false);
206
+ static sk_sp<FileResourceProvider> Make(SkString base_dir,
207
+ ImageDecodeStrategy = ImageDecodeStrategy::kLazyDecode);
204
208
 
205
209
  sk_sp<SkData> load(const char resource_path[], const char resource_name[]) const override;
206
210
 
207
211
  sk_sp<ImageAsset> loadImageAsset(const char[], const char[], const char[]) const override;
208
212
 
209
213
  private:
210
- FileResourceProvider(SkString, bool);
214
+ FileResourceProvider(SkString, ImageDecodeStrategy);
211
215
 
212
216
  const SkString fDir;
213
- const bool fPredecode;
217
+ const ImageDecodeStrategy fStrategy;
214
218
 
215
219
  using INHERITED = ResourceProvider;
216
220
  };
@@ -249,16 +253,23 @@ private:
249
253
 
250
254
  class DataURIResourceProviderProxy final : public ResourceProviderProxyBase {
251
255
  public:
252
- static sk_sp<DataURIResourceProviderProxy> Make(sk_sp<ResourceProvider> rp,
253
- bool predecode = false);
256
+ // If font data is supplied via base64 encoding, this needs a provided SkFontMgr to process
257
+ // that font data into an SkTypeface.
258
+ static sk_sp<DataURIResourceProviderProxy> Make(
259
+ sk_sp<ResourceProvider> rp,
260
+ ImageDecodeStrategy = ImageDecodeStrategy::kLazyDecode,
261
+ sk_sp<const SkFontMgr> fontMgr = nullptr);
254
262
 
255
263
  private:
256
- DataURIResourceProviderProxy(sk_sp<ResourceProvider>, bool);
264
+ DataURIResourceProviderProxy(sk_sp<ResourceProvider>,
265
+ ImageDecodeStrategy,
266
+ sk_sp<const SkFontMgr> fontMgr);
257
267
 
258
268
  sk_sp<ImageAsset> loadImageAsset(const char[], const char[], const char[]) const override;
259
269
  sk_sp<SkTypeface> loadTypeface(const char[], const char[]) const override;
260
270
 
261
- const bool fPredecode;
271
+ const ImageDecodeStrategy fStrategy;
272
+ sk_sp<const SkFontMgr> fFontMgr;
262
273
 
263
274
  using INHERITED = ResourceProviderProxyBase;
264
275
  };
@@ -129,7 +129,17 @@ class SKUNICODE_API SkUnicode {
129
129
  virtual bool isSpace(SkUnichar utf8) = 0;
130
130
  virtual bool isTabulation(SkUnichar utf8) = 0;
131
131
  virtual bool isHardBreak(SkUnichar utf8) = 0;
132
+ /**
133
+ * Returns if a code point may start an emoji sequence.
134
+ * Returns true for '#', '*', and '0'-'9' since they may start an emoji sequence.
135
+ * To determine if a list of code points begins with an emoji sequence, use
136
+ * getEmojiSequence.
137
+ **/
132
138
  virtual bool isEmoji(SkUnichar utf8) = 0;
139
+ virtual bool isEmojiComponent(SkUnichar utf8) = 0;
140
+ virtual bool isEmojiModifierBase(SkUnichar utf8) = 0;
141
+ virtual bool isEmojiModifier(SkUnichar utf8) = 0;
142
+ virtual bool isRegionalIndicator(SkUnichar utf8) = 0;
133
143
  virtual bool isIdeographic(SkUnichar utf8) = 0;
134
144
 
135
145
  // Methods used in SkShaper and SkText
@@ -303,6 +313,8 @@ class SKUNICODE_API SkUnicode {
303
313
  std::vector<SkUnicode::LineBreakBefore> lineBreaks);
304
314
 
305
315
  static std::unique_ptr<SkUnicode> MakeLibgraphemeBasedUnicode();
316
+
317
+ static std::unique_ptr<SkUnicode> MakeIcu4xBasedUnicode();
306
318
  };
307
319
 
308
320
  namespace sknonstd {
@@ -27,7 +27,10 @@ public:
27
27
  class Builder final {
28
28
  public:
29
29
  /**
30
- * Specify a font manager for loading SVG fonts.
30
+ * Specify a font manager for loading fonts (e.g. from the system) to render <text>
31
+ * SVG nodes.
32
+ * If this is not set, but a font is required as part of rendering, the text will
33
+ * not be displayed.
31
34
  */
32
35
  Builder& setFontManager(sk_sp<SkFontMgr>);
33
36
 
@@ -138,7 +138,10 @@ public:
138
138
  }
139
139
 
140
140
  sk_sp<SkFontMgr> fontMgr() const {
141
- return fFontMgr ? fFontMgr : SkFontMgr::RefDefault();
141
+ // It is probably an oversight to try to render <text> without having set the SkFontMgr.
142
+ // We will assert this in debug mode, but fallback to an empty fontmgr in release builds.
143
+ SkASSERT(fFontMgr);
144
+ return fFontMgr ? fFontMgr : SkFontMgr::RefEmpty();
142
145
  }
143
146
 
144
147
  // Returns the translate/scale transformation required to map into the current OBB scope,
@@ -35,6 +35,13 @@ SK_SPI int CountUTF32(const int32_t* utf32, size_t byteLength);
35
35
  */
36
36
  SK_SPI SkUnichar NextUTF8(const char** ptr, const char* end);
37
37
 
38
+ /** Given a sequence of UTF-8 bytes, return the first unicode codepoint.
39
+ The pointer will be incremented to point at the next codepoint's start. If
40
+ invalid UTF-8 is encountered, set *ptr to end and
41
+ return the replacement character (0xFFFD)
42
+ */
43
+ SK_SPI SkUnichar NextUTF8WithReplacement(const char** ptr, const char* end);
44
+
38
45
  /** Given a sequence of aligned UTF-16 characters in machine-endian form,
39
46
  return the first unicode codepoint. The pointer will be incremented to
40
47
  point at the next codepoint's start. If invalid UTF-16 is encountered,
@@ -119,24 +119,32 @@ public:
119
119
  return nullptr;
120
120
  }
121
121
 
122
- // Remove the value with this key from the hash table.
123
- void remove(const K& key) {
124
- SkASSERT(this->find(key));
125
-
122
+ // If a value with this key exists in the hash table, removes it and returns true.
123
+ // Otherwise, returns false.
124
+ bool removeIfExists(const K& key) {
126
125
  uint32_t hash = Hash(key);
127
126
  int index = hash & (fCapacity-1);
128
127
  for (int n = 0; n < fCapacity; n++) {
129
128
  Slot& s = fSlots[index];
130
- SkASSERT(s.has_value());
129
+ if (s.empty()) {
130
+ return false;
131
+ }
131
132
  if (hash == s.fHash && key == Traits::GetKey(*s)) {
132
133
  this->removeSlot(index);
133
134
  if (4 * fCount <= fCapacity && fCapacity > 4) {
134
135
  this->resize(fCapacity / 2);
135
136
  }
136
- return;
137
+ return true;
137
138
  }
138
139
  index = this->next(index);
139
140
  }
141
+ SkASSERT(fCapacity == fCount);
142
+ return false;
143
+ }
144
+
145
+ // Removes the value with this key from the hash table. Asserts if it is missing.
146
+ void remove(const K& key) {
147
+ SkAssertResult(this->removeIfExists(key));
140
148
  }
141
149
 
142
150
  // Hash tables will automatically resize themselves when set() and remove() are called, but
@@ -482,12 +490,16 @@ public:
482
490
  return *this->set(key, V{});
483
491
  }
484
492
 
485
- // Remove the key/value entry in the table with this key.
493
+ // Removes the key/value entry in the table with this key. Asserts if the key is not present.
486
494
  void remove(const K& key) {
487
- SkASSERT(this->find(key));
488
495
  fTable.remove(key);
489
496
  }
490
497
 
498
+ // If the key exists in the table, removes it and returns true. Otherwise, returns false.
499
+ bool removeIfExists(const K& key) {
500
+ return fTable.removeIfExists(key);
501
+ }
502
+
491
503
  // Call fn on every key/value pair in the table. You may mutate the value but not the key.
492
504
  template <typename Fn, // f(K, V*) or f(const K&, V*)
493
505
  std::enable_if_t<std::is_invocable_v<Fn, K, V*>>* = nullptr>
@@ -6,7 +6,8 @@ import { RRectNode } from "./drawings";
6
6
  import type { NodeContext } from "./Node";
7
7
  export declare class JsiSkDOM implements SkDOM {
8
8
  private ctx;
9
- constructor(ctx: NodeContext);
9
+ private native;
10
+ constructor(ctx: NodeContext, native: boolean);
10
11
  Layer(props?: ChildrenProps): import("../types").RenderNode<ChildrenProps>;
11
12
  Group(props?: GroupProps): import("../types").RenderNode<GroupProps>;
12
13
  Paint(props: PaintProps): import("../types").DeclarationNode<PaintProps>;
@@ -19,7 +20,7 @@ export declare class JsiSkDOM implements SkDOM {
19
20
  Patch(props: PatchProps): import("../types").RenderNode<PatchProps>;
20
21
  Points(props: PointsProps): import("../types").RenderNode<PointsProps>;
21
22
  Rect(props: RectProps): import("./DrawingNode").JsiDrawingNode<RectProps, import("../..").SkRect>;
22
- RRect(props: RoundedRectProps): import("./DrawingNode").JsiDrawingNode<RoundedRectProps, import("../..").SkRRect> | RRectNode;
23
+ RRect(props: RoundedRectProps): RRectNode | import("./DrawingNode").JsiDrawingNode<RoundedRectProps, import("../..").SkRRect>;
23
24
  Vertices(props: VerticesProps): import("../types").RenderNode<VerticesProps>;
24
25
  Text(props: TextProps): import("../types").RenderNode<TextProps>;
25
26
  TextPath(props: TextPathProps): import("../types").RenderNode<TextPathProps>;
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.JsiSkDOM = void 0;
7
7
 
8
- var _HostComponents = require("../../renderer/HostComponents");
9
-
10
8
  var _drawings = require("./drawings");
11
9
 
12
10
  var _paint = require("./paint");
@@ -26,140 +24,141 @@ var _LayerNode = require("./LayerNode");
26
24
  var _ParagraphNode = require("./drawings/ParagraphNode");
27
25
 
28
26
  class JsiSkDOM {
29
- constructor(ctx) {
27
+ constructor(ctx, native) {
30
28
  this.ctx = ctx;
29
+ this.native = native;
31
30
  }
32
31
 
33
32
  Layer(props) {
34
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LayerNode(props ?? {}) : new _LayerNode.LayerNode(this.ctx, props ?? {});
33
+ return this.native ? global.SkiaDomApi.LayerNode(props ?? {}) : new _LayerNode.LayerNode(this.ctx, props ?? {});
35
34
  }
36
35
 
37
36
  Group(props) {
38
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.GroupNode(props ?? {}) : new _GroupNode.GroupNode(this.ctx, props ?? {});
37
+ return this.native ? global.SkiaDomApi.GroupNode(props ?? {}) : new _GroupNode.GroupNode(this.ctx, props ?? {});
39
38
  }
40
39
 
41
40
  Paint(props) {
42
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PaintNode(props ?? {}) : new _PaintNode.PaintNode(this.ctx, props);
41
+ return this.native ? global.SkiaDomApi.PaintNode(props ?? {}) : new _PaintNode.PaintNode(this.ctx, props);
43
42
  } // Drawings
44
43
 
45
44
 
46
45
  Fill(props) {
47
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.FillNode(props ?? {}) : new _drawings.FillNode(this.ctx, props);
46
+ return this.native ? global.SkiaDomApi.FillNode(props ?? {}) : new _drawings.FillNode(this.ctx, props);
48
47
  }
49
48
 
50
49
  Image(props) {
51
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ImageNode(props ?? {}) : new _drawings.ImageNode(this.ctx, props);
50
+ return this.native ? global.SkiaDomApi.ImageNode(props ?? {}) : new _drawings.ImageNode(this.ctx, props);
52
51
  }
53
52
 
54
53
  Circle(props) {
55
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.CircleNode(props ?? {}) : new _drawings.CircleNode(this.ctx, props);
54
+ return this.native ? global.SkiaDomApi.CircleNode(props ?? {}) : new _drawings.CircleNode(this.ctx, props);
56
55
  }
57
56
 
58
57
  Path(props) {
59
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PathNode(props ?? {}) : new _drawings.PathNode(this.ctx, props);
58
+ return this.native ? global.SkiaDomApi.PathNode(props ?? {}) : new _drawings.PathNode(this.ctx, props);
60
59
  }
61
60
 
62
61
  Line(props) {
63
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LineNode(props ?? {}) : new _drawings.LineNode(this.ctx, props);
62
+ return this.native ? global.SkiaDomApi.LineNode(props ?? {}) : new _drawings.LineNode(this.ctx, props);
64
63
  }
65
64
 
66
65
  Oval(props) {
67
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.OvalNode(props ?? {}) : new _drawings.OvalNode(this.ctx, props);
66
+ return this.native ? global.SkiaDomApi.OvalNode(props ?? {}) : new _drawings.OvalNode(this.ctx, props);
68
67
  }
69
68
 
70
69
  Patch(props) {
71
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PatchNode(props ?? {}) : new _drawings.PatchNode(this.ctx, props);
70
+ return this.native ? global.SkiaDomApi.PatchNode(props ?? {}) : new _drawings.PatchNode(this.ctx, props);
72
71
  }
73
72
 
74
73
  Points(props) {
75
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PointsNode(props ?? {}) : new _drawings.PointsNode(this.ctx, props);
74
+ return this.native ? global.SkiaDomApi.PointsNode(props ?? {}) : new _drawings.PointsNode(this.ctx, props);
76
75
  }
77
76
 
78
77
  Rect(props) {
79
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.RectNode(props) : new _drawings.RectNode(this.ctx, props);
78
+ return this.native ? global.SkiaDomApi.RectNode(props) : new _drawings.RectNode(this.ctx, props);
80
79
  }
81
80
 
82
81
  RRect(props) {
83
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.RRectNode(props) : new _drawings.RRectNode(this.ctx, props);
82
+ return this.native ? global.SkiaDomApi.RRectNode(props) : new _drawings.RRectNode(this.ctx, props);
84
83
  }
85
84
 
86
85
  Vertices(props) {
87
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.VerticesNode(props) : new _drawings.VerticesNode(this.ctx, props);
86
+ return this.native ? global.SkiaDomApi.VerticesNode(props) : new _drawings.VerticesNode(this.ctx, props);
88
87
  }
89
88
 
90
89
  Text(props) {
91
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TextNode(props) : new _drawings.TextNode(this.ctx, props);
90
+ return this.native ? global.SkiaDomApi.TextNode(props) : new _drawings.TextNode(this.ctx, props);
92
91
  }
93
92
 
94
93
  TextPath(props) {
95
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TextPathNode(props) : new _drawings.TextPathNode(this.ctx, props);
94
+ return this.native ? global.SkiaDomApi.TextPathNode(props) : new _drawings.TextPathNode(this.ctx, props);
96
95
  }
97
96
 
98
97
  TextBlob(props) {
99
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TextBlobNode(props) : new _drawings.TextBlobNode(this.ctx, props);
98
+ return this.native ? global.SkiaDomApi.TextBlobNode(props) : new _drawings.TextBlobNode(this.ctx, props);
100
99
  }
101
100
 
102
101
  Glyphs(props) {
103
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.GlyphsNode(props) : new _drawings.GlyphsNode(this.ctx, props);
102
+ return this.native ? global.SkiaDomApi.GlyphsNode(props) : new _drawings.GlyphsNode(this.ctx, props);
104
103
  }
105
104
 
106
105
  DiffRect(props) {
107
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DiffRectNode(props) : new _drawings.DiffRectNode(this.ctx, props);
106
+ return this.native ? global.SkiaDomApi.DiffRectNode(props) : new _drawings.DiffRectNode(this.ctx, props);
108
107
  }
109
108
 
110
109
  Picture(props) {
111
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PictureNode(props) : new _drawings.PictureNode(this.ctx, props);
110
+ return this.native ? global.SkiaDomApi.PictureNode(props) : new _drawings.PictureNode(this.ctx, props);
112
111
  }
113
112
 
114
113
  ImageSVG(props) {
115
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ImageSVGNode(props) : new _drawings.ImageSVGNode(this.ctx, props);
114
+ return this.native ? global.SkiaDomApi.ImageSVGNode(props) : new _drawings.ImageSVGNode(this.ctx, props);
116
115
  } // BlurMaskFilters
117
116
 
118
117
 
119
118
  BlurMaskFilter(props) {
120
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlurMaskFilterNode(props) : new _paint.BlurMaskFilterNode(this.ctx, props);
119
+ return this.native ? global.SkiaDomApi.BlurMaskFilterNode(props) : new _paint.BlurMaskFilterNode(this.ctx, props);
121
120
  } // ImageFilters
122
121
 
123
122
 
124
123
  BlendImageFilter(props) {
125
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlendImageFilterNode(props) : new _paint.BlendImageFilterNode(this.ctx, props);
124
+ return this.native ? global.SkiaDomApi.BlendImageFilterNode(props) : new _paint.BlendImageFilterNode(this.ctx, props);
126
125
  }
127
126
 
128
127
  DropShadowImageFilter(props) {
129
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DropShadowImageFilterNode(props) : new _paint.DropShadowImageFilterNode(this.ctx, props);
128
+ return this.native ? global.SkiaDomApi.DropShadowImageFilterNode(props) : new _paint.DropShadowImageFilterNode(this.ctx, props);
130
129
  }
131
130
 
132
131
  DisplacementMapImageFilter(props) {
133
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DisplacementMapImageFilterNode(props) : new _paint.DisplacementMapImageFilterNode(this.ctx, props);
132
+ return this.native ? global.SkiaDomApi.DisplacementMapImageFilterNode(props) : new _paint.DisplacementMapImageFilterNode(this.ctx, props);
134
133
  }
135
134
 
136
135
  BlurImageFilter(props) {
137
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlurImageFilterNode(props) : new _paint.BlurImageFilterNode(this.ctx, props);
136
+ return this.native ? global.SkiaDomApi.BlurImageFilterNode(props) : new _paint.BlurImageFilterNode(this.ctx, props);
138
137
  }
139
138
 
140
139
  OffsetImageFilter(props) {
141
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.OffsetImageFilterNode(props) : new _paint.OffsetImageFilterNode(this.ctx, props);
140
+ return this.native ? global.SkiaDomApi.OffsetImageFilterNode(props) : new _paint.OffsetImageFilterNode(this.ctx, props);
142
141
  }
143
142
 
144
143
  MorphologyImageFilter(props) {
145
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.MorphologyImageFilterNode(props) : new _ImageFilters.MorphologyImageFilterNode(this.ctx, props);
144
+ return this.native ? global.SkiaDomApi.MorphologyImageFilterNode(props) : new _ImageFilters.MorphologyImageFilterNode(this.ctx, props);
146
145
  }
147
146
 
148
147
  RuntimeShaderImageFilter(props) {
149
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.RuntimeShaderImageFilterNode(props) : new _paint.RuntimeShaderImageFilterNode(this.ctx, props);
148
+ return this.native ? global.SkiaDomApi.RuntimeShaderImageFilterNode(props) : new _paint.RuntimeShaderImageFilterNode(this.ctx, props);
150
149
  } // Color Filters
151
150
 
152
151
 
153
152
  MatrixColorFilter(props) {
154
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.MatrixColorFilterNode(props) : new _ColorFilters.MatrixColorFilterNode(this.ctx, props);
153
+ return this.native ? global.SkiaDomApi.MatrixColorFilterNode(props) : new _ColorFilters.MatrixColorFilterNode(this.ctx, props);
155
154
  }
156
155
 
157
156
  BlendColorFilter(props) {
158
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlendColorFilterNode(props) : new _ColorFilters.BlendColorFilterNode(this.ctx, props);
157
+ return this.native ? global.SkiaDomApi.BlendColorFilterNode(props) : new _ColorFilters.BlendColorFilterNode(this.ctx, props);
159
158
  }
160
159
 
161
160
  LumaColorFilter() {
162
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LumaColorFilterNode() : new _ColorFilters.LumaColorFilterNode(this.ctx);
161
+ return this.native ? global.SkiaDomApi.LumaColorFilterNode() : new _ColorFilters.LumaColorFilterNode(this.ctx);
163
162
  }
164
163
 
165
164
  LinearToSRGBGammaColorFilter() {
@@ -171,94 +170,94 @@ class JsiSkDOM {
171
170
  }
172
171
 
173
172
  LerpColorFilter(props) {
174
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LerpColorFilterNode(props) : new _ColorFilters.LerpColorFilterNode(this.ctx, props);
173
+ return this.native ? global.SkiaDomApi.LerpColorFilterNode(props) : new _ColorFilters.LerpColorFilterNode(this.ctx, props);
175
174
  } // Shaders
176
175
 
177
176
 
178
177
  Shader(props) {
179
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ShaderNode(props) : new _Shaders.ShaderNode(this.ctx, props);
178
+ return this.native ? global.SkiaDomApi.ShaderNode(props) : new _Shaders.ShaderNode(this.ctx, props);
180
179
  }
181
180
 
182
181
  ImageShader(props) {
183
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ImageShaderNode(props) : new _Shaders.ImageShaderNode(this.ctx, props);
182
+ return this.native ? global.SkiaDomApi.ImageShaderNode(props) : new _Shaders.ImageShaderNode(this.ctx, props);
184
183
  }
185
184
 
186
185
  ColorShader(props) {
187
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ColorShaderNode(props) : new _Shaders.ColorNode(this.ctx, props);
186
+ return this.native ? global.SkiaDomApi.ColorShaderNode(props) : new _Shaders.ColorNode(this.ctx, props);
188
187
  }
189
188
 
190
189
  SweepGradient(props) {
191
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.SweepGradientNode(props) : new _Shaders.SweepGradientNode(this.ctx, props);
190
+ return this.native ? global.SkiaDomApi.SweepGradientNode(props) : new _Shaders.SweepGradientNode(this.ctx, props);
192
191
  }
193
192
 
194
193
  Turbulence(props) {
195
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TurbulenceNode(props) : new _Shaders.TurbulenceNode(this.ctx, props);
194
+ return this.native ? global.SkiaDomApi.TurbulenceNode(props) : new _Shaders.TurbulenceNode(this.ctx, props);
196
195
  }
197
196
 
198
197
  FractalNoise(props) {
199
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.FractalNoiseNode(props) : new _Shaders.FractalNoiseNode(this.ctx, props);
198
+ return this.native ? global.SkiaDomApi.FractalNoiseNode(props) : new _Shaders.FractalNoiseNode(this.ctx, props);
200
199
  }
201
200
 
202
201
  LinearGradient(props) {
203
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LinearGradientNode(props) : new _Shaders.LinearGradientNode(this.ctx, props);
202
+ return this.native ? global.SkiaDomApi.LinearGradientNode(props) : new _Shaders.LinearGradientNode(this.ctx, props);
204
203
  }
205
204
 
206
205
  RadialGradient(props) {
207
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.RadialGradientNode(props) : new _Shaders.RadialGradientNode(this.ctx, props);
206
+ return this.native ? global.SkiaDomApi.RadialGradientNode(props) : new _Shaders.RadialGradientNode(this.ctx, props);
208
207
  }
209
208
 
210
209
  TwoPointConicalGradient(props) {
211
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TwoPointConicalGradientNode(props) : new _Shaders.TwoPointConicalGradientNode(this.ctx, props);
210
+ return this.native ? global.SkiaDomApi.TwoPointConicalGradientNode(props) : new _Shaders.TwoPointConicalGradientNode(this.ctx, props);
212
211
  } // Path Effects
213
212
 
214
213
 
215
214
  CornerPathEffect(props) {
216
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.CornerPathEffectNode(props) : new _paint.CornerPathEffectNode(this.ctx, props);
215
+ return this.native ? global.SkiaDomApi.CornerPathEffectNode(props) : new _paint.CornerPathEffectNode(this.ctx, props);
217
216
  }
218
217
 
219
218
  DiscretePathEffect(props) {
220
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DiscretePathEffectNode(props) : new _paint.DiscretePathEffectNode(this.ctx, props);
219
+ return this.native ? global.SkiaDomApi.DiscretePathEffectNode(props) : new _paint.DiscretePathEffectNode(this.ctx, props);
221
220
  }
222
221
 
223
222
  DashPathEffect(props) {
224
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DashPathEffectNode(props) : new _paint.DashPathEffectNode(this.ctx, props);
223
+ return this.native ? global.SkiaDomApi.DashPathEffectNode(props) : new _paint.DashPathEffectNode(this.ctx, props);
225
224
  }
226
225
 
227
226
  Path1DPathEffect(props) {
228
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.Path1DPathEffectNode(props) : new _paint.Path1DPathEffectNode(this.ctx, props);
227
+ return this.native ? global.SkiaDomApi.Path1DPathEffectNode(props) : new _paint.Path1DPathEffectNode(this.ctx, props);
229
228
  }
230
229
 
231
230
  Path2DPathEffect(props) {
232
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.Path2DPathEffectNode(props) : new _paint.Path2DPathEffectNode(this.ctx, props);
231
+ return this.native ? global.SkiaDomApi.Path2DPathEffectNode(props) : new _paint.Path2DPathEffectNode(this.ctx, props);
233
232
  }
234
233
 
235
234
  SumPathEffect() {
236
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.SumPathEffectNode() : new _paint.SumPathEffectNode(this.ctx);
235
+ return this.native ? global.SkiaDomApi.SumPathEffectNode() : new _paint.SumPathEffectNode(this.ctx);
237
236
  }
238
237
 
239
238
  Line2DPathEffect(props) {
240
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.Line2DPathEffectNode(props) : new _paint.Line2DPathEffectNode(this.ctx, props);
239
+ return this.native ? global.SkiaDomApi.Line2DPathEffectNode(props) : new _paint.Line2DPathEffectNode(this.ctx, props);
241
240
  }
242
241
 
243
242
  Blend(props) {
244
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlendNode(props) : new _paint.BlendNode(this.ctx, props);
243
+ return this.native ? global.SkiaDomApi.BlendNode(props) : new _paint.BlendNode(this.ctx, props);
245
244
  }
246
245
 
247
246
  BackdropFilter(props) {
248
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BackdropFilterNode(props) : new _drawings.BackdropFilterNode(this.ctx, props);
247
+ return this.native ? global.SkiaDomApi.BackdropFilterNode(props) : new _drawings.BackdropFilterNode(this.ctx, props);
249
248
  }
250
249
 
251
250
  Box(props) {
252
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BoxNode(props) : new _drawings.BoxNode(this.ctx, props);
251
+ return this.native ? global.SkiaDomApi.BoxNode(props) : new _drawings.BoxNode(this.ctx, props);
253
252
  }
254
253
 
255
254
  BoxShadow(props) {
256
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BoxShadowNode(props) : new _drawings.BoxShadowNode(this.ctx, props);
255
+ return this.native ? global.SkiaDomApi.BoxShadowNode(props) : new _drawings.BoxShadowNode(this.ctx, props);
257
256
  } // Paragraph
258
257
 
259
258
 
260
259
  Paragraph(props) {
261
- return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ParagraphNode(props) : new _ParagraphNode.ParagraphNode(this.ctx, props);
260
+ return this.native ? global.SkiaDomApi.ParagraphNode(props) : new _ParagraphNode.ParagraphNode(this.ctx, props);
262
261
  }
263
262
 
264
263
  }