react-native-skia 3.0.3 → 3.0.5

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 (210) hide show
  1. package/android/CMakeLists.txt +0 -2
  2. package/android/build.gradle +15 -7
  3. package/android/cpp/jni/JniPlatformContext.cpp +0 -24
  4. package/android/cpp/jni/include/JniPlatformContext.h +0 -2
  5. package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +0 -140
  6. package/android/src/main/java/com/reactnative/skia/BackingViewKind.java +24 -0
  7. package/android/src/main/java/com/reactnative/skia/FrameScheduler.java +104 -0
  8. package/android/src/main/java/com/reactnative/skia/PlatformContext.java +0 -5
  9. package/android/src/main/java/com/reactnative/skia/SkiaView.java +55 -44
  10. package/android/src/test/java/com/reactnative/skia/FrameSchedulerTest.java +186 -0
  11. package/apple/RNSkApplePlatformContext.h +0 -10
  12. package/apple/RNSkApplePlatformContext.mm +0 -182
  13. package/cpp/api/JsiGPUTexture.h +48 -0
  14. package/cpp/api/JsiSkApi.h +1 -16
  15. package/cpp/api/JsiSkImage.h +0 -12
  16. package/cpp/api/JsiSkImageFactory.h +36 -57
  17. package/cpp/api/JsiSkSurface.h +3 -10
  18. package/cpp/api/JsiSkSurfaceFactory.h +13 -18
  19. package/cpp/rnskia/RNDawnContext.h +5 -113
  20. package/cpp/rnskia/RNDawnUtils.h +33 -0
  21. package/cpp/rnskia/RNSkPlatformContext.h +0 -54
  22. package/cpp/rnskia/RNSkView.h +10 -7
  23. package/lib/commonjs/external/reanimated/index.d.ts +0 -1
  24. package/lib/commonjs/external/reanimated/index.js +0 -11
  25. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  26. package/lib/commonjs/mock/index.js +1 -2
  27. package/lib/commonjs/mock/index.js.map +1 -1
  28. package/lib/commonjs/skia/types/GPUTexture.d.ts +11 -0
  29. package/lib/commonjs/skia/types/GPUTexture.js +2 -0
  30. package/lib/commonjs/skia/types/GPUTexture.js.map +1 -0
  31. package/lib/commonjs/skia/types/Image/Image.d.ts +0 -10
  32. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  33. package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +25 -48
  34. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  35. package/lib/commonjs/skia/types/Skia.d.ts +0 -4
  36. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  37. package/lib/commonjs/skia/types/Surface/Surface.d.ts +3 -14
  38. package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
  39. package/lib/commonjs/skia/types/Surface/SurfaceFactory.d.ts +10 -9
  40. package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
  41. package/lib/commonjs/skia/types/index.d.ts +1 -2
  42. package/lib/commonjs/skia/types/index.js +11 -22
  43. package/lib/commonjs/skia/types/index.js.map +1 -1
  44. package/lib/commonjs/skia/web/JsiSkImage.d.ts +0 -1
  45. package/lib/commonjs/skia/web/JsiSkImage.js +0 -4
  46. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  47. package/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +4 -5
  48. package/lib/commonjs/skia/web/JsiSkImageFactory.js +6 -10
  49. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  50. package/lib/commonjs/skia/web/JsiSkSurface.d.ts +0 -1
  51. package/lib/commonjs/skia/web/JsiSkSurface.js +0 -4
  52. package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
  53. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.d.ts +2 -2
  54. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js +1 -1
  55. package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  56. package/lib/commonjs/skia/web/JsiSkia.js +0 -4
  57. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  58. package/lib/module/external/reanimated/index.d.ts +0 -1
  59. package/lib/module/external/reanimated/index.js +0 -1
  60. package/lib/module/external/reanimated/index.js.map +1 -1
  61. package/lib/module/mock/index.js +1 -2
  62. package/lib/module/mock/index.js.map +1 -1
  63. package/lib/module/skia/types/GPUTexture.d.ts +11 -0
  64. package/lib/module/skia/types/GPUTexture.js +2 -0
  65. package/lib/module/skia/types/GPUTexture.js.map +1 -0
  66. package/lib/module/skia/types/Image/Image.d.ts +0 -10
  67. package/lib/module/skia/types/Image/Image.js.map +1 -1
  68. package/lib/module/skia/types/Image/ImageFactory.d.ts +25 -48
  69. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  70. package/lib/module/skia/types/Skia.d.ts +0 -4
  71. package/lib/module/skia/types/Skia.js.map +1 -1
  72. package/lib/module/skia/types/Surface/Surface.d.ts +3 -14
  73. package/lib/module/skia/types/Surface/Surface.js.map +1 -1
  74. package/lib/module/skia/types/Surface/SurfaceFactory.d.ts +10 -9
  75. package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
  76. package/lib/module/skia/types/index.d.ts +1 -2
  77. package/lib/module/skia/types/index.js +1 -2
  78. package/lib/module/skia/types/index.js.map +1 -1
  79. package/lib/module/skia/web/JsiSkImage.d.ts +0 -1
  80. package/lib/module/skia/web/JsiSkImage.js +0 -4
  81. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  82. package/lib/module/skia/web/JsiSkImageFactory.d.ts +4 -5
  83. package/lib/module/skia/web/JsiSkImageFactory.js +6 -10
  84. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  85. package/lib/module/skia/web/JsiSkSurface.d.ts +0 -1
  86. package/lib/module/skia/web/JsiSkSurface.js +0 -4
  87. package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
  88. package/lib/module/skia/web/JsiSkSurfaceFactory.d.ts +2 -2
  89. package/lib/module/skia/web/JsiSkSurfaceFactory.js +1 -1
  90. package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
  91. package/lib/module/skia/web/JsiSkia.js +0 -4
  92. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  93. package/lib/typescript/src/external/reanimated/index.d.ts +0 -1
  94. package/lib/typescript/src/skia/types/GPUTexture.d.ts +11 -0
  95. package/lib/typescript/src/skia/types/Image/Image.d.ts +0 -10
  96. package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +25 -48
  97. package/lib/typescript/src/skia/types/Skia.d.ts +0 -4
  98. package/lib/typescript/src/skia/types/Surface/Surface.d.ts +3 -14
  99. package/lib/typescript/src/skia/types/Surface/SurfaceFactory.d.ts +10 -9
  100. package/lib/typescript/src/skia/types/index.d.ts +1 -2
  101. package/lib/typescript/src/skia/web/JsiSkImage.d.ts +0 -1
  102. package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +4 -5
  103. package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +0 -1
  104. package/lib/typescript/src/skia/web/JsiSkSurfaceFactory.d.ts +2 -2
  105. package/package.json +1 -1
  106. package/src/external/reanimated/index.ts +0 -1
  107. package/src/mock/index.ts +0 -1
  108. package/src/skia/types/GPUTexture.ts +9 -0
  109. package/src/skia/types/Image/Image.ts +0 -11
  110. package/src/skia/types/Image/ImageFactory.ts +25 -55
  111. package/src/skia/types/Skia.ts +0 -4
  112. package/src/skia/types/Surface/Surface.ts +3 -15
  113. package/src/skia/types/Surface/SurfaceFactory.ts +11 -9
  114. package/src/skia/types/index.ts +1 -2
  115. package/src/skia/web/JsiSkImage.ts +0 -5
  116. package/src/skia/web/JsiSkImageFactory.ts +16 -16
  117. package/src/skia/web/JsiSkSurface.ts +0 -5
  118. package/src/skia/web/JsiSkSurfaceFactory.ts +2 -2
  119. package/src/skia/web/JsiSkia.ts +0 -4
  120. package/android/cpp/rnskia-android/AHardwareBufferUtils.cpp +0 -31
  121. package/android/cpp/rnskia-android/AHardwareBufferUtils.h +0 -13
  122. package/android/cpp/rnskia-android/RNSkAndroidVideo.cpp +0 -200
  123. package/android/cpp/rnskia-android/RNSkAndroidVideo.h +0 -44
  124. package/android/src/main/java/com/reactnative/skia/RNSkVideo.java +0 -320
  125. package/apple/RNSkAppleVideo.h +0 -78
  126. package/apple/RNSkAppleVideo.mm +0 -292
  127. package/cpp/api/JsiNativeBuffer.h +0 -56
  128. package/cpp/api/JsiTextureInfo.h +0 -53
  129. package/cpp/api/JsiVideo.h +0 -101
  130. package/cpp/rnskia/RNSkVideo.h +0 -31
  131. package/lib/commonjs/external/reanimated/useVideo.d.ts +0 -21
  132. package/lib/commonjs/external/reanimated/useVideo.js +0 -150
  133. package/lib/commonjs/external/reanimated/useVideo.js.map +0 -1
  134. package/lib/commonjs/external/reanimated/useVideoLoading.d.ts +0 -4
  135. package/lib/commonjs/external/reanimated/useVideoLoading.js +0 -40
  136. package/lib/commonjs/external/reanimated/useVideoLoading.js.map +0 -1
  137. package/lib/commonjs/external/reanimated/useVideoLoading.web.d.ts +0 -4
  138. package/lib/commonjs/external/reanimated/useVideoLoading.web.js +0 -20
  139. package/lib/commonjs/external/reanimated/useVideoLoading.web.js.map +0 -1
  140. package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.d.ts +0 -29
  141. package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.js +0 -15
  142. package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.js.map +0 -1
  143. package/lib/commonjs/skia/types/NativeBuffer/index.d.ts +0 -1
  144. package/lib/commonjs/skia/types/NativeBuffer/index.js +0 -17
  145. package/lib/commonjs/skia/types/NativeBuffer/index.js.map +0 -1
  146. package/lib/commonjs/skia/types/Video/Video.d.ts +0 -20
  147. package/lib/commonjs/skia/types/Video/Video.js +0 -6
  148. package/lib/commonjs/skia/types/Video/Video.js.map +0 -1
  149. package/lib/commonjs/skia/types/Video/index.d.ts +0 -1
  150. package/lib/commonjs/skia/types/Video/index.js +0 -17
  151. package/lib/commonjs/skia/types/Video/index.js.map +0 -1
  152. package/lib/commonjs/skia/web/CanvasKitWebGLBufferImpl.d.ts +0 -9
  153. package/lib/commonjs/skia/web/CanvasKitWebGLBufferImpl.js +0 -30
  154. package/lib/commonjs/skia/web/CanvasKitWebGLBufferImpl.js.map +0 -1
  155. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.d.ts +0 -9
  156. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.js +0 -48
  157. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.js.map +0 -1
  158. package/lib/commonjs/skia/web/JsiVideo.d.ts +0 -28
  159. package/lib/commonjs/skia/web/JsiVideo.js +0 -96
  160. package/lib/commonjs/skia/web/JsiVideo.js.map +0 -1
  161. package/lib/module/external/reanimated/useVideo.d.ts +0 -21
  162. package/lib/module/external/reanimated/useVideo.js +0 -142
  163. package/lib/module/external/reanimated/useVideo.js.map +0 -1
  164. package/lib/module/external/reanimated/useVideoLoading.d.ts +0 -4
  165. package/lib/module/external/reanimated/useVideoLoading.js +0 -33
  166. package/lib/module/external/reanimated/useVideoLoading.js.map +0 -1
  167. package/lib/module/external/reanimated/useVideoLoading.web.d.ts +0 -4
  168. package/lib/module/external/reanimated/useVideoLoading.web.js +0 -13
  169. package/lib/module/external/reanimated/useVideoLoading.web.js.map +0 -1
  170. package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.d.ts +0 -29
  171. package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.js +0 -5
  172. package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.js.map +0 -1
  173. package/lib/module/skia/types/NativeBuffer/index.d.ts +0 -1
  174. package/lib/module/skia/types/NativeBuffer/index.js +0 -2
  175. package/lib/module/skia/types/NativeBuffer/index.js.map +0 -1
  176. package/lib/module/skia/types/Video/Video.d.ts +0 -20
  177. package/lib/module/skia/types/Video/Video.js +0 -2
  178. package/lib/module/skia/types/Video/Video.js.map +0 -1
  179. package/lib/module/skia/types/Video/index.d.ts +0 -1
  180. package/lib/module/skia/types/Video/index.js +0 -2
  181. package/lib/module/skia/types/Video/index.js.map +0 -1
  182. package/lib/module/skia/web/CanvasKitWebGLBufferImpl.d.ts +0 -9
  183. package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js +0 -23
  184. package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js.map +0 -1
  185. package/lib/module/skia/web/JsiSkNativeBufferFactory.d.ts +0 -9
  186. package/lib/module/skia/web/JsiSkNativeBufferFactory.js +0 -41
  187. package/lib/module/skia/web/JsiSkNativeBufferFactory.js.map +0 -1
  188. package/lib/module/skia/web/JsiVideo.d.ts +0 -28
  189. package/lib/module/skia/web/JsiVideo.js +0 -88
  190. package/lib/module/skia/web/JsiVideo.js.map +0 -1
  191. package/lib/typescript/src/external/reanimated/useVideo.d.ts +0 -21
  192. package/lib/typescript/src/external/reanimated/useVideoLoading.d.ts +0 -4
  193. package/lib/typescript/src/external/reanimated/useVideoLoading.web.d.ts +0 -4
  194. package/lib/typescript/src/skia/types/NativeBuffer/NativeBufferFactory.d.ts +0 -29
  195. package/lib/typescript/src/skia/types/NativeBuffer/index.d.ts +0 -1
  196. package/lib/typescript/src/skia/types/Video/Video.d.ts +0 -20
  197. package/lib/typescript/src/skia/types/Video/index.d.ts +0 -1
  198. package/lib/typescript/src/skia/web/CanvasKitWebGLBufferImpl.d.ts +0 -9
  199. package/lib/typescript/src/skia/web/JsiSkNativeBufferFactory.d.ts +0 -9
  200. package/lib/typescript/src/skia/web/JsiVideo.d.ts +0 -28
  201. package/src/external/reanimated/useVideo.ts +0 -161
  202. package/src/external/reanimated/useVideoLoading.ts +0 -39
  203. package/src/external/reanimated/useVideoLoading.web.ts +0 -17
  204. package/src/skia/types/NativeBuffer/NativeBufferFactory.ts +0 -52
  205. package/src/skia/types/NativeBuffer/index.ts +0 -1
  206. package/src/skia/types/Video/Video.ts +0 -19
  207. package/src/skia/types/Video/index.ts +0 -1
  208. package/src/skia/web/CanvasKitWebGLBufferImpl.ts +0 -25
  209. package/src/skia/web/JsiSkNativeBufferFactory.ts +0 -51
  210. package/src/skia/web/JsiVideo.ts +0 -113
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=GPUTexture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["GPUTexture.ts"],"sourcesContent":["/**\n * A WebGPU texture, as accepted by `Skia.Image.MakeImageFromGPUTexture` and\n * `Skia.Surface.MakeFromGPUTexture`: a `GPUTexture` created with React Native\n * WebGPU on the shared device, whose `nativePointer` (a non-spec extension)\n * holds the `WGPUTexture` handle. The handle itself, as a `BigInt`, is\n * accepted too for libraries that export textures without React Native\n * WebGPU.\n */\nexport type GPUTextureHandle = { readonly nativePointer: bigint } | bigint;\n"],"mappings":"","ignoreList":[]}
@@ -56,16 +56,6 @@ export interface SkImage extends SkJSIInstance<"Image"> {
56
56
  * Returns the ImageInfo describing the image.
57
57
  */
58
58
  getImageInfo(): ImageInfo;
59
- /**
60
- * Returns the backend texture of the image.
61
- * The returned object can be used to create a Skia Image object.
62
- * The returned object is backend specific and should be used with caution.
63
- * It is the caller's responsibility to ensure that the texture is not used after the image is deleted.
64
- * The returned object may be null if the image does not have a backend texture.
65
- *
66
- * @return backend texture of the image or null
67
- */
68
- getNativeTextureUnstable(): unknown;
69
59
  /**
70
60
  * Returns this image as a shader with the specified tiling. It will use cubic sampling.
71
61
  * @param tx - tile mode in the x direction.
@@ -1 +1 @@
1
- {"version":3,"names":["FilterMode","exports","MipmapMode","ImageFormat","isCubicSampling","sampling","MitchellCubicSampling","B","C","CatmullRomCubicSampling","CubicSampling","MakeCubic"],"sources":["Image.ts"],"sourcesContent":["import type { SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { TileMode } from \"../ImageFilter\";\nimport type { SkShader } from \"../Shader\";\n\nimport type { ImageInfo } from \"./ImageFactory\";\n\nexport interface CubicResampler {\n B: number;\n C: number;\n}\n\nexport interface FilterOptions {\n filter: FilterMode;\n mipmap?: MipmapMode;\n}\n\nexport enum FilterMode {\n Nearest,\n Linear,\n}\n\nexport enum MipmapMode {\n None,\n Nearest,\n Linear,\n}\n\nexport enum ImageFormat {\n JPEG = 3,\n PNG = 4,\n WEBP = 6,\n}\n\nexport type SamplingOptions = CubicResampler | FilterOptions;\n\nexport const isCubicSampling = (\n sampling: SamplingOptions\n): sampling is CubicResampler => {\n \"worklet\";\n return \"B\" in sampling && \"C\" in sampling;\n};\n\nexport const MitchellCubicSampling = { B: 1 / 3.0, C: 1 / 3.0 };\nexport const CatmullRomCubicSampling = { B: 0, C: 1 / 2.0 };\nexport const CubicSampling = { B: 0, C: 0 };\nexport const MakeCubic = (B: number, C: number) => ({ B, C });\n\nexport interface SkImage extends SkJSIInstance<\"Image\"> {\n /**\n * Returns the possibly scaled height of the image.\n */\n height(): number;\n\n /**\n * Returns the possibly scaled width of the image.\n */\n width(): number;\n\n /**\n * Returns the ImageInfo describing the image.\n */\n getImageInfo(): ImageInfo;\n\n /**\n * Returns the backend texture of the image.\n * The returned object can be used to create a Skia Image object.\n * The returned object is backend specific and should be used with caution.\n * It is the caller's responsibility to ensure that the texture is not used after the image is deleted.\n * The returned object may be null if the image does not have a backend texture.\n *\n * @return backend texture of the image or null\n */\n getNativeTextureUnstable(): unknown;\n\n /**\n * Returns this image as a shader with the specified tiling. It will use cubic sampling.\n * @param tx - tile mode in the x direction.\n * @param ty - tile mode in the y direction.\n * @param fm - The filter mode. (default nearest)\n * @param mm - The mipmap mode. Note: for settings other than None, the image must have mipmaps (default none)\n * calculated with makeCopyWithDefaultMipmaps;\n * @param localMatrix\n */\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader;\n\n /**\n * Returns this image as a shader with the specified tiling. It will use cubic sampling.\n * @param tx - tile mode in the x direction.\n * @param ty - tile mode in the y direction.\n * @param B - See CubicResampler in SkSamplingOptions.h for more information\n * @param C - See CubicResampler in SkSamplingOptions.h for more information\n * @param localMatrix\n */\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader;\n\n /** Encodes Image pixels, returning result as UInt8Array. Returns existing\n encoded data if present; otherwise, SkImage is encoded with\n SkEncodedImageFormat::kPNG. Skia must be built with SK_ENCODE_PNG to encode\n SkImage.\n\n Returns nullptr if existing encoded data is missing or invalid, and\n encoding fails.\n\n @param fmt - PNG is the default value.\n @param quality - a value from 0 to 100; 100 is the least lossy. May be ignored.\n\n @return Uint8Array with data\n */\n encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array;\n\n /** Encodes Image pixels, returning result as a base64 encoded string. Returns existing\n encoded data if present; otherwise, SkImage is encoded with\n SkEncodedImageFormat::kPNG. Skia must be built with SK_ENCODE_PNG to encode\n SkImage.\n\n Returns nullptr if existing encoded data is missing or invalid, and\n encoding fails.\n\n @param fmt - PNG is the default value.\n @param quality - a value from 0 to 100; 100 is the least lossy. May be ignored.\n\n @return base64 encoded string of data\n */\n encodeToBase64(fmt?: ImageFormat, quality?: number): string;\n\n /** Read Image pixels\n *\n * @param srcX - optional x-axis upper left corner of the rectangle to read from\n * @param srcY - optional y-axis upper left corner of the rectangle to read from\n * @param imageInfo - optional describes the pixel format and dimensions of the data to read into\n * @return Float32Array or Uint8Array with data or null if the read failed.\n */\n readPixels(\n srcX?: number,\n srcY?: number,\n imageInfo?: ImageInfo\n ): Float32Array | Uint8Array | null;\n\n /**\n * Returns raster image or lazy image. Copies SkImage backed by GPU texture\n * into CPU memory if needed. Returns original SkImage if decoded in raster\n * bitmap, or if encoded in a stream.\n * Returns null if the conversion fails.\n */\n makeNonTextureImage(): SkImage | null;\n}\n"],"mappings":";;;;;;IAiBYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAKVE,UAAU,GAAAD,OAAA,CAAAC,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAMVC,WAAW,GAAAF,OAAA,CAAAE,WAAA,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAQhB,MAAMC,eAAe,GAC1BC,QAAyB,IACM;EAC/B,SAAS;;EACT,OAAO,GAAG,IAAIA,QAAQ,IAAI,GAAG,IAAIA,QAAQ;AAC3C,CAAC;AAACJ,OAAA,CAAAG,eAAA,GAAAA,eAAA;AAEK,MAAME,qBAAqB,GAAAL,OAAA,CAAAK,qBAAA,GAAG;EAAEC,CAAC,EAAE,CAAC,GAAG,GAAG;EAAEC,CAAC,EAAE,CAAC,GAAG;AAAI,CAAC;AACxD,MAAMC,uBAAuB,GAAAR,OAAA,CAAAQ,uBAAA,GAAG;EAAEF,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC,GAAG;AAAI,CAAC;AACpD,MAAME,aAAa,GAAAT,OAAA,CAAAS,aAAA,GAAG;EAAEH,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE;AAAE,CAAC;AACpC,MAAMG,SAAS,GAAGA,CAACJ,CAAS,EAAEC,CAAS,MAAM;EAAED,CAAC;EAAEC;AAAE,CAAC,CAAC;AAACP,OAAA,CAAAU,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["FilterMode","exports","MipmapMode","ImageFormat","isCubicSampling","sampling","MitchellCubicSampling","B","C","CatmullRomCubicSampling","CubicSampling","MakeCubic"],"sources":["Image.ts"],"sourcesContent":["import type { SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { TileMode } from \"../ImageFilter\";\nimport type { SkShader } from \"../Shader\";\n\nimport type { ImageInfo } from \"./ImageFactory\";\n\nexport interface CubicResampler {\n B: number;\n C: number;\n}\n\nexport interface FilterOptions {\n filter: FilterMode;\n mipmap?: MipmapMode;\n}\n\nexport enum FilterMode {\n Nearest,\n Linear,\n}\n\nexport enum MipmapMode {\n None,\n Nearest,\n Linear,\n}\n\nexport enum ImageFormat {\n JPEG = 3,\n PNG = 4,\n WEBP = 6,\n}\n\nexport type SamplingOptions = CubicResampler | FilterOptions;\n\nexport const isCubicSampling = (\n sampling: SamplingOptions\n): sampling is CubicResampler => {\n \"worklet\";\n return \"B\" in sampling && \"C\" in sampling;\n};\n\nexport const MitchellCubicSampling = { B: 1 / 3.0, C: 1 / 3.0 };\nexport const CatmullRomCubicSampling = { B: 0, C: 1 / 2.0 };\nexport const CubicSampling = { B: 0, C: 0 };\nexport const MakeCubic = (B: number, C: number) => ({ B, C });\n\nexport interface SkImage extends SkJSIInstance<\"Image\"> {\n /**\n * Returns the possibly scaled height of the image.\n */\n height(): number;\n\n /**\n * Returns the possibly scaled width of the image.\n */\n width(): number;\n\n /**\n * Returns the ImageInfo describing the image.\n */\n getImageInfo(): ImageInfo;\n\n /**\n * Returns this image as a shader with the specified tiling. It will use cubic sampling.\n * @param tx - tile mode in the x direction.\n * @param ty - tile mode in the y direction.\n * @param fm - The filter mode. (default nearest)\n * @param mm - The mipmap mode. Note: for settings other than None, the image must have mipmaps (default none)\n * calculated with makeCopyWithDefaultMipmaps;\n * @param localMatrix\n */\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader;\n\n /**\n * Returns this image as a shader with the specified tiling. It will use cubic sampling.\n * @param tx - tile mode in the x direction.\n * @param ty - tile mode in the y direction.\n * @param B - See CubicResampler in SkSamplingOptions.h for more information\n * @param C - See CubicResampler in SkSamplingOptions.h for more information\n * @param localMatrix\n */\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader;\n\n /** Encodes Image pixels, returning result as UInt8Array. Returns existing\n encoded data if present; otherwise, SkImage is encoded with\n SkEncodedImageFormat::kPNG. Skia must be built with SK_ENCODE_PNG to encode\n SkImage.\n\n Returns nullptr if existing encoded data is missing or invalid, and\n encoding fails.\n\n @param fmt - PNG is the default value.\n @param quality - a value from 0 to 100; 100 is the least lossy. May be ignored.\n\n @return Uint8Array with data\n */\n encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array;\n\n /** Encodes Image pixels, returning result as a base64 encoded string. Returns existing\n encoded data if present; otherwise, SkImage is encoded with\n SkEncodedImageFormat::kPNG. Skia must be built with SK_ENCODE_PNG to encode\n SkImage.\n\n Returns nullptr if existing encoded data is missing or invalid, and\n encoding fails.\n\n @param fmt - PNG is the default value.\n @param quality - a value from 0 to 100; 100 is the least lossy. May be ignored.\n\n @return base64 encoded string of data\n */\n encodeToBase64(fmt?: ImageFormat, quality?: number): string;\n\n /** Read Image pixels\n *\n * @param srcX - optional x-axis upper left corner of the rectangle to read from\n * @param srcY - optional y-axis upper left corner of the rectangle to read from\n * @param imageInfo - optional describes the pixel format and dimensions of the data to read into\n * @return Float32Array or Uint8Array with data or null if the read failed.\n */\n readPixels(\n srcX?: number,\n srcY?: number,\n imageInfo?: ImageInfo\n ): Float32Array | Uint8Array | null;\n\n /**\n * Returns raster image or lazy image. Copies SkImage backed by GPU texture\n * into CPU memory if needed. Returns original SkImage if decoded in raster\n * bitmap, or if encoded in a stream.\n * Returns null if the conversion fails.\n */\n makeNonTextureImage(): SkImage | null;\n}\n"],"mappings":";;;;;;IAiBYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAKVE,UAAU,GAAAD,OAAA,CAAAC,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAMVC,WAAW,GAAAF,OAAA,CAAAE,WAAA,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAQhB,MAAMC,eAAe,GAC1BC,QAAyB,IACM;EAC/B,SAAS;;EACT,OAAO,GAAG,IAAIA,QAAQ,IAAI,GAAG,IAAIA,QAAQ;AAC3C,CAAC;AAACJ,OAAA,CAAAG,eAAA,GAAAA,eAAA;AAEK,MAAME,qBAAqB,GAAAL,OAAA,CAAAK,qBAAA,GAAG;EAAEC,CAAC,EAAE,CAAC,GAAG,GAAG;EAAEC,CAAC,EAAE,CAAC,GAAG;AAAI,CAAC;AACxD,MAAMC,uBAAuB,GAAAR,OAAA,CAAAQ,uBAAA,GAAG;EAAEF,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC,GAAG;AAAI,CAAC;AACpD,MAAME,aAAa,GAAAT,OAAA,CAAAS,aAAA,GAAG;EAAEH,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE;AAAE,CAAC;AACpC,MAAMG,SAAS,GAAGA,CAACJ,CAAS,EAAEC,CAAS,MAAM;EAAED,CAAC;EAAEC;AAAE,CAAC,CAAC;AAACP,OAAA,CAAAU,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { SkData } from "../Data";
2
- import type { NativeBuffer } from "../NativeBuffer";
2
+ import type { GPUTextureHandle } from "../GPUTexture";
3
3
  import type { ColorType } from "./ColorType";
