@shopify/react-native-skia 2.9.1 → 2.10.0

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 (220) hide show
  1. package/android/CMakeLists.txt +1 -5
  2. package/cpp/api/JsiNativeBuffer.h +15 -10
  3. package/cpp/api/JsiSkAnimatedImage.h +21 -19
  4. package/cpp/api/JsiSkAnimatedImageFactory.h +13 -14
  5. package/cpp/api/JsiSkApi.h +246 -92
  6. package/cpp/api/JsiSkCanvas.h +76 -58
  7. package/cpp/api/JsiSkColor.h +7 -5
  8. package/cpp/api/JsiSkColorFilter.h +15 -8
  9. package/cpp/api/JsiSkColorFilterFactory.h +45 -45
  10. package/cpp/api/JsiSkContourMeasure.h +24 -21
  11. package/cpp/api/JsiSkContourMeasureIter.h +18 -21
  12. package/cpp/api/JsiSkData.h +13 -7
  13. package/cpp/api/JsiSkDataFactory.h +22 -21
  14. package/cpp/api/JsiSkFont.h +56 -44
  15. package/cpp/api/JsiSkFontMgr.h +22 -13
  16. package/cpp/api/JsiSkFontMgrFactory.h +12 -10
  17. package/cpp/api/JsiSkFontStyle.h +14 -12
  18. package/cpp/api/JsiSkImage.h +45 -34
  19. package/cpp/api/JsiSkImageFactory.h +47 -52
  20. package/cpp/api/JsiSkImageFilter.h +21 -11
  21. package/cpp/api/JsiSkImageFilterFactory.h +96 -96
  22. package/cpp/api/JsiSkImageInfo.h +22 -19
  23. package/cpp/api/JsiSkMaskFilter.h +21 -11
  24. package/cpp/api/JsiSkMaskFilterFactory.h +16 -13
  25. package/cpp/api/JsiSkMatrix.h +31 -31
  26. package/cpp/api/JsiSkNativeObjects.h +419 -0
  27. package/cpp/api/JsiSkPaint.h +59 -39
  28. package/cpp/api/JsiSkParagraph.h +39 -32
  29. package/cpp/api/JsiSkParagraphBuilder.h +24 -21
  30. package/cpp/api/JsiSkParagraphBuilderFactory.h +13 -12
  31. package/cpp/api/JsiSkPath.h +95 -70
  32. package/cpp/api/JsiSkPathBuilder.h +83 -67
  33. package/cpp/api/JsiSkPathBuilderFactory.h +16 -17
  34. package/cpp/api/JsiSkPathEffect.h +21 -11
  35. package/cpp/api/JsiSkPathEffectFactory.h +33 -32
  36. package/cpp/api/JsiSkPathFactory.h +79 -103
  37. package/cpp/api/JsiSkPicture.h +24 -13
  38. package/cpp/api/JsiSkPictureFactory.h +21 -26
  39. package/cpp/api/JsiSkPictureRecorder.h +21 -22
  40. package/cpp/api/JsiSkPoint.h +19 -22
  41. package/cpp/api/JsiSkRRect.h +22 -29
  42. package/cpp/api/JsiSkRSXform.h +26 -30
  43. package/cpp/api/JsiSkRect.h +28 -30
  44. package/cpp/api/JsiSkRuntimeEffect.h +39 -30
  45. package/cpp/api/JsiSkRuntimeEffectFactory.h +12 -12
  46. package/cpp/api/JsiSkRuntimeShaderBuilder.h +25 -18
  47. package/cpp/api/JsiSkSVG.h +13 -13
  48. package/cpp/api/JsiSkSVGFactory.h +17 -20
  49. package/cpp/api/JsiSkShader.h +15 -8
  50. package/cpp/api/JsiSkShaderFactory.h +41 -48
  51. package/cpp/api/JsiSkSkottie.h +49 -39
  52. package/cpp/api/JsiSkSurface.h +24 -24
  53. package/cpp/api/JsiSkSurfaceFactory.h +15 -16
  54. package/cpp/api/JsiSkTextBlob.h +15 -8
  55. package/cpp/api/JsiSkTextBlobFactory.h +25 -28
  56. package/cpp/api/JsiSkTypeface.h +19 -12
  57. package/cpp/api/JsiSkTypefaceFactory.h +12 -12
  58. package/cpp/api/JsiSkTypefaceFontProvider.h +30 -25
  59. package/cpp/api/JsiSkTypefaceFontProviderFactory.h +14 -12
  60. package/cpp/api/JsiSkVertices.h +21 -18
  61. package/cpp/api/JsiSkiaContext.h +17 -17
  62. package/cpp/api/JsiSkottieFactory.h +16 -17
  63. package/cpp/api/JsiVideo.h +27 -25
  64. package/cpp/api/recorder/Convertor.h +31 -61
  65. package/cpp/api/recorder/DataTypes.h +8 -16
  66. package/cpp/api/recorder/JsiRecorder.h +83 -55
  67. package/cpp/api/recorder/RNRecorder.h +1 -1
  68. package/cpp/jsi/BoxedNativeObject.h +146 -0
  69. package/cpp/{jsi2 → jsi}/EnumMapper.h +4 -1
  70. package/cpp/{jsi2 → jsi}/NativeObject.h +120 -146
  71. package/cpp/jsi/RuntimeAwareCache.cpp +1 -1
  72. package/cpp/jsi/RuntimeAwareCache.h +26 -8
  73. package/cpp/jsi/ViewProperty.h +5 -11
  74. package/cpp/rnskia/RNSkJsiViewApi.h +20 -11
  75. package/cpp/rnskia/RNSkManager.cpp +23 -25
  76. package/cpp/rnskia/RNSkPictureView.h +1 -1
  77. package/cpp/rnwgpu/ArrayBuffer.h +5 -6
  78. package/cpp/rnwgpu/Canvas.h +4 -2
  79. package/cpp/rnwgpu/api/GPU.cpp +4 -4
  80. package/cpp/rnwgpu/api/GPU.h +1 -1
  81. package/cpp/rnwgpu/api/GPUAdapter.cpp +2 -3
  82. package/cpp/rnwgpu/api/GPUAdapter.h +4 -4
  83. package/cpp/rnwgpu/api/GPUAdapterInfo.h +1 -1
  84. package/cpp/rnwgpu/api/GPUBindGroup.h +1 -1
  85. package/cpp/rnwgpu/api/GPUBindGroupLayout.h +1 -1
  86. package/cpp/rnwgpu/api/GPUBuffer.h +1 -1
  87. package/cpp/rnwgpu/api/GPUCanvasContext.h +1 -1
  88. package/cpp/rnwgpu/api/GPUCommandBuffer.h +1 -1
  89. package/cpp/rnwgpu/api/GPUCommandEncoder.h +1 -1
  90. package/cpp/rnwgpu/api/GPUCompilationInfo.h +1 -1
  91. package/cpp/rnwgpu/api/GPUCompilationMessage.h +1 -1
  92. package/cpp/rnwgpu/api/GPUComputePassEncoder.h +1 -1
  93. package/cpp/rnwgpu/api/GPUComputePipeline.h +1 -1
  94. package/cpp/rnwgpu/api/GPUDevice.cpp +6 -7
  95. package/cpp/rnwgpu/api/GPUDevice.h +3 -3
  96. package/cpp/rnwgpu/api/GPUDeviceLostInfo.h +1 -1
  97. package/cpp/rnwgpu/api/GPUError.h +1 -1
  98. package/cpp/rnwgpu/api/GPUExtent3D.h +1 -1
  99. package/cpp/rnwgpu/api/GPUExternalTexture.h +1 -1
  100. package/cpp/rnwgpu/api/GPUInternalError.h +1 -1
  101. package/cpp/rnwgpu/api/GPUOrigin2D.h +1 -1
  102. package/cpp/rnwgpu/api/GPUOrigin3D.h +1 -1
  103. package/cpp/rnwgpu/api/GPUOutOfMemoryError.h +1 -1
  104. package/cpp/rnwgpu/api/GPUPipelineLayout.h +1 -1
  105. package/cpp/rnwgpu/api/GPUQuerySet.h +1 -1
  106. package/cpp/rnwgpu/api/GPUQueue.h +1 -1
  107. package/cpp/rnwgpu/api/GPURenderBundle.h +1 -1
  108. package/cpp/rnwgpu/api/GPURenderBundleEncoder.h +1 -1
  109. package/cpp/rnwgpu/api/GPURenderPassEncoder.h +1 -1
  110. package/cpp/rnwgpu/api/GPURenderPipeline.h +1 -1
  111. package/cpp/rnwgpu/api/GPUSampler.h +1 -1
  112. package/cpp/rnwgpu/api/GPUShaderModule.cpp +1 -1
  113. package/cpp/rnwgpu/api/GPUShaderModule.h +1 -1
  114. package/cpp/rnwgpu/api/GPUSharedFence.h +1 -1
  115. package/cpp/rnwgpu/api/GPUSharedTextureMemory.h +1 -1
  116. package/cpp/rnwgpu/api/GPUSupportedLimits.h +1 -1
  117. package/cpp/rnwgpu/api/GPUTexture.h +1 -1
  118. package/cpp/rnwgpu/api/GPUTextureView.h +1 -1
  119. package/cpp/rnwgpu/api/GPUUncapturedErrorEvent.h +1 -1
  120. package/cpp/rnwgpu/api/GPUValidationError.h +1 -1
  121. package/cpp/rnwgpu/api/ImageBitmap.h +1 -1
  122. package/cpp/rnwgpu/api/RNWebGPU.h +1 -1
  123. package/cpp/rnwgpu/api/descriptors/GPUBindGroupDescriptor.h +1 -1
  124. package/cpp/rnwgpu/api/descriptors/GPUBindGroupEntry.h +1 -1
  125. package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutDescriptor.h +1 -1
  126. package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutEntry.h +1 -1
  127. package/cpp/rnwgpu/api/descriptors/GPUBlendComponent.h +1 -1
  128. package/cpp/rnwgpu/api/descriptors/GPUBlendState.h +1 -1
  129. package/cpp/rnwgpu/api/descriptors/GPUBufferBinding.h +1 -1
  130. package/cpp/rnwgpu/api/descriptors/GPUBufferBindingLayout.h +1 -1
  131. package/cpp/rnwgpu/api/descriptors/GPUBufferDescriptor.h +1 -1
  132. package/cpp/rnwgpu/api/descriptors/GPUCanvasConfiguration.h +1 -1
  133. package/cpp/rnwgpu/api/descriptors/GPUColor.h +1 -1
  134. package/cpp/rnwgpu/api/descriptors/GPUColorTargetState.h +1 -1
  135. package/cpp/rnwgpu/api/descriptors/GPUCommandBufferDescriptor.h +1 -1
  136. package/cpp/rnwgpu/api/descriptors/GPUCommandEncoderDescriptor.h +1 -1
  137. package/cpp/rnwgpu/api/descriptors/GPUComputePassDescriptor.h +1 -1
  138. package/cpp/rnwgpu/api/descriptors/GPUComputePassTimestampWrites.h +1 -1
  139. package/cpp/rnwgpu/api/descriptors/GPUComputePipelineDescriptor.h +1 -1
  140. package/cpp/rnwgpu/api/descriptors/GPUDawnTogglesDescriptor.h +1 -1
  141. package/cpp/rnwgpu/api/descriptors/GPUDepthStencilState.h +1 -1
  142. package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +1 -1
  143. package/cpp/rnwgpu/api/descriptors/GPUExternalTextureBindingLayout.h +1 -1
  144. package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +1 -1
  145. package/cpp/rnwgpu/api/descriptors/GPUFragmentState.h +1 -1
  146. package/cpp/rnwgpu/api/descriptors/GPUImageCopyBuffer.h +1 -1
  147. package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +1 -1
  148. package/cpp/rnwgpu/api/descriptors/GPUImageCopyTexture.h +1 -1
  149. package/cpp/rnwgpu/api/descriptors/GPUImageCopyTextureTagged.h +1 -1
  150. package/cpp/rnwgpu/api/descriptors/GPUImageDataLayout.h +1 -1
  151. package/cpp/rnwgpu/api/descriptors/GPUMultisampleState.h +1 -1
  152. package/cpp/rnwgpu/api/descriptors/GPUPipelineLayoutDescriptor.h +1 -1
  153. package/cpp/rnwgpu/api/descriptors/GPUPrimitiveState.h +1 -1
  154. package/cpp/rnwgpu/api/descriptors/GPUProgrammableStage.h +1 -1
  155. package/cpp/rnwgpu/api/descriptors/GPUQuerySetDescriptor.h +1 -1
  156. package/cpp/rnwgpu/api/descriptors/GPUQueueDescriptor.h +1 -1
  157. package/cpp/rnwgpu/api/descriptors/GPURenderBundleDescriptor.h +1 -1
  158. package/cpp/rnwgpu/api/descriptors/GPURenderBundleEncoderDescriptor.h +1 -1
  159. package/cpp/rnwgpu/api/descriptors/GPURenderPassColorAttachment.h +1 -1
  160. package/cpp/rnwgpu/api/descriptors/GPURenderPassDepthStencilAttachment.h +1 -1
  161. package/cpp/rnwgpu/api/descriptors/GPURenderPassDescriptor.h +1 -1
  162. package/cpp/rnwgpu/api/descriptors/GPURenderPassTimestampWrites.h +1 -1
  163. package/cpp/rnwgpu/api/descriptors/GPURenderPipelineDescriptor.h +1 -1
  164. package/cpp/rnwgpu/api/descriptors/GPURequestAdapterOptions.h +1 -1
  165. package/cpp/rnwgpu/api/descriptors/GPUSamplerBindingLayout.h +1 -1
  166. package/cpp/rnwgpu/api/descriptors/GPUSamplerDescriptor.h +1 -1
  167. package/cpp/rnwgpu/api/descriptors/GPUShaderModuleCompilationHint.h +1 -1
  168. package/cpp/rnwgpu/api/descriptors/GPUShaderModuleDescriptor.h +1 -1
  169. package/cpp/rnwgpu/api/descriptors/GPUSharedFenceDescriptor.h +1 -1
  170. package/cpp/rnwgpu/api/descriptors/GPUSharedFenceState.h +1 -1
  171. package/cpp/rnwgpu/api/descriptors/GPUSharedTextureMemoryDescriptor.h +1 -1
  172. package/cpp/rnwgpu/api/descriptors/GPUStencilFaceState.h +1 -1
  173. package/cpp/rnwgpu/api/descriptors/GPUStorageTextureBindingLayout.h +1 -1
  174. package/cpp/rnwgpu/api/descriptors/GPUTextureBindingLayout.h +1 -1
  175. package/cpp/rnwgpu/api/descriptors/GPUTextureDescriptor.h +1 -1
  176. package/cpp/rnwgpu/api/descriptors/GPUTextureViewDescriptor.h +1 -1
  177. package/cpp/rnwgpu/api/descriptors/GPUUncapturedErrorEventInit.h +1 -1
  178. package/cpp/rnwgpu/api/descriptors/GPUVertexAttribute.h +1 -1
  179. package/cpp/rnwgpu/api/descriptors/GPUVertexBufferLayout.h +1 -1
  180. package/cpp/rnwgpu/api/descriptors/GPUVertexState.h +1 -1
  181. package/cpp/rnwgpu/api/descriptors/Unions.h +1 -1
  182. package/cpp/rnwgpu/async/AsyncTaskHandle.cpp +20 -21
  183. package/lib/commonjs/external/reanimated/renderHelpers.d.ts +15 -0
  184. package/lib/commonjs/external/reanimated/renderHelpers.js +30 -1
  185. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  186. package/lib/commonjs/skia/NativeSetup.js +4 -0
  187. package/lib/commonjs/skia/NativeSetup.js.map +1 -1
  188. package/lib/commonjs/skia/SkiaWorkletSerialization.d.ts +1 -0
  189. package/lib/commonjs/skia/SkiaWorkletSerialization.js +66 -0
  190. package/lib/commonjs/skia/SkiaWorkletSerialization.js.map +1 -0
  191. package/lib/commonjs/sksg/Container.native.js +20 -1
  192. package/lib/commonjs/sksg/Container.native.js.map +1 -1
  193. package/lib/module/external/reanimated/renderHelpers.d.ts +15 -0
  194. package/lib/module/external/reanimated/renderHelpers.js +29 -0
  195. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  196. package/lib/module/skia/NativeSetup.js +4 -0
  197. package/lib/module/skia/NativeSetup.js.map +1 -1
  198. package/lib/module/skia/SkiaWorkletSerialization.d.ts +1 -0
  199. package/lib/module/skia/SkiaWorkletSerialization.js +59 -0
  200. package/lib/module/skia/SkiaWorkletSerialization.js.map +1 -0
  201. package/lib/module/sksg/Container.native.js +21 -2
  202. package/lib/module/sksg/Container.native.js.map +1 -1
  203. package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +2 -0
  204. package/lib/typescript/lib/commonjs/skia/SkiaWorkletSerialization.d.ts +2 -0
  205. package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +15 -0
  206. package/lib/typescript/lib/module/skia/SkiaWorkletSerialization.d.ts +1 -0
  207. package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +15 -0
  208. package/lib/typescript/src/skia/SkiaWorkletSerialization.d.ts +1 -0
  209. package/package.json +6 -2
  210. package/react-native-skia.podspec +1 -2
  211. package/src/external/reanimated/renderHelpers.ts +30 -0
  212. package/src/skia/NativeSetup.ts +5 -0
  213. package/src/skia/SkiaWorkletSerialization.ts +67 -0
  214. package/src/sksg/Container.native.ts +40 -2
  215. package/cpp/api/JsiSkHostObjects.h +0 -257
  216. package/cpp/jsi/JsiHostObject.cpp +0 -137
  217. package/cpp/jsi/JsiHostObject.h +0 -385
  218. /package/cpp/{jsi2 → jsi}/JSIConverter.h +0 -0
  219. /package/cpp/{jsi2 → jsi}/Promise.cpp +0 -0
  220. /package/cpp/{jsi2 → jsi}/Promise.h +0 -0
