@shopify/react-native-skia 1.12.0 → 1.12.2

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 (233) hide show
  1. package/android/cpp/jni/JniPlatformContext.cpp +1 -0
  2. package/apple/MetalContext.h +129 -0
  3. package/apple/MetalContext.mm +34 -0
  4. package/apple/MetalWindowContext.h +39 -0
  5. package/apple/MetalWindowContext.mm +64 -0
  6. package/apple/RNSkApplePlatformContext.h +79 -0
  7. package/apple/RNSkApplePlatformContext.mm +303 -0
  8. package/apple/RNSkAppleVideo.h +51 -0
  9. package/apple/RNSkAppleVideo.mm +137 -0
  10. package/apple/RNSkAppleView.h +37 -0
  11. package/apple/RNSkAppleView.mm +35 -0
  12. package/apple/RNSkMetalCanvasProvider.h +38 -0
  13. package/apple/RNSkMetalCanvasProvider.mm +108 -0
  14. package/apple/RNSkiaModule.h +20 -0
  15. package/apple/RNSkiaModule.mm +55 -0
  16. package/apple/SkiaCVPixelBufferUtils.h +119 -0
  17. package/apple/SkiaCVPixelBufferUtils.mm +344 -0
  18. package/apple/SkiaManager.h +25 -0
  19. package/apple/SkiaManager.mm +62 -0
  20. package/apple/SkiaPictureView.h +7 -0
  21. package/apple/SkiaPictureView.mm +66 -0
  22. package/apple/SkiaPictureViewManager.h +8 -0
  23. package/apple/SkiaPictureViewManager.mm +55 -0
  24. package/apple/SkiaUIView.h +45 -0
  25. package/apple/SkiaUIView.mm +172 -0
  26. package/apple/ViewScreenshotService.h +25 -0
  27. package/apple/ViewScreenshotService.mm +89 -0
  28. package/cpp/api/JsiSkContourMeasure.h +1 -1
  29. package/cpp/api/JsiSkHostObjects.h +21 -10
  30. package/cpp/api/JsiSkParagraph.h +17 -27
  31. package/cpp/api/JsiSkPathEffect.h +1 -1
  32. package/cpp/api/JsiSkPictureFactory.h +1 -1
  33. package/cpp/api/recorder/Drawings.h +4 -3
  34. package/cpp/skia/include/codec/SkCodec.h +7 -2
  35. package/cpp/skia/include/config/SkUserConfig.h +11 -0
  36. package/cpp/skia/include/core/SkCanvas.h +11 -7
  37. package/cpp/skia/include/core/SkColor.h +10 -0
  38. package/cpp/skia/include/core/SkColorSpace.h +184 -2
  39. package/cpp/skia/include/core/SkColorType.h +114 -32
  40. package/cpp/skia/include/core/SkFontScanner.h +5 -8
  41. package/cpp/skia/include/core/SkFontStyle.h +1 -1
  42. package/cpp/skia/include/core/SkMaskFilter.h +0 -8
  43. package/cpp/skia/include/core/SkMilestone.h +1 -1
  44. package/cpp/skia/include/core/SkPath.h +1 -1
  45. package/cpp/skia/include/core/SkRRect.h +3 -1
  46. package/cpp/skia/include/core/SkShader.h +3 -3
  47. package/cpp/skia/include/core/SkString.h +8 -8
  48. package/cpp/skia/include/core/SkSurface.h +14 -0
  49. package/cpp/skia/include/core/SkTypeface.h +24 -7
  50. package/cpp/skia/include/effects/SkGradientShader.h +6 -1
  51. package/cpp/skia/include/effects/SkRuntimeEffect.h +1 -0
  52. package/cpp/skia/include/encode/SkPngEncoder.h +14 -0
  53. package/cpp/skia/include/gpu/GpuTypes.h +9 -0
  54. package/cpp/skia/include/gpu/ganesh/GrContextOptions.h +135 -133
  55. package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +5 -0
  56. package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkarounds.h +3 -3
  57. package/cpp/skia/include/gpu/ganesh/GrTypes.h +14 -9
  58. package/cpp/skia/include/gpu/graphite/Context.h +25 -2
  59. package/cpp/skia/include/gpu/graphite/ContextOptions.h +23 -5
  60. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +20 -1
  61. package/cpp/skia/include/gpu/graphite/Image.h +1 -0
  62. package/cpp/skia/include/gpu/graphite/LogPriority.h +36 -0
  63. package/cpp/skia/include/gpu/graphite/PrecompileContext.h +52 -0
  64. package/cpp/skia/include/gpu/graphite/Recorder.h +6 -0
  65. package/cpp/skia/include/gpu/graphite/Recording.h +3 -1
  66. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +4 -36
  67. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypesUtils.h +48 -0
  68. package/cpp/skia/include/gpu/graphite/precompile/Precompile.h +3 -2
  69. package/cpp/skia/include/pathops/SkPathOps.h +9 -1
  70. package/cpp/skia/include/ports/SkFontMgr_FontConfigInterface.h +3 -0
  71. package/cpp/skia/include/private/SkPathRef.h +15 -21
  72. package/cpp/skia/include/private/base/SkAttributes.h +16 -10
  73. package/cpp/skia/include/private/base/SkMutex.h +8 -0
  74. package/cpp/skia/include/private/base/SkTArray.h +1 -1
  75. package/cpp/skia/include/private/base/SkTDArray.h +1 -1
  76. package/cpp/skia/include/private/base/SkTemplates.h +24 -11
  77. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +1 -1
  78. package/cpp/skia/include/sksl/SkSLDebugTrace.h +0 -3
  79. package/cpp/skia/modules/skcms/src/Transform_inl.h +20 -20
  80. package/cpp/skia/modules/skcms/src/skcms_Transform.h +4 -3
  81. package/cpp/skia/modules/skcms/src/skcms_public.h +19 -15
  82. package/cpp/skia/modules/skresources/include/SkResources.h +3 -1
  83. package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
  84. package/cpp/skia/modules/svg/include/SkSVGContainer.h +1 -1
  85. package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +1 -1
  86. package/cpp/skia/modules/svg/include/SkSVGImage.h +2 -2
  87. package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
  88. package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
  89. package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
  90. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +2 -0
  91. package/cpp/skia/modules/svg/include/SkSVGShape.h +1 -0
  92. package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
  93. package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +4 -0
  94. package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
  95. package/cpp/skia/src/core/SkLRUCache.h +19 -13
  96. package/cpp/skia/src/core/SkTHash.h +50 -4
  97. package/cpp/skia/src/gpu/ganesh/gl/GrGLDefines.h +1 -0
  98. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +4 -3
  99. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
  100. package/lib/commonjs/mock/index.js +1 -2
  101. package/lib/commonjs/mock/index.js.map +1 -1
  102. package/lib/commonjs/skia/web/Host.d.ts +4 -6
  103. package/lib/commonjs/skia/web/Host.js +23 -10
  104. package/lib/commonjs/skia/web/Host.js.map +1 -1
  105. package/lib/commonjs/skia/web/JsiSkCanvas.js +15 -15
  106. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  107. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
  108. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  109. package/lib/commonjs/skia/web/JsiSkFont.js +3 -3
  110. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  111. package/lib/commonjs/skia/web/JsiSkFontMgr.js +1 -1
  112. package/lib/commonjs/skia/web/JsiSkFontMgr.js.map +1 -1
  113. package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
  114. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  115. package/lib/commonjs/skia/web/JsiSkImageFactory.js +3 -3
  116. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  117. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +9 -9
  118. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  119. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
  120. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  121. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
  122. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  123. package/lib/commonjs/skia/web/JsiSkPath.js +4 -4
  124. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  125. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +3 -3
  126. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  127. package/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +1 -1
  128. package/lib/commonjs/skia/web/JsiSkPathFactory.js +2 -2
  129. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  130. package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
  131. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  132. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
  133. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  134. package/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.js +1 -1
  135. package/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.js.map +1 -1
  136. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +1 -1
  137. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
  138. package/lib/commonjs/skia/web/JsiSkia.js +4 -3
  139. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  140. package/lib/commonjs/skia/web/JsiVideo.js +2 -1
  141. package/lib/commonjs/skia/web/JsiVideo.js.map +1 -1
  142. package/lib/module/external/reanimated/useAnimatedImageValue.js +4 -3
  143. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  144. package/lib/module/mock/index.js +1 -2
  145. package/lib/module/mock/index.js.map +1 -1
  146. package/lib/module/skia/web/Host.d.ts +4 -6
  147. package/lib/module/skia/web/Host.js +21 -8
  148. package/lib/module/skia/web/Host.js.map +1 -1
  149. package/lib/module/skia/web/JsiSkCanvas.js +15 -15
  150. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  151. package/lib/module/skia/web/JsiSkColorFilterFactory.js +1 -1
  152. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  153. package/lib/module/skia/web/JsiSkFont.js +4 -4
  154. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  155. package/lib/module/skia/web/JsiSkFontMgr.js +2 -2
  156. package/lib/module/skia/web/JsiSkFontMgr.js.map +1 -1
  157. package/lib/module/skia/web/JsiSkImage.js +6 -6
  158. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  159. package/lib/module/skia/web/JsiSkImageFactory.js +4 -4
  160. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  161. package/lib/module/skia/web/JsiSkImageFilterFactory.js +10 -10
  162. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  163. package/lib/module/skia/web/JsiSkMaskFilterFactory.js +1 -1
  164. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  165. package/lib/module/skia/web/JsiSkPaint.js +3 -3
  166. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  167. package/lib/module/skia/web/JsiSkPath.js +4 -4
  168. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  169. package/lib/module/skia/web/JsiSkPathEffectFactory.js +4 -4
  170. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  171. package/lib/module/skia/web/JsiSkPathFactory.d.ts +1 -1
  172. package/lib/module/skia/web/JsiSkPathFactory.js +3 -3
  173. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  174. package/lib/module/skia/web/JsiSkPicture.js +1 -1
  175. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  176. package/lib/module/skia/web/JsiSkShaderFactory.js +5 -5
  177. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  178. package/lib/module/skia/web/JsiSkTypefaceFontProvider.js +2 -2
  179. package/lib/module/skia/web/JsiSkTypefaceFontProvider.js.map +1 -1
  180. package/lib/module/skia/web/JsiSkVerticesFactory.js +1 -1
  181. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
  182. package/lib/module/skia/web/JsiSkia.js +4 -3
  183. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  184. package/lib/module/skia/web/JsiVideo.js +2 -1
  185. package/lib/module/skia/web/JsiVideo.js.map +1 -1
  186. package/lib/typescript/lib/commonjs/mock/index.d.ts +1 -1
  187. package/lib/typescript/lib/commonjs/skia/web/Host.d.ts +3 -5
  188. package/lib/typescript/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -1
  189. package/lib/typescript/lib/commonjs/skia/web/JsiSkFontMgr.d.ts +1 -1
  190. package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +1 -1
  191. package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +1 -1
  192. package/lib/typescript/lib/commonjs/skia/web/JsiSkPathEffectFactory.d.ts +2 -2
  193. package/lib/typescript/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +1 -1
  194. package/lib/typescript/lib/commonjs/skia/web/JsiSkTypefaceFontProvider.d.ts +1 -1
  195. package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +3 -3
  196. package/lib/typescript/lib/commonjs/skia/web/JsiVideo.d.ts +1 -1
  197. package/lib/typescript/lib/module/mock/index.d.ts +1 -1
  198. package/lib/typescript/lib/module/skia/Skia.web.d.ts +3 -3
  199. package/lib/typescript/lib/module/skia/web/Host.d.ts +3 -5
  200. package/lib/typescript/lib/module/skia/web/JsiSkFont.d.ts +1 -1
  201. package/lib/typescript/lib/module/skia/web/JsiSkFontMgr.d.ts +1 -1
  202. package/lib/typescript/lib/module/skia/web/JsiSkImageFactory.d.ts +1 -1
  203. package/lib/typescript/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +1 -1
  204. package/lib/typescript/lib/module/skia/web/JsiSkPathEffectFactory.d.ts +2 -2
  205. package/lib/typescript/lib/module/skia/web/JsiSkPathFactory.d.ts +1 -1
  206. package/lib/typescript/lib/module/skia/web/JsiSkTypefaceFontProvider.d.ts +1 -1
  207. package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +3 -3
  208. package/lib/typescript/lib/module/skia/web/JsiVideo.d.ts +1 -1
  209. package/lib/typescript/src/skia/web/Host.d.ts +4 -6
  210. package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +1 -1
  211. package/package.json +2 -2
  212. package/src/external/reanimated/useAnimatedImageValue.ts +4 -3
  213. package/src/mock/index.ts +1 -2
  214. package/src/skia/__tests__/Enums.spec.ts +34 -0
  215. package/src/skia/web/Host.ts +29 -11
  216. package/src/skia/web/JsiSkCanvas.ts +17 -17
  217. package/src/skia/web/JsiSkColorFilterFactory.ts +1 -1
  218. package/src/skia/web/JsiSkFont.ts +5 -5
  219. package/src/skia/web/JsiSkFontMgr.ts +3 -3
  220. package/src/skia/web/JsiSkImage.ts +14 -10
  221. package/src/skia/web/JsiSkImageFactory.ts +5 -5
  222. package/src/skia/web/JsiSkImageFilterFactory.ts +12 -22
  223. package/src/skia/web/JsiSkMaskFilterFactory.ts +1 -1
  224. package/src/skia/web/JsiSkPaint.ts +3 -3
  225. package/src/skia/web/JsiSkPath.ts +4 -4
  226. package/src/skia/web/JsiSkPathEffectFactory.ts +6 -6
  227. package/src/skia/web/JsiSkPathFactory.ts +4 -9
  228. package/src/skia/web/JsiSkPicture.ts +3 -3
  229. package/src/skia/web/JsiSkShaderFactory.ts +5 -5
  230. package/src/skia/web/JsiSkTypefaceFontProvider.ts +3 -3
  231. package/src/skia/web/JsiSkVerticesFactory.ts +1 -1
  232. package/src/skia/web/JsiSkia.ts +7 -4
  233. package/src/skia/web/JsiVideo.ts +2 -1