4
4
  import type { SkImage } from "./Image";
5
5
  export declare enum AlphaType {
@@ -28,38 +28,17 @@ export interface ImageFactory {
28
28
  */
29
29
  MakeImageFromEncoded: (encoded: SkData) => SkImage | null;
30
30
  /**
31
- * Return an Image backed by a given native buffer.
32
- * The native buffer must be a valid owning reference.
31
+ * Web only. Creates an image from a `CanvasImageSource`: an
32
+ * `HTMLVideoElement`, an `ImageBitmap`, a canvas, an `HTMLImageElement`...
33
33
  *
34
- * For instance, this API is used by
35
- * [react-native-vision-camera](https://github.com/mrousavy/react-native-vision-camera)
36
- * to render a Skia Camera preview.
34
+ * On native platforms, camera and video frames are rendered into a texture
35
+ * of the shared device by React Native WebGPU
36
+ * (`queue.copyExternalImageToTexture()`), and the texture is wrapped with
37
+ * {@link MakeImageFromGPUTexture}. Calling this method there throws.
37
38
  *
38
- * - On Android; This is an `AHardwareBuffer*`
39
- * - On iOS, this is a `CVPixelBufferRef`
40
- * @param nativeBuffer A strong `uintptr_t` pointer to the native buffer
41
- * @throws Throws an error if the Image could not be created, for example when the given
42
- * native buffer is invalid.
39
+ * @param source The image source
43
40
  */
44
- MakeImageFromNativeBuffer: (nativeBuffer: NativeBuffer) => SkImage;
45
- /**
46
- *
47
- * Return an Image backed by a given native texture.
48
- *
49
- * The native texture must be a valid owning reference.
50
- *
51
- * This API might be used to integrate with other libraries using gpu textures,
52
- * or to transfer images between different threads.
53
- *
54
- * @param texture A native texture handle
55
- * @param width The width of the texture
56
- * @param height The height of the texture
57
- * @param mipmapped Whether the texture is mipmapped
58
- * @throws Throws an error if the Image could not be created, for example when the given native texture is invalid.
59
- *
60
- * @returns Returns a valid SkImage, if the texture is invalid, an error is thrown.
61
- */
62
- MakeImageFromNativeTextureUnstable: (texture: unknown, width: number, height: number, mipmapped?: boolean, outputImage?: SkImage) => SkImage;
41
+ MakeImageFromNativeBuffer: (source: CanvasImageSource) => SkImage;
63
42
  /**
64
43
  * Returns an image that will be a screenshot of the view represented by
65
44
  * the view tag
@@ -79,32 +58,30 @@ export interface ImageFactory {
79
58
  */
80
59
  MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): SkImage | null;
81
60
  /**
82
- * Creates an SkImage from a WebGPU texture.
83
- * This allows using textures rendered by WebGPU in Skia drawings. The
84
- * texture crosses the package boundary as a raw pointer: pass
85
- * `texture.nativePointer` from a react-native-webgpu GPUTexture created on
86
- * the shared device (importDevice(Skia.getNativeDevice())). The native side
87
- * takes its own reference, so the handle stays valid even if the JS
88
- * GPUTexture is garbage collected — but do not call texture.destroy()
89
- * while the image is in use: destroy() releases the underlying GPU
90
- * resource regardless of reference counts.
61
+ * Creates an SkImage from a WebGPU texture, without copying it.
62
+ * The texture must be created with React Native WebGPU on the shared
63
+ * device (importDevice(Skia.getNativeDevice())) with the TEXTURE_BINDING
64
+ * usage. The image takes its own reference to the texture, so it stays
65
+ * valid even if the JS GPUTexture is garbage collected; do not call
66
+ * texture.destroy() while the image is in use, as destroy() releases the
67
+ * GPU resource regardless of references.
91
68
  *
92
69
  * Native only.
93
70
  *
94
- * @param pointer - The WGPUTexture pointer (texture.nativePointer)
95
- * @returns An SkImage wrapping the texture, or throws if the texture is invalid
71
+ * @param texture - The GPUTexture (see {@link GPUTextureHandle})
72
+ * @returns An SkImage sampling the texture, or throws if the texture is invalid
96
73
  */
97
- MakeImageFromNativeTexture(pointer: bigint): SkImage;
74
+ MakeImageFromGPUTexture(texture: GPUTextureHandle): SkImage;
98
75
  /**
99
- * Creates a WebGPU texture from an SkImage.
100
- * This allows using Skia images in WebGPU rendering pipelines. The
101
- * returned pointer carries one reference and must be adopted exactly once
102
- * with react-native-webgpu's adoptTexture(), which owns it from then on.
76
+ * Draws an SkImage into a new WebGPU texture on the shared device.
77
+ * The returned pointer carries one reference and must be adopted exactly
78
+ * once with React Native WebGPU's adoptTexture(), which builds the
79
+ * GPUTexture and owns the reference from then on.
103
80
  *
104
81
  * Native only.
105
82
  *
106
- * @param image - An SkImage to convert to a texture
83
+ * @param image - The SkImage to draw into the texture
107
84
  * @returns A WGPUTexture pointer for adoptTexture(), or throws on failure
108
85
  */
109
- MakeNativeTextureFromImage(image: SkImage): bigint;
86
+ MakeGPUTextureFromImage(image: SkImage): bigint;
110
87
  }