@@ -7,8 +7,8 @@
7
7
 
8
8
  #include <jsi/jsi.h>
9
9
 
10
- #include "JsiSkHostObjects.h"
11
10
  #include "JsiSkMatrix.h"
11
+ #include "JsiSkNativeObjects.h"
12
12
  #include "JsiSkPathEffect.h"
13
13
  #include "JsiSkPoint.h"
14
14
  #include "JsiSkRRect.h"
@@ -17,7 +17,6 @@
17
17
  #pragma clang diagnostic push
18
18
  #pragma clang diagnostic ignored "-Wdocumentation"
19
19
 
20
- #include "utils/RNSkLog.h"
21
20
  #include "include/core/SkPath.h"
22
21
  #include "include/core/SkPathBuilder.h"
23
22
  #include "include/core/SkPathUtils.h"
@@ -26,6 +25,7 @@
26
25
  #include "include/effects/SkTrimPathEffect.h"
27
26
  #include "include/pathops/SkPathOps.h"
28
27
  #include "include/utils/SkTextUtils.h"
28
+ #include "utils/RNSkLog.h"
29
29
 
30
30
  #pragma clang diagnostic pop
31
31
 
@@ -33,7 +33,7 @@ namespace RNSkia {
33
33
 
34
34
  namespace jsi = facebook::jsi;
35
35
 
36
- class JsiSkPathFactory : public JsiSkHostObject {
36
+ class JsiSkPathFactory : public JsiSkNativeObject<JsiSkPathFactory> {
37
37
 
38
38
  static const int MOVE = 0;
39
39
  static const int LINE = 1;
@@ -43,11 +43,11 @@ class JsiSkPathFactory : public JsiSkHostObject {
43
43
  static const int CLOSE = 5;
44
44
 
45
45
  public:
46
+ static constexpr const char *CLASS_NAME = "PathFactory";
47
+
46
48
  JSI_HOST_FUNCTION(Make) {
47
- auto hostObjectInstance =
48
- std::make_shared<JsiSkPath>(getContext(), SkPath());
49
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
50
- runtime, hostObjectInstance, getContext());
49
+ return makeJsiObject(runtime,
50
+ std::make_shared<JsiSkPath>(getContext(), SkPath()));
51
51
  }
52
52
 
53
53
  JSI_HOST_FUNCTION(MakeFromSVGString) {
@@ -57,10 +57,8 @@ public:
57
57
  throw jsi::JSError(runtime, "Could not parse Svg path");
58
58
  return jsi::Value(nullptr);
59
59
  }
60
- auto hostObjectInstance =
61
- std::make_shared<JsiSkPath>(getContext(), std::move(result.value()));
62
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
63
- runtime, hostObjectInstance, getContext());
60
+ return makeJsiObject(runtime, std::make_shared<JsiSkPath>(
61
+ getContext(), std::move(result.value())));
64
62
  }
65
63
 
66
64
  JSI_HOST_FUNCTION(MakeFromOp) {
@@ -71,10 +69,8 @@ public:
71
69
  if (!result.has_value()) {
72
70
  return jsi::Value(nullptr);
73
71
  }
74
- auto hostObjectInstance =
75
- std::make_shared<JsiSkPath>(getContext(), std::move(result.value()));
76
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
77
- runtime, hostObjectInstance, getContext());
72
+ return makeJsiObject(runtime, std::make_shared<JsiSkPath>(
73
+ getContext(), std::move(result.value())));
78
74
  }