@@ -105,6 +105,9 @@ SKCMS_API bool skcms_TransferFunction_isHLGish (const skcms_TransferFunction*);
105
105
  // Unified representation of 'curv' or 'para' tag data, or a 1D table from 'mft1' or 'mft2'
106
106
  typedef union skcms_Curve {
107
107
  struct {
108
+ // this needs to line up with alias_of_table_entries so we can tell if there are or
109
+ // are not table entries. If this is 0, this struct is a parametric function,
110
+ // otherwise it's a table entry.
108
111
  uint32_t alias_of_table_entries;
109
112
  skcms_TransferFunction parametric;
110
113
  };
@@ -123,44 +126,44 @@ typedef struct skcms_A2B {
123
126
  // Optional: N 1D "A" curves, followed by an N-dimensional CLUT.
124
127
  // If input_channels == 0, these curves and CLUT are skipped,
125
128
  // Otherwise, input_channels must be in [1, 4].
126
- uint32_t input_channels;
127
129
  skcms_Curve input_curves[4];
128
- uint8_t grid_points[4];
129
130
  const uint8_t* grid_8;
130
131
  const uint8_t* grid_16;
132
+ uint32_t input_channels;
133
+ uint8_t grid_points[4];
131
134
 
132
135
  // Optional: 3 1D "M" curves, followed by a color matrix.
133
136
  // If matrix_channels == 0, these curves and matrix are skipped,
134
137
  // Otherwise, matrix_channels must be 3.
135
- uint32_t matrix_channels;
136
138
  skcms_Curve matrix_curves[3];
137
139
  skcms_Matrix3x4 matrix;
140
+ uint32_t matrix_channels;
138
141
 
139
142
  // Required: 3 1D "B" curves. Always present, and output_channels must be 3.
140
- uint32_t output_channels;
143
+ uint32_t output_channels; // list first to pack with matrix_channels
141
144
  skcms_Curve output_curves[3];
142
145
  } skcms_A2B;
143
146
 
144
147
  typedef struct skcms_B2A {
145
148
  // Required: 3 1D "B" curves. Always present, and input_channels must be 3.
146
- uint32_t input_channels;
147
149
  skcms_Curve input_curves[3];
150
+ uint32_t input_channels;
148
151
 
149
152
  // Optional: a color matrix, followed by 3 1D "M" curves.
150
153
  // If matrix_channels == 0, this matrix and these curves are skipped,
151
154
  // Otherwise, matrix_channels must be 3.
152
- uint32_t matrix_channels;
153
- skcms_Matrix3x4 matrix;
155
+ uint32_t matrix_channels; // list first to pack with input_channels
154
156
  skcms_Curve matrix_curves[3];
157
+ skcms_Matrix3x4 matrix;
155
158
 
156
159
  // Optional: an N-dimensional CLUT, followed by N 1D "A" curves.
157
160
  // If output_channels == 0, this CLUT and these curves are skipped,
158
161
  // Otherwise, output_channels must be in [1, 4].
159
- uint32_t output_channels;
160
- uint8_t grid_points[4];
162
+ skcms_Curve output_curves[4];
161
163
  const uint8_t* grid_8;
162
164
  const uint8_t* grid_16;
163
- skcms_Curve output_curves[4];
165
+ uint8_t grid_points[4];
166
+ uint32_t output_channels;
164
167
  } skcms_B2A;
165
168
 
166
169
  typedef struct skcms_CICP {
@@ -182,30 +185,31 @@ typedef struct skcms_ICCProfile {
182
185
 
183
186
  // If we can parse red, green and blue transfer curves from the profile,
184
187
  // trc will be set to those three curves, and has_trc will be true.
185
- bool has_trc;
186
188
  skcms_Curve trc[3];
187
189
 
188
190
  // If this profile's gamut can be represented by a 3x3 transform to XYZD50,
189
191
  // skcms_Parse() sets toXYZD50 to that transform and has_toXYZD50 to true.
190
- bool has_toXYZD50;
191
192
  skcms_Matrix3x3 toXYZD50;
192
193
 
193
194
  // If the profile has a valid A2B0 or A2B1 tag, skcms_Parse() sets A2B to
194
195
  // that data, and has_A2B to true. skcms_ParseWithA2BPriority() does the
195
196
  // same following any user-provided prioritization of A2B0, A2B1, or A2B2.
196
- bool has_A2B;
197
197
  skcms_A2B A2B;
198
198
 
199
199
  // If the profile has a valid B2A0 or B2A1 tag, skcms_Parse() sets B2A to
200
200
  // that data, and has_B2A to true. skcms_ParseWithA2BPriority() does the
201
201
  // same following any user-provided prioritization of B2A0, B2A1, or B2A2.
202
- bool has_B2A;
203
202
  skcms_B2A B2A;
204
203
 
205
204
  // If the profile has a valid CICP tag, skcms_Parse() sets CICP to that data,
206
205
  // and has_CICP to true.
207
- bool has_CICP;
208
206
  skcms_CICP CICP;
207
+
208
+ bool has_trc;
209
+ bool has_toXYZD50;
210
+ bool has_A2B;
211
+ bool has_B2A;
212
+ bool has_CICP;
209
213
  } skcms_ICCProfile;
210
214
 
211
215
  // The sRGB color profile is so commonly used that we offer a canonical skcms_ICCProfile for it.
@@ -108,9 +108,11 @@ public:
108
108
  static sk_sp<MultiFrameImageAsset> Make(std::unique_ptr<SkCodec>,
109
109
  ImageDecodeStrategy = ImageDecodeStrategy::kLazyDecode);
110
110
 
111
-
112
111
  bool isMultiFrame() override;
113
112
 
113
+ // Animation duration, in ms.
114
+ float duration() const;
115
+
114
116
  sk_sp<SkImage> getFrame(float t) override;
115
117
 
116
118
  private:
@@ -42,7 +42,7 @@ protected:
42
42
 
43
43
  SkPath onAsPath(const SkSVGRenderContext&) const override;
44
44
 
45
- SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
45
+ SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const override;
46
46
 
47
47
  private:
48
48
  SkSVGCircle();
@@ -29,7 +29,7 @@ protected:
29
29
 
30
30
  SkPath onAsPath(const SkSVGRenderContext&) const override;
31
31
 
32
- SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
32
+ SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const final;
33
33
 
34
34
  bool hasChildren() const final;
35
35
 
@@ -20,7 +20,7 @@
20
20
  class SK_API SkSVGFeLightSource : public SkSVGHiddenContainer {
21
21
  public:
22
22
  void appendChild(sk_sp<SkSVGNode>) final {
23
- SkDebugf("cannot append child nodes to an SVG light source.\n");
23
+ SkDEBUGF("cannot append child nodes to an SVG light source.\n");
24
24
  }
25
25
 
26
26
  protected:
@@ -31,13 +31,13 @@ public:
31
31
  }
32
32
 
33
33
  void appendChild(sk_sp<SkSVGNode>) override {
34
- SkDebugf("cannot append child nodes to this element.\n");
34
+ SkDEBUGF("cannot append child nodes to this element.\n");
35
35
  }
36
36
 
37
37
  bool onPrepareToRender(SkSVGRenderContext*) const override;
38
38
  void onRender(const SkSVGRenderContext&) const override;
39
39
  SkPath onAsPath(const SkSVGRenderContext&) const override;
40
- SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
40
+ SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const override;
41
41
 
42
42
  struct ImageInfo {
43
43
  sk_sp<SkImage> fImage;
@@ -35,7 +35,7 @@ protected:
35
35
 
36
36
  SkPath onAsPath(const SkSVGRenderContext&) const override;
37
37
 
38
- SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
38
+ SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const override;
39
39
 
40
40
  private:
41
41
  SkSVGPath();
@@ -43,7 +43,7 @@ protected:
43
43
 
44
44
  SkPath onAsPath(const SkSVGRenderContext&) const override;
45
45
 
46
- SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
46
+ SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const override;
47
47
 
48
48
  private:
49
49
  SkSVGPoly(SkSVGTag);
@@ -44,7 +44,7 @@ protected:
44
44
 
45
45
  SkPath onAsPath(const SkSVGRenderContext&) const override;
46
46
 
47
- SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
47
+ SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const override;
48
48
 
49
49
  private:
50
50
  SkSVGRect();
@@ -171,6 +171,8 @@ public:
171
171
  const SkSVGLength& w, const SkSVGLength& h,
172
172
  SkSVGObjectBoundingBoxUnits) const;
173
173
 
174
+ const OBBScope& currentOBBScope() const { return fOBBScope; }
175
+
174
176
  std::unique_ptr<SkShaper> makeShaper() const {
175
177
  SkASSERT(fTextShapingFactory);
176
178
  return fTextShapingFactory->makeShaper(this->fontMgr());
@@ -8,6 +8,7 @@
8
8
  #ifndef SkSVGShape_DEFINED
9
9
  #define SkSVGShape_DEFINED
10
10
 
11
+ #include "include/core/SkRect.h"
11
12
  #include "include/core/SkRefCnt.h"
12
13
  #include "include/private/base/SkAPI.h"
13
14
  #include "modules/svg/include/SkSVGTransformableNode.h"
@@ -75,7 +75,7 @@ private:
75
75
 
76
76
  void onRender(const SkSVGRenderContext&) const override;
77
77
 
78
- SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
78
+ SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const override;
79
79
  SkPath onAsPath(const SkSVGRenderContext&) const override;
80
80
 
81
81
  using INHERITED = SkSVGTextContainer;
@@ -34,6 +34,10 @@ protected:
34
34
 
35
35
  void mapToParent(SkRect*) const;
36
36
 
37
+ SkRect onObjectBoundingBox(const SkSVGRenderContext& ) const final;
38
+
39
+ virtual SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const;
40
+
37
41
  private:
38
42
  // FIXME: should be sparse
39
43
  SkSVGTransformType fTransform;
@@ -36,7 +36,7 @@ protected:
36
36
  bool onPrepareToRender(SkSVGRenderContext*) const override;
37
37
  void onRender(const SkSVGRenderContext&) const override;
38
38
  SkPath onAsPath(const SkSVGRenderContext&) const override;
39
- SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
39
+ SkRect onTransformableObjectBoundingBox(const SkSVGRenderContext&) const override;
40
40
 
41
41
  private:
42
42
  SkSVGUse();
@@ -12,16 +12,21 @@
12
12
  #include "src/core/SkChecksum.h"
13
13
  #include "src/core/SkTHash.h"
14
14
 
15
+ struct SkNoOpPurge {
16
+ template <typename K, typename V>
17
+ void operator()(const K& /* k */, const V* /* v */) const {}
18
+ };
19
+
15
20
  /**
16
21
  * A generic LRU cache.
17
22
  */
18
- template <typename K, typename V, typename HashK = SkGoodHash>
23
+ template <typename K, typename V, typename HashK = SkGoodHash, typename PurgeCB = SkNoOpPurge>
19
24
  class SkLRUCache {
20
25
  private:
21
26
  struct Entry {
22
27
  Entry(const K& key, V&& value)
23
- : fKey(key)
24
- , fValue(std::move(value)) {}
28
+ : fKey(key)
29
+ , fValue(std::move(value)) {}
25
30
 
26
31
  K fKey;
27
32
  V fValue;
@@ -101,6 +106,17 @@ public:
101
106
  }
102
107
  }
103
108
 
109
+ void remove(const K& key) {
110
+ Entry** value = fMap.find(key);
111
+ SkASSERT(value);
112
+ Entry* entry = *value;
113
+ SkASSERT(key == entry->fKey);
114
+ PurgeCB()(key, &entry->fValue);
115
+ fMap.remove(key);
116
+ fLRU.remove(entry);
117
+ delete entry;
118
+ }
119
+
104
120
  private:
105
121
  struct Traits {
106
122
  static const K& GetKey(Entry* e) {
@@ -112,16 +128,6 @@ private:
112
128
  }
113
129
  };
114
130
 
115
- void remove(const K& key) {
116
- Entry** value = fMap.find(key);
117
- SkASSERT(value);
118
- Entry* entry = *value;
119
- SkASSERT(key == entry->fKey);
120
- fMap.remove(key);
121
- fLRU.remove(entry);
122
- delete entry;
123
- }
124
-
125
131
  int fMaxCount;
126
132
  skia_private::THashTable<Entry*, K, Traits> fMap;
127
133
  SkTInternalLList<Entry> fLRU;
@@ -27,6 +27,10 @@ namespace skia_private {
27
27
  // Traits must have:
28
28
  // - static K GetKey(T)
29
29
  // - static uint32_t Hash(K)
30
+ // Traits may also define (both required if either is defined):
31
+ // - static bool ShouldGrow(int count, int capacity)
32
+ // - static bool ShouldShrink(int count, int capacity)
33
+ // , which specify the max/min load factor of the table.
30
34
  // If the key is large and stored inside T, you may want to make K a const&.
31
35
  // Similarly, if T is large you might want it to be a pointer.
32
36
  template <typename T, typename K, typename Traits = T>
@@ -98,7 +102,13 @@ public:
98
102
  // Copy val into the hash table, returning a pointer to the copy now in the table.
99
103
  // If there already is an entry in the table with the same key, we overwrite it.
100
104
  T* set(T val) {
101
- if (4 * fCount >= 3 * fCapacity) {
105
+ bool shouldGrow = false;
106
+ if constexpr (HasShouldGrow<Traits>::value) {
107
+ shouldGrow = Traits::ShouldGrow(fCount, fCapacity);
108
+ } else {
109
+ shouldGrow = (4 * fCount >= 3 * fCapacity);
110
+ }
111
+ if (shouldGrow) {
102
112
  this->resize(fCapacity > 0 ? fCapacity * 2 : 4);
103
113
  }
104
114
  return this->uncheckedSet(std::move(val));
@@ -143,8 +153,16 @@ public:
143
153
  }
144
154
  if (hash == s.fHash && key == Traits::GetKey(*s)) {
145
155
  this->removeSlot(index);
146
- if (4 * fCount <= fCapacity && fCapacity > 4) {
147
- this->resize(fCapacity / 2);
156
+ if (fCapacity > 4) {
157
+ bool shouldShrink = false;
158
+ if constexpr (HasShouldShrink<Traits>::value) {
159
+ shouldShrink = Traits::ShouldShrink(fCount, fCapacity);
160
+ } else {
161
+ shouldShrink = (4 * fCount <= fCapacity);
162
+ }
163
+ if (shouldShrink) {
164
+ this->resize(fCapacity / 2);
165
+ }
148
166
  }
149
167
  return true;
150
168
  }
@@ -192,7 +210,14 @@ public:
192
210
  // - Hash tables grow when they exceed 3/4 capacity, not when they are full.
193
211
  void reserve(int n) {
194
212
  int newCapacity = SkNextPow2(n);
195
- if (n * 4 > newCapacity * 3) {
213
+
214
+ bool shouldGrow = false;
215
+ if constexpr (HasShouldGrow<Traits>::value) {
216
+ shouldGrow = Traits::ShouldGrow(n, newCapacity);
217
+ } else {
218
+ shouldGrow = (n * 4 > newCapacity * 3);
219
+ }
220
+ if (shouldGrow) {
196
221
  newCapacity *= 2;
197
222
  }
198
223
 
@@ -274,6 +299,27 @@ public:
274
299
  };
275
300
 
276
301
  private:
302
+ template <typename U, typename = void> struct HasShouldGrow : std::false_type {};
303
+ template <typename U, typename = void> struct HasShouldShrink : std::false_type {};
304
+
305
+ template <typename U>
306
+ struct HasShouldGrow<
307
+ U,
308
+ std::void_t<decltype(U::ShouldGrow(std::declval<int>(), std::declval<int>()))>>
309
+ : std::true_type {
310
+ static_assert(HasShouldShrink<U>::value,
311
+ "The traits class must also provide ShouldShrink() method.");
312
+ };
313
+
314
+ template <typename U>
315
+ struct HasShouldShrink<
316
+ U,
317
+ std::void_t<decltype(U::ShouldShrink(std::declval<int>(), std::declval<int>()))>>
318
+ : std::true_type {
319
+ static_assert(HasShouldGrow<U>::value,
320
+ "The traits class must also provide ShouldGrow() method.");
321
+ };
322
+
277
323
  // Finds the first non-empty slot for an iterator.
278
324
  int firstPopulatedSlot() const {
279
325
  for (int i = 0; i < fCapacity; i++) {
@@ -891,6 +891,7 @@
891
891
  #define GR_GL_ANY_SAMPLES_PASSED 0x8C2F
892
892
  #define GR_GL_TIME_ELAPSED 0x88BF
893
893
  #define GR_GL_TIMESTAMP 0x8E28
894
+ #define GR_GL_GPU_DISJOINT 0x8FBB
894
895
  #define GR_GL_PRIMITIVES_GENERATED 0x8C87
895
896
  #define GR_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
896
897
 
@@ -38,10 +38,11 @@ const useAnimatedImageValue = (source, paused) => {
38
38
 
39
39
  // Update the current frame
40
40
  animatedImage.decodeNextFrame();
41
- if (currentFrame.value) {
42
- currentFrame.value.dispose();
43
- }
41
+ const oldFrame = currentFrame.value;
44
42
  currentFrame.value = animatedImage.getCurrentFrame();
43
+ if (oldFrame) {
44
+ oldFrame.dispose();
45
+ }
45
46
 
46
47
  // Update the last timestamp
47
48
  lastTimestamp.value = timestamp;
@@ -1 +1 @@
1
- {"version":3,"names":["_AnimatedImage","require","_ReanimatedProxy","_interopRequireDefault","e","__esModule","default","DEFAULT_FRAME_DURATION","useAnimatedImageValue","source","paused","defaultPaused","Rea","useSharedValue","isPaused","currentFrame","lastTimestamp","animatedImage","useAnimatedImage","err","console","error","Error","message","frameDuration","currentFrameDuration","useFrameCallback","frameInfo","value","timestamp","elapsed","decodeNextFrame","dispose","getCurrentFrame","exports"],"sources":["useAnimatedImageValue.ts"],"sourcesContent":["import type { FrameInfo, SharedValue } from \"react-native-reanimated\";\n\nimport { useAnimatedImage } from \"../../skia/core/AnimatedImage\";\nimport type { DataSourceParam, SkImage } from \"../../skia/types\";\n\nimport Rea from \"./ReanimatedProxy\";\n\nconst DEFAULT_FRAME_DURATION = 60;\n\nexport const useAnimatedImageValue = (\n source: DataSourceParam,\n paused?: SharedValue<boolean>\n) => {\n const defaultPaused = Rea.useSharedValue(false);\n const isPaused = paused ?? defaultPaused;\n const currentFrame = Rea.useSharedValue<null | SkImage>(null);\n const lastTimestamp = Rea.useSharedValue(-1);\n const animatedImage = useAnimatedImage(source, (err) => {\n console.error(err);\n throw new Error(`Could not load animated image - got '${err.message}'`);\n });\n const frameDuration =\n animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;\n\n Rea.useFrameCallback((frameInfo: FrameInfo) => {\n if (!animatedImage) {\n currentFrame.value = null;\n return;\n }\n if (isPaused.value && lastTimestamp.value !== -1) {\n return;\n }\n const { timestamp } = frameInfo;\n const elapsed = timestamp - lastTimestamp.value;\n\n // Check if it's time to switch frames based on GIF frame duration\n if (elapsed < frameDuration) {\n return;\n }\n\n // Update the current frame\n animatedImage.decodeNextFrame();\n if (currentFrame.value) {\n currentFrame.value.dispose();\n }\n currentFrame.value = animatedImage.getCurrentFrame();\n\n // Update the last timestamp\n lastTimestamp.value = timestamp;\n });\n return currentFrame;\n};\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAGA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAoC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,MAAMG,sBAAsB,GAAG,EAAE;AAE1B,MAAMC,qBAAqB,GAAGA,CACnCC,MAAuB,EACvBC,MAA6B,KAC1B;EACH,MAAMC,aAAa,GAAGC,wBAAG,CAACC,cAAc,CAAC,KAAK,CAAC;EAC/C,MAAMC,QAAQ,GAAGJ,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIC,aAAa;EACxC,MAAMI,YAAY,GAAGH,wBAAG,CAACC,cAAc,CAAiB,IAAI,CAAC;EAC7D,MAAMG,aAAa,GAAGJ,wBAAG,CAACC,cAAc,CAAC,CAAC,CAAC,CAAC;EAC5C,MAAMI,aAAa,GAAG,IAAAC,+BAAgB,EAACT,MAAM,EAAGU,GAAG,IAAK;IACtDC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;IAClB,MAAM,IAAIG,KAAK,CAAC,wCAAwCH,GAAG,CAACI,OAAO,GAAG,CAAC;EACzE,CAAC,CAAC;EACF,MAAMC,aAAa,GACjB,CAAAP,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEQ,oBAAoB,CAAC,CAAC,KAAIlB,sBAAsB;EAEjEK,wBAAG,CAACc,gBAAgB,CAAEC,SAAoB,IAAK;IAC7C,IAAI,CAACV,aAAa,EAAE;MAClBF,YAAY,CAACa,KAAK,GAAG,IAAI;MACzB;IACF;IACA,IAAId,QAAQ,CAACc,KAAK,IAAIZ,aAAa,CAACY,KAAK,KAAK,CAAC,CAAC,EAAE;MAChD;IACF;IACA,MAAM;MAAEC;IAAU,CAAC,GAAGF,SAAS;IAC/B,MAAMG,OAAO,GAAGD,SAAS,GAAGb,aAAa,CAACY,KAAK;;IAE/C;IACA,IAAIE,OAAO,GAAGN,aAAa,EAAE;MAC3B;IACF;;IAEA;IACAP,aAAa,CAACc,eAAe,CAAC,CAAC;IAC/B,IAAIhB,YAAY,CAACa,KAAK,EAAE;MACtBb,YAAY,CAACa,KAAK,CAACI,OAAO,CAAC,CAAC;IAC9B;IACAjB,YAAY,CAACa,KAAK,GAAGX,aAAa,CAACgB,eAAe,CAAC,CAAC;;IAEpD;IACAjB,aAAa,CAACY,KAAK,GAAGC,SAAS;EACjC,CAAC,CAAC;EACF,OAAOd,YAAY;AACrB,CAAC;AAACmB,OAAA,CAAA1B,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_AnimatedImage","require","_ReanimatedProxy","_interopRequireDefault","e","__esModule","default","DEFAULT_FRAME_DURATION","useAnimatedImageValue","source","paused","defaultPaused","Rea","useSharedValue","isPaused","currentFrame","lastTimestamp","animatedImage","useAnimatedImage","err","console","error","Error","message","frameDuration","currentFrameDuration","useFrameCallback","frameInfo","value","timestamp","elapsed","decodeNextFrame","oldFrame","getCurrentFrame","dispose","exports"],"sources":["useAnimatedImageValue.ts"],"sourcesContent":["import type { FrameInfo, SharedValue } from \"react-native-reanimated\";\n\nimport { useAnimatedImage } from \"../../skia/core/AnimatedImage\";\nimport type { DataSourceParam, SkImage } from \"../../skia/types\";\n\nimport Rea from \"./ReanimatedProxy\";\n\nconst DEFAULT_FRAME_DURATION = 60;\n\nexport const useAnimatedImageValue = (\n source: DataSourceParam,\n paused?: SharedValue<boolean>\n) => {\n const defaultPaused = Rea.useSharedValue(false);\n const isPaused = paused ?? defaultPaused;\n const currentFrame = Rea.useSharedValue<null | SkImage>(null);\n const lastTimestamp = Rea.useSharedValue(-1);\n const animatedImage = useAnimatedImage(source, (err) => {\n console.error(err);\n throw new Error(`Could not load animated image - got '${err.message}'`);\n });\n const frameDuration =\n animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;\n\n Rea.useFrameCallback((frameInfo: FrameInfo) => {\n if (!animatedImage) {\n currentFrame.value = null;\n return;\n }\n if (isPaused.value && lastTimestamp.value !== -1) {\n return;\n }\n const { timestamp } = frameInfo;\n const elapsed = timestamp - lastTimestamp.value;\n\n // Check if it's time to switch frames based on GIF frame duration\n if (elapsed < frameDuration) {\n return;\n }\n\n // Update the current frame\n animatedImage.decodeNextFrame();\n const oldFrame = currentFrame.value;\n currentFrame.value = animatedImage.getCurrentFrame();\n if (oldFrame) {\n oldFrame.dispose();\n }\n\n // Update the last timestamp\n lastTimestamp.value = timestamp;\n });\n return currentFrame;\n};\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAGA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAoC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,MAAMG,sBAAsB,GAAG,EAAE;AAE1B,MAAMC,qBAAqB,GAAGA,CACnCC,MAAuB,EACvBC,MAA6B,KAC1B;EACH,MAAMC,aAAa,GAAGC,wBAAG,CAACC,cAAc,CAAC,KAAK,CAAC;EAC/C,MAAMC,QAAQ,GAAGJ,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIC,aAAa;EACxC,MAAMI,YAAY,GAAGH,wBAAG,CAACC,cAAc,CAAiB,IAAI,CAAC;EAC7D,MAAMG,aAAa,GAAGJ,wBAAG,CAACC,cAAc,CAAC,CAAC,CAAC,CAAC;EAC5C,MAAMI,aAAa,GAAG,IAAAC,+BAAgB,EAACT,MAAM,EAAGU,GAAG,IAAK;IACtDC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;IAClB,MAAM,IAAIG,KAAK,CAAC,wCAAwCH,GAAG,CAACI,OAAO,GAAG,CAAC;EACzE,CAAC,CAAC;EACF,MAAMC,aAAa,GACjB,CAAAP,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEQ,oBAAoB,CAAC,CAAC,KAAIlB,sBAAsB;EAEjEK,wBAAG,CAACc,gBAAgB,CAAEC,SAAoB,IAAK;IAC7C,IAAI,CAACV,aAAa,EAAE;MAClBF,YAAY,CAACa,KAAK,GAAG,IAAI;MACzB;IACF;IACA,IAAId,QAAQ,CAACc,KAAK,IAAIZ,aAAa,CAACY,KAAK,KAAK,CAAC,CAAC,EAAE;MAChD;IACF;IACA,MAAM;MAAEC;IAAU,CAAC,GAAGF,SAAS;IAC/B,MAAMG,OAAO,GAAGD,SAAS,GAAGb,aAAa,CAACY,KAAK;;IAE/C;IACA,IAAIE,OAAO,GAAGN,aAAa,EAAE;MAC3B;IACF;;IAEA;IACAP,aAAa,CAACc,eAAe,CAAC,CAAC;IAC/B,MAAMC,QAAQ,GAAGjB,YAAY,CAACa,KAAK;IACnCb,YAAY,CAACa,KAAK,GAAGX,aAAa,CAACgB,eAAe,CAAC,CAAC;IACpD,IAAID,QAAQ,EAAE;MACZA,QAAQ,CAACE,OAAO,CAAC,CAAC;IACpB;;IAEA;IACAlB,aAAa,CAACY,KAAK,GAAGC,SAAS;EACjC,CAAC,CAAC;EACF,OAAOd,YAAY;AACrB,CAAC;AAACoB,OAAA,CAAA3B,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -27,8 +27,7 @@ const Mock = CanvasKit => {
27
27
  ...require("../animation"),
28
28
  ...require("../dom/types"),
29
29
  ...require("../dom/nodes"),
30
- // We could use the real Canvas if we mock the SkiaView component for node
31
- Canvas: Noop,
30
+ Canvas: require("react-native").View,
32
31
  // Skia Animations
33
32
  useValue: NoopValue,
34
33
  useComputedValue: NoopValue,
@@ -1 +1 @@
1
- {"version":3,"names":["_web","require","Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","JsiSkApi","Skia","Canvas","useValue","useComputedValue","useTiming","useLoop","useSpring","useClockValue","useValueEffect","useClock","usePathInterpolation","useImageAsTexture","useTextureValue","useTextureValueFromPicture","useRSXformBuffer","usePointBuffer","useColorBuffer","useRectBuffer","useBuffer","useRawData","useData","useFont","Font","useFonts","useTypeface","useImage","useSVG","useVideo","exports"],"sources":["index.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport { JsiSkApi } from \"../skia/web\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Noop: () => any = () => undefined;\nconst NoopValue = () => ({ current: 0 });\nconst NoopSharedValue = () => ({ value: 0 });\n\nexport const Mock = (CanvasKit: CanvasKit) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n global.SkiaApi = JsiSkApi(CanvasKit);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const Skia = global.SkiaApi;\n return {\n Skia,\n ...require(\"../renderer/components\"),\n ...require(\"../skia\"),\n ...require(\"../animation\"),\n ...require(\"../dom/types\"),\n ...require(\"../dom/nodes\"),\n // We could use the real Canvas if we mock the SkiaView component for node\n Canvas: Noop,\n // Skia Animations\n useValue: NoopValue,\n useComputedValue: NoopValue,\n useTiming: NoopValue,\n useLoop: NoopValue,\n useSpring: NoopValue,\n useClockValue: NoopValue,\n useValueEffect: Noop,\n // Reanimated hooks\n useClock: NoopSharedValue,\n usePathInterpolation: NoopSharedValue,\n useImageAsTexture: NoopSharedValue,\n useTextureValue: NoopSharedValue,\n useTextureValueFromPicture: NoopSharedValue,\n useRSXformBuffer: NoopSharedValue,\n usePointBuffer: NoopSharedValue,\n useColorBuffer: NoopSharedValue,\n useRectBuffer: NoopSharedValue,\n useBuffer: NoopSharedValue,\n useRawData: Noop,\n useData: Noop,\n useFont: () => Skia.Font(undefined, 0),\n useFonts: Noop,\n useTypeface: () => null,\n useImage: () => null,\n useSVG: () => null,\n useVideo: () => null,\n };\n};\n"],"mappings":";;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,IAAe,GAAGA,CAAA,KAAMC,SAAS;AACvC,MAAMC,SAAS,GAAGA,CAAA,MAAO;EAAEC,OAAO,EAAE;AAAE,CAAC,CAAC;AACxC,MAAMC,eAAe,GAAGA,CAAA,MAAO;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AAErC,MAAMC,IAAI,GAAIC,SAAoB,IAAK;EAC5C;EACA;EACAC,MAAM,CAACC,OAAO,GAAG,IAAAC,aAAQ,EAACH,SAAS,CAAC;EACpC;EACA;EACA,MAAMI,IAAI,GAAGH,MAAM,CAACC,OAAO;EAC3B,OAAO;IACLE,IAAI;IACJ,GAAGZ,OAAO,CAAC,wBAAwB,CAAC;IACpC,GAAGA,OAAO,CAAC,SAAS,CAAC;IACrB,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1B,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1B,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1B;IACAa,MAAM,EAAEZ,IAAI;IACZ;IACAa,QAAQ,EAAEX,SAAS;IACnBY,gBAAgB,EAAEZ,SAAS;IAC3Ba,SAAS,EAAEb,SAAS;IACpBc,OAAO,EAAEd,SAAS;IAClBe,SAAS,EAAEf,SAAS;IACpBgB,aAAa,EAAEhB,SAAS;IACxBiB,cAAc,EAAEnB,IAAI;IACpB;IACAoB,QAAQ,EAAEhB,eAAe;IACzBiB,oBAAoB,EAAEjB,eAAe;IACrCkB,iBAAiB,EAAElB,eAAe;IAClCmB,eAAe,EAAEnB,eAAe;IAChCoB,0BAA0B,EAAEpB,eAAe;IAC3CqB,gBAAgB,EAAErB,eAAe;IACjCsB,cAAc,EAAEtB,eAAe;IAC/BuB,cAAc,EAAEvB,eAAe;IAC/BwB,aAAa,EAAExB,eAAe;IAC9ByB,SAAS,EAAEzB,eAAe;IAC1B0B,UAAU,EAAE9B,IAAI;IAChB+B,OAAO,EAAE/B,IAAI;IACbgC,OAAO,EAAEA,CAAA,KAAMrB,IAAI,CAACsB,IAAI,CAAChC,SAAS,EAAE,CAAC,CAAC;IACtCiC,QAAQ,EAAElC,IAAI;IACdmC,WAAW,EAAEA,CAAA,KAAM,IAAI;IACvBC,QAAQ,EAAEA,CAAA,KAAM,IAAI;IACpBC,MAAM,EAAEA,CAAA,KAAM,IAAI;IAClBC,QAAQ,EAAEA,CAAA,KAAM;EAClB,CAAC;AACH,CAAC;AAACC,OAAA,CAAAjC,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_web","require","Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","JsiSkApi","Skia","Canvas","View","useValue","useComputedValue","useTiming","useLoop","useSpring","useClockValue","useValueEffect","useClock","usePathInterpolation","useImageAsTexture","useTextureValue","useTextureValueFromPicture","useRSXformBuffer","usePointBuffer","useColorBuffer","useRectBuffer","useBuffer","useRawData","useData","useFont","Font","useFonts","useTypeface","useImage","useSVG","useVideo","exports"],"sources":["index.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport { JsiSkApi } from \"../skia/web\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Noop: () => any = () => undefined;\nconst NoopValue = () => ({ current: 0 });\nconst NoopSharedValue = () => ({ value: 0 });\n\nexport const Mock = (CanvasKit: CanvasKit) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n global.SkiaApi = JsiSkApi(CanvasKit);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const Skia = global.SkiaApi;\n return {\n Skia,\n ...require(\"../renderer/components\"),\n ...require(\"../skia\"),\n ...require(\"../animation\"),\n ...require(\"../dom/types\"),\n ...require(\"../dom/nodes\"),\n Canvas: require(\"react-native\").View,\n // Skia Animations\n useValue: NoopValue,\n useComputedValue: NoopValue,\n useTiming: NoopValue,\n useLoop: NoopValue,\n useSpring: NoopValue,\n useClockValue: NoopValue,\n useValueEffect: Noop,\n // Reanimated hooks\n useClock: NoopSharedValue,\n usePathInterpolation: NoopSharedValue,\n useImageAsTexture: NoopSharedValue,\n useTextureValue: NoopSharedValue,\n useTextureValueFromPicture: NoopSharedValue,\n useRSXformBuffer: NoopSharedValue,\n usePointBuffer: NoopSharedValue,\n useColorBuffer: NoopSharedValue,\n useRectBuffer: NoopSharedValue,\n useBuffer: NoopSharedValue,\n useRawData: Noop,\n useData: Noop,\n useFont: () => Skia.Font(undefined, 0),\n useFonts: Noop,\n useTypeface: () => null,\n useImage: () => null,\n useSVG: () => null,\n useVideo: () => null,\n };\n};\n"],"mappings":";;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,IAAe,GAAGA,CAAA,KAAMC,SAAS;AACvC,MAAMC,SAAS,GAAGA,CAAA,MAAO;EAAEC,OAAO,EAAE;AAAE,CAAC,CAAC;AACxC,MAAMC,eAAe,GAAGA,CAAA,MAAO;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AAErC,MAAMC,IAAI,GAAIC,SAAoB,IAAK;EAC5C;EACA;EACAC,MAAM,CAACC,OAAO,GAAG,IAAAC,aAAQ,EAACH,SAAS,CAAC;EACpC;EACA;EACA,MAAMI,IAAI,GAAGH,MAAM,CAACC,OAAO;EAC3B,OAAO;IACLE,IAAI;IACJ,GAAGZ,OAAO,CAAC,wBAAwB,CAAC;IACpC,GAAGA,OAAO,CAAC,SAAS,CAAC;IACrB,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1B,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1B,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1Ba,MAAM,EAAEb,OAAO,CAAC,cAAc,CAAC,CAACc,IAAI;IACpC;IACAC,QAAQ,EAAEZ,SAAS;IACnBa,gBAAgB,EAAEb,SAAS;IAC3Bc,SAAS,EAAEd,SAAS;IACpBe,OAAO,EAAEf,SAAS;IAClBgB,SAAS,EAAEhB,SAAS;IACpBiB,aAAa,EAAEjB,SAAS;IACxBkB,cAAc,EAAEpB,IAAI;IACpB;IACAqB,QAAQ,EAAEjB,eAAe;IACzBkB,oBAAoB,EAAElB,eAAe;IACrCmB,iBAAiB,EAAEnB,eAAe;IAClCoB,eAAe,EAAEpB,eAAe;IAChCqB,0BAA0B,EAAErB,eAAe;IAC3CsB,gBAAgB,EAAEtB,eAAe;IACjCuB,cAAc,EAAEvB,eAAe;IAC/BwB,cAAc,EAAExB,eAAe;IAC/ByB,aAAa,EAAEzB,eAAe;IAC9B0B,SAAS,EAAE1B,eAAe;IAC1B2B,UAAU,EAAE/B,IAAI;IAChBgC,OAAO,EAAEhC,IAAI;IACbiC,OAAO,EAAEA,CAAA,KAAMtB,IAAI,CAACuB,IAAI,CAACjC,SAAS,EAAE,CAAC,CAAC;IACtCkC,QAAQ,EAAEnC,IAAI;IACdoC,WAAW,EAAEA,CAAA,KAAM,IAAI;IACvBC,QAAQ,EAAEA,CAAA,KAAM,IAAI;IACpBC,MAAM,EAAEA,CAAA,KAAM,IAAI;IAClBC,QAAQ,EAAEA,CAAA,KAAM;EAClB,CAAC;AACH,CAAC;AAACC,OAAA,CAAAlC,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -1,8 +1,6 @@
1
- import type { CanvasKit, EmbindEnumEntity, EmbindEnum } from "canvaskit-wasm";
1
+ import type { CanvasKit, EmbindEnumEntity } from "canvaskit-wasm";
2
2
  import type { SkJSIInstance } from "../types";
3
- export declare class NotImplementedOnRNWeb extends Error {
4
- constructor(msg?: string);
5
- }
3
+ export declare const throwNotImplementedOnRNWeb: <T>() => T;
6
4
  export declare abstract class Host {
7
5
  readonly CanvasKit: CanvasKit;
8
6
  constructor(CanvasKit: CanvasKit);
@@ -16,5 +14,5 @@ export declare abstract class BaseHostObject<T, N extends string> extends Host i
16
14
  export declare abstract class HostObject<T, N extends string> extends BaseHostObject<T, N> {
17
15
  static fromValue<T>(value: SkJSIInstance<string>): T;
18
16
  }
19
- export declare const getEnum: (e: EmbindEnum, v: number) => EmbindEnumEntity;
20
- export declare const optEnum: (e: EmbindEnum, value: number | undefined) => EmbindEnumEntity | undefined;
17
+ export declare const getEnum: (CanvasKit: CanvasKit, name: keyof CanvasKit, v: number) => EmbindEnumEntity;
18
+ export declare const optEnum: (CanvasKit: CanvasKit, name: keyof CanvasKit, v: number | undefined) => EmbindEnumEntity | undefined;
@@ -3,16 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.optEnum = exports.getEnum = exports.NotImplementedOnRNWeb = exports.HostObject = exports.Host = exports.BaseHostObject = void 0;
6
+ exports.throwNotImplementedOnRNWeb = exports.optEnum = exports.getEnum = exports.HostObject = exports.Host = exports.BaseHostObject = void 0;
7
7
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
9
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- class NotImplementedOnRNWeb extends Error {
11
- constructor(msg) {
12
- super(msg !== null && msg !== void 0 ? msg : "Not implemented on React Native Web");
10
+ const throwNotImplementedOnRNWeb = () => {
11
+ if (typeof jest !== "undefined") {
12
+ return jest.fn();
13
13
  }
14
- }
15
- exports.NotImplementedOnRNWeb = NotImplementedOnRNWeb;
14
+ throw new Error("Not implemented on React Native Web");
15
+ };
16
+ exports.throwNotImplementedOnRNWeb = throwNotImplementedOnRNWeb;
16
17
  class Host {
17
18
  constructor(CanvasKit) {
18
19
  _defineProperty(this, "CanvasKit", void 0);
@@ -36,10 +37,22 @@ class HostObject extends BaseHostObject {
36
37
  }
37
38
  }
38
39
  exports.HostObject = HostObject;
39
- const getEnum = (e, v) => Object.values(e).find(({
40
- value
41
- }) => value === v);
40
+ const getEnum = (CanvasKit, name, v) => {
41
+ const e = CanvasKit[name];
42
+ if (typeof e !== "function") {
43
+ throw new Error(`${name} is not an number`);
44
+ }
45
+ const result = Object.values(e).find(({
46
+ value
47
+ }) => value === v);
48
+ if (!result) {
49
+ throw new Error(`Enum ${name} does not have value ${v} on React Native Web`);
50
+ }
51
+ return result;
52
+ };
42
53
  exports.getEnum = getEnum;
43
- const optEnum = (e, value) => value === undefined ? undefined : getEnum(e, value);
54
+ const optEnum = (CanvasKit, name, v) => {
55
+ return v === undefined ? undefined : getEnum(CanvasKit, name, v);
56
+ };
44
57
  exports.optEnum = optEnum;
45
58
  //# sourceMappingURL=Host.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","exports","Host","CanvasKit","_defineProperty","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","getEnum","e","v","Object","values","find","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity, EmbindEnum } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n\n abstract dispose(): void;\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const getEnum = (e: EmbindEnum, v: number): EmbindEnumEntity =>\n Object.values(e).find(({ value }) => value === v);\n\nexport const optEnum = (\n e: EmbindEnum,\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : getEnum(e, value);\n"],"mappings":";;;;;;;;;AAIO,MAAMA,qBAAqB,SAASC,KAAK,CAAC;EAC/CC,WAAWA,CAACC,GAAY,EAAE;IACxB,KAAK,CAACA,GAAG,aAAHA,GAAG,cAAHA,GAAG,GAAI,qCAAqC,CAAC;EACrD;AACF;AAACC,OAAA,CAAAJ,qBAAA,GAAAA,qBAAA;AAEM,MAAeK,IAAI,CAAC;EAGzBH,WAAWA,CAACI,SAAoB,EAAE;IAAAC,eAAA;IAChC,IAAI,CAACD,SAAS,GAAGA,SAAS;EAC5B;AACF;AAACF,OAAA,CAAAC,IAAA,GAAAA,IAAA;AAEM,MAAeG,cAAc,SAC1BH,IAAI,CAEd;EAIEH,WAAWA,CAACI,SAAoB,EAAEG,GAAM,EAAEC,QAAW,EAAE;IACrD,KAAK,CAACJ,SAAS,CAAC;IAACC,eAAA;IAAAA,eAAA;IACjB,IAAI,CAACE,GAAG,GAAGA,GAAG;IACd,IAAI,CAACE,YAAY,GAAGD,QAAQ;EAC9B;AAGF;AAACN,OAAA,CAAAI,cAAA,GAAAA,cAAA;AAEM,MAAeI,UAAU,SAA8BJ,cAAc,CAG1E;EACA,OAAOK,SAASA,CAAIC,KAA4B,EAAE;IAChD,OAAQA,KAAK,CAA2BL,GAAG;EAC7C;AACF;AAACL,OAAA,CAAAQ,UAAA,GAAAA,UAAA;AAEM,MAAMG,OAAO,GAAGA,CAACC,CAAa,EAAEC,CAAS,KAC9CC,MAAM,CAACC,MAAM,CAACH,CAAC,CAAC,CAACI,IAAI,CAAC,CAAC;EAAEN;AAAM,CAAC,KAAKA,KAAK,KAAKG,CAAC,CAAC;AAACb,OAAA,CAAAW,OAAA,GAAAA,OAAA;AAE7C,MAAMM,OAAO,GAAGA,CACrBL,CAAa,EACbF,KAAyB,KAEzBA,KAAK,KAAKQ,SAAS,GAAGA,SAAS,GAAGP,OAAO,CAACC,CAAC,EAAEF,KAAK,CAAC;AAACV,OAAA,CAAAiB,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["throwNotImplementedOnRNWeb","jest","fn","Error","exports","Host","constructor","CanvasKit","_defineProperty","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","getEnum","name","v","e","result","Object","values","find","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport const throwNotImplementedOnRNWeb = <T>(): T => {\n if (typeof jest !== \"undefined\") {\n return jest.fn() as unknown as T;\n }\n throw new Error(\"Not implemented on React Native Web\");\n};\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n\n abstract dispose(): void;\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const getEnum = (\n CanvasKit: CanvasKit,\n name: keyof CanvasKit,\n v: number\n): EmbindEnumEntity => {\n const e = CanvasKit[name];\n if (typeof e !== \"function\") {\n throw new Error(`${name} is not an number`);\n }\n const result = Object.values(e).find(({ value }) => value === v);\n if (!result) {\n throw new Error(\n `Enum ${name} does not have value ${v} on React Native Web`\n );\n }\n return result;\n};\n\nexport const optEnum = (\n CanvasKit: CanvasKit,\n name: keyof CanvasKit,\n v: number | undefined\n): EmbindEnumEntity | undefined => {\n return v === undefined ? undefined : getEnum(CanvasKit, name, v);\n};\n"],"mappings":";;;;;;;;;AAIO,MAAMA,0BAA0B,GAAGA,CAAA,KAAY;EACpD,IAAI,OAAOC,IAAI,KAAK,WAAW,EAAE;IAC/B,OAAOA,IAAI,CAACC,EAAE,CAAC,CAAC;EAClB;EACA,MAAM,IAAIC,KAAK,CAAC,qCAAqC,CAAC;AACxD,CAAC;AAACC,OAAA,CAAAJ,0BAAA,GAAAA,0BAAA;AAEK,MAAeK,IAAI,CAAC;EAGzBC,WAAWA,CAACC,SAAoB,EAAE;IAAAC,eAAA;IAChC,IAAI,CAACD,SAAS,GAAGA,SAAS;EAC5B;AACF;AAACH,OAAA,CAAAC,IAAA,GAAAA,IAAA;AAEM,MAAeI,cAAc,SAC1BJ,IAAI,CAEd;EAIEC,WAAWA,CAACC,SAAoB,EAAEG,GAAM,EAAEC,QAAW,EAAE;IACrD,KAAK,CAACJ,SAAS,CAAC;IAACC,eAAA;IAAAA,eAAA;IACjB,IAAI,CAACE,GAAG,GAAGA,GAAG;IACd,IAAI,CAACE,YAAY,GAAGD,QAAQ;EAC9B;AAGF;AAACP,OAAA,CAAAK,cAAA,GAAAA,cAAA;AAEM,MAAeI,UAAU,SAA8BJ,cAAc,CAG1E;EACA,OAAOK,SAASA,CAAIC,KAA4B,EAAE;IAChD,OAAQA,KAAK,CAA2BL,GAAG;EAC7C;AACF;AAACN,OAAA,CAAAS,UAAA,GAAAA,UAAA;AAEM,MAAMG,OAAO,GAAGA,CACrBT,SAAoB,EACpBU,IAAqB,EACrBC,CAAS,KACY;EACrB,MAAMC,CAAC,GAAGZ,SAAS,CAACU,IAAI,CAAC;EACzB,IAAI,OAAOE,CAAC,KAAK,UAAU,EAAE;IAC3B,MAAM,IAAIhB,KAAK,CAAC,GAAGc,IAAI,mBAAmB,CAAC;EAC7C;EACA,MAAMG,MAAM,GAAGC,MAAM,CAACC,MAAM,CAACH,CAAC,CAAC,CAACI,IAAI,CAAC,CAAC;IAAER;EAAM,CAAC,KAAKA,KAAK,KAAKG,CAAC,CAAC;EAChE,IAAI,CAACE,MAAM,EAAE;IACX,MAAM,IAAIjB,KAAK,CACb,QAAQc,IAAI,wBAAwBC,CAAC,sBACvC,CAAC;EACH;EACA,OAAOE,MAAM;AACf,CAAC;AAAChB,OAAA,CAAAY,OAAA,GAAAA,OAAA;AAEK,MAAMQ,OAAO,GAAGA,CACrBjB,SAAoB,EACpBU,IAAqB,EACrBC,CAAqB,KACY;EACjC,OAAOA,CAAC,KAAKO,SAAS,GAAGA,SAAS,GAAGT,OAAO,CAACT,SAAS,EAAEU,IAAI,EAAEC,CAAC,CAAC;AAClE,CAAC;AAACd,OAAA,CAAAoB,OAAA,GAAAA,OAAA","ignoreList":[]}