@@ -1 +1 @@
1
- {"version":3,"names":["AlphaType","exports"],"sources":["ImageFactory.ts"],"sourcesContent":["import type { SkData } from \"../Data\";\nimport type { NativeBuffer } from \"../NativeBuffer\";\n\nimport type { ColorType } from \"./ColorType\";\nimport type { SkImage } from \"./Image\";\n\nexport enum AlphaType {\n Unknown,\n Opaque,\n Premul,\n Unpremul,\n}\n\nexport interface ImageInfo {\n alphaType: AlphaType;\n // TODO: add support for color space\n // colorSpace: ColorSpace;\n colorType: ColorType;\n height: number;\n width: number;\n}\n\nexport interface ImageFactory {\n MakeNull: () => SkImage;\n /**\n * Return an Image backed by the encoded data, but attempt to defer decoding until the image\n * is actually used/drawn. This deferral allows the system to cache the result, either on the\n * CPU or on the GPU, depending on where the image is drawn.\n * This decoding uses the codecs that have been compiled into CanvasKit. If the bytes are\n * invalid (or an unrecognized codec), null will be returned. See Image.h for more details.\n * @param data - Data object with bytes of data\n * @returns If the encoded format is not supported, or subset is outside of the bounds of the decoded\n * image, nullptr is returned.\n */\n MakeImageFromEncoded: (encoded: SkData) => SkImage | null;\n\n /**\n * Return an Image backed by a given native buffer.\n * The native buffer must be a valid owning reference.\n *\n * For instance, this API is used by\n * [react-native-vision-camera](https://github.com/mrousavy/react-native-vision-camera)\n * to render a Skia Camera preview.\n *\n * - On Android; This is an `AHardwareBuffer*`\n * - On iOS, this is a `CVPixelBufferRef`\n * @param nativeBuffer A strong `uintptr_t` pointer to the native buffer\n * @throws Throws an error if the Image could not be created, for example when the given\n * native buffer is invalid.\n */\n MakeImageFromNativeBuffer: (nativeBuffer: NativeBuffer) => SkImage;\n\n /**\n *\n * Return an Image backed by a given native texture.\n *\n * The native texture must be a valid owning reference.\n *\n * This API might be used to integrate with other libraries using gpu textures,\n * or to transfer images between different threads.\n *\n * @param texture A native texture handle\n * @param width The width of the texture\n * @param height The height of the texture\n * @param mipmapped Whether the texture is mipmapped\n * @throws Throws an error if the Image could not be created, for example when the given native texture is invalid.\n *\n * @returns Returns a valid SkImage, if the texture is invalid, an error is thrown.\n */\n MakeImageFromNativeTextureUnstable: (\n texture: unknown,\n width: number,\n height: number,\n mipmapped?: boolean,\n outputImage?: SkImage\n ) => SkImage;\n\n /**\n * Returns an image that will be a screenshot of the view represented by\n * the view tag\n * @param viewTag - The tag of the view to make an image from.\n * @returns Returns a valid SkImage, if the view tag is invalid, nullptr is returned.\n */\n MakeImageFromViewTag: (viewTag: number) => Promise<SkImage | null>;\n\n /**\n * Returns an image with the given pixel data and format.\n * Note that we will always make a copy of the pixel data, because of inconsistencies in\n * behavior between GPU and CPU (i.e. the pixel data will be turned into a GPU texture and\n * not modifiable after creation).\n *\n * @param info\n * @param data - bytes representing the pixel data.\n * @param bytesPerRow\n */\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): SkImage | null;\n\n /**\n * Creates an SkImage from a WebGPU texture.\n * This allows using textures rendered by WebGPU in Skia drawings. The\n * texture crosses the package boundary as a raw pointer: pass\n * `texture.nativePointer` from a react-native-webgpu GPUTexture created on\n * the shared device (importDevice(Skia.getNativeDevice())). The native side\n * takes its own reference, so the handle stays valid even if the JS\n * GPUTexture is garbage collected — but do not call texture.destroy()\n * while the image is in use: destroy() releases the underlying GPU\n * resource regardless of reference counts.\n *\n * Native only.\n *\n * @param pointer - The WGPUTexture pointer (texture.nativePointer)\n * @returns An SkImage wrapping the texture, or throws if the texture is invalid\n */\n MakeImageFromNativeTexture(pointer: bigint): SkImage;\n\n /**\n * Creates a WebGPU texture from an SkImage.\n * This allows using Skia images in WebGPU rendering pipelines. The\n * returned pointer carries one reference and must be adopted exactly once\n * with react-native-webgpu's adoptTexture(), which owns it from then on.\n *\n * Native only.\n *\n * @param image - An SkImage to convert to a texture\n * @returns A WGPUTexture pointer for adoptTexture(), or throws on failure\n */\n MakeNativeTextureFromImage(image: SkImage): bigint;\n}\n"],"mappings":";;;;;;IAMYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["AlphaType","exports"],"sources":["ImageFactory.ts"],"sourcesContent":["import type { SkData } from \"../Data\";\nimport type { GPUTextureHandle } from \"../GPUTexture\";\n\nimport type { ColorType } from \"./ColorType\";\nimport type { SkImage } from \"./Image\";\n\nexport enum AlphaType {\n Unknown,\n Opaque,\n Premul,\n Unpremul,\n}\n\nexport interface ImageInfo {\n alphaType: AlphaType;\n // TODO: add support for color space\n // colorSpace: ColorSpace;\n colorType: ColorType;\n height: number;\n width: number;\n}\n\nexport interface ImageFactory {\n MakeNull: () => SkImage;\n /**\n * Return an Image backed by the encoded data, but attempt to defer decoding until the image\n * is actually used/drawn. This deferral allows the system to cache the result, either on the\n * CPU or on the GPU, depending on where the image is drawn.\n * This decoding uses the codecs that have been compiled into CanvasKit. If the bytes are\n * invalid (or an unrecognized codec), null will be returned. See Image.h for more details.\n * @param data - Data object with bytes of data\n * @returns If the encoded format is not supported, or subset is outside of the bounds of the decoded\n * image, nullptr is returned.\n */\n MakeImageFromEncoded: (encoded: SkData) => SkImage | null;\n\n /**\n * Web only. Creates an image from a `CanvasImageSource`: an\n * `HTMLVideoElement`, an `ImageBitmap`, a canvas, an `HTMLImageElement`...\n *\n * On native platforms, camera and video frames are rendered into a texture\n * of the shared device by React Native WebGPU\n * (`queue.copyExternalImageToTexture()`), and the texture is wrapped with\n * {@link MakeImageFromGPUTexture}. Calling this method there throws.\n *\n * @param source The image source\n */\n MakeImageFromNativeBuffer: (source: CanvasImageSource) => SkImage;\n\n /**\n * Returns an image that will be a screenshot of the view represented by\n * the view tag\n * @param viewTag - The tag of the view to make an image from.\n * @returns Returns a valid SkImage, if the view tag is invalid, nullptr is returned.\n */\n MakeImageFromViewTag: (viewTag: number) => Promise<SkImage | null>;\n\n /**\n * Returns an image with the given pixel data and format.\n * Note that we will always make a copy of the pixel data, because of inconsistencies in\n * behavior between GPU and CPU (i.e. the pixel data will be turned into a GPU texture and\n * not modifiable after creation).\n *\n * @param info\n * @param data - bytes representing the pixel data.\n * @param bytesPerRow\n */\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): SkImage | null;\n\n /**\n * Creates an SkImage from a WebGPU texture, without copying it.\n * The texture must be created with React Native WebGPU on the shared\n * device (importDevice(Skia.getNativeDevice())) with the TEXTURE_BINDING\n * usage. The image takes its own reference to the texture, so it stays\n * valid even if the JS GPUTexture is garbage collected; do not call\n * texture.destroy() while the image is in use, as destroy() releases the\n * GPU resource regardless of references.\n *\n * Native only.\n *\n * @param texture - The GPUTexture (see {@link GPUTextureHandle})\n * @returns An SkImage sampling the texture, or throws if the texture is invalid\n */\n MakeImageFromGPUTexture(texture: GPUTextureHandle): SkImage;\n\n /**\n * Draws an SkImage into a new WebGPU texture on the shared device.\n * The returned pointer carries one reference and must be adopted exactly\n * once with React Native WebGPU's adoptTexture(), which builds the\n * GPUTexture and owns the reference from then on.\n *\n * Native only.\n *\n * @param image - The SkImage to draw into the texture\n * @returns A WGPUTexture pointer for adoptTexture(), or throws on failure\n */\n MakeGPUTextureFromImage(image: SkImage): bigint;\n}\n"],"mappings":";;;;;;IAMYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA","ignoreList":[]}
@@ -26,8 +26,6 @@ import type { Color, SkColor } from "./Color";
26
26
  import type { TypefaceFontProviderFactory } from "./Paragraph/TypefaceFontProviderFactory";