79
75
 
80
76
  JSI_HOST_FUNCTION(MakeFromCmds) {
@@ -159,10 +155,8 @@ public:
159
155
  }
160
156
  }
161
157
  }
162
- auto hostObjectInstance =
163
- std::make_shared<JsiSkPath>(getContext(), builder.snapshot());
164
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
165
- runtime, hostObjectInstance, getContext());
158
+ return makeJsiObject(
159
+ runtime, std::make_shared<JsiSkPath>(getContext(), builder.snapshot()));
166
160
  }
167
161
 
168
162
  JSI_HOST_FUNCTION(MakeFromText) {
@@ -173,10 +167,8 @@ public:
173
167
  SkPath path;
174
168
  SkTextUtils::GetPath(text.c_str(), strlen(text.c_str()),
175
169
  SkTextEncoding::kUTF8, x, y, *font, &path);
176
- auto hostObjectInstance =
177
- std::make_shared<JsiSkPath>(getContext(), std::move(path));
178
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
179
- runtime, hostObjectInstance, getContext());
170
+ return makeJsiObject(
171
+ runtime, std::make_shared<JsiSkPath>(getContext(), std::move(path)));
180
172
  }
181
173
 
182
174
  // Static shape factories
@@ -188,10 +180,8 @@ public:
188
180
  }
