@shopify/react-native-skia 2.6.9 → 2.7.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 (145) hide show
  1. package/android/cpp/jni/include/JniSkiaBaseView.h +6 -4
  2. package/android/cpp/jni/include/JniSkiaPictureView.h +8 -6
  3. package/android/cpp/rnskia-android/OpenGLContext.h +10 -1
  4. package/android/cpp/rnskia-android/RNSkAndroidView.h +8 -8
  5. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +9 -5
  6. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +4 -2
  7. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +48 -12
  8. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseViewManager.java +5 -0
  9. package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +2 -2
  10. package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +11 -7
  11. package/apple/MetalContext.h +7 -6
  12. package/apple/MetalLayerColorSpace.mm +39 -0
  13. package/apple/MetalLayerColorSpaceUtils.h +34 -0
  14. package/apple/MetalWindowContext.h +3 -1
  15. package/apple/MetalWindowContext.mm +9 -8
  16. package/apple/RNSkAppleView.h +6 -0
  17. package/apple/RNSkMetalCanvasProvider.h +2 -0
  18. package/apple/RNSkMetalCanvasProvider.mm +15 -2
  19. package/apple/SkiaPictureView.mm +1 -0
  20. package/apple/SkiaPictureViewManager.mm +5 -0
  21. package/apple/SkiaUIView.h +1 -0
  22. package/apple/SkiaUIView.mm +9 -0
  23. package/cpp/api/JsiSkSurface.h +8 -2
  24. package/cpp/rnskia/RNDawnContext.h +4 -3
  25. package/cpp/rnskia/RNDawnUtils.h +25 -6
  26. package/cpp/rnskia/RNDawnWindowContext.h +44 -10
  27. package/cpp/rnskia/RNMetalLayerColorSpace.h +16 -0
  28. package/cpp/rnskia/RNSkJsiViewApi.h +46 -24
  29. package/cpp/rnwgpu/SurfaceRegistry.h +10 -4
  30. package/lib/commonjs/Platform/Platform.web.js +2 -90
  31. package/lib/commonjs/Platform/Platform.web.js.map +1 -1
  32. package/lib/commonjs/mock/index.js +1 -0
  33. package/lib/commonjs/mock/index.js.map +1 -1
  34. package/lib/commonjs/renderer/Canvas.d.ts +10 -1
  35. package/lib/commonjs/renderer/Canvas.js +2 -0
  36. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  37. package/lib/commonjs/skia/types/Surface/Surface.d.ts +5 -1
  38. package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
  39. package/lib/commonjs/skia/web/JsiSkParagraphStyle.js +14 -3
  40. package/lib/commonjs/skia/web/JsiSkParagraphStyle.js.map +1 -1
  41. package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -1
  42. package/lib/commonjs/skia/web/JsiSkSurface.js +2 -1
  43. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  44. package/lib/commonjs/sksg/Container.native.d.ts +1 -0
  45. package/lib/commonjs/sksg/Container.native.js +11 -0
  46. package/lib/commonjs/sksg/Container.native.js.map +1 -1
  47. package/lib/commonjs/sksg/Container.web.d.ts +1 -0
  48. package/lib/commonjs/sksg/Container.web.js +11 -0
  49. package/lib/commonjs/sksg/Container.web.js.map +1 -1
  50. package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +2 -0
  51. package/lib/commonjs/specs/NativeSkiaModule.web.js +32 -7
  52. package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -1
  53. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
  54. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -1
  55. package/lib/commonjs/views/SkiaPictureView.js +2 -0
  56. package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
  57. package/lib/commonjs/views/SkiaPictureView.web.js +279 -94
  58. package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
  59. package/lib/commonjs/views/formats.d.ts +1 -0
  60. package/lib/commonjs/views/formats.js +28 -0
  61. package/lib/commonjs/views/formats.js.map +1 -0
  62. package/lib/commonjs/views/index.d.ts +1 -0
  63. package/lib/commonjs/views/index.js +11 -0
  64. package/lib/commonjs/views/index.js.map +1 -1
  65. package/lib/commonjs/views/types.d.ts +6 -0
  66. package/lib/commonjs/views/types.js.map +1 -1
  67. package/lib/module/Platform/Platform.web.js +3 -91
  68. package/lib/module/Platform/Platform.web.js.map +1 -1
  69. package/lib/module/mock/index.js +1 -0
  70. package/lib/module/mock/index.js.map +1 -1
  71. package/lib/module/renderer/Canvas.d.ts +10 -1
  72. package/lib/module/renderer/Canvas.js +2 -0
  73. package/lib/module/renderer/Canvas.js.map +1 -1
  74. package/lib/module/skia/types/Surface/Surface.d.ts +5 -1
  75. package/lib/module/skia/types/Surface/Surface.js.map +1 -1
  76. package/lib/module/skia/web/JsiSkParagraphStyle.js +14 -3
  77. package/lib/module/skia/web/JsiSkParagraphStyle.js.map +1 -1
  78. package/lib/module/skia/web/JsiSkSurface.d.ts +1 -1
  79. package/lib/module/skia/web/JsiSkSurface.js +2 -1
  80. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  81. package/lib/module/sksg/Container.native.d.ts +1 -0
  82. package/lib/module/sksg/Container.native.js +11 -0
  83. package/lib/module/sksg/Container.native.js.map +1 -1
  84. package/lib/module/sksg/Container.web.d.ts +1 -0
  85. package/lib/module/sksg/Container.web.js +11 -0
  86. package/lib/module/sksg/Container.web.js.map +1 -1
  87. package/lib/module/specs/NativeSkiaModule.web.d.ts +2 -0
  88. package/lib/module/specs/NativeSkiaModule.web.js +32 -7
  89. package/lib/module/specs/NativeSkiaModule.web.js.map +1 -1
  90. package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
  91. package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -1
  92. package/lib/module/views/SkiaPictureView.js +2 -0
  93. package/lib/module/views/SkiaPictureView.js.map +1 -1
  94. package/lib/module/views/SkiaPictureView.web.js +280 -95
  95. package/lib/module/views/SkiaPictureView.web.js.map +1 -1
  96. package/lib/module/views/formats.d.ts +1 -0
  97. package/lib/module/views/formats.js +22 -0
  98. package/lib/module/views/formats.js.map +1 -0
  99. package/lib/module/views/index.d.ts +1 -0
  100. package/lib/module/views/index.js +1 -0
  101. package/lib/module/views/index.js.map +1 -1
  102. package/lib/module/views/types.d.ts +6 -0
  103. package/lib/module/views/types.js.map +1 -1
  104. package/lib/typescript/lib/commonjs/Platform/Platform.web.d.ts +1 -2
  105. package/lib/typescript/lib/commonjs/mock/index.d.ts +1 -0
  106. package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +2 -1
  107. package/lib/typescript/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -1
  108. package/lib/typescript/lib/commonjs/sksg/Container.native.d.ts +1 -1
  109. package/lib/typescript/lib/commonjs/sksg/Container.web.d.ts +1 -1
  110. package/lib/typescript/lib/commonjs/views/formats.d.ts +2 -0
  111. package/lib/typescript/lib/module/Platform/Platform.web.d.ts +1 -3
  112. package/lib/typescript/lib/module/mock/index.d.ts +2 -2
  113. package/lib/typescript/lib/module/renderer/Canvas.d.ts +2 -1
  114. package/lib/typescript/lib/module/skia/web/JsiSkSurface.d.ts +1 -1
  115. package/lib/typescript/lib/module/sksg/Container.native.d.ts +1 -1
  116. package/lib/typescript/lib/module/sksg/Container.web.d.ts +1 -1
  117. package/lib/typescript/lib/module/views/formats.d.ts +1 -0
  118. package/lib/typescript/lib/module/views/index.d.ts +1 -0
  119. package/lib/typescript/src/renderer/Canvas.d.ts +10 -1
  120. package/lib/typescript/src/skia/types/Surface/Surface.d.ts +5 -1
  121. package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -1
  122. package/lib/typescript/src/sksg/Container.native.d.ts +1 -0
  123. package/lib/typescript/src/sksg/Container.web.d.ts +1 -0
  124. package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +2 -0
  125. package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
  126. package/lib/typescript/src/views/formats.d.ts +1 -0
  127. package/lib/typescript/src/views/index.d.ts +1 -0
  128. package/lib/typescript/src/views/types.d.ts +6 -0
  129. package/package.json +4 -1
  130. package/react-native-skia.podspec +1 -0
  131. package/src/Platform/Platform.web.tsx +7 -99
  132. package/src/mock/index.ts +1 -0
  133. package/src/renderer/Canvas.tsx +11 -0
  134. package/src/skia/types/Surface/Surface.ts +5 -1
  135. package/src/skia/web/JsiSkParagraphStyle.ts +16 -2
  136. package/src/skia/web/JsiSkSurface.ts +2 -1
  137. package/src/sksg/Container.native.ts +12 -0
  138. package/src/sksg/Container.web.ts +12 -0
  139. package/src/specs/NativeSkiaModule.web.ts +39 -7
  140. package/src/specs/SkiaPictureViewNativeComponent.ts +1 -0
  141. package/src/views/SkiaPictureView.tsx +2 -0
  142. package/src/views/SkiaPictureView.web.tsx +318 -106
  143. package/src/views/formats.ts +21 -0
  144. package/src/views/index.ts +1 -0
  145. package/src/views/types.ts +7 -0