27
27
  import type { AnimatedImageFactory } from "./AnimatedImage";
28
28
  import type { ParagraphBuilderFactory } from "./Paragraph/ParagraphBuilder";
29
- import type { Video } from "./Video";
30
- import type { NativeBufferFactory } from "./NativeBuffer";
31
29
  import type { JsiRecorder } from "./Recorder";
32
30
  import type { SkottieFactory } from "./Skottie";
33
31
  /**
@@ -77,8 +75,6 @@ export interface Skia {
77
75
  Surface: SurfaceFactory;
78
76
  ParagraphBuilder: ParagraphBuilderFactory;
79
77
  Skottie: SkottieFactory;
80
- Video: (url: string) => Promise<Video> | Video;
81
- NativeBuffer: NativeBufferFactory;
82
78
  Recorder(): JsiRecorder;
83
79
  /**
84
80
  * Raw WGPUDevice pointer of Skia's Graphite device, as a BigInt. Pass it to
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Skia.ts"],"sourcesContent":["import type { ImageFilterFactory } from \"./ImageFilter\";\nimport type { PathFactory, PathBuilderFactory } from \"./Path\";\nimport type { ColorFilterFactory } from \"./ColorFilter\";\nimport type { SkFont, FontMgrFactory } from \"./Font\";\nimport type { SkTypeface, TypefaceFactory } from \"./Typeface\";\nimport type { ImageFactory } from \"./Image\";\nimport type { MaskFilterFactory } from \"./MaskFilter\";\nimport type { SkPaint } from \"./Paint\";\nimport type { SkHostRect, SkRect } from \"./Rect\";\nimport type { SkRRect } from \"./RRect\";\nimport type {\n RuntimeEffectFactory,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n} from \"./RuntimeEffect\";\nimport type { ShaderFactory } from \"./Shader\";\nimport type { SkMatrix } from \"./Matrix\";\nimport type { PathEffectFactory } from \"./PathEffect\";\nimport type { SkPoint } from \"./Point\";\nimport type { SkVertices, VertexMode } from \"./Vertices/Vertices\";\nimport type { DataFactory } from \"./Data\";\nimport type { SVGFactory } from \"./SVG\";\nimport type { TextBlobFactory } from \"./TextBlob\";\nimport type { SurfaceFactory } from \"./Surface\";\nimport type { SkRSXform } from \"./RSXform\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkContourMeasureIter } from \"./ContourMeasure\";\nimport type { PictureFactory, SkPictureRecorder } from \"./Picture\";\nimport type { Color, SkColor } from \"./Color\";\nimport type { TypefaceFontProviderFactory } from \"./Paragraph/TypefaceFontProviderFactory\";\nimport type { AnimatedImageFactory } from \"./AnimatedImage\";\nimport type { ParagraphBuilderFactory } from \"./Paragraph/ParagraphBuilder\";\nimport type { Video } from \"./Video\";\nimport type { NativeBufferFactory } from \"./NativeBuffer\";\nimport type { JsiRecorder } from \"./Recorder\";\nimport type { SkottieFactory } from \"./Skottie\";\n\n/**\n * Declares the interface for the native Skia API\n */\nexport interface Skia {\n Point: (x: number, y: number) => SkPoint;\n XYWHRect: (x: number, y: number, width: number, height: number) => SkHostRect;\n RuntimeShaderBuilder: (rt: SkRuntimeEffect) => SkRuntimeShaderBuilder;\n RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;\n RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;\n RSXformFromRadians: (\n scale: number,\n radians: number,\n tx: number,\n ty: number,\n px: number,\n py: number\n ) => SkRSXform;\n Color: (color: Color) => SkColor;\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ) => SkContourMeasureIter;\n Paint: () => SkPaint;\n PictureRecorder: () => SkPictureRecorder;\n Picture: PictureFactory;\n Path: PathFactory;\n PathBuilder: PathBuilderFactory;\n Matrix: (matrix?: readonly number[]) => SkMatrix;\n ColorFilter: ColorFilterFactory;\n Font: (typeface?: SkTypeface, size?: number) => SkFont;\n Typeface: TypefaceFactory;\n TypefaceFontProvider: TypefaceFontProviderFactory;\n FontMgr: FontMgrFactory;\n MaskFilter: MaskFilterFactory;\n RuntimeEffect: RuntimeEffectFactory;\n ImageFilter: ImageFilterFactory;\n Shader: ShaderFactory;\n PathEffect: PathEffectFactory;\n /**\n * Returns an Vertices based on the given positions and optional parameters.\n * See SkVertices.h (especially the Builder) for more details.\n * @param mode\n * @param positions\n * @param textureCoordinates\n * @param colors - either a list of int colors or a flattened color array.\n * @param indices\n * @param isVolatile\n */\n MakeVertices(\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n ): SkVertices;\n Data: DataFactory;\n Image: ImageFactory;\n AnimatedImage: AnimatedImageFactory;\n SVG: SVGFactory;\n TextBlob: TextBlobFactory;\n Surface: SurfaceFactory;\n ParagraphBuilder: ParagraphBuilderFactory;\n Skottie: SkottieFactory;\n Video: (url: string) => Promise<Video> | Video;\n NativeBuffer: NativeBufferFactory;\n Recorder(): JsiRecorder;\n /**\n * Raw WGPUDevice pointer of Skia's Graphite device, as a BigInt. Pass it to\n * react-native-webgpu's importDevice() to get a GPUDevice sharing Skia's\n * device (zero-copy interop). Native only.\n */\n getNativeDevice(): bigint;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["Skia.ts"],"sourcesContent":["import type { ImageFilterFactory } from \"./ImageFilter\";\nimport type { PathFactory, PathBuilderFactory } from \"./Path\";\nimport type { ColorFilterFactory } from \"./ColorFilter\";\nimport type { SkFont, FontMgrFactory } from \"./Font\";\nimport type { SkTypeface, TypefaceFactory } from \"./Typeface\";\nimport type { ImageFactory } from \"./Image\";\nimport type { MaskFilterFactory } from \"./MaskFilter\";\nimport type { SkPaint } from \"./Paint\";\nimport type { SkHostRect, SkRect } from \"./Rect\";\nimport type { SkRRect } from \"./RRect\";\nimport type {\n RuntimeEffectFactory,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n} from \"./RuntimeEffect\";\nimport type { ShaderFactory } from \"./Shader\";\nimport type { SkMatrix } from \"./Matrix\";\nimport type { PathEffectFactory } from \"./PathEffect\";\nimport type { SkPoint } from \"./Point\";\nimport type { SkVertices, VertexMode } from \"./Vertices/Vertices\";\nimport type { DataFactory } from \"./Data\";\nimport type { SVGFactory } from \"./SVG\";\nimport type { TextBlobFactory } from \"./TextBlob\";\nimport type { SurfaceFactory } from \"./Surface\";\nimport type { SkRSXform } from \"./RSXform\";\nimport type { SkPath } from \"./Path/Path\";\nimport type { SkContourMeasureIter } from \"./ContourMeasure\";\nimport type { PictureFactory, SkPictureRecorder } from \"./Picture\";\nimport type { Color, SkColor } from \"./Color\";\nimport type { TypefaceFontProviderFactory } from \"./Paragraph/TypefaceFontProviderFactory\";\nimport type { AnimatedImageFactory } from \"./AnimatedImage\";\nimport type { ParagraphBuilderFactory } from \"./Paragraph/ParagraphBuilder\";\nimport type { JsiRecorder } from \"./Recorder\";\nimport type { SkottieFactory } from \"./Skottie\";\n\n/**\n * Declares the interface for the native Skia API\n */\nexport interface Skia {\n Point: (x: number, y: number) => SkPoint;\n XYWHRect: (x: number, y: number, width: number, height: number) => SkHostRect;\n RuntimeShaderBuilder: (rt: SkRuntimeEffect) => SkRuntimeShaderBuilder;\n RRectXY: (rect: SkRect, rx: number, ry: number) => SkRRect;\n RSXform: (scos: number, ssin: number, tx: number, ty: number) => SkRSXform;\n RSXformFromRadians: (\n scale: number,\n radians: number,\n tx: number,\n ty: number,\n px: number,\n py: number\n ) => SkRSXform;\n Color: (color: Color) => SkColor;\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ) => SkContourMeasureIter;\n Paint: () => SkPaint;\n PictureRecorder: () => SkPictureRecorder;\n Picture: PictureFactory;\n Path: PathFactory;\n PathBuilder: PathBuilderFactory;\n Matrix: (matrix?: readonly number[]) => SkMatrix;\n ColorFilter: ColorFilterFactory;\n Font: (typeface?: SkTypeface, size?: number) => SkFont;\n Typeface: TypefaceFactory;\n TypefaceFontProvider: TypefaceFontProviderFactory;\n FontMgr: FontMgrFactory;\n MaskFilter: MaskFilterFactory;\n RuntimeEffect: RuntimeEffectFactory;\n ImageFilter: ImageFilterFactory;\n Shader: ShaderFactory;\n PathEffect: PathEffectFactory;\n /**\n * Returns an Vertices based on the given positions and optional parameters.\n * See SkVertices.h (especially the Builder) for more details.\n * @param mode\n * @param positions\n * @param textureCoordinates\n * @param colors - either a list of int colors or a flattened color array.\n * @param indices\n * @param isVolatile\n */\n MakeVertices(\n mode: VertexMode,\n positions: SkPoint[],\n textureCoordinates?: SkPoint[] | null,\n colors?: SkColor[],\n indices?: number[] | null,\n isVolatile?: boolean\n ): SkVertices;\n Data: DataFactory;\n Image: ImageFactory;\n AnimatedImage: AnimatedImageFactory;\n SVG: SVGFactory;\n TextBlob: TextBlobFactory;\n Surface: SurfaceFactory;\n ParagraphBuilder: ParagraphBuilderFactory;\n Skottie: SkottieFactory;\n Recorder(): JsiRecorder;\n /**\n * Raw WGPUDevice pointer of Skia's Graphite device, as a BigInt. Pass it to\n * react-native-webgpu's importDevice() to get a GPUDevice sharing Skia's\n * device (zero-copy interop). Native only.\n */\n getNativeDevice(): bigint;\n}\n"],"mappings":"","ignoreList":[]}
@@ -12,17 +12,6 @@ export interface SkSurface extends SkJSIInstance<"Surface"> {
12
12
  example: https://fiddle.skia.org/c/@Surface_getCanvas
13
13
  */
14
14
  getCanvas(): SkCanvas;
15
- /**
16
- * Returns the backend texture of the surface.
17
- * The returned object can be used to create a Skia Image object.
18
- * The returned object is backend specific and should be used with caution.
19
- * It is the caller's responsibility to ensure that the texture is not used after the surface is deleted
20
- * or draw operations are performed on the surface.
21
- * The returned object may be null if the surface does not have a backend texture.
22
- *
23
- * @return backend texture of the surface or null
24
- */
25
- getNativeTextureUnstable(): unknown;
26
15
  /** Returns Image capturing Surface contents. Subsequent drawing to
27
16
  Surface contents are not captured.
28
17
 
@@ -36,9 +25,9 @@ export interface SkSurface extends SkJSIInstance<"Surface"> {
36
25
  /**
37
26
  * Make sure any queued draws are sent to the screen or the GPU.
38
27
  * @param sync - When true, block until the GPU has finished executing the
39
- * submitted work. Use this before reading the surface's texture from a native
40
- * consumer on a different command queue (see {@link getNativeTextureUnstable}).
41
- * Defaults to false.
28
+ * submitted work. Use this before a consumer on a different command queue
29
+ * reads the texture this surface draws into (see
30
+ * `Skia.Surface.MakeFromGPUTexture`). Defaults to false.
42
31
  */
43
32
  flush(sync?: boolean): void;
44
33
  /**
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Surface.ts"],"sourcesContent":["import type { SkImage } from \"../Image\";\nimport type { SkCanvas } from \"../Canvas\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkRect } from \"../Rect\";\n\nexport interface SkSurface extends SkJSIInstance<\"Surface\"> {\n /** Returns Canvas that draws into the surface. Subsequent calls return the\n same Canvas. Canvas returned is managed and owned by Surface, and is\n deleted when Surface is deleted.\n\n @return drawing Canvas for Surface\n\n example: https://fiddle.skia.org/c/@Surface_getCanvas\n */\n getCanvas(): SkCanvas;\n\n /**\n * Returns the backend texture of the surface.\n * The returned object can be used to create a Skia Image object.\n * The returned object is backend specific and should be used with caution.\n * It is the caller's responsibility to ensure that the texture is not used after the surface is deleted\n * or draw operations are performed on the surface.\n * The returned object may be null if the surface does not have a backend texture.\n *\n * @return backend texture of the surface or null\n */\n getNativeTextureUnstable(): unknown;\n\n /** Returns Image capturing Surface contents. Subsequent drawing to\n Surface contents are not captured.\n\n @param bounds A rectangle specifying the subset of the surface that\n is of interest.\n @return Image initialized with Surface contents\n\n example: https://fiddle.skia.org/c/@Surface_makeImageSnapshot\n */\n makeImageSnapshot(bounds?: SkRect, outputImage?: SkImage): SkImage;\n\n /**\n * Make sure any queued draws are sent to the screen or the GPU.\n * @param sync - When true, block until the GPU has finished executing the\n * submitted work. Use this before reading the surface's texture from a native\n * consumer on a different command queue (see {@link getNativeTextureUnstable}).\n * Defaults to false.\n */\n flush(sync?: boolean): void;\n\n /**\n * Returns the possibly scaled width of the surface.\n */\n width(): number;\n\n /**\n * Returns the possibly scaled height of the surface.\n */\n height(): number;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["Surface.ts"],"sourcesContent":["import type { SkImage } from \"../Image\";\nimport type { SkCanvas } from \"../Canvas\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkRect } from \"../Rect\";\n\nexport interface SkSurface extends SkJSIInstance<\"Surface\"> {\n /** Returns Canvas that draws into the surface. Subsequent calls return the\n same Canvas. Canvas returned is managed and owned by Surface, and is\n deleted when Surface is deleted.\n\n @return drawing Canvas for Surface\n\n example: https://fiddle.skia.org/c/@Surface_getCanvas\n */\n getCanvas(): SkCanvas;\n\n /** Returns Image capturing Surface contents. Subsequent drawing to\n Surface contents are not captured.\n\n @param bounds A rectangle specifying the subset of the surface that\n is of interest.\n @return Image initialized with Surface contents\n\n example: https://fiddle.skia.org/c/@Surface_makeImageSnapshot\n */\n makeImageSnapshot(bounds?: SkRect, outputImage?: SkImage): SkImage;\n\n /**\n * Make sure any queued draws are sent to the screen or the GPU.\n * @param sync - When true, block until the GPU has finished executing the\n * submitted work. Use this before a consumer on a different command queue\n * reads the texture this surface draws into (see\n * `Skia.Surface.MakeFromGPUTexture`). Defaults to false.\n */\n flush(sync?: boolean): void;\n\n /**\n * Returns the possibly scaled width of the surface.\n */\n width(): number;\n\n /**\n * Returns the possibly scaled height of the surface.\n */\n height(): number;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ import type { GPUTextureHandle } from "../GPUTexture";
1
2
  import type { SkSurface } from "./Surface";
2
3
  export declare const ColorSpace: {
3
4
  readonly SRGB: "srgb";
@@ -25,18 +26,18 @@ export interface SurfaceFactory {
25
26
  MakeOffscreen: (width: number, height: number, opts?: SurfaceOptions) => SkSurface | null;
26
27
  /**
27
28
  * Creates a GPU backed surface that draws directly into a WebGPU texture
28
- * (zero-copy). The texture must be created on Skia's device
29
- * (importDevice(Skia.getNativeDevice())) with RENDER_ATTACHMENT usage; add
30
- * TEXTURE_BINDING to sample what Skia drew from WebGPU after each flush().
31
- * The surface holds its own reference to the texture and keeps it alive
32
- * for its lifetime, so the caller may release the GPUTexture once the
33
- * surface exists. Calling destroy() on the GPUTexture still invalidates
34
- * the surface.
29
+ * (zero-copy). The texture must be created with React Native WebGPU on
30
+ * the shared device (importDevice(Skia.getNativeDevice())) with the
31
+ * RENDER_ATTACHMENT usage; add TEXTURE_BINDING to sample what Skia drew
32
+ * from WebGPU after each flush(). The surface holds its own reference to
33
+ * the texture and keeps it alive for its lifetime, so the caller may
34
+ * release the GPUTexture once the surface exists. Calling destroy() on the
35
+ * GPUTexture still invalidates the surface.
35
36
  *
36
37
  * Native only.
37
38
  *
38
- * @param pointer - The WGPUTexture pointer (texture.nativePointer)
39
+ * @param texture - The GPUTexture (see {@link GPUTextureHandle})
39
40
  * @returns An SkSurface rendering into the texture, or throws if the texture is invalid
40
41
  */
41
- MakeFromNativeTexture: (pointer: bigint) => SkSurface;
42
+ MakeFromGPUTexture: (texture: GPUTextureHandle) => SkSurface;
42
43
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ColorSpace","exports","SRGB","DisplayP3"],"sources":["SurfaceFactory.ts"],"sourcesContent":["import type { SkSurface } from \"./Surface\";\n\nexport const ColorSpace = {\n SRGB: \"srgb\",\n DisplayP3: \"display-p3\",\n} as const;\n\nexport type ColorSpaceValue = (typeof ColorSpace)[keyof typeof ColorSpace];\n\nexport interface SurfaceOptions {\n colorSpace: ColorSpaceValue;\n}\n\nexport interface SurfaceFactory {\n /**\n * Returns a CPU backed surface with the given dimensions, an SRGB colorspace, Unpremul\n * alphaType and 8888 color type. The pixels belonging to this surface will be in memory and\n * not visible.\n * @param width - number of pixels of the width of the drawable area.\n * @param height - number of pixels of the height of the drawable area.\n */\n Make: (width: number, height: number) => SkSurface | null;\n\n /**\n * Creates a GPU backed surface.\n * @param width - number of pixels of the width of the drawable area.\n * @param height - number of pixels of the height of the drawable area.\n * @param opts - optional surface options (e.g. colorSpace: \"display-p3\" | \"srgb\").\n */\n MakeOffscreen: (\n width: number,\n height: number,\n opts?: SurfaceOptions\n ) => SkSurface | null;\n\n /**\n * Creates a GPU backed surface that draws directly into a WebGPU texture\n * (zero-copy). The texture must be created on Skia's device\n * (importDevice(Skia.getNativeDevice())) with RENDER_ATTACHMENT usage; add\n * TEXTURE_BINDING to sample what Skia drew from WebGPU after each flush().\n * The surface holds its own reference to the texture and keeps it alive\n * for its lifetime, so the caller may release the GPUTexture once the\n * surface exists. Calling destroy() on the GPUTexture still invalidates\n * the surface.\n *\n * Native only.\n *\n * @param pointer - The WGPUTexture pointer (texture.nativePointer)\n * @returns An SkSurface rendering into the texture, or throws if the texture is invalid\n */\n MakeFromNativeTexture: (pointer: bigint) => SkSurface;\n}\n"],"mappings":";;;;;;AAEO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,IAAI,EAAE,MAAM;EACZC,SAAS,EAAE;AACb,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["ColorSpace","exports","SRGB","DisplayP3"],"sources":["SurfaceFactory.ts"],"sourcesContent":["import type { GPUTextureHandle } from \"../GPUTexture\";\n\nimport type { SkSurface } from \"./Surface\";\n\nexport const ColorSpace = {\n SRGB: \"srgb\",\n DisplayP3: \"display-p3\",\n} as const;\n\nexport type ColorSpaceValue = (typeof ColorSpace)[keyof typeof ColorSpace];\n\nexport interface SurfaceOptions {\n colorSpace: ColorSpaceValue;\n}\n\nexport interface SurfaceFactory {\n /**\n * Returns a CPU backed surface with the given dimensions, an SRGB colorspace, Unpremul\n * alphaType and 8888 color type. The pixels belonging to this surface will be in memory and\n * not visible.\n * @param width - number of pixels of the width of the drawable area.\n * @param height - number of pixels of the height of the drawable area.\n */\n Make: (width: number, height: number) => SkSurface | null;\n\n /**\n * Creates a GPU backed surface.\n * @param width - number of pixels of the width of the drawable area.\n * @param height - number of pixels of the height of the drawable area.\n * @param opts - optional surface options (e.g. colorSpace: \"display-p3\" | \"srgb\").\n */\n MakeOffscreen: (\n width: number,\n height: number,\n opts?: SurfaceOptions\n ) => SkSurface | null;\n\n /**\n * Creates a GPU backed surface that draws directly into a WebGPU texture\n * (zero-copy). The texture must be created with React Native WebGPU on\n * the shared device (importDevice(Skia.getNativeDevice())) with the\n * RENDER_ATTACHMENT usage; add TEXTURE_BINDING to sample what Skia drew\n * from WebGPU after each flush(). The surface holds its own reference to\n * the texture and keeps it alive for its lifetime, so the caller may\n * release the GPUTexture once the surface exists. Calling destroy() on the\n * GPUTexture still invalidates the surface.\n *\n * Native only.\n *\n * @param texture - The GPUTexture (see {@link GPUTextureHandle})\n * @returns An SkSurface rendering into the texture, or throws if the texture is invalid\n */\n MakeFromGPUTexture: (texture: GPUTextureHandle) => SkSurface;\n}\n"],"mappings":";;;;;;AAIO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACxBE,IAAI,EAAE,MAAM;EACZC,SAAS,EAAE;AACb,CAAU","ignoreList":[]}
@@ -29,8 +29,7 @@ export * from "./TextBlob";
29
29
  export * from "./Size";
30
30
  export * from "./Paragraph";
31
31
  export * from "./Matrix4";
32
- export * from "./NativeBuffer";
33
32
  export * from "./Recorder";
34
- export * from "./Video";
35
33
  export * from "./Skottie";
36
34
  export * from "./Graphite";
35
+ export * from "./GPUTexture";
@@ -344,17 +344,6 @@ Object.keys(_Matrix2).forEach(function (key) {
344
344
  }
345
345
  });