189
181
  SkPathBuilder builder;
190
182
  builder.addRect(*rect, direction);
191
- auto hostObjectInstance =
192
- std::make_shared<JsiSkPath>(getContext(), builder.snapshot());
193
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
194
- runtime, hostObjectInstance, getContext());
183
+ return makeJsiObject(
184
+ runtime, std::make_shared<JsiSkPath>(getContext(), builder.snapshot()));
195
185
  }
196
186
 
197
187
  JSI_HOST_FUNCTION(Oval) {
@@ -203,10 +193,8 @@ public:
203
193
  unsigned startIndex = count < 3 ? 0 : arguments[2].asNumber();
204
194
  SkPathBuilder builder;
205
195
  builder.addOval(*rect, direction, startIndex);
206
- auto hostObjectInstance =
207
- std::make_shared<JsiSkPath>(getContext(), builder.snapshot());
208
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
209
- runtime, hostObjectInstance, getContext());
196
+ return makeJsiObject(
197
+ runtime, std::make_shared<JsiSkPath>(getContext(), builder.snapshot()));
210
198
  }
211
199
 
212
200
  JSI_HOST_FUNCTION(Circle) {
@@ -215,10 +203,8 @@ public:
215
203
  auto r = arguments[2].asNumber();
216
204
  SkPathBuilder builder;
217
205
  builder.addCircle(x, y, r);
218
- auto hostObjectInstance =
219
- std::make_shared<JsiSkPath>(getContext(), builder.snapshot());
220
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
221
- runtime, hostObjectInstance, getContext());
206
+ return makeJsiObject(
207
+ runtime, std::make_shared<JsiSkPath>(getContext(), builder.snapshot()));
222
208
  }