@@ -1 +1 @@
1
- {"version":3,"names":["TextDirection","JsiSkParagraphStyle","toParagraphStyle","ck","value","_value$disableHinting","_value$ellipsis","_value$heightMultipli","_value$maxLines","_value$replaceTabChar","_ps$strutStyle","_value$strutStyle$fon","_value$strutStyle","_value$strutStyle$fon2","_value$strutStyle2","_value$strutStyle$hei","_value$strutStyle3","_value$strutStyle$lea","_value$strutStyle4","_value$strutStyle$for","_value$strutStyle5","_ps$strutStyle$fontSt","_value$strutStyle6","_value$strutStyle7","_value$strutStyle8","_value$strutStyle$hal","_value$strutStyle9","_value$strutStyle$str","_value$strutStyle0","ps","ParagraphStyle","textStyle","color","BLACK","disableHinting","ellipsis","heightMultiplier","maxLines","replaceTabCharacters","textAlign","undefined","textDirection","LTR","textHeightBehavior","strutStyle","fontFamilies","fontSize","leading","forceStrutHeight","fontStyle","slant","width","weight","halfLeading","strutEnabled"],"sources":["JsiSkParagraphStyle.ts"],"sourcesContent":["import type { CanvasKit, ParagraphStyle } from \"canvaskit-wasm\";\n\nimport { TextDirection } from \"../types\";\nimport type { SkParagraphStyle } from \"../types\";\n\nexport class JsiSkParagraphStyle {\n static toParagraphStyle(\n ck: CanvasKit,\n value: SkParagraphStyle\n ): ParagraphStyle {\n // Seems like we need to provide the textStyle.color value, otherwise\n // the constructor crashes.\n const ps = new ck.ParagraphStyle({ textStyle: { color: ck.BLACK } });\n\n ps.disableHinting = value.disableHinting ?? ps.disableHinting;\n ps.ellipsis = value.ellipsis ?? ps.ellipsis;\n ps.heightMultiplier = value.heightMultiplier ?? ps.heightMultiplier;\n ps.maxLines = value.maxLines ?? ps.maxLines;\n ps.replaceTabCharacters =\n value.replaceTabCharacters ?? ps.replaceTabCharacters;\n ps.textAlign =\n value.textAlign !== undefined ? { value: value.textAlign } : ps.textAlign;\n ps.textDirection =\n value.textDirection !== undefined\n ? { value: value.textDirection === TextDirection.LTR ? 1 : 0 }\n : ps.textDirection;\n ps.textHeightBehavior =\n value.textHeightBehavior !== undefined\n ? { value: value.textHeightBehavior }\n : ps.textHeightBehavior;\n\n ps.strutStyle = ps.strutStyle ?? {};\n ps.strutStyle.fontFamilies =\n value.strutStyle?.fontFamilies ?? ps.strutStyle.fontFamilies;\n ps.strutStyle.fontSize =\n value.strutStyle?.fontSize ?? ps.strutStyle.fontSize;\n ps.strutStyle.heightMultiplier =\n value.strutStyle?.heightMultiplier ?? ps.strutStyle.heightMultiplier;\n ps.strutStyle.leading = value.strutStyle?.leading ?? ps.strutStyle.leading;\n ps.strutStyle.forceStrutHeight =\n value.strutStyle?.forceStrutHeight ?? ps.strutStyle.forceStrutHeight;\n\n ps.strutStyle.fontStyle = ps.strutStyle.fontStyle ?? {};\n\n ps.strutStyle.fontStyle.slant =\n value.strutStyle?.fontStyle?.slant !== undefined\n ? { value: value.strutStyle.fontStyle.slant }\n : ps.strutStyle.fontStyle.slant;\n ps.strutStyle.fontStyle.width =\n value.strutStyle?.fontStyle?.width !== undefined\n ? { value: value.strutStyle.fontStyle.width }\n : ps.strutStyle.fontStyle.width;\n ps.strutStyle.fontStyle.weight =\n value.strutStyle?.fontStyle?.weight !== undefined\n ? { value: value.strutStyle.fontStyle.weight }\n : ps.strutStyle.fontStyle.weight;\n ps.strutStyle.halfLeading =\n value.strutStyle?.halfLeading ?? ps.strutStyle.halfLeading;\n ps.strutStyle.strutEnabled =\n value.strutStyle?.strutEnabled ?? ps.strutStyle.strutEnabled;\n\n return ps;\n }\n}\n"],"mappings":"AAEA,SAASA,aAAa,QAAQ,UAAU;AAGxC,OAAO,MAAMC,mBAAmB,CAAC;EAC/B,OAAOC,gBAAgBA,CACrBC,EAAa,EACbC,KAAuB,EACP;IAAA,IAAAC,qBAAA,EAAAC,eAAA,EAAAC,qBAAA,EAAAC,eAAA,EAAAC,qBAAA,EAAAC,cAAA,EAAAC,qBAAA,EAAAC,iBAAA,EAAAC,sBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,kBAAA,EAAAC,kBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,kBAAA;IAChB;IACA;IACA,MAAMC,EAAE,GAAG,IAAI1B,EAAE,CAAC2B,cAAc,CAAC;MAAEC,SAAS,EAAE;QAAEC,KAAK,EAAE7B,EAAE,CAAC8B;MAAM;IAAE,CAAC,CAAC;IAEpEJ,EAAE,CAACK,cAAc,IAAA7B,qBAAA,GAAGD,KAAK,CAAC8B,cAAc,cAAA7B,qBAAA,cAAAA,qBAAA,GAAIwB,EAAE,CAACK,cAAc;IAC7DL,EAAE,CAACM,QAAQ,IAAA7B,eAAA,GAAGF,KAAK,CAAC+B,QAAQ,cAAA7B,eAAA,cAAAA,eAAA,GAAIuB,EAAE,CAACM,QAAQ;IAC3CN,EAAE,CAACO,gBAAgB,IAAA7B,qBAAA,GAAGH,KAAK,CAACgC,gBAAgB,cAAA7B,q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SkTextStyle","JsiSkParagraphStyle","toParagraphStyle","ck","value","_value$disableHinting","_value$ellipsis","_value$heightMultipli","_value$maxLines","_value$replaceTabChar","_ps$strutStyle","_value$strutStyle$fon","_value$strutStyle","_value$strutStyle$fon2","_value$strutStyle2","_value$strutStyle$hei","_value$strutStyle3","_value$strutStyle$lea","_value$strutStyle4","_value$strutStyle$for","_value$strutStyle5","_ps$strutStyle$fontSt","_value$strutStyle6","_value$strutStyle7","_value$strutStyle8","_value$strutStyle$hal","_value$strutStyle9","_value$strutStyle$str","_value$strutStyle0","textStyle","color","BLACK","Object","entries","toTextStyle","forEach","key","v","undefined","ps","ParagraphStyle","disableHinting","ellipsis","heightMultiplier","maxLines","replaceTabCharacters","textAlign","textDirection","LTR","textHeightBehavior","strutStyle","fontFamilies","fontSize","leading","forceStrutHeight","fontStyle","slant","width","weight","halfLeading","strutEnabled"],"sources":["JsiSkParagraphStyle.ts"],"sourcesContent":["import type { CanvasKit, ParagraphStyle, TextStyle } from \"canvaskit-wasm\";\n\nimport { TextDirection } from \"../types\";\nimport type { SkParagraphStyle } from \"../types\";\n\nimport { JsiSkTextStyle } from \"./JsiSkTextStyle\";\n\nexport class JsiSkParagraphStyle {\n static toParagraphStyle(\n ck: CanvasKit,\n value: SkParagraphStyle\n ): ParagraphStyle {\n // Seems like we need to provide the textStyle.color value, otherwise\n // the constructor crashes.\n const textStyle: TextStyle = { color: ck.BLACK };\n if (value.textStyle) {\n // Only merge the properties that are set; toTextStyle() emits undefined\n // for the others and the ParagraphStyle constructor requires a color.\n Object.entries(JsiSkTextStyle.toTextStyle(value.textStyle)).forEach(\n ([key, v]) => {\n if (v !== undefined) {\n (textStyle as Record<string, unknown>)[key] = v;\n }\n }\n );\n }\n const ps = new ck.ParagraphStyle({ textStyle });\n\n ps.disableHinting = value.disableHinting ?? ps.disableHinting;\n ps.ellipsis = value.ellipsis ?? ps.ellipsis;\n ps.heightMultiplier = value.heightMultiplier ?? ps.heightMultiplier;\n ps.maxLines = value.maxLines ?? ps.maxLines;\n ps.replaceTabCharacters =\n value.replaceTabCharacters ?? ps.replaceTabCharacters;\n ps.textAlign =\n value.textAlign !== undefined ? { value: value.textAlign } : ps.textAlign;\n ps.textDirection =\n value.textDirection !== undefined\n ? { value: value.textDirection === TextDirection.LTR ? 1 : 0 }\n : ps.textDirection;\n ps.textHeightBehavior =\n value.textHeightBehavior !== undefined\n ? { value: value.textHeightBehavior }\n : ps.textHeightBehavior;\n\n ps.strutStyle = ps.strutStyle ?? {};\n ps.strutStyle.fontFamilies =\n value.strutStyle?.fontFamilies ?? ps.strutStyle.fontFamilies;\n ps.strutStyle.fontSize =\n value.strutStyle?.fontSize ?? ps.strutStyle.fontSize;\n ps.strutStyle.heightMultiplier =\n value.strutStyle?.heightMultiplier ?? ps.strutStyle.heightMultiplier;\n ps.strutStyle.leading = value.strutStyle?.leading ?? ps.strutStyle.leading;\n ps.strutStyle.forceStrutHeight =\n value.strutStyle?.forceStrutHeight ?? ps.strutStyle.forceStrutHeight;\n\n ps.strutStyle.fontStyle = ps.strutStyle.fontStyle ?? {};\n\n ps.strutStyle.fontStyle.slant =\n value.strutStyle?.fontStyle?.slant !== undefined\n ? { value: value.strutStyle.fontStyle.slant }\n : ps.strutStyle.fontStyle.slant;\n ps.strutStyle.fontStyle.width =\n value.strutStyle?.fontStyle?.width !== undefined\n ? { value: value.strutStyle.fontStyle.width }\n : ps.strutStyle.fontStyle.width;\n ps.strutStyle.fontStyle.weight =\n value.strutStyle?.fontStyle?.weight !== undefined\n ? { value: value.strutStyle.fontStyle.weight }\n : ps.strutStyle.fontStyle.weight;\n ps.strutStyle.halfLeading =\n value.strutStyle?.halfLeading ?? ps.strutStyle.halfLeading;\n ps.strutStyle.strutEnabled =\n value.strutStyle?.strutEnabled ?? ps.strutStyle.strutEnabled;\n\n return ps;\n }\n}\n"],"mappings":"AAEA,SAASA,aAAa,QAAQ,UAAU;AAGxC,SAASC,cAAc,QAAQ,kBAAkB;AAEjD,OAAO,MA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 @@ import { JsiSkImage } from "./JsiSkImage";
5
5
  export declare class JsiSkSurface extends HostObject<Surface, "Surface"> implements SkSurface {
6
6
  constructor(CanvasKit: CanvasKit, ref: Surface);
7
7
  [Symbol.dispose](): void;
8
- flush(): void;
8
+ flush(_sync?: boolean): void;
9
9
  width(): number;
10
10
  height(): number;
11
11
  getCanvas(): SkCanvas;
@@ -9,7 +9,8 @@ export class JsiSkSurface extends HostObject {
9
9
  [Symbol.dispose]() {
10
10
  this.ref.dispose();
11
11
  }
12
- flush() {
12
+ flush(_sync) {
13
+ // CanvasKit has no separate CPU sync; flush() is sufficient on the web backend.
13
14
  this.ref.flush();
14
15
  }
15
16
  width() {
@@ -1 +1 @@
1
- {"version":3,"names":["HostObject","JsiSkCanvas","JsiSkImage","JsiSkRect","JsiSkSurface","constructor","CanvasKit","ref","Symbol","dispose","flush","width","height","getCanvas","makeImageSnapshot","bounds","outputImage","image","Array","from","fromValue","undefined","getNativeTextureUnstable","console","warn"],"sources":["JsiSkSurface.ts"],"sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { SkCanvas, SkImage, SkRect, SkSurface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkSurface\n extends HostObject<Surface, \"Surface\">\n implements SkSurface\n{\n constructor(CanvasKit: CanvasKit, ref: Surface) {\n super(CanvasKit, ref, \"Surface\");\n }\n\n [Symbol.dispose]() {\n this.ref.dispose();\n }\n\n flush() {\n this.ref.flush();\n }\n\n width() {\n return this.ref.width();\n }\n\n height() {\n return this.ref.height();\n }\n\n getCanvas(): SkCanvas {\n return new JsiSkCanvas(this.CanvasKit, this.ref.getCanvas());\n }\n\n makeImageSnapshot(bounds?: SkRect, outputImage?: JsiSkImage): SkImage {\n const image = this.ref.makeImageSnapshot(\n bounds\n ? Array.from(JsiSkRect.fromValue(this.CanvasKit, bounds))\n : undefined\n );\n if (outputImage) {\n outputImage.ref = image;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n getNativeTextureUnstable(): unknown {\n console.warn(\"getBackendTexture is not implemented on Web\");\n return null;\n }\n}\n"],"mappings":"AAIA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,aAAa;AAEvC,OAAO,MAAMC,YAAY,SACfJ,UAAU,CAEpB;EACEK,WAAWA,CAACC,SAAoB,EAAEC,GAAY,EAAE;IAC9C,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,SAAS,CAAC;EAClC;EAEA,CAACC,MAAM,CAACC,OAAO,IAAI;IACjB,IAAI,CAACF,GAAG,CAACE,OAAO,CAAC,CAAC;EACpB;EAEAC,KAAKA,CAAA,EAAG;IACN,IAAI,CAACH,GAAG,CAACG,KAAK,CAAC,CAAC;EAClB;EAEAC,KAAKA,CAAA,EAAG;IACN,OAAO,IAAI,CAACJ,GAAG,CAACI,KAAK,CAAC,CAAC;EACzB;EAEAC,MAAMA,CAAA,EAAG;IACP,OAAO,IAAI,CAACL,GAAG,CAACK,MAAM,CAAC,CAAC;EAC1B;EAEAC,SAASA,CAAA,EAAa;IACpB,OAAO,IAAIZ,WAAW,CAAC,IAAI,CAACK,SAAS,EAAE,IAAI,CAACC,GAAG,CAACM,SAAS,CAAC,CAAC,CAAC;EAC9D;EAEAC,iBAAiBA,CAACC,MAAe,EAAEC,WAAwB,EAAW;IACpE,MAAMC,KAAK,GAAG,IAAI,CAACV,GAAG,CAACO,iBAAiB,CACtCC,MAAM,GACFG,KAAK,CAACC,IAAI,CAAChB,SAAS,CAACiB,SAAS,CAAC,IAAI,CAACd,SAAS,EAAES,MAAM,CAAC,CAAC,GACvDM,SACN,CAAC;IACD,IAAIL,WAAW,EAAE;MACfA,WAAW,CAACT,GAAG,GAAGU,KAAK;IACzB;IACA,OAAO,IAAIf,UAAU,CAAC,IAAI,CAACI,SAAS,EAAEW,KAAK,CAAC;EAC9C;EAEAK,wBAAwBA,CAAA,EAAY;IAClCC,OAAO,CAACC,IAAI,CAAC,6CAA6C,CAAC;IAC3D,OAAO,IAAI;EACb;AACF","ignoreList":[]}
1
+ {"version":3,"names":["HostObject","JsiSkCanvas","JsiSkImage","JsiSkRect","JsiSkSurface","constructor","CanvasKit","ref","Symbol","dispose","flush","_sync","width","height","getCanvas","makeImageSnapshot","bounds","outputImage","image","Array","from","fromValue","undefined","getNativeTextureUnstable","console","warn"],"sources":["JsiSkSurface.ts"],"sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { SkCanvas, SkImage, SkRect, SkSurface } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkSurface\n extends HostObject<Surface, \"Surface\">\n implements SkSurface\n{\n constructor(CanvasKit: CanvasKit, ref: Surface) {\n super(CanvasKit, ref, \"Surface\");\n }\n\n [Symbol.dispose]() {\n this.ref.dispose();\n }\n\n flush(_sync?: boolean) {\n // CanvasKit has no separate CPU sync; flush() is sufficient on the web backend.\n this.ref.flush();\n }\n\n width() {\n return this.ref.width();\n }\n\n height() {\n return this.ref.height();\n }\n\n getCanvas(): SkCanvas {\n return new JsiSkCanvas(this.CanvasKit, this.ref.getCanvas());\n }\n\n makeImageSnapshot(bounds?: SkRect, outputImage?: JsiSkImage): SkImage {\n const image = this.ref.makeImageSnapshot(\n bounds\n ? Array.from(JsiSkRect.fromValue(this.CanvasKit, bounds))\n : undefined\n );\n if (outputImage) {\n outputImage.ref = image;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n getNativeTextureUnstable(): unknown {\n console.warn(\"getBackendTexture is not implemented on Web\");\n return null;\n }\n}\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6C,CAAC;IAC3D,OAAO,IAAI;EACb;AACF","ignoreList":[]}
@@ -7,6 +7,7 @@ declare class NativeReanimatedContainer extends Container {
7
7
  private mapperId;
8
8
  private picture;
9
9
  constructor(Skia: Skia, nativeId: number);
10
+ unmount(): void;
10
11
  redraw(): void;
11
12
  }
12
13
  export declare const createContainer: (Skia: Skia, nativeId: number) => StaticContainer | NativeReanimatedContainer;
@@ -30,9 +30,20 @@ class NativeReanimatedContainer extends Container {
30
30
  _defineProperty(this, "picture", void 0);
31
31
  this.picture = Skia.Picture.MakePicture(null);
32
32
  }
33
+ unmount() {
34
+ super.unmount();
35
+ if (this.mapperId !== null) {
36
+ // The mapper closure retains the recorder and its resources (e.g.
37
+ // images) on the UI runtime and keeps updating the picture of an
38
+ // unmounted view — stop it or it leaks for the lifetime of the app.
39
+ Rea.stopMapper(this.mapperId);
40
+ this.mapperId = null;
41
+ }
42
+ }
33
43
  redraw() {
34
44
  if (this.mapperId !== null) {
35
45
  Rea.stopMapper(this.mapperId);
46
+ this.mapperId = null;
36
47
  }
37
48
  if (this.unmounted) {
38
49
  return;
@@ -1 +1 @@
1
- {"version":3,"names":["Rea","HAS_REANIMATED_3","ReanimatedRecorder","Container","StaticContainer","visit","SkiaViewApi","globalThis","nativeDrawOnscreen","nativeId","recorder","picture","play","setJsiProperty","NativeReanimatedContainer","constructor","Skia","_defineProperty","Picture","MakePicture","redraw","mapperId","stopMapper","unmounted","root","sharedValues","getSharedValues","sharedRecorder","getRecorder","runOnUI","length","startMapper","applyUpdates","createContainer"],"sources":["Container.native.ts"],"sourcesContent":["import Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia, SkPicture } from \"../skia/types\";\nimport { HAS_REANIMATED_3 } from \"../external/reanimated/renderHelpers\";\nimport type { JsiRecorder } from \"../skia/types/Recorder\";\n\nimport { ReanimatedRecorder } from \"./Recorder/ReanimatedRecorder\";\nimport { Container, StaticContainer } from \"./StaticContainer\";\nimport { visit } from \"./Recorder/Visitor\";\n\nimport \"../skia/NativeSetup\";\nimport \"../views/api\";\n\n// create local reference for `strictGlobal` option in Worklets\nconst { SkiaViewApi } = globalThis;\n\nconst nativeDrawOnscreen = (\n nativeId: number,\n recorder: JsiRecorder,\n picture: SkPicture\n) => {\n \"worklet\";\n\n //const start = performance.now();\n recorder.play(picture);\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nclass NativeReanimatedContainer extends Container {\n private mapperId: number | null = null;\n private picture: SkPicture;\n\n constructor(\n Skia: Skia,\n private nativeId: number\n ) {\n super(Skia);\n this.picture = Skia.Picture.MakePicture(null)!;\n }\n\n redraw() {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n if (this.unmounted) {\n return;\n }\n const recorder = new ReanimatedRecorder(this.Skia);\n const { nativeId, picture } = this;\n visit(recorder, this.root);\n const sharedValues = recorder.getSharedValues();\n const sharedRecorder = recorder.getRecorder();\n // Draw first frame\n Rea.runOnUI(() => {\n \"worklet\";\n nativeDrawOnscreen(nativeId, sharedRecorder, picture);\n })();\n // Animate\n if (sharedValues.length > 0) {\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n sharedRecorder.applyUpdates(sharedValues);\n nativeDrawOnscreen(nativeId, sharedRecorder, picture);\n }, sharedValues);\n }\n }\n}\n\nexport const createContainer = (Skia: Skia, nativeId: number) => {\n if (HAS_REANIMATED_3 && nativeId !== -1) {\n return new NativeReanimatedContainer(Skia, nativeId);\n } else {\n return new StaticContainer(Skia, nativeId);\n }\n};\n"],"mappings":";;;AAAA,OAAOA,GAAG,MAAM,wCAAwC;AAExD,SAASC,gBAAgB,QAAQ,sCAAsC;AAGvE,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,SAAS,EAAEC,eAAe,QAAQ,mBAAmB;AAC9D,SAASC,KAAK,QAAQ,oBAAoB;AAE1C,OAAO,qBAAqB;AAC5B,OAAO,cAAc;;AAErB;AAC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AM,GAAG,CAAC,EAAE;MAC3B,IAAI,CAACT,QAAQ,GAAGrB,GAAG,CAAC+B,WAAW,CAAC,MAAM;QACpC,SAAS;;QACTJ,cAAc,CAACK,YAAY,CAACP,YAAY,CAAC;QACzCjB,kBAAkB,CAACC,QAAQ,EAAEkB,cAAc,EAAEhB,OAAO,CAAC;MACvD,CAAC,EAAEc,YAAY,CAAC;IAClB;EACF;AACF;AAEA,OAAO,MAAMQ,eAAe,GAAGA,CAACjB,IAAU,EAAEP,QAAgB,KAAK;EAC/D,IAAIR,gBAAgB,IAAIQ,QAAQ,KAAK,CAAC,CAAC,EAAE;IACvC,OAAO,IAAIK,yBAAyB,CAACE,IAAI,EAAEP,QAAQ,CAAC;EACtD,CAAC,MAAM;IACL,OAAO,IAAIL,eAAe,CAACY,IAAI,EAAEP,QAAQ,CAAC;EAC5C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Rea","HAS_REANIMATED_3","ReanimatedRecorder","Container","StaticContainer","visit","SkiaViewApi","globalThis","nativeDrawOnscreen","nativeId","recorder","picture","play","setJsiProperty","NativeReanimatedContainer","constructor","Skia","_defineProperty","Picture","MakePicture","unmount","mapperId","stopMapper","redraw","unmounted","root","sharedValues","getSharedValues","sharedRecorder","getRecorder","runOnUI","length","startMapper","applyUpdates","createContainer"],"sources":["Container.native.ts"],"sourcesContent":["import Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia, SkPicture } from \"../skia/types\";\nimport { HAS_REANIMATED_3 } from \"../external/reanimated/renderHelpers\";\nimport type { JsiRecorder } from \"../skia/types/Recorder\";\n\nimport { ReanimatedRecorder } from \"./Recorder/ReanimatedRecorder\";\nimport { Container, StaticContainer } from \"./StaticContainer\";\nimport { visit } from \"./Recorder/Visitor\";\n\nimport \"../skia/NativeSetup\";\nimport \"../views/api\";\n\n// create local reference for `strictGlobal` option in Worklets\nconst { SkiaViewApi } = globalThis;\n\nconst nativeDrawOnscreen = (\n nativeId: number,\n recorder: JsiRecorder,\n picture: SkPicture\n) => {\n \"worklet\";\n\n //const start = performance.now();\n recorder.play(picture);\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nclass NativeReanimatedContainer extends Container {\n private mapperId: number | null = null;\n private picture: SkPicture;\n\n constructor(\n Skia: Skia,\n private nativeId: number\n ) {\n super(Skia);\n this.picture = Skia.Picture.MakePicture(null)!;\n }\n\n unmount() {\n super.unmount();\n if (this.mapperId !== null) {\n // The mapper closure retains the recorder and its resources (e.g.\n // images) on the UI runtime and keeps updating the picture of an\n // unmounted view — stop it or it leaks for the lifetime of the app.\n Rea.stopMapper(this.mapperId);\n this.mapperId = null;\n }\n }\n\n redraw() {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n this.mapperId = null;\n }\n if (this.unmounted) {\n return;\n }\n const recorder = new ReanimatedRecorder(this.Skia);\n const { nativeId, picture } = this;\n visit(recorder, this.root);\n const sharedValues = recorder.getSharedValues();\n const sharedRecorder = recorder.getRecorder();\n // Draw first frame\n Rea.runOnUI(() => {\n \"worklet\";\n nativeDrawOnscreen(nativeId, sharedRecorder, picture);\n })();\n // Animate\n if (sharedValues.length > 0) {\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n sharedRecorder.applyUpdates(sharedValues);\n nativeDrawOnscreen(nativeId, sharedRecorder, picture);\n }, sharedValues);\n }\n }\n}\n\nexport const createContainer = (Skia: Skia, nativeId: number) => {\n if (HAS_REANIMATED_3 && nativeId !== -1) {\n return new NativeReanimatedContainer(Skia, nativeId);\n } else {\n return new StaticContainer(Skia, nativeId);\n }\n};\n"],"mappings":";;;AAAA,OAAOA,GAAG,MAAM,wCAAwC;AAExD,SAASC,gBAAgB,QAAQ,sCAAsC;AAGvE,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,SAAS,EAAEC,eAAe,QAAQ,mBAAmB;AAC9D,SAASC,KAAK,QAAQ,oBAAoB;AAE1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,CAAC;IAC1B,MAAMC,YAAY,GAAGhB,QAAQ,CAACiB,eAAe,CAAC,CAAC;IAC/C,MAAMC,cAAc,GAAGlB,QAAQ,CAACmB,WAAW,CAAC,CAAC;IAC7C;IACA7B,GAAG,CAAC8B,OAAO,CAAC,MAAM;MAChB,SAAS;;MACTtB,kBAAkB,CAACC,QAAQ,EAAEmB,cAAc,EAAEjB,OAAO,CAAC;IACvD,CAAC,CAAC,CAAC,CAAC;IACJ;IACA,IAAIe,YAAY,CAACK,MAAM,GAAG,CAAC,EAAE;MAC3B,IAAI,CAACV,QAAQ,GAAGrB,GAAG,CAACgC,WAAW,CAAC,MAAM;QACpC,SAAS;;QACTJ,cAAc,CAACK,YAAY,CAACP,YAAY,CAAC;QACzClB,kBAAkB,CAACC,QAAQ,EAAEmB,cAAc,EAAEjB,OAAO,CAAC;MACvD,CAAC,EAAEe,YAAY,CAAC;IAClB;EACF;AACF;AAEA,OAAO,MAAMQ,eAAe,GAAGA,CAAClB,IAAU,EAAEP,QAAgB,KAAK;EAC/D,IAAIR,gBAAgB,IAAIQ,QAAQ,KAAK,CAAC,CAAC,EAAE;IACvC,OAAO,IAAIK,yBAAyB,CAACE,IAAI,EAAEP,QAAQ,CAAC;EACtD,CAAC,MAAM;IACL,OAAO,IAAIL,eAAe,CAACY,IAAI,EAAEP,QAAQ,CAAC;EAC5C;AACF,CAAC","ignoreList":[]}
@@ -6,6 +6,7 @@ declare class ReanimatedContainer extends Container {
6
6
  private nativeId;
7
7
  private mapperId;
8
8
  constructor(Skia: Skia, nativeId: number);
9
+ unmount(): void;
9
10
  redraw(): void;
10
11
  }
11
12
  export declare const createContainer: (Skia: Skia, nativeId: number) => StaticContainer | ReanimatedContainer;
@@ -36,9 +36,20 @@ class ReanimatedContainer extends Container {
36
36
  this.nativeId = nativeId;
37
37
  _defineProperty(this, "mapperId", null);
38
38
  }
39
+ unmount() {
40
+ super.unmount();
41
+ if (this.mapperId !== null) {
42
+ // The mapper closure retains the recording and keeps updating the
43
+ // picture of an unmounted view — stop it or it leaks for the
44
+ // lifetime of the app.
45
+ Rea.stopMapper(this.mapperId);
46
+ this.mapperId = null;
47
+ }
48
+ }
39
49
  redraw() {
40
50
  if (this.mapperId !== null) {
41
51
  Rea.stopMapper(this.mapperId);
52
+ this.mapperId = null;
42
53
  }
43
54
  if (this.unmounted) {
44
55
  return;
@@ -1 +1 @@
1
- {"version":3,"names":["Rea","HAS_REANIMATED_3","Recorder","visit","replay","createDrawingContext","Container","StaticContainer","SkiaViewApi","globalThis","drawOnscreen","Skia","nativeId","recording","rec","PictureRecorder","canvas","beginRecording","ctx","paintPool","commands","picture","finishRecordingAsPicture","dispose","setJsiProperty","ReanimatedContainer","constructor","_defineProperty","redraw","mapperId","stopMapper","unmounted","recorder","root","record","getRecording","animationValues","size","startMapper","Array","from","runOnUI","createContainer"],"sources":["Container.web.ts"],"sourcesContent":["import Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia } from \"../skia/types\";\nimport { HAS_REANIMATED_3 } from \"../external/reanimated/renderHelpers\";\n\nimport type { Recording } from \"./Recorder/Recorder\";\nimport { Recorder } from \"./Recorder/Recorder\";\nimport { visit } from \"./Recorder/Visitor\";\nimport { replay } from \"./Recorder/Player\";\nimport { createDrawingContext } from \"./Recorder/DrawingContext\";\nimport { Container, StaticContainer } from \"./StaticContainer\";\n\nimport \"../skia/NativeSetup\";\nimport \"../views/api\";\n\n// create local reference for `strictGlobal` option in Worklets\nconst { SkiaViewApi } = globalThis;\n\nconst drawOnscreen = (Skia: Skia, nativeId: number, recording: Recording) => {\n \"worklet\";\n const rec = Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n //const start = performance.now();\n\n const ctx = createDrawingContext(Skia, recording.paintPool, canvas);\n replay(ctx, recording.commands);\n const picture = rec.finishRecordingAsPicture();\n rec.dispose();\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nclass ReanimatedContainer extends Container {\n private mapperId: number | null = null;\n\n constructor(\n Skia: Skia,\n private nativeId: number\n ) {\n super(Skia);\n }\n\n redraw() {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n if (this.unmounted) {\n return;\n }\n const recorder = new Recorder();\n visit(recorder, this.root);\n const record = recorder.getRecording();\n const { animationValues } = record;\n this.recording = {\n commands: record.commands,\n paintPool: record.paintPool,\n };\n const { nativeId, Skia, recording } = this;\n if (animationValues.size > 0) {\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, recording!);\n }, Array.from(animationValues));\n }\n Rea.runOnUI(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, recording!);\n })();\n }\n}\n\nexport const createContainer = (Skia: Skia, nativeId: number) => {\n if (HAS_REANIMATED_3 && nativeId !== -1) {\n return new ReanimatedContainer(Skia, nativeId);\n } else {\n return new StaticContainer(Skia, nativeId);\n }\n};\n"],"mappings":";;;AAAA,OAAOA,GAAG,MAAM,wCAAwC;AAExD,SAASC,gBAAgB,QAAQ,sCAAsC;AAGvE,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,SAAS,EAAEC,eAAe,QAAQ,mBAAmB;AAE9D,OAAO,qBAAqB;AAC5B,OAAO,cAAc;;AAErB;AACA,MAAM;EAAEC;AAAY,CAAC,GAAGC,UAAU;AAElC,MAAMC,YAAY,GAAGA,CAACC,IAAU,EAAEC,QAAgB,EAAEC,SAAoB,KAAK;EAC3E,SAAS;;EACT,MAAMC,GAAG,GAAGH,IAAI,CAACI,eAAe,CAAC,CAAC;EAClC,MAAMC,MAAM,GAAGF,GAAG,CAACG,cAAc,CAAC,CAAC;EACnC;;EAEA,MAAMC,GAAG,GAAGb,oBAAoB,CAACM,IAAI,EAAEE,SAAS,CAACM,SAAS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U,CAAC;MAC1C,CAAC,EAAE0B,KAAK,CAACC,IAAI,CAACJ,eAAe,CAAC,CAAC;IACjC;IACApC,GAAG,CAACyC,OAAO,CAAC,MAAM;MAChB,SAAS;;MACT/B,YAAY,CAACC,IAAI,EAAEC,QAAQ,EAAEC,SAAU,CAAC;IAC1C,CAAC,CAAC,CAAC,CAAC;EACN;AACF;AAEA,OAAO,MAAM6B,eAAe,GAAGA,CAAC/B,IAAU,EAAEC,QAAgB,KAAK;EAC/D,IAAIX,gBAAgB,IAAIW,QAAQ,KAAK,CAAC,CAAC,EAAE;IACvC,OAAO,IAAIa,mBAAmB,CAACd,IAAI,EAAEC,QAAQ,CAAC;EAChD,CAAC,MAAM;IACL,OAAO,IAAIL,eAAe,CAACI,IAAI,EAAEC,QAAQ,CAAC;EAC5C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Rea","HAS_REANIMATED_3","Recorder","visit","replay","createDrawingContext","Container","StaticContainer","SkiaViewApi","globalThis","drawOnscreen","Skia","nativeId","recording","rec","PictureRecorder","canvas","beginRecording","ctx","paintPool","commands","picture","finishRecordingAsPicture","dispose","setJsiProperty","ReanimatedContainer","constructor","_defineProperty","unmount","mapperId","stopMapper","redraw","unmounted","recorder","root","record","getRecording","animationValues","size","startMapper","Array","from","runOnUI","createContainer"],"sources":["Container.web.ts"],"sourcesContent":["import Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia } from \"../skia/types\";\nimport { HAS_REANIMATED_3 } from \"../external/reanimated/renderHelpers\";\n\nimport type { Recording } from \"./Recorder/Recorder\";\nimport { Recorder } from \"./Recorder/Recorder\";\nimport { visit } from \"./Recorder/Visitor\";\nimport { replay } from \"./Recorder/Player\";\nimport { createDrawingContext } from \"./Recorder/DrawingContext\";\nimport { Container, StaticContainer } from \"./StaticContainer\";\n\nimport \"../skia/NativeSetup\";\nimport \"../views/api\";\n\n// create local reference for `strictGlobal` option in Worklets\nconst { SkiaViewApi } = globalThis;\n\nconst drawOnscreen = (Skia: Skia, nativeId: number, recording: Recording) => {\n \"worklet\";\n const rec = Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n //const start = performance.now();\n\n const ctx = createDrawingContext(Skia, recording.paintPool, canvas);\n replay(ctx, recording.commands);\n const picture = rec.finishRecordingAsPicture();\n rec.dispose();\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nclass ReanimatedContainer extends Container {\n private mapperId: number | null = null;\n\n constructor(\n Skia: Skia,\n private nativeId: number\n ) {\n super(Skia);\n }\n\n unmount() {\n super.unmount();\n if (this.mapperId !== null) {\n // The mapper closure retains the recording and keeps updating the\n // picture of an unmounted view — stop it or it leaks for the\n // lifetime of the app.\n Rea.stopMapper(this.mapperId);\n this.mapperId = null;\n }\n }\n\n redraw() {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n this.mapperId = null;\n }\n if (this.unmounted) {\n return;\n }\n const recorder = new Recorder();\n visit(recorder, this.root);\n const record = recorder.getRecording();\n const { animationValues } = record;\n this.recording = {\n commands: record.commands,\n paintPool: record.paintPool,\n };\n const { nativeId, Skia, recording } = this;\n if (animationValues.size > 0) {\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, recording!);\n }, Array.from(animationValues));\n }\n Rea.runOnUI(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, recording!);\n })();\n }\n}\n\nexport const createContainer = (Skia: Skia, nativeId: number) => {\n if (HAS_REANIMATED_3 && nativeId !== -1) {\n return new ReanimatedContainer(Skia, nativeId);\n } else {\n return new StaticContainer(Skia, nativeId);\n }\n};\n"],"mappings":";;;AAAA,OAAOA,GAAG,MAAM,wCAAwC;AAExD,SAASC,gBAAgB,QAAQ,sCAAsC;AAGvE,SAASC,QAAQ,QAAQ,qBAAqB;AAC9C,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC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AC","ignoreList":[]}
@@ -4,7 +4,9 @@ import type { SkiaPictureViewHandle } from "../views/SkiaPictureView.web";
4
4
  export type ISkiaViewApiWeb = ISkiaViewApi & {
5
5
  views: Record<string, SkiaPictureViewHandle>;
6
6
  deferedPictures: Record<string, SkPicture>;
7
+ unregisteredViews: Set<string>;
7
8
  registerView(nativeId: string, view: SkiaPictureViewHandle): void;
9
+ unregisterView(nativeId: string): void;
8
10
  };
9
11
  declare const _default: {};
10
12
  export default _default;
@@ -3,23 +3,37 @@
3
3
  global.SkiaViewApi = {
4
4
  views: {},
5
5
  deferedPictures: {},
6
+ unregisteredViews: new Set(),
6
7
  deferedOnSize: {},
7
8
  web: true,
8
9
  registerView(nativeId, view) {
10
+ this.unregisteredViews.delete(nativeId);
9
11
  // Maybe a picture for this view was already set
10
12
  if (this.deferedPictures[nativeId]) {
11
13
  view.setPicture(this.deferedPictures[nativeId]);
14
+ delete this.deferedPictures[nativeId];
12
15
  }
13
16
  this.views[nativeId] = view;
14
17
  },
18
+ unregisterView(nativeId) {
19
+ // Views must be removed on unmount: the handle's closures capture the
20
+ // canvas element, so a stale entry retains the whole detached DOM tree.
21
+ this.unregisteredViews.add(nativeId);
22
+ delete this.views[nativeId];
23
+ delete this.deferedPictures[nativeId];
24
+ },
15
25
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
26
  setJsiProperty(nativeId, name, value) {
17
27
  if (name === "picture") {
18
- if (!this.views[`${nativeId}`]) {
19
- this.deferedPictures[`${nativeId}`] = value;
20
- } else {
21
- this.views[`${nativeId}`].setPicture(value);
28
+ const id = `${nativeId}`;
29
+ if (this.views[id]) {
30
+ this.views[id].setPicture(value);
31
+ } else if (!this.unregisteredViews.has(id)) {
32
+ this.deferedPictures[id] = value;
22
33
  }
34
+ // Otherwise the view has unmounted (e.g. a trailing animation frame):
35
+ // drop the picture instead of deferring it for an id that will never
36
+ // register again, which would retain it forever.
23
37
  }
24
38
  },
25
39
  size(nativeId) {
@@ -33,14 +47,25 @@ global.SkiaViewApi = {
33
47
  }
34
48
  },
35
49
  requestRedraw(nativeId) {
36
- this.views[`${nativeId}`].redraw();
50
+ var _this$views;
51
+ // The view may already have unmounted (e.g. a trailing animation frame).
52
+ (_this$views = this.views[`${nativeId}`]) === null || _this$views === void 0 || _this$views.redraw();
37
53
  },
38
54
  makeImageSnapshot(nativeId, rect) {
39
- return this.views[`${nativeId}`].makeImageSnapshot(rect);
55
+ const view = this.views[`${nativeId}`];
56
+ if (!view) {
57
+ throw new Error(`Cannot make image snapshot: view with nativeID ${nativeId} is not registered (it may have unmounted)`);
58
+ }
59
+ return view.makeImageSnapshot(rect);
40
60
  },
41
61
  makeImageSnapshotAsync(nativeId, rect) {
42
62
  return new Promise((resolve, reject) => {
43
- const result = this.views[`${nativeId}`].makeImageSnapshot(rect);
63
+ const view = this.views[`${nativeId}`];
64
+ if (!view) {
65
+ reject(new Error(`Cannot make image snapshot: view with nativeID ${nativeId} is not registered (it may have unmounted)`));
66
+ return;
67
+ }
68
+ const result = view.makeImageSnapshot(rect);
44
69
  if (result) {
45
70
  resolve(result);
46
71
  } else {
@@ -1 +1 @@
1
- {"version":3,"names":["global","SkiaViewApi","views","deferedPictures","deferedOnSize","web","registerView","nativeId","view","setPicture","setJsiProperty","name","value","size","getSize","width","height","requestRedraw","redraw","makeImageSnapshot","rect","makeImageSnapshotAsync","Promise","resolve","reject","result","Error"],"sources":["NativeSkiaModule.web.ts"],"sourcesContent":["/* eslint-disable import/no-anonymous-default-export */\nimport type { SkPicture, SkRect } from \"../skia/types\";\nimport type { ISkiaViewApi } from \"../views/types\";\nimport type { SkiaPictureViewHandle } from \"../views/SkiaPictureView.web\";\n\nexport type ISkiaViewApiWeb = ISkiaViewApi & {\n views: Record<string, SkiaPictureViewHandle>;\n deferedPictures: Record<string, SkPicture>;\n registerView(nativeId: string, view: SkiaPictureViewHandle): void;\n};\n\nglobal.SkiaViewApi = {\n views: {},\n deferedPictures: {},\n deferedOnSize: {},\n web: true,\n registerView(nativeId: string, view: SkiaPictureViewHandle) {\n // Maybe a picture for this view was already set\n if (this.deferedPictures[nativeId]) {\n view.setPicture(this.deferedPictures[nativeId] as SkPicture);\n }\n this.views[nativeId] = view;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setJsiProperty(nativeId: number, name: string, value: any) {\n if (name === \"picture\") {\n if (!this.views[`${nativeId}`]) {\n this.deferedPictures[`${nativeId}`] = value;\n } else {\n this.views[`${nativeId}`].setPicture(value);\n }\n }\n },\n size(nativeId: number) {\n if (this.views[`${nativeId}`]) {\n return this.views[`${nativeId}`].getSize();\n } else {\n return { width: 0, height: 0 };\n }\n },\n requestRedraw(nativeId: number) {\n this.views[`${nativeId}`].redraw();\n },\n makeImageSnapshot(nativeId: number, rect?: SkRect) {\n return this.views[`${nativeId}`].makeImageSnapshot(rect);\n },\n makeImageSnapshotAsync(nativeId: number, rect?: SkRect) {\n return new Promise((resolve, reject) => {\n const result = this.views[`${nativeId}`].makeImageSnapshot(rect);\n if (result) {\n resolve(result);\n } else {\n reject(new Error(\"Failed to make image snapshot\"));\n }\n });\n },\n} as ISkiaViewApiWeb;\n\n// eslint-disable-next-line import/no-default-export\nexport default {};\n"],"mappings":"AAAA;;AAWAA,MAAM,CAACC,WAAW,GAAG;EACnBC,KAAK,EAAE,CAAC,CAAC;EACTC,eAAe,EAAE,CAAC,CAAC;EACnBC,aAAa,EAAE,CAAC,CAAC;EACjBC,GAAG,EAAE,IAAI;EACTC,YAAYA,CAACC,QAAgB,EAAEC,IAA2B,EAAE;IAC1D;IACA,IAAI,IAAI,CAACL,eAAe,CAACI,QAAQ,CAAC,EAAE;MAClCC,IAAI,CAACC,UAAU,CAAC,IAAI,CAACN,eAAe,CAACI,QAAQ,CAAc,CAAC;IAC9D;IACA,IAAI,CAACL,KAAK,CAACK,QAAQ,CAAC,GAAGC,IAAI;EAC7B,CAAC;EACD;EACAE,cAAcA,CAACH,QAAgB,EAAEI,IAAY,EAAEC,KAAU,EAAE;IACz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AC;MACpD;IACF,CAAC,CAAC;EACJ;AACF,CAAoB;;AAEpB;AACA,eAAe,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["global","SkiaViewApi","views","deferedPictures","unregisteredViews","Set","deferedOnSize","web","registerView","nativeId","view","delete","setPicture","unregisterView","add","setJsiProperty","name","value","id","has","size","getSize","width","height","requestRedraw","_this$views","redraw","makeImageSnapshot","rect","Error","makeImageSnapshotAsync","Promise","resolve","reject","result"],"sources":["NativeSkiaModule.web.ts"],"sourcesContent":["/* eslint-disable import/no-anonymous-default-export */\nimport type { SkPicture, SkRect } from \"../skia/types\";\nimport type { ISkiaViewApi } from \"../views/types\";\nimport type { SkiaPictureViewHandle } from \"../views/SkiaPictureView.web\";\n\nexport type ISkiaViewApiWeb = ISkiaViewApi & {\n views: Record<string, SkiaPictureViewHandle>;\n deferedPictures: Record<string, SkPicture>;\n unregisteredViews: Set<string>;\n registerView(nativeId: string, view: SkiaPictureViewHandle): void;\n unregisterView(nativeId: string): void;\n};\n\nglobal.SkiaViewApi = {\n views: {},\n deferedPictures: {},\n unregisteredViews: new Set<string>(),\n deferedOnSize: {},\n web: true,\n registerView(nativeId: string, view: SkiaPictureViewHandle) {\n this.unregisteredViews.delete(nativeId);\n // Maybe a picture for this view was already set\n if (this.deferedPictures[nativeId]) {\n view.setPicture(this.deferedPictures[nativeId] as SkPicture);\n delete this.deferedPictures[nativeId];\n }\n this.views[nativeId] = view;\n },\n unregisterView(nativeId: string) {\n // Views must be removed on unmount: the handle's closures capture the\n // canvas element, so a stale entry retains the whole detached DOM tree.\n this.unregisteredViews.add(nativeId);\n delete this.views[nativeId];\n delete this.deferedPictures[nativeId];\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setJsiProperty(nativeId: number, name: string, value: any) {\n if (name === \"picture\") {\n const id = `${nativeId}`;\n if (this.views[id]) {\n this.views[id].setPicture(value);\n } else if (!this.unregisteredViews.has(id)) {\n this.deferedPictures[id] = value;\n }\n // Otherwise the view has unmounted (e.g. a trailing animation frame):\n // drop the picture instead of deferring it for an id that will never\n // register again, which would retain it forever.\n }\n },\n size(nativeId: number) {\n if (this.views[`${nativeId}`]) {\n return this.views[`${nativeId}`].getSize();\n } else {\n return { width: 0, height: 0 };\n }\n },\n requestRedraw(nativeId: number) {\n // The view may already have unmounted (e.g. a trailing animation frame).\n this.views[`${nativeId}`]?.redraw();\n },\n makeImageSnapshot(nativeId: number, rect?: SkRect) {\n const view = this.views[`${nativeId}`];\n if (!view) {\n throw new Error(\n `Cannot make image snapshot: view with nativeID ${nativeId} is not registered (it may have unmounted)`\n );\n }\n return view.makeImageSnapshot(rect);\n },\n makeImageSnapshotAsync(nativeId: number, rect?: SkRect) {\n return new Promise((resolve, reject) => {\n const view = this.views[`${nativeId}`];\n if (!view) {\n reject(\n new Error(\n `Cannot make image snapshot: view with nativeID ${nativeId} is not registered (it may have unmounted)`\n )\n );\n return;\n }\n const result = view.makeImageSnapshot(rect);\n if (result) {\n resolve(result);\n } else {\n reject(new Error(\"Failed to make image snapshot\"));\n }\n });\n },\n} as ISkiaViewApiWeb;\n\n// eslint-disable-next-line import/no-default-export\nexport default {};\n"],"mappings":"AAAA;;AAaAA,MAAM,CAACC,WAAW,GAAG;EACnBC,KAAK,EAAE,CAAC,CAAC;EACTC,eAAe,EAAE,CAAC,CAAC;EACnBC,iBAAiB,EAAE,IAAIC,GAAG,CAAS,CAAC;EACpCC,aAAa,EAAE,CAAC,CAAC;EACjBC,GAAG,EAAE,IAAI;EACTC,YAAYA,CAACC,QAAgB,EAAEC,IAA2B,EAAE;IAC1D,IAAI,CAACN,iBAAiB,CAACO,MAAM,CAACF,QAAQ,CAAC;IACvC;IACA,IAAI,IAAI,CAACN,eAAe,CAACM,QAAQ,CAAC,EAAE;MAClCC,IAAI,CAACE,UAAU,CAAC,IAAI,CAACT,eAAe,CAACM,QAAQ,CAAc,CAAC;MAC5D,OAAO,IAAI,CAACN,eAAe,CAACM,QAAQ,CAAC;IACvC;IACA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AiBA,CAAClB,QAAgB,EAAEmB,IAAa,EAAE;IACjD,MAAMlB,IAAI,GAAG,IAAI,CAACR,KAAK,CAAC,GAAGO,QAAQ,EAAE,CAAC;IACtC,IAAI,CAACC,IAAI,EAAE;MACT,MAAM,IAAImB,KAAK,CACb,kDAAkDpB,QAAQ,4CAC5D,CAAC;IACH;IACA,OAAOC,IAAI,CAACiB,iBAAiB,CAACC,IAAI,CAAC;EACrC,CAAC;EACDE,sBAAsBA,CAACrB,QAAgB,EAAEmB,IAAa,EAAE;IACtD,OAAO,IAAIG,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MACtC,MAAMvB,IAAI,GAAG,IAAI,CAACR,KAAK,CAAC,GAAGO,QAAQ,EAAE,CAAC;MACtC,IAAI,CAACC,IAAI,EAAE;QACTuB,MAAM,CACJ,IAAIJ,KAAK,CACP,kDAAkDpB,QAAQ,4CAC5D,CACF,CAAC;QACD;MACF;MACA,MAAMyB,MAAM,GAAGxB,IAAI,CAACiB,iBAAiB,CAACC,IAAI,CAAC;MAC3C,IAAIM,MAAM,EAAE;QACVF,OAAO,CAACE,MAAM,CAAC;MACjB,CAAC,MAAM;QACLD,MAAM,CAAC,IAAIJ,KAAK,CAAC,+BAA+B,CAAC,CAAC;MACpD;IACF,CAAC,CAAC;EACJ;AACF,CAAoB;;AAEpB;AACA,eAAe,CAAC,CAAC","ignoreList":[]}
@@ -4,6 +4,7 @@ export interface NativeProps extends ViewProps {
4
4
  debug?: boolean;
5
5
  opaque?: boolean;
6
6
  colorSpace?: string;
7
+ highBitDepth?: boolean;
7
8
  androidWarmup?: boolean;
8
9
  pointerEvents?: WithDefault<"auto" | "none" | "box-none" | "box-only", "auto">;
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"names":["codegenNativeComponent"],"sources":["SkiaPictureViewNativeComponent.ts"],"sourcesContent":["import { codegenNativeComponent, type ViewProps } from \"react-native\";\nimport type { WithDefault } from \"react-native/Libraries/Types/CodegenTypes\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore - pointerEvents needs to be redeclared for codegen to generate native bindings\nexport interface NativeProps extends ViewProps {\n debug?: boolean;\n opaque?: boolean;\n colorSpace?: string;\n androidWarmup?: boolean;\n pointerEvents?: WithDefault<\n \"auto\" | \"none\" | \"box-none\" | \"box-only\",\n \"auto\"\n >;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default codegenNativeComponent<NativeProps>(\"SkiaPictureView\");\n"],"mappings":"AAAA,SAASA,sBAAsB,QAAwB,cAAc;;AAGrE;AACA;;AAYA;AACA,eAAeA,sBAAsB,CAAc,iBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["codegenNativeComponent"],"sources":["SkiaPictureViewNativeComponent.ts"],"sourcesContent":["import { codegenNativeComponent, type ViewProps } from \"react-native\";\nimport type { WithDefault } from \"react-native/Libraries/Types/CodegenTypes\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore - pointerEvents needs to be redeclared for codegen to generate native bindings\nexport interface NativeProps extends ViewProps {\n debug?: boolean;\n opaque?: boolean;\n colorSpace?: string;\n highBitDepth?: boolean;\n androidWarmup?: boolean;\n pointerEvents?: WithDefault<\n \"auto\" | \"none\" | \"box-none\" | \"box-only\",\n \"auto\"\n >;\n}\n\n// eslint-disable-next-line import/no-default-export\nexport default codegenNativeComponent<NativeProps>(\"SkiaPictureView\");\n"],"mappings":"AAAA,SAASA,sBAAsB,QAAwB,cAAc;;AAGrE;AACA;;AAaA;AACA,eAAeA,sBAAsB,CAAc,iBAAiB,CAAC","ignoreList":[]}
@@ -79,6 +79,7 @@ export class SkiaPictureView extends React.Component {
79
79
  mode,
80
80
  debug = false,
81
81
  opaque = false,
82
+ highBitDepth = false,
82
83
  androidWarmup = false,
83
84
  ...viewProps
84
85
  } = this.props;
@@ -87,6 +88,7 @@ export class SkiaPictureView extends React.Component {
87
88
  nativeID: `${this._nativeId}`,
88
89
  debug: debug,
89
90
  opaque: opaque,
91
+ highBitDepth: highBitDepth,
90
92
  androidWarmup: androidWarmup
91
93
  }, viewProps));
92
94
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","SkiaPictureViewNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaPictureView","SkiaPictureView","Component","constructor","props","_defineProperty","_nativeId","current","picture","onSize","assertSkiaViewApi","setJsiProperty","tick","nativeId","componentDidUpdate","prevProps","componentWillUnmount","requestId","cancelAnimationFrame","redraw","mode","requestAnimationFrame","bind","makeImageSnapshot","rect","requestRedraw","render","debug","opaque","androidWarmup","viewProps","createElement","_extends","collapsable","nativeID","Error"],"sources":["SkiaPictureView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaPictureViewNativeProps } from \"./types\";\nimport { SkiaViewNativeId } from \"./SkiaViewNativeId\";\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\ninterface SkiaPictureViewProps extends SkiaPictureViewNativeProps {\n mode?: \"default\" | \"continuous\";\n androidWarmup?: boolean;\n}\n\nexport class SkiaPictureView extends React.Component<SkiaPictureViewProps> {\n private requestId = 0;\n\n constructor(props: SkiaPictureViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { picture, onSize } = props;\n if (picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaPictureViewProps) {\n const { picture, onSize } = this.props;\n if (picture !== prevProps.picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n componentWillUnmount() {\n if (this.requestId) {\n cancelAnimationFrame(this.requestId);\n }\n }\n\n private tick() {\n this.redraw();\n if (this.props.mode === \"continuous\") {\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n render() {\n const {\n mode,\n debug = false,\n opaque = false,\n androidWarmup = false,\n ...viewProps\n } = this.props;\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n debug={debug}\n opaque={opaque}\n androidWarmup={androidWarmup}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAOC,8BAA8B,MAAM,yCAAyC;AAEpF,SAASC,WAAW,QAAQ,OAAO;AAEnC,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC,qBAAqB,GAAGH,8BAA8B;AAO5D,OAAO,MAAMI,eAAe,SAASL,KAAK,CAACM,SAAS,CAAuB;EAGzEC,WAAWA,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oBAHK,CAAC;IAAAA,eAAA;IAInB,IAAI,CAACC,SAAS,GAAGP,gBAAgB,CAACQ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,CAACT,IAAI,CAACU,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9D;EACF;;EAEA;AACF;AACA;AACA;AACA;EACSC,iBAAiBA,CAACC,IAAa,EAAE;IACtCd,iBAAiB,CAAC,CAAC;IACnB,OAAOZ,WAAW,CAACyB,iBAAiB,CAAC,IAAI,CAACjB,SAAS,EAAEkB,IAAI,CAAC;EAC5D;;EAEA;AACF;AACA;EACSL,MAAMA,CAAA,EAAG;IACdT,iBAAiB,CAAC,CAAC;IACnBZ,WAAW,CAAC2B,aAAa,CAAC,IAAI,CAACnB,SAAS,CAAC;EAC3C;EAEAoB,MAAMA,CAAA,EAAG;IACP,MAAM;MACJN,IAAI;MACJO,KAAK,GAAG,KAAK;MACbC,MAAM,GAAG,KAAK;MACdC,aAAa,GAAG,KAAK;MACrB,GAAGC;IACL,CAAC,GAAG,IAAI,CAAC1B,KAAK;IACd,oBACER,KAAA,CAAAmC,aAAA,CAAC/B,qBAAqB,EAAAgC,QAAA;MACpBC,WAAW,EAAE,KAAM;MACnBC,QAAQ,EAAE,GAAG,IAAI,CAAC5B,SAAS,EAAG;MAC9BqB,KAAK,EAAEA,KAAM;MACbC,MAAM,EAAEA,MAAO;MACfC,aAAa,EAAEA;IAAc,GACzBC,SAAS,CACd,CAAC;EAEN;AACF;AAEA,MAAMpB,iBAAiB,GAAGA,CAAA,KAAM;EAC9B,IACEZ,WAAW,KAAK,IAAI,IACpBA,WAAW,CAACa,cAAc,KAAK,IAAI,IACnCb,WAAW,CAAC2B,aAAa,KAAK,IAAI,IAClC3B,WAAW,CAACyB,iBAAiB,KAAK,IAAI,EACtC;IACA,MAAMY,KAAK,CAAC,8BAA8B,CAAC;EAC7C;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","SkiaPictureViewNativeComponent","SkiaViewApi","SkiaViewNativeId","NativeSkiaPictureView","SkiaPictureView","Component","constructor","props","_defineProperty","_nativeId","current","picture","onSize","assertSkiaViewApi","setJsiProperty","tick","nativeId","componentDidUpdate","prevProps","componentWillUnmount","requestId","cancelAnimationFrame","redraw","mode","requestAnimationFrame","bind","makeImageSnapshot","rect","requestRedraw","render","debug","opaque","highBitDepth","androidWarmup","viewProps","createElement","_extends","collapsable","nativeID","Error"],"sources":["SkiaPictureView.tsx"],"sourcesContent":["import React from \"react\";\n\nimport type { SkRect } from \"../skia/types\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\n\nimport { SkiaViewApi } from \"./api\";\nimport type { SkiaPictureViewNativeProps } from \"./types\";\nimport { SkiaViewNativeId } from \"./SkiaViewNativeId\";\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\ninterface SkiaPictureViewProps extends SkiaPictureViewNativeProps {\n mode?: \"default\" | \"continuous\";\n androidWarmup?: boolean;\n}\n\nexport class SkiaPictureView extends React.Component<SkiaPictureViewProps> {\n private requestId = 0;\n\n constructor(props: SkiaPictureViewProps) {\n super(props);\n this._nativeId = SkiaViewNativeId.current++;\n const { picture, onSize } = props;\n if (picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n private _nativeId: number;\n\n public get nativeId() {\n return this._nativeId;\n }\n\n componentDidUpdate(prevProps: SkiaPictureViewProps) {\n const { picture, onSize } = this.props;\n if (picture !== prevProps.picture) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"picture\", picture);\n }\n if (onSize !== prevProps.onSize) {\n assertSkiaViewApi();\n SkiaViewApi.setJsiProperty(this._nativeId, \"onSize\", onSize);\n }\n this.tick();\n }\n\n componentWillUnmount() {\n if (this.requestId) {\n cancelAnimationFrame(this.requestId);\n }\n }\n\n private tick() {\n this.redraw();\n if (this.props.mode === \"continuous\") {\n this.requestId = requestAnimationFrame(this.tick.bind(this));\n }\n }\n\n /**\n * Creates a snapshot from the canvas in the surface\n * @param rect Rect to use as bounds. Optional.\n * @returns An Image object.\n */\n public makeImageSnapshot(rect?: SkRect) {\n assertSkiaViewApi();\n return SkiaViewApi.makeImageSnapshot(this._nativeId, rect);\n }\n\n /**\n * Sends a redraw request to the native SkiaView.\n */\n public redraw() {\n assertSkiaViewApi();\n SkiaViewApi.requestRedraw(this._nativeId);\n }\n\n render() {\n const {\n mode,\n debug = false,\n opaque = false,\n highBitDepth = false,\n androidWarmup = false,\n ...viewProps\n } = this.props;\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${this._nativeId}`}\n debug={debug}\n opaque={opaque}\n highBitDepth={highBitDepth}\n androidWarmup={androidWarmup}\n {...viewProps}\n />\n );\n }\n}\n\nconst assertSkiaViewApi = () => {\n if (\n SkiaViewApi === null ||\n SkiaViewApi.setJsiProperty === null ||\n SkiaViewApi.requestRedraw === null ||\n SkiaViewApi.makeImageSnapshot === null\n ) {\n throw Error(\"Skia View Api was not found.\");\n }\n};\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAOC,8BAA8B,MAAM,yCAAyC;AAEpF,SAASC,WAAW,QAAQ,OAAO;AAEnC,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,MAAMC,qBAAqB,GAAGH,8BAA8B;AAO5D,OAAO,MAAMI,eAAe,SAASL,KAAK,CAACM,SAAS,CAAuB;EAGzEC,WAAWA,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,oBAHK,CAAC;IAAAA,eAAA;IAInB,IAAI,CAACC,SAAS,GAAGP,gBAAgB,CAACQ,OAAO,EAAE;IAC3C,MAAM;MAAEC,OAAO;MAAEC;IAAO,CAAC,GAAGL,KAAK;IACjC,IAAII,OAAO,EAAE;MACXE,iBAAiB,CAAC,CAAC;MACnBZ,WAAW,CAACa,cAAc,CAAC,IAAI,CAACL,SAAS,EAAE,SAAS,EAAEE,OAAO,CAAC;IAChE;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