346
346
  });
347
- var _NativeBuffer = require("./NativeBuffer");
348
- Object.keys(_NativeBuffer).forEach(function (key) {
349
- if (key === "default" || key === "__esModule") return;
350
- if (key in exports && exports[key] === _NativeBuffer[key]) return;
351
- Object.defineProperty(exports, key, {
352
- enumerable: true,
353
- get: function () {
354
- return _NativeBuffer[key];
355
- }
356
- });
357
- });
358
347
  var _Recorder = require("./Recorder");
359
348
  Object.keys(_Recorder).forEach(function (key) {
360
349
  if (key === "default" || key === "__esModule") return;
@@ -366,17 +355,6 @@ Object.keys(_Recorder).forEach(function (key) {
366
355
  }
367
356
  });
368
357
  });
369
- var _Video = require("./Video");
370
- Object.keys(_Video).forEach(function (key) {
371
- if (key === "default" || key === "__esModule") return;
372
- if (key in exports && exports[key] === _Video[key]) return;
373
- Object.defineProperty(exports, key, {
374
- enumerable: true,
375
- get: function () {
376
- return _Video[key];
377
- }
378
- });
379
- });
380
358
  var _Skottie = require("./Skottie");
381
359
  Object.keys(_Skottie).forEach(function (key) {
382
360
  if (key === "default" || key === "__esModule") return;
@@ -399,4 +377,15 @@ Object.keys(_Graphite).forEach(function (key) {
399
377
  }
400
378
  });
401
379
  });