223
209
 
224
210
  JSI_HOST_FUNCTION(RRect) {
@@ -229,10 +215,8 @@ public:
229
215
  }
230
216
  SkPathBuilder builder;
231
217
  builder.addRRect(*rrect, direction);
232
- auto hostObjectInstance =
233
- std::make_shared<JsiSkPath>(getContext(), builder.snapshot());
234
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
235
- runtime, hostObjectInstance, getContext());
218
+ return makeJsiObject(
219
+ runtime, std::make_shared<JsiSkPath>(getContext(), builder.snapshot()));
236
220
  }
237
221
 
238
222
  JSI_HOST_FUNCTION(Line) {
@@ -241,10 +225,8 @@ public:
241
225
  SkPathBuilder builder;
242
226
  builder.moveTo(*p1);
243
227
  builder.lineTo(*p2);
244
- auto hostObjectInstance =
245
- std::make_shared<JsiSkPath>(getContext(), builder.snapshot());
246
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
247
- runtime, hostObjectInstance, getContext());
228
+ return makeJsiObject(
229
+ runtime, std::make_shared<JsiSkPath>(getContext(), builder.snapshot()));
248
230
  }
249
231
 
250
232
  JSI_HOST_FUNCTION(Polygon) {
@@ -260,10 +242,8 @@ public:
260
242
  }
261
243
  SkPathBuilder builder;
262
244
  builder.addPolygon(SkSpan(points), close);
263
- auto hostObjectInstance =
264
- std::make_shared<JsiSkPath>(getContext(), builder.snapshot());
265
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
266
- runtime, hostObjectInstance, getContext());
245
+ return makeJsiObject(
246
+ runtime, std::make_shared<JsiSkPath>(getContext(), builder.snapshot()));
267
247
  }
268
248
 
269
249
  // Static path operations
@@ -307,19 +287,17 @@ public:
307
287
  auto success =
308
288
  skpathutils::FillPathWithPaint(path, p, &resultBuilder, nullptr, ctm);
309
289
  if (success) {
310
- auto hostObjectInstance =
311
- std::make_shared<JsiSkPath>(getContext(), resultBuilder.snapshot());
312
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
313
- runtime, hostObjectInstance, getContext());
290
+ return makeJsiObject(
291
+ runtime, std::make_shared<JsiSkPath>(getContext(),
292
+ resultBuilder.snapshot()));
314
293
  }
315
294
  } else {
316
295
  SkPathBuilder resultBuilder;
317
296
  auto success = skpathutils::FillPathWithPaint(path, p, &resultBuilder);
318
297
  if (success) {
319
- auto hostObjectInstance =
320
- std::make_shared<JsiSkPath>(getContext(), resultBuilder.snapshot());
321
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
322
- runtime, hostObjectInstance, getContext());
298
+ return makeJsiObject(
299
+ runtime, std::make_shared<JsiSkPath>(getContext(),
300
+ resultBuilder.snapshot()));
323
301
  }
324
302
  }
325
303
  return jsi::Value::null();
@@ -335,10 +313,8 @@ public:
335
313
  // If requesting the full path in normal mode, just return a copy
336
314
  if (start <= 0 && end >= 1 && !isComplement) {
337
315
  SkPath result = srcPath->snapshot();
338
- auto hostObjectInstance =
339
- std::make_shared<JsiSkPath>(getContext(), std::move(result));
340
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
341
- runtime, hostObjectInstance, getContext());
316
+ return makeJsiObject(runtime, std::make_shared<JsiSkPath>(
317
+ getContext(), std::move(result)));
342
318
  }
343
319
  SkPath path = srcPath->snapshot();
344
320
  auto mode = isComplement ? SkTrimPathEffect::Mode::kInverted
@@ -351,10 +327,8 @@ public:
351
327
  SkPathBuilder resultBuilder;
352
328
  if (pe->filterPath(&resultBuilder, path, &rec)) {
353
329
  auto result = resultBuilder.detach();
354
- auto hostObjectInstance =
355
- std::make_shared<JsiSkPath>(getContext(), std::move(result));
356
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
357
- runtime, hostObjectInstance, getContext());
330
+ return makeJsiObject(runtime, std::make_shared<JsiSkPath>(
331
+ getContext(), std::move(result)));
358
332
  }
359
333
  return jsi::Value::null();
360
334
  }
@@ -363,10 +337,9 @@ public:
363
337
  auto srcPath = JsiSkPath::fromValue(runtime, arguments[0]);
364
338
  auto result = ::Simplify(srcPath->snapshot());
365
339
  if (result.has_value()) {
366
- auto hostObjectInstance =
367
- std::make_shared<JsiSkPath>(getContext(), std::move(result.value()));
368
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
369
- runtime, hostObjectInstance, getContext());
340
+ return makeJsiObject(
341
+ runtime,
342
+ std::make_shared<JsiSkPath>(getContext(), std::move(result.value())));
370
343
  }
371
344
  return jsi::Value::null();
372
345
  }
@@ -386,10 +359,8 @@ public:
386
359
  SkPathBuilder resultBuilder;
387
360
  if (pe->filterPath(&resultBuilder, srcPath->snapshot(), &rec)) {
388
361
  auto result = resultBuilder.detach();
389
- auto hostObjectInstance =
390
- std::make_shared<JsiSkPath>(getContext(), std::move(result));
391
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
392
- runtime, hostObjectInstance, getContext());
362
+ return makeJsiObject(runtime, std::make_shared<JsiSkPath>(
363
+ getContext(), std::move(result)));
393
364
  }
394
365
  return jsi::Value::null();
395
366
  }
@@ -398,10 +369,9 @@ public:
398
369
  auto srcPath = JsiSkPath::fromValue(runtime, arguments[0]);
399
370
  auto result = ::AsWinding(srcPath->snapshot());
400
371
  if (result.has_value()) {
401
- auto hostObjectInstance =
402
- std::make_shared<JsiSkPath>(getContext(), std::move(result.value()));
403
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
404
- runtime, hostObjectInstance, getContext());
372
+ return makeJsiObject(
373
+ runtime,
374
+ std::make_shared<JsiSkPath>(getContext(), std::move(result.value())));
405
375
  }
406
376
  return jsi::Value::null();
407
377
  }
@@ -417,38 +387,44 @@ public:
417
387
  if (!succeed) {
418
388
  return jsi::Value::null();
419
389
  }
420
- auto hostObjectInstance =
421
- std::make_shared<JsiSkPath>(getContext(), std::move(result));
422
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
423
- runtime, hostObjectInstance, getContext());
390
+ return makeJsiObject(
391
+ runtime, std::make_shared<JsiSkPath>(getContext(), std::move(result)));
424
392
  }
425
393
 
426
- size_t getMemoryPressure() const override { return 1024; }
427
-
428
- std::string getObjectType() const override { return "JsiSkPathFactory"; }
429
-
430
- JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPathFactory, Make),
431
- JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromSVGString),
432
- JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromOp),
433
- JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromCmds),
434
- JSI_EXPORT_FUNC(JsiSkPathFactory, MakeFromText),
435
- // Static shape factories
436
- JSI_EXPORT_FUNC(JsiSkPathFactory, Rect),
437
- JSI_EXPORT_FUNC(JsiSkPathFactory, Oval),
438
- JSI_EXPORT_FUNC(JsiSkPathFactory, Circle),
439
- JSI_EXPORT_FUNC(JsiSkPathFactory, RRect),
440
- JSI_EXPORT_FUNC(JsiSkPathFactory, Line),
441
- JSI_EXPORT_FUNC(JsiSkPathFactory, Polygon),
442
- // Static path operations
443
- JSI_EXPORT_FUNC(JsiSkPathFactory, Stroke),
444
- JSI_EXPORT_FUNC(JsiSkPathFactory, Trim),
445
- JSI_EXPORT_FUNC(JsiSkPathFactory, Simplify),
446
- JSI_EXPORT_FUNC(JsiSkPathFactory, Dash),
447
- JSI_EXPORT_FUNC(JsiSkPathFactory, AsWinding),
448
- JSI_EXPORT_FUNC(JsiSkPathFactory, Interpolate))
394
+ size_t getMemoryPressure() override { return 1024; }
395
+
396
+ static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
397
+ installHostMethod(runtime, prototype, "Make", &JsiSkPathFactory::Make);
398
+ installHostMethod(runtime, prototype, "MakeFromSVGString",
399
+ &JsiSkPathFactory::MakeFromSVGString);
400
+ installHostMethod(runtime, prototype, "MakeFromOp",
401
+ &JsiSkPathFactory::MakeFromOp);
402
+ installHostMethod(runtime, prototype, "MakeFromCmds",
403
+ &JsiSkPathFactory::MakeFromCmds);
404
+ installHostMethod(runtime, prototype, "MakeFromText",
405
+ &JsiSkPathFactory::MakeFromText);
406
+ // Static shape factories
407
+ installHostMethod(runtime, prototype, "Rect", &JsiSkPathFactory::Rect);
408
+ installHostMethod(runtime, prototype, "Oval", &JsiSkPathFactory::Oval);
409
+ installHostMethod(runtime, prototype, "Circle", &JsiSkPathFactory::Circle);
410
+ installHostMethod(runtime, prototype, "RRect", &JsiSkPathFactory::RRect);
411
+ installHostMethod(runtime, prototype, "Line", &JsiSkPathFactory::Line);
412
+ installHostMethod(runtime, prototype, "Polygon",
413
+ &JsiSkPathFactory::Polygon);
414
+ // Static path operations
415
+ installHostMethod(runtime, prototype, "Stroke", &JsiSkPathFactory::Stroke);
416
+ installHostMethod(runtime, prototype, "Trim", &JsiSkPathFactory::Trim);
417
+ installHostMethod(runtime, prototype, "Simplify",
418
+ &JsiSkPathFactory::Simplify);
419
+ installHostMethod(runtime, prototype, "Dash", &JsiSkPathFactory::Dash);
420
+ installHostMethod(runtime, prototype, "AsWinding",
421
+ &JsiSkPathFactory::AsWinding);
422
+ installHostMethod(runtime, prototype, "Interpolate",
423
+ &JsiSkPathFactory::Interpolate);
424
+ }
449
425
 
450
426
  explicit JsiSkPathFactory(std::shared_ptr<RNSkPlatformContext> context)
451
- : JsiSkHostObject(std::move(context)) {}
427
+ : JsiSkNativeObject<JsiSkPathFactory>(std::move(context)) {}
452
428
  };