380
+ var _GPUTexture = require("./GPUTexture");
381
+ Object.keys(_GPUTexture).forEach(function (key) {
382
+ if (key === "default" || key === "__esModule") return;
383
+ if (key in exports && exports[key] === _GPUTexture[key]) return;
384
+ Object.defineProperty(exports, key, {
385
+ enumerable: true,
386
+ get: function () {
387
+ return _GPUTexture[key];
388
+ }
389
+ });
390
+ });
402
391
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_Picture","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Data","_SVG","_Surface","_Vertices","_RuntimeEffect","_Shader","_Image","_AnimatedImage","_ColorFilter","_ImageFilter","_Font","_Typeface","_Paint","_Path","_Color","_Canvas","_ContourMeasure","_MaskFilter","_Matrix","_PathEffect","_Point","_Rect","_RRect","_RSXform","_JsiInstance","_Skia","_TextBlob","_Size","_Paragraph","_Matrix2","_NativeBuffer","_Recorder","_Video","_Skottie","_Graphite"],"sources":["index.ts"],"sourcesContent":["export * from \"./Picture\";\nexport * from \"./Data\";\nexport * from \"./SVG\";\nexport * from \"./Surface\";\nexport * from \"./Vertices\";\nexport * from \"./RuntimeEffect\";\nexport * from \"./Shader\";\nexport * from \"./Image\";\nexport * from \"./AnimatedImage\";\nexport * from \"./ColorFilter\";\nexport * from \"./ImageFilter\";\nexport * from \"./Font\";\nexport * from \"./Typeface\";\nexport * from \"./Paint\";\nexport * from \"./Path\";\nexport * from \"./Color\";\nexport * from \"./Canvas\";\nexport * from \"./ContourMeasure\";\nexport * from \"./MaskFilter\";\nexport * from \"./Matrix\";\nexport * from \"./PathEffect\";\nexport * from \"./Point\";\nexport * from \"./Rect\";\nexport * from \"./RRect\";\nexport * from \"./RSXform\";\nexport * from \"./JsiInstance\";\nexport * from \"./Skia\";\nexport * from \"./TextBlob\";\nexport * from \"./Size\";\nexport * from \"./Paragraph\";\nexport * from \"./Matrix4\";\nexport * from \"./NativeBuffer\";\nexport * from \"./Recorder\";\nexport * from \"./Video\";\nexport * from \"./Skottie\";\nexport * from \"./Graphite\";\n"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,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AAA1C,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAwC,QAAA,EAAAvC,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAsC,QAAA,CAAAtC,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAkC,QAAA,CAAAtC,GAAA;IAAA;EAAA;AAAA;AACA,IAAAuC,SAAA,GAAA3C,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAyC,SAAA,EAAAxC,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAuC,SAAA,CAAAvC,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAmC,SAAA,CAAAvC,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Picture","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Data","_SVG","_Surface","_Vertices","_RuntimeEffect","_Shader","_Image","_AnimatedImage","_ColorFilter","_ImageFilter","_Font","_Typeface","_Paint","_Path","_Color","_Canvas","_ContourMeasure","_MaskFilter","_Matrix","_PathEffect","_Point","_Rect","_RRect","_RSXform","_JsiInstance","_Skia","_TextBlob","_Size","_Paragraph","_Matrix2","_Recorder","_Skottie","_Graphite","_GPUTexture"],"sources":["index.ts"],"sourcesContent":["export * from \"./Picture\";\nexport * from \"./Data\";\nexport * from \"./SVG\";\nexport * from \"./Surface\";\nexport * from \"./Vertices\";\nexport * from \"./RuntimeEffect\";\nexport * from \"./Shader\";\nexport * from \"./Image\";\nexport * from \"./AnimatedImage\";\nexport * from \"./ColorFilter\";\nexport * from \"./ImageFilter\";\nexport * from \"./Font\";\nexport * from \"./Typeface\";\nexport * from \"./Paint\";\nexport * from \"./Path\";\nexport * from \"./Color\";\nexport * from \"./Canvas\";\nexport * from \"./ContourMeasure\";\nexport * from \"./MaskFilter\";\nexport * from \"./Matrix\";\nexport * from \"./PathEffect\";\nexport * from \"./Point\";\nexport * from \"./Rect\";\nexport * from \"./RRect\";\nexport * from \"./RSXform\";\nexport * from \"./JsiInstance\";\nexport * from \"./Skia\";\nexport * from \"./TextBlob\";\nexport * from \"./Size\";\nexport * from \"./Paragraph\";\nexport * from \"./Matrix4\";\nexport * from \"./Recorder\";\nexport * from \"./Skottie\";\nexport * from \"./Graphite\";\nexport * from \"./GPUTexture\";\n"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,KAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,KAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,KAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,KAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,IAAA,GAAAV,OAAA;A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AAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAoC,QAAA,CAAApC,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAgC,QAAA,CAAApC,GAAA;IAAA;EAAA;AAAA;AACA,IAAAqC,SAAA,GAAAzC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAuC,SAAA,EAAAtC,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAqC,SAAA,CAAArC,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAiC,SAAA,CAAArC,GAAA;IAAA;EAAA;AAAA;AACA,IAAAsC,WAAA,GAAA1C,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAwC,WAAA,EAAAvC,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAsC,WAAA,CAAAtC,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAkC,WAAA,CAAAtC,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -13,5 +13,4 @@ export declare class JsiSkImage extends HostObject<Image, "Image"> implements Sk
13
13
  encodeToBase64(fmt?: ImageFormat, quality?: number): string;