453
429
 
454
430
  } // namespace RNSkia
@@ -4,8 +4,8 @@
4
4
 
5
5
  #include "JsiSkData.h"
6
6
  #include "JsiSkDispatcher.h"
7
- #include "JsiSkHostObjects.h"
8
7
  #include "JsiSkMatrix.h"
8
+ #include "JsiSkNativeObjects.h"
9
9
  #include "JsiSkRect.h"
10
10
  #include "JsiSkShader.h"
11
11
 
@@ -20,14 +20,18 @@ namespace RNSkia {
20
20
 
21
21
  namespace jsi = facebook::jsi;
22
22
 
23
- class JsiSkPicture : public JsiSkWrappingSkPtrHostObject<SkPicture> {
23
+ class JsiSkPicture
24
+ : public JsiSkWrappingSkPtrNativeObject<JsiSkPicture, SkPicture> {
24
25
  private:
25
26
  std::shared_ptr<Dispatcher> _dispatcher;
26
27
 
27
28
  public:
29
+ static constexpr const char *CLASS_NAME = "Picture";
30
+
28
31
  JsiSkPicture(std::shared_ptr<RNSkPlatformContext> context,
29
32
  const sk_sp<SkPicture> picture)
30
- : JsiSkWrappingSkPtrHostObject<SkPicture>(context, picture) {
33
+ : JsiSkWrappingSkPtrNativeObject<JsiSkPicture, SkPicture>(context,
34
+ picture) {
31
35
  // Get the dispatcher for the current thread
32
36
  _dispatcher = Dispatcher::getDispatcher();
33
37
  // Process any pending operations
@@ -66,9 +70,8 @@ public:
66
70
 
67
71
  // Create shader
68
72
  auto shader = getObject()->makeShader(tmx, tmy, fm, m, tr);
69
- auto shaderObj = std::make_shared<JsiSkShader>(getContext(), shader);
70
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(runtime, shaderObj,
71
- getContext());
73
+ return makeJsiObject(runtime,
74
+ std::make_shared<JsiSkShader>(getContext(), shader));
72
75
  }
73
76
 
74
77
  JSI_HOST_FUNCTION(serialize) {
@@ -90,13 +93,23 @@ public:
90
93
  return array;
91
94
  }
92
95
 
93
- EXPORT_JSI_API_TYPENAME(JsiSkPicture, Picture)
96
+ /**
97
+ Returns the underlying object from a host object of this type
98
+ */
99
+ static sk_sp<SkPicture> fromValue(jsi::Runtime &runtime,
100
+ const jsi::Value &obj) {
101
+ return getJsiObject<JsiSkPicture>(runtime, obj)->getObject();
102
+ }
94
103
 
95
- JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPicture, makeShader),
96
- JSI_EXPORT_FUNC(JsiSkPicture, serialize),
97
- JSI_EXPORT_FUNC(JsiSkPicture, dispose))
104
+ static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
105
+ installCommon(runtime, prototype);
106
+ installHostMethod(runtime, prototype, "makeShader",
107
+ &JsiSkPicture::makeShader);
108
+ installHostMethod(runtime, prototype, "serialize",
109
+ &JsiSkPicture::serialize);
110
+ }
98
111
 
99
- size_t getMemoryPressure() const override {
112
+ size_t getMemoryPressure() override {
100
113
  if (isDisposed()) {
101
114
  return 0;
102
115
  }
@@ -108,7 +121,5 @@ public:
108
121
  auto bytesUsed = picture->approximateBytesUsed();
109
122
  return bytesUsed;
110
123
  }
111
-
112
- std::string getObjectType() const override { return "JsiSkPicture"; }
113
124
  };
114
125
  } // namespace RNSkia
@@ -4,7 +4,7 @@
4
4
 
5
5
  #include "JsiSkColorFilter.h"
6
6
  #include "JsiSkData.h"
7
- #include "JsiSkHostObjects.h"
7
+ #include "JsiSkNativeObjects.h"
8
8
  #include "JsiSkPicture.h"
9
9
 
10
10
  #pragma clang diagnostic push
@@ -19,15 +19,15 @@ namespace RNSkia {
19
19
 
20
20
  namespace jsi = facebook::jsi;
21
21
 
22
- class JsiSkPictureFactory : public JsiSkHostObject {
22
+ class JsiSkPictureFactory : public JsiSkNativeObject<JsiSkPictureFactory> {
23
23
  public:
24
+ static constexpr const char *CLASS_NAME = "PictureFactory";
25
+
24
26
  JSI_HOST_FUNCTION(MakePicture) {
25
27
  // Handle null case - create JsiSkPicture with nullptr
26
28
  if (arguments[0].isNull() || arguments[0].isUndefined()) {
27
- auto hostObjectInstance =
28
- std::make_shared<JsiSkPicture>(getContext(), nullptr);
29
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
30
- runtime, hostObjectInstance, getContext());
29
+ return makeJsiObject(
30
+ runtime, std::make_shared<JsiSkPicture>(getContext(), nullptr));
31
31
  }
32
32
 
33
33
  if (!arguments[0].isObject()) {
@@ -36,18 +36,14 @@ public:
36
36
  auto obj = arguments[0].asObject(runtime);
37
37
 
38
38
  // Check if it's a JsiSkData object first
39
- if (obj.isHostObject(runtime)) {
40
- if (auto jsiData = obj.asHostObject<JsiSkData>(runtime)) {
41
- auto data = jsiData->getObject();
42
- auto picture = SkPicture::MakeFromData(data.get());
43
- if (picture != nullptr) {
44
- auto hostObjectInstance =
45
- std::make_shared<JsiSkPicture>(getContext(), std::move(picture));
46
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
47
- runtime, hostObjectInstance, getContext());
48
- }
49
- return jsi::Value::undefined();
39
+ if (auto jsiData = tryGetJsiObject<JsiSkData>(runtime, obj)) {
40
+ auto data = jsiData->getObject();
41
+ auto picture = SkPicture::MakeFromData(data.get());
42
+ if (picture != nullptr) {
43
+ return makeJsiObject(runtime, std::make_shared<JsiSkPicture>(
44
+ getContext(), std::move(picture)));
50
45
  }
46
+ return jsi::Value::undefined();
51
47
  }
52
48
 
53
49
  // Get ArrayBuffer - try buffer property first (Uint8Array, etc.), then
@@ -64,23 +60,22 @@ public:
64
60
  SkData::MakeWithCopy(buffer.data(runtime), buffer.size(runtime));
65
61
  auto picture = SkPicture::MakeFromData(data.get());
66
62
  if (picture != nullptr) {
67
- auto hostObjectInstance =
68
- std::make_shared<JsiSkPicture>(getContext(), std::move(picture));
69
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
70
- runtime, hostObjectInstance, getContext());
63
+ return makeJsiObject(runtime, std::make_shared<JsiSkPicture>(
64
+ getContext(), std::move(picture)));
71
65
  } else {
72
66
  return jsi::Value::undefined();
73
67
  }
74
68
  }
75
69
 
76
- JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPictureFactory, MakePicture))
70
+ size_t getMemoryPressure() override { return 1024; }
77
71
 
78
- size_t getMemoryPressure() const override { return 1024; }
79
-
80
- std::string getObjectType() const override { return "JsiSkPictureFactory"; }
72
+ static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
73
+ installHostMethod(runtime, prototype, "MakePicture",
74
+ &JsiSkPictureFactory::MakePicture);
75
+ }
81
76
 
82
77
  explicit JsiSkPictureFactory(std::shared_ptr<RNSkPlatformContext> context)
83
- : JsiSkHostObject(std::move(context)) {}
78
+ : JsiSkNativeObject<JsiSkPictureFactory>(std::move(context)) {}
84
79
  };
85
80
 
86
81
  } // namespace RNSkia
@@ -3,7 +3,7 @@
3
3
  #include <memory>
4
4
 
5
5
  #include "JsiSkCanvas.h"
6
- #include "JsiSkHostObjects.h"
6
+ #include "JsiSkNativeObjects.h"
7
7
  #include "JsiSkPicture.h"
8
8
  #include "JsiSkRect.h"
9
9
 
@@ -20,10 +20,14 @@ namespace RNSkia {
20
20
  namespace jsi = facebook::jsi;
21
21
 
22
22
  class JsiSkPictureRecorder
23
- : public JsiSkWrappingSharedPtrHostObject<SkPictureRecorder> {
23
+ : public JsiSkWrappingSharedPtrNativeObject<JsiSkPictureRecorder,
24
+ SkPictureRecorder> {
24
25
  public:
26
+ static constexpr const char *CLASS_NAME = "PictureRecorder";
27
+
25
28
  explicit JsiSkPictureRecorder(std::shared_ptr<RNSkPlatformContext> context)
26
- : JsiSkWrappingSharedPtrHostObject<SkPictureRecorder>(
29
+ : JsiSkWrappingSharedPtrNativeObject<JsiSkPictureRecorder,
30
+ SkPictureRecorder>(
27
31
  context, std::make_shared<SkPictureRecorder>()) {}
28
32
 
29
33
  JSI_HOST_FUNCTION(beginRecording) {
@@ -37,36 +41,31 @@ public:
37
41
  SkRect rect = SkRect::Make(size);
38
42
  canvas = getObject()->beginRecording(rect, nullptr);
39
43
  }
40
- auto canvasObj = std::make_shared<JsiSkCanvas>(getContext(), canvas);
41
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(runtime, canvasObj,
42
- getContext());
44
+ return makeJsiObject(runtime,
45
+ std::make_shared<JsiSkCanvas>(getContext(), canvas));
43
46
  }
44
47
 
45
48
  JSI_HOST_FUNCTION(finishRecordingAsPicture) {
46
49
  auto picture = getObject()->finishRecordingAsPicture();
47
- auto hostObjectInstance =
48
- std::make_shared<JsiSkPicture>(getContext(), std::move(picture));
49
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
50
- runtime, hostObjectInstance, getContext());
50
+ return makeJsiObject(runtime, std::make_shared<JsiSkPicture>(
51
+ getContext(), std::move(picture)));
51
52
  }
52
53
 
53
- EXPORT_JSI_API_TYPENAME(JsiSkPictureRecorder, PictureRecorder)
54
-
55
- JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPictureRecorder, beginRecording),
56
- JSI_EXPORT_FUNC(JsiSkPictureRecorder,
57
- finishRecordingAsPicture),
58
- JSI_EXPORT_FUNC(JsiSkPictureRecorder, dispose))
59
-
60
- size_t getMemoryPressure() const override { return 1024 * 1024; }
54
+ static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
55
+ installCommon(runtime, prototype);
56
+ installHostMethod(runtime, prototype, "beginRecording",
57
+ &JsiSkPictureRecorder::beginRecording);
58
+ installHostMethod(runtime, prototype, "finishRecordingAsPicture",
59
+ &JsiSkPictureRecorder::finishRecordingAsPicture);
60
+ }
61
61
 
62
- std::string getObjectType() const override { return "JsiSkPictureRecorder"; }
62
+ size_t getMemoryPressure() override { return 1024 * 1024; }
63
63
 
64
64
  static const jsi::HostFunctionType
65
65
  createCtor(std::shared_ptr<RNSkPlatformContext> context) {
66
66
  return JSI_HOST_FUNCTION_LAMBDA {
67
- auto recorder = std::make_shared<JsiSkPictureRecorder>(context);
68
- return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(runtime, recorder,
69
- context);
67
+ return makeJsiObject(runtime,
68
+ std::make_shared<JsiSkPictureRecorder>(context));
70
69
  };
71
70
  }
72
71
  };