14
14
  readPixels(srcX?: number, srcY?: number, imageInfo?: ImageInfo): Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | null;
15
15
  makeNonTextureImage(): SkImage;
16
- getNativeTextureUnstable(): unknown;
17
16
  }
@@ -113,10 +113,6 @@ class JsiSkImage extends _Host.HostObject {
113
113
  }
114
114
  return new JsiSkImage(this.CanvasKit, img);
115
115
  }
116
- getNativeTextureUnstable() {
117
- console.warn("getBackendTexture is not implemented on Web");
118
- return null;
119
- }
120
116
  }
121
117
  exports.JsiSkImage = JsiSkImage;
122
118
  //# sourceMappingURL=JsiSkImage.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_Host","require","_JsiSkMatrix","_JsiSkShader","toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","exports","JsiSkImage","HostObject","constructor","CanvasKit","ref","height","width","getImageInfo","info","colorType","value","alphaType","makeShaderOptions","tx","ty","fm","mm","localMatrix","JsiSkShader","getEnum","JsiSkMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","max","Error","encodeToBase64","readPixels","srcX","srcY","imageInfo","_imageInfo$width","_imageInfo$height","pxInfo","colorSpace","ColorSpace","SRGB","makeNonTextureImage","partialInfo","getColorSpace","pixels","img","MakeImage","getNativeTextureUnstable","console","warn"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type {\n CanvasKit,\n ImageInfo as CKImageInfo,\n Image,\n} from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n ImageFormat,\n ImageInfo,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\n// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js\nexport const toBase64String = (bytes: Uint8Array) => {\n if (typeof Buffer !== \"undefined\") {\n // Are we on node?\n return Buffer.from(bytes).toString(\"base64\");\n } else {\n // From https://stackoverflow.com/a/25644409\n // because the naive solution of\n // btoa(String.fromCharCode.apply(null, bytes));\n // would occasionally throw \"Maximum call stack size exceeded\"\n var CHUNK_SIZE = 0x8000; //arbitrary number\n var index = 0;\n var { length } = bytes;\n var result = \"\";\n var slice;\n while (index < length) {\n slice = bytes.slice(index, Math.min(index + CHUNK_SIZE, length));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result += String.fromCharCode.apply(null, slice as any);\n index += CHUNK_SIZE;\n }\n return btoa(result);\n }\n};\n\nexport class JsiSkImage extends HostObject<Image, \"Image\"> implements SkImage {\n constructor(CanvasKit: CanvasKit, ref: Image) {\n super(CanvasKit, ref, \"Image\");\n }\n\n height() {\n return this.ref.height();\n }\n\n width() {\n return this.ref.width();\n }\n\n getImageInfo(): ImageInfo {\n const info = this.ref.getImageInfo();\n return {\n width: info.width,\n height: info.height,\n colorType: info.colorType.value,\n alphaType: info.alphaType.value,\n };\n }\n\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderOptions(\n getEnum(this.CanvasKit, \"TileMode\", tx),\n getEnum(this.CanvasKit, \"TileMode\", ty),\n getEnum(this.CanvasKit, \"FilterMode\", fm),\n getEnum(this.CanvasKit, \"MipmapMode\", mm),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderCubic(\n getEnum(this.CanvasKit, \"TileMode\", tx),\n getEnum(this.CanvasKit, \"TileMode\", ty),\n B,\n C,\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n encodeToBytes(fmt?: ImageFormat, quality?: number) {\n let result: Uint8Array | null;\n if (fmt !== undefined && quality !== undefined) {\n // CanvasKit's encodeToBytes() applies `quality || 100`, which would\n // turn a valid quality of 0 into 100. The encoders clamp any quality\n // below 1 up to 1 anyway, so pass 1 to get the same output as 0.\n result = this.ref.encodeToBytes(\n getEnum(this.CanvasKit, \"ImageFormat\", fmt),\n Math.max(quality, 1)\n );\n } else if (fmt !== undefined) {\n result = this.ref.encodeToBytes(\n getEnum(this.CanvasKit, \"ImageFormat\", fmt)\n );\n } else {\n result = this.ref.encodeToBytes();\n }\n if (!result) {\n throw new Error(\"encodeToBytes failed\");\n }\n return result;\n }\n\n encodeToBase64(fmt?: ImageFormat, quality?: number) {\n const bytes = this.encodeToBytes(fmt, quality);\n return toBase64String(bytes);\n }\n\n // TODO: this is leaking on Web\n // Add signature with allocated buffer\n readPixels(srcX?: number, srcY?: number, imageInfo?: ImageInfo) {\n const info = this.getImageInfo();\n const pxInfo: CKImageInfo = {\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n width: imageInfo?.width ?? info.width,\n height: imageInfo?.height ?? info.height,\n alphaType: getEnum(\n this.CanvasKit,\n \"AlphaType\",\n (imageInfo ?? info).alphaType\n ),\n colorType: getEnum(\n this.CanvasKit,\n \"ColorType\",\n (imageInfo ?? info).colorType\n ),\n };\n return this.ref.readPixels(srcX ?? 0, srcY ?? 0, pxInfo);\n }\n\n makeNonTextureImage(): SkImage {\n // if the image is already a non-texture image, this is a no-op\n const partialInfo = this.ref.getImageInfo();\n const colorSpace = this.ref.getColorSpace();\n const info = {\n ...partialInfo,\n colorSpace,\n };\n const pixels = this.ref.readPixels(0, 0, info) as Uint8Array | null;\n if (!pixels) {\n throw new Error(\"Could not read pixels from image\");\n }\n const img = this.CanvasKit.MakeImage(info, pixels, info.width * 4);\n if (!img) {\n throw new Error(\"Could not create image from bytes\");\n }\n return new JsiSkImage(this.CanvasKit, img);\n }\n\n getNativeTextureUnstable(): unknown {\n console.warn(\"getBackendTexture is not implemented on Web\");\n return null;\n }\n}\n"],"mappings":";;;;;;AAiBA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,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C;IACtD;IACA,OAAO,IAAI9B,UAAU,CAAC,IAAI,CAACG,SAAS,EAAE2C,GAAG,CAAC;EAC5C;EAEAE,wBAAwBA,CAAA,EAAY;IAClCC,OAAO,CAACC,IAAI,CAAC,6CAA6C,CAAC;IAC3D,OAAO,IAAI;EACb;AACF;AAACnD,OAAA,CAAAC,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Host","require","_JsiSkMatrix","_JsiSkShader","toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","exports","JsiSkImage","HostObject","constructor","CanvasKit","ref","height","width","getImageInfo","info","colorType","value","alphaType","makeShaderOptions","tx","ty","fm","mm","localMatrix","JsiSkShader","getEnum","JsiSkMatrix","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","max","Error","encodeToBase64","readPixels","srcX","srcY","imageInfo","_imageInfo$width","_imageInfo$height","pxInfo","colorSpace","ColorSpace","SRGB","makeNonTextureImage","partialInfo","getColorSpace","pixels","img","MakeImage"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type {\n CanvasKit,\n ImageInfo as CKImageInfo,\n Image,\n} from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n ImageFormat,\n ImageInfo,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\n// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js\nexport const toBase64String = (bytes: Uint8Array) => {\n if (typeof Buffer !== \"undefined\") {\n // Are we on node?\n return Buffer.from(bytes).toString(\"base64\");\n } else {\n // From https://stackoverflow.com/a/25644409\n // because the naive solution of\n // btoa(String.fromCharCode.apply(null, bytes));\n // would occasionally throw \"Maximum call stack size exceeded\"\n var CHUNK_SIZE = 0x8000; //arbitrary number\n var index = 0;\n var { length } = bytes;\n var result = \"\";\n var slice;\n while (index < length) {\n slice = bytes.slice(index, Math.min(index + CHUNK_SIZE, length));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result += String.fromCharCode.apply(null, slice as any);\n index += CHUNK_SIZE;\n }\n return btoa(result);\n }\n};\n\nexport class JsiSkImage extends HostObject<Image, \"Image\"> implements SkImage {\n constructor(CanvasKit: CanvasKit, ref: Image) {\n super(CanvasKit, ref, \"Image\");\n }\n\n height() {\n return this.ref.height();\n }\n\n width() {\n return this.ref.width();\n }\n\n getImageInfo(): ImageInfo {\n const info = this.ref.getImageInfo();\n return {\n width: info.width,\n height: info.height,\n colorType: info.colorType.value,\n alphaType: info.alphaType.value,\n };\n }\n\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderOptions(\n getEnum(this.CanvasKit, \"TileMode\", tx),\n getEnum(this.CanvasKit, \"TileMode\", ty),\n getEnum(this.CanvasKit, \"FilterMode\", fm),\n getEnum(this.CanvasKit, \"MipmapMode\", mm),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderCubic(\n getEnum(this.CanvasKit, \"TileMode\", tx),\n getEnum(this.CanvasKit, \"TileMode\", ty),\n B,\n C,\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n encodeToBytes(fmt?: ImageFormat, quality?: number) {\n let result: Uint8Array | null;\n if (fmt !== undefined && quality !== undefined) {\n // CanvasKit's encodeToBytes() applies `quality || 100`, which would\n // turn a valid quality of 0 into 100. The encoders clamp any quality\n // below 1 up to 1 anyway, so pass 1 to get the same output as 0.\n result = this.ref.encodeToBytes(\n getEnum(this.CanvasKit, \"ImageFormat\", fmt),\n Math.max(quality, 1)\n );\n } else if (fmt !== undefined) {\n result = this.ref.encodeToBytes(\n getEnum(this.CanvasKit, \"ImageFormat\", fmt)\n );\n } else {\n result = this.ref.encodeToBytes();\n }\n if (!result) {\n throw new Error(\"encodeToBytes failed\");\n }\n return result;\n }\n\n encodeToBase64(fmt?: ImageFormat, quality?: number) {\n const bytes = this.encodeToBytes(fmt, quality);\n return toBase64String(bytes);\n }\n\n // TODO: this is leaking on Web\n // Add signature with allocated buffer\n readPixels(srcX?: number, srcY?: number, imageInfo?: ImageInfo) {\n const info = this.getImageInfo();\n const pxInfo: CKImageInfo = {\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n width: imageInfo?.width ?? info.width,\n height: imageInfo?.height ?? info.height,\n alphaType: getEnum(\n this.CanvasKit,\n \"AlphaType\",\n (imageInfo ?? info).alphaType\n ),\n colorType: getEnum(\n this.CanvasKit,\n \"ColorType\",\n (imageInfo ?? info).colorType\n ),\n };\n return this.ref.readPixels(srcX ?? 0, srcY ?? 0, pxInfo);\n }\n\n makeNonTextureImage(): SkImage {\n // if the image is already a non-texture image, this is a no-op\n const partialInfo = this.ref.getImageInfo();\n const colorSpace = this.ref.getColorSpace();\n const info = {\n ...partialInfo,\n colorSpace,\n };\n const pixels = this.ref.readPixels(0, 0, info) as Uint8Array | null;\n if (!pixels) {\n throw new Error(\"Could not read pixels from image\");\n }\n const img = this.CanvasKit.MakeImage(info, pixels, info.width * 4);\n if (!img) {\n throw new Error(\"Could not create image from bytes\");\n }\n return new JsiSkImage(this.CanvasKit, img);\n }\n}\n"],"mappings":";;;;;;AAiBA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA;AACO,MAAMG,cAAc,GAAIC,KAAiB,IAAK;EACnD,IAAI,OA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AACF;AAAC/C,OAAA,CAAAC,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { CanvasKit } from "canvaskit-wasm";
2
- import type { SkData, ImageInfo, SkImage, NativeBuffer, ImageFactory } from "../types";
2
+ import type { SkData, ImageInfo, SkImage, ImageFactory, GPUTextureHandle } from "../types";
3
3
  import { Host } from "./Host";
4
4
  import { JsiSkImage } from "./JsiSkImage";
5
5
  import type { JsiSkSurface } from "./JsiSkSurface";
@@ -7,10 +7,9 @@ export declare class JsiSkImageFactory extends Host implements ImageFactory {
7
7
  constructor(CanvasKit: CanvasKit);
8
8
  MakeNull(): JsiSkImage;
9
9
  MakeImageFromViewTag(viewTag: number): Promise<SkImage | null>;
10
- MakeImageFromNativeBuffer(buffer: NativeBuffer, surface?: JsiSkSurface, image?: JsiSkImage): JsiSkImage;
10
+ MakeImageFromNativeBuffer(buffer: CanvasImageSource, surface?: JsiSkSurface, image?: JsiSkImage): JsiSkImage;
11
11
  MakeImageFromEncoded(encoded: SkData): JsiSkImage | null;
12
- MakeImageFromNativeTextureUnstable(): SkImage;
13
12
  MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number): JsiSkImage | null;
14
- MakeImageFromNativeTexture(_pointer: bigint): SkImage;
15
- MakeNativeTextureFromImage(_image: SkImage): bigint;
13
+ MakeImageFromGPUTexture(_texture: GPUTextureHandle): SkImage;
14
+ MakeGPUTextureFromImage(_image: SkImage): bigint;
16
15
  }
@@ -4,10 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.JsiSkImageFactory = void 0;
7
- var _types = require("../types");
8
7
  var _Host = require("./Host");
9
8
  var _JsiSkImage = require("./JsiSkImage");
10
9
  var _JsiSkData = require("./JsiSkData");
10
+ // The video element of a playing video, an ImageBitmap, a canvas...
11
+ const isCanvasImageSource = buffer => buffer instanceof HTMLVideoElement || buffer instanceof HTMLCanvasElement || buffer instanceof ImageBitmap || buffer instanceof OffscreenCanvas || typeof VideoFrame !== "undefined" && buffer instanceof VideoFrame || buffer instanceof HTMLImageElement || buffer instanceof SVGImageElement;
11
12
  class JsiSkImageFactory extends _Host.Host {
12
13
  constructor(CanvasKit) {
13
14
  super(CanvasKit);
@@ -22,15 +23,13 @@ class JsiSkImageFactory extends _Host.Host {
22
23
  return Promise.resolve(null);
23
24
  }
24
25
  MakeImageFromNativeBuffer(buffer, surface, image) {
25
- if (!(0, _types.isNativeBufferWeb)(buffer)) {
26
- throw new Error("Invalid NativeBuffer");
26
+ if (!isCanvasImageSource(buffer)) {
27
+ throw new Error("MakeImageFromNativeBuffer expects a CanvasImageSource");
27
28
  }
28
29
  if (!surface) {
29
30
  let img;
30
31
  if (buffer instanceof HTMLImageElement || buffer instanceof HTMLVideoElement || buffer instanceof ImageBitmap) {
31
32
  img = this.CanvasKit.MakeLazyImageFromTextureSource(buffer);
32
- } else if (buffer instanceof _types.CanvasKitWebGLBuffer) {
33
- img = buffer.toImage();
34
33
  } else {
35
34
  img = this.CanvasKit.MakeImageFromCanvasImageSource(buffer);
36
35
  }
@@ -52,9 +51,6 @@ class JsiSkImageFactory extends _Host.Host {
52
51
  }
53
52
  return new _JsiSkImage.JsiSkImage(this.CanvasKit, image);
54
53
  }
55
- MakeImageFromNativeTextureUnstable() {
56
- return (0, _Host.throwNotImplementedOnRNWeb)();
57
- }
58
54
  MakeImage(info, data, bytesPerRow) {
59
55
  // see toSkImageInfo() from canvaskit
60
56
  const image = this.CanvasKit.MakeImage({
@@ -69,10 +65,10 @@ class JsiSkImageFactory extends _Host.Host {
69
65
  }
70
66
  return new _JsiSkImage.JsiSkImage(this.CanvasKit, image);
71
67
  }
72
- MakeImageFromNativeTexture(_pointer) {
68
+ MakeImageFromGPUTexture(_texture) {
73
69
  return (0, _Host.throwNotImplementedOnRNWeb)();
74
70
  }
75
- MakeNativeTextureFromImage(_image) {
71
+ MakeGPUTextureFromImage(_image) {
76
72
  return (0, _Host.throwNotImplementedOnRNWeb)();
77
73
  }
78
74
  }