react-native-skia 3.0.4 → 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.
- package/android/CMakeLists.txt +0 -2
- package/android/cpp/jni/JniPlatformContext.cpp +0 -24
- package/android/cpp/jni/include/JniPlatformContext.h +0 -2
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +0 -140
- package/android/src/main/java/com/reactnative/skia/PlatformContext.java +0 -5
- package/apple/RNSkApplePlatformContext.h +0 -10
- package/apple/RNSkApplePlatformContext.mm +0 -182
- package/cpp/api/JsiGPUTexture.h +48 -0
- package/cpp/api/JsiSkApi.h +1 -16
- package/cpp/api/JsiSkImage.h +0 -12
- package/cpp/api/JsiSkImageFactory.h +36 -57
- package/cpp/api/JsiSkSurface.h +3 -10
- package/cpp/api/JsiSkSurfaceFactory.h +13 -18
- package/cpp/rnskia/RNDawnContext.h +5 -113
- package/cpp/rnskia/RNDawnUtils.h +33 -0
- package/cpp/rnskia/RNSkPlatformContext.h +0 -54
- package/lib/commonjs/external/reanimated/index.d.ts +0 -1
- package/lib/commonjs/external/reanimated/index.js +0 -11
- package/lib/commonjs/external/reanimated/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +1 -2
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/skia/types/GPUTexture.d.ts +11 -0
- package/lib/commonjs/skia/types/GPUTexture.js +2 -0
- package/lib/commonjs/skia/types/GPUTexture.js.map +1 -0
- package/lib/commonjs/skia/types/Image/Image.d.ts +0 -10
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +25 -48
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +0 -4
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/Surface.d.ts +3 -14
- package/lib/commonjs/skia/types/Surface/Surface.js.map +1 -1
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.d.ts +10 -9
- package/lib/commonjs/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/types/index.d.ts +1 -2
- package/lib/commonjs/skia/types/index.js +11 -22
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +0 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +0 -4
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.d.ts +4 -5
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +6 -10
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.d.ts +0 -1
- package/lib/commonjs/skia/web/JsiSkSurface.js +0 -4
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +0 -4
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/external/reanimated/index.d.ts +0 -1
- package/lib/module/external/reanimated/index.js +0 -1
- package/lib/module/external/reanimated/index.js.map +1 -1
- package/lib/module/mock/index.js +1 -2
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/skia/types/GPUTexture.d.ts +11 -0
- package/lib/module/skia/types/GPUTexture.js +2 -0
- package/lib/module/skia/types/GPUTexture.js.map +1 -0
- package/lib/module/skia/types/Image/Image.d.ts +0 -10
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/Image/ImageFactory.d.ts +25 -48
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +0 -4
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/types/Surface/Surface.d.ts +3 -14
- package/lib/module/skia/types/Surface/Surface.js.map +1 -1
- package/lib/module/skia/types/Surface/SurfaceFactory.d.ts +10 -9
- package/lib/module/skia/types/Surface/SurfaceFactory.js.map +1 -1
- package/lib/module/skia/types/index.d.ts +1 -2
- package/lib/module/skia/types/index.js +1 -2
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.d.ts +0 -1
- package/lib/module/skia/web/JsiSkImage.js +0 -4
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.d.ts +4 -5
- package/lib/module/skia/web/JsiSkImageFactory.js +6 -10
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.d.ts +0 -1
- package/lib/module/skia/web/JsiSkSurface.js +0 -4
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.d.ts +2 -2
- package/lib/module/skia/web/JsiSkSurfaceFactory.js +1 -1
- package/lib/module/skia/web/JsiSkSurfaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +0 -4
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/typescript/src/external/reanimated/index.d.ts +0 -1
- package/lib/typescript/src/skia/types/GPUTexture.d.ts +11 -0
- package/lib/typescript/src/skia/types/Image/Image.d.ts +0 -10
- package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +25 -48
- package/lib/typescript/src/skia/types/Skia.d.ts +0 -4
- package/lib/typescript/src/skia/types/Surface/Surface.d.ts +3 -14
- package/lib/typescript/src/skia/types/Surface/SurfaceFactory.d.ts +10 -9
- package/lib/typescript/src/skia/types/index.d.ts +1 -2
- package/lib/typescript/src/skia/web/JsiSkImage.d.ts +0 -1
- package/lib/typescript/src/skia/web/JsiSkImageFactory.d.ts +4 -5
- package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +0 -1
- package/lib/typescript/src/skia/web/JsiSkSurfaceFactory.d.ts +2 -2
- package/package.json +1 -1
- package/src/external/reanimated/index.ts +0 -1
- package/src/mock/index.ts +0 -1
- package/src/skia/types/GPUTexture.ts +9 -0
- package/src/skia/types/Image/Image.ts +0 -11
- package/src/skia/types/Image/ImageFactory.ts +25 -55
- package/src/skia/types/Skia.ts +0 -4
- package/src/skia/types/Surface/Surface.ts +3 -15
- package/src/skia/types/Surface/SurfaceFactory.ts +11 -9
- package/src/skia/types/index.ts +1 -2
- package/src/skia/web/JsiSkImage.ts +0 -5
- package/src/skia/web/JsiSkImageFactory.ts +16 -16
- package/src/skia/web/JsiSkSurface.ts +0 -5
- package/src/skia/web/JsiSkSurfaceFactory.ts +2 -2
- package/src/skia/web/JsiSkia.ts +0 -4
- package/android/cpp/rnskia-android/AHardwareBufferUtils.cpp +0 -31
- package/android/cpp/rnskia-android/AHardwareBufferUtils.h +0 -13
- package/android/cpp/rnskia-android/RNSkAndroidVideo.cpp +0 -200
- package/android/cpp/rnskia-android/RNSkAndroidVideo.h +0 -44
- package/android/src/main/java/com/reactnative/skia/RNSkVideo.java +0 -320
- package/apple/RNSkAppleVideo.h +0 -78
- package/apple/RNSkAppleVideo.mm +0 -292
- package/cpp/api/JsiNativeBuffer.h +0 -56
- package/cpp/api/JsiTextureInfo.h +0 -53
- package/cpp/api/JsiVideo.h +0 -101
- package/cpp/rnskia/RNSkVideo.h +0 -31
- package/lib/commonjs/external/reanimated/useVideo.d.ts +0 -21
- package/lib/commonjs/external/reanimated/useVideo.js +0 -150
- package/lib/commonjs/external/reanimated/useVideo.js.map +0 -1
- package/lib/commonjs/external/reanimated/useVideoLoading.d.ts +0 -4
- package/lib/commonjs/external/reanimated/useVideoLoading.js +0 -40
- package/lib/commonjs/external/reanimated/useVideoLoading.js.map +0 -1
- package/lib/commonjs/external/reanimated/useVideoLoading.web.d.ts +0 -4
- package/lib/commonjs/external/reanimated/useVideoLoading.web.js +0 -20
- package/lib/commonjs/external/reanimated/useVideoLoading.web.js.map +0 -1
- package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.d.ts +0 -29
- package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.js +0 -15
- package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.js.map +0 -1
- package/lib/commonjs/skia/types/NativeBuffer/index.d.ts +0 -1
- package/lib/commonjs/skia/types/NativeBuffer/index.js +0 -17
- package/lib/commonjs/skia/types/NativeBuffer/index.js.map +0 -1
- package/lib/commonjs/skia/types/Video/Video.d.ts +0 -20
- package/lib/commonjs/skia/types/Video/Video.js +0 -6
- package/lib/commonjs/skia/types/Video/Video.js.map +0 -1
- package/lib/commonjs/skia/types/Video/index.d.ts +0 -1
- package/lib/commonjs/skia/types/Video/index.js +0 -17
- package/lib/commonjs/skia/types/Video/index.js.map +0 -1
- package/lib/commonjs/skia/web/CanvasKitWebGLBufferImpl.d.ts +0 -9
- package/lib/commonjs/skia/web/CanvasKitWebGLBufferImpl.js +0 -30
- package/lib/commonjs/skia/web/CanvasKitWebGLBufferImpl.js.map +0 -1
- package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.d.ts +0 -9
- package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.js +0 -48
- package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.js.map +0 -1
- package/lib/commonjs/skia/web/JsiVideo.d.ts +0 -28
- package/lib/commonjs/skia/web/JsiVideo.js +0 -96
- package/lib/commonjs/skia/web/JsiVideo.js.map +0 -1
- package/lib/module/external/reanimated/useVideo.d.ts +0 -21
- package/lib/module/external/reanimated/useVideo.js +0 -142
- package/lib/module/external/reanimated/useVideo.js.map +0 -1
- package/lib/module/external/reanimated/useVideoLoading.d.ts +0 -4
- package/lib/module/external/reanimated/useVideoLoading.js +0 -33
- package/lib/module/external/reanimated/useVideoLoading.js.map +0 -1
- package/lib/module/external/reanimated/useVideoLoading.web.d.ts +0 -4
- package/lib/module/external/reanimated/useVideoLoading.web.js +0 -13
- package/lib/module/external/reanimated/useVideoLoading.web.js.map +0 -1
- package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.d.ts +0 -29
- package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.js +0 -5
- package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.js.map +0 -1
- package/lib/module/skia/types/NativeBuffer/index.d.ts +0 -1
- package/lib/module/skia/types/NativeBuffer/index.js +0 -2
- package/lib/module/skia/types/NativeBuffer/index.js.map +0 -1
- package/lib/module/skia/types/Video/Video.d.ts +0 -20
- package/lib/module/skia/types/Video/Video.js +0 -2
- package/lib/module/skia/types/Video/Video.js.map +0 -1
- package/lib/module/skia/types/Video/index.d.ts +0 -1
- package/lib/module/skia/types/Video/index.js +0 -2
- package/lib/module/skia/types/Video/index.js.map +0 -1
- package/lib/module/skia/web/CanvasKitWebGLBufferImpl.d.ts +0 -9
- package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js +0 -23
- package/lib/module/skia/web/CanvasKitWebGLBufferImpl.js.map +0 -1
- package/lib/module/skia/web/JsiSkNativeBufferFactory.d.ts +0 -9
- package/lib/module/skia/web/JsiSkNativeBufferFactory.js +0 -41
- package/lib/module/skia/web/JsiSkNativeBufferFactory.js.map +0 -1
- package/lib/module/skia/web/JsiVideo.d.ts +0 -28
- package/lib/module/skia/web/JsiVideo.js +0 -88
- package/lib/module/skia/web/JsiVideo.js.map +0 -1
- package/lib/typescript/src/external/reanimated/useVideo.d.ts +0 -21
- package/lib/typescript/src/external/reanimated/useVideoLoading.d.ts +0 -4
- package/lib/typescript/src/external/reanimated/useVideoLoading.web.d.ts +0 -4
- package/lib/typescript/src/skia/types/NativeBuffer/NativeBufferFactory.d.ts +0 -29
- package/lib/typescript/src/skia/types/NativeBuffer/index.d.ts +0 -1
- package/lib/typescript/src/skia/types/Video/Video.d.ts +0 -20
- package/lib/typescript/src/skia/types/Video/index.d.ts +0 -1
- package/lib/typescript/src/skia/web/CanvasKitWebGLBufferImpl.d.ts +0 -9
- package/lib/typescript/src/skia/web/JsiSkNativeBufferFactory.d.ts +0 -9
- package/lib/typescript/src/skia/web/JsiVideo.d.ts +0 -28
- package/src/external/reanimated/useVideo.ts +0 -161
- package/src/external/reanimated/useVideoLoading.ts +0 -39
- package/src/external/reanimated/useVideoLoading.web.ts +0 -17
- package/src/skia/types/NativeBuffer/NativeBufferFactory.ts +0 -52
- package/src/skia/types/NativeBuffer/index.ts +0 -1
- package/src/skia/types/Video/Video.ts +0 -19
- package/src/skia/types/Video/index.ts +0 -1
- package/src/skia/web/CanvasKitWebGLBufferImpl.ts +0 -25
- package/src/skia/web/JsiSkNativeBufferFactory.ts +0 -51
- package/src/skia/web/JsiVideo.ts +0 -113
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_Host","require","_JsiSkImage","_JsiSkData","isCanvasImageSource","buffer","HTMLVideoElement","HTMLCanvasElement","ImageBitmap","OffscreenCanvas","VideoFrame","HTMLImageElement","SVGImageElement","JsiSkImageFactory","Host","constructor","CanvasKit","MakeNull","JsiSkImage","MakeImageFromViewTag","viewTag","view","console","log","Promise","resolve","MakeImageFromNativeBuffer","surface","image","Error","img","MakeLazyImageFromTextureSource","MakeImageFromCanvasImageSource","makeImageFromTextureSource","updateTextureFromSource","MakeImageFromEncoded","encoded","JsiSkData","fromValue","MakeImage","info","data","bytesPerRow","alphaType","getEnum","colorSpace","ColorSpace","SRGB","colorType","height","width","MakeImageFromGPUTexture","_texture","throwNotImplementedOnRNWeb","MakeGPUTextureFromImage","_image","exports"],"sources":["JsiSkImageFactory.ts"],"sourcesContent":["import type { CanvasKit, Image } from \"canvaskit-wasm\";\n\nimport type {\n SkData,\n ImageInfo,\n SkImage,\n ImageFactory,\n GPUTextureHandle,\n} from \"../types\";\n\nimport { Host, getEnum, throwNotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkData } from \"./JsiSkData\";\nimport type { JsiSkSurface } from \"./JsiSkSurface\";\n\n// The video element of a playing video, an ImageBitmap, a canvas...\nconst isCanvasImageSource = (buffer: unknown): buffer is CanvasImageSource =>\n buffer instanceof HTMLVideoElement ||\n buffer instanceof HTMLCanvasElement ||\n buffer instanceof ImageBitmap ||\n buffer instanceof OffscreenCanvas ||\n (typeof VideoFrame !== \"undefined\" && buffer instanceof VideoFrame) ||\n buffer instanceof HTMLImageElement ||\n buffer instanceof SVGImageElement;\n\nexport class JsiSkImageFactory extends Host implements ImageFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeNull() {\n return new JsiSkImage(this.CanvasKit, null as unknown as Image);\n }\n\n MakeImageFromViewTag(viewTag: number): Promise<SkImage | null> {\n const view = viewTag as unknown as HTMLElement;\n // TODO: Implement screenshot from view in React JS\n console.log(view);\n return Promise.resolve(null);\n }\n\n MakeImageFromNativeBuffer(\n buffer: CanvasImageSource,\n surface?: JsiSkSurface,\n image?: JsiSkImage\n ) {\n if (!isCanvasImageSource(buffer)) {\n throw new Error(\"MakeImageFromNativeBuffer expects a CanvasImageSource\");\n }\n if (!surface) {\n let img: Image;\n if (\n buffer instanceof HTMLImageElement ||\n buffer instanceof HTMLVideoElement ||\n buffer instanceof ImageBitmap\n ) {\n img = this.CanvasKit.MakeLazyImageFromTextureSource(buffer);\n } else {\n img = this.CanvasKit.MakeImageFromCanvasImageSource(buffer);\n }\n return new JsiSkImage(this.CanvasKit, img);\n } else if (!image) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const img = (surface as any).makeImageFromTextureSource(buffer) as Image;\n return new JsiSkImage(this.CanvasKit, img);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const img = (surface as any).updateTextureFromSource(\n image,\n buffer\n ) as Image;\n return new JsiSkImage(this.CanvasKit, img);\n }\n }\n\n MakeImageFromEncoded(encoded: SkData) {\n const image = this.CanvasKit.MakeImageFromEncoded(\n JsiSkData.fromValue(encoded)\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number) {\n // see toSkImageInfo() from canvaskit\n const image = this.CanvasKit.MakeImage(\n {\n alphaType: getEnum(this.CanvasKit, \"AlphaType\", info.alphaType),\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n colorType: getEnum(this.CanvasKit, \"ColorType\", info.colorType),\n height: info.height,\n width: info.width,\n },\n JsiSkData.fromValue(data),\n bytesPerRow\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n MakeImageFromGPUTexture(_texture: GPUTextureHandle): SkImage {\n return throwNotImplementedOnRNWeb<SkImage>();\n }\n\n MakeGPUTextureFromImage(_image: SkImage): bigint {\n return throwNotImplementedOnRNWeb<bigint>();\n }\n}\n"],"mappings":";;;;;;AAUA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGA;AACA,MAAMG,mBAAmB,GAAIC,MAAe,IAC1CA,MAAM,YAAYC,gBAAgB,IAClCD,MAAM,YAAYE,iBAAiB,IACnCF,MAAM,YAAYG,WAAW,IAC7BH,MAAM,YAAYI,eAAe,IAChC,OAAOC,UAAU,KAAK,WAAW,IAAIL,MAAM,YAAYK,UAAW,IACnEL,MAAM,YAAYM,gBAAgB,IAClCN,MAAM,YAAYO,eAAe;AAE5B,MAAMC,iBAAiB,SAASC,UAAI,CAAyB;EAClEC,WAAWA,CAACC,SAAoB,EAAE;IAChC,KAAK,CAACA,SAAS,CAAC;EAClB;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,IAAIC,sBAAU,CAAC,IAAI,CAACF,SAAS,EAAE,IAAwB,CAAC;EACjE;EAEAG,oBAAoBA,CAACC,OAAe,EAA2B;IAC7D,MAAMC,IAAI,GAAGD,OAAiC;IAC9C;IACAE,OAAO,CAACC,GAAG,CAACF,IAAI,CAAC;IACjB,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AAEY,KAAK,CAAC;EAC9C;EAEAW,SAASA,CAACC,IAAe,EAAEC,IAAY,EAAEC,WAAmB,EAAE;IAC5D;IACA,MAAMd,KAAK,GAAG,IAAI,CAACZ,SAAS,CAACuB,SAAS,CACpC;MACEI,SAAS,EAAE,IAAAC,aAAO,EAAC,IAAI,CAAC5B,SAAS,EAAE,WAAW,EAAEwB,IAAI,CAACG,SAAS,CAAC;MAC/DE,UAAU,EAAE,IAAI,CAAC7B,SAAS,CAAC8B,UAAU,CAACC,IAAI;MAC1CC,SAAS,EAAE,IAAAJ,aAAO,EAAC,IAAI,CAAC5B,SAAS,EAAE,WAAW,EAAEwB,IAAI,CAACQ,SAAS,CAAC;MAC/DC,MAAM,EAAET,IAAI,CAACS,MAAM;MACnBC,KAAK,EAAEV,IAAI,CAACU;IACd,CAAC,EACDb,oBAAS,CAACC,SAAS,CAACG,IAAI,CAAC,EACzBC,WACF,CAAC;IACD,IAAId,KAAK,KAAK,IAAI,EAAE;MAClB,OAAO,IAAI;IACb;IACA,OAAO,IAAIV,sBAAU,CAAC,IAAI,CAACF,SAAS,EAAEY,KAAK,CAAC;EAC9C;EAEAuB,uBAAuBA,CAACC,QAA0B,EAAW;IAC3D,OAAO,IAAAC,gCAA0B,EAAU,CAAC;EAC9C;EAEAC,uBAAuBA,CAACC,MAAe,EAAU;IAC/C,OAAO,IAAAF,gCAA0B,EAAS,CAAC;EAC7C;AACF;AAACG,OAAA,CAAA3C,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -35,10 +35,6 @@ class JsiSkSurface extends _Host.HostObject {
|
|
|
35
35
|
}
|
|
36
36
|
return new _JsiSkImage.JsiSkImage(this.CanvasKit, image);
|
|
37
37
|
}
|
|
38
|
-
getNativeTextureUnstable() {
|
|
39
|
-
console.warn("getBackendTexture is not implemented on Web");
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
38
|
}
|
|
43
39
|
exports.JsiSkSurface = JsiSkSurface;
|
|
44
40
|
//# sourceMappingURL=JsiSkSurface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Host","require","_JsiSkCanvas","_JsiSkImage","_JsiSkRect","JsiSkSurface","HostObject","constructor","CanvasKit","ref","Symbol","dispose","flush","_sync","width","height","getCanvas","JsiSkCanvas","makeImageSnapshot","bounds","outputImage","image","Array","from","JsiSkRect","fromValue","undefined","JsiSkImage","
|
|
1
|
+
{"version":3,"names":["_Host","require","_JsiSkCanvas","_JsiSkImage","_JsiSkRect","JsiSkSurface","HostObject","constructor","CanvasKit","ref","Symbol","dispose","flush","_sync","width","height","getCanvas","JsiSkCanvas","makeImageSnapshot","bounds","outputImage","image","Array","from","JsiSkRect","fromValue","undefined","JsiSkImage","exports"],"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,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}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { CanvasKit } from "canvaskit-wasm";
|
|
2
|
-
import type { SkSurface, SurfaceFactory } from "../types";
|
|
2
|
+
import type { GPUTextureHandle, SkSurface, SurfaceFactory } from "../types";
|
|
3
3
|
import { Host } from "./Host";
|
|
4
4
|
import { JsiSkSurface } from "./JsiSkSurface";
|
|
5
5
|
export declare class JsiSkSurfaceFactory extends Host implements SurfaceFactory {
|
|
6
6
|
constructor(CanvasKit: CanvasKit);
|
|
7
7
|
Make(width: number, height: number): JsiSkSurface;
|
|
8
8
|
MakeOffscreen(width: number, height: number): JsiSkSurface | null;
|
|
9
|
-
|
|
9
|
+
MakeFromGPUTexture(_texture: GPUTextureHandle): SkSurface;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Host","require","_JsiSkSurface","JsiSkSurfaceFactory","Host","constructor","CanvasKit","Make","width","height","JsiSkSurface","MakeSurface","MakeOffscreen","OC","globalThis","OffscreenCanvas","surface","undefined","offscreen","webglContext","GetWebGLContext","grContext","MakeWebGLContext","Error","MakeRenderTarget","
|
|
1
|
+
{"version":3,"names":["_Host","require","_JsiSkSurface","JsiSkSurfaceFactory","Host","constructor","CanvasKit","Make","width","height","JsiSkSurface","MakeSurface","MakeOffscreen","OC","globalThis","OffscreenCanvas","surface","undefined","offscreen","webglContext","GetWebGLContext","grContext","MakeWebGLContext","Error","MakeRenderTarget","MakeFromGPUTexture","_texture","throwNotImplementedOnRNWeb","exports"],"sources":["JsiSkSurfaceFactory.ts"],"sourcesContent":["import type { CanvasKit, Surface } from \"canvaskit-wasm\";\n\nimport type { GPUTextureHandle, SkSurface, SurfaceFactory } from \"../types\";\n\nimport { Host, throwNotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkSurface } from \"./JsiSkSurface\";\n\nexport class JsiSkSurfaceFactory extends Host implements SurfaceFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make(width: number, height: number) {\n return new JsiSkSurface(\n this.CanvasKit,\n this.CanvasKit.MakeSurface(width, height)!\n );\n }\n\n MakeOffscreen(width: number, height: number) {\n // OffscreenCanvas may be unvailable in some environments.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const OC = (globalThis as any).OffscreenCanvas;\n let surface: Surface | null;\n if (OC === undefined) {\n return this.Make(width, height);\n } else {\n const offscreen = new OC(width, height);\n const webglContext = this.CanvasKit.GetWebGLContext(offscreen);\n const grContext = this.CanvasKit.MakeWebGLContext(webglContext);\n if (!grContext) {\n throw new Error(\"Could not make a graphics context\");\n }\n surface = this.CanvasKit.MakeRenderTarget(grContext, width, height);\n }\n if (!surface) {\n return null;\n }\n return new JsiSkSurface(this.CanvasKit, surface);\n }\n\n MakeFromGPUTexture(_texture: GPUTextureHandle): SkSurface {\n return throwNotImplementedOnRNWeb<SkSurface>();\n }\n}\n"],"mappings":";;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,mBAAmB,SAASC,UAAI,CAA2B;EACtEC,WAAWA,CAACC,SAAoB,EAAE;IAChC,KAAK,CAACA,SAAS,CAAC;EAClB;EAEAC,IAAIA,CAACC,KAAa,EAAEC,MAAc,EAAE;IAClC,OAAO,IAAIC,0BAAY,CACrB,IAAI,CAACJ,SAAS,EACd,IAAI,CAACA,SAAS,CAACK,WAAW,CAACH,KAAK,EAAEC,MAAM,CAC1C,CAAC;EACH;EAEAG,aAAaA,CAACJ,KAAa,EAAEC,MAAc,EAAE;IAC3C;IACA;IACA,MAAMI,EAAE,GAAIC,UAAU,CAASC,eAAe;IAC9C,IAAIC,OAAuB;IAC3B,IAAIH,EAAE,KAAKI,SAAS,EAAE;MACpB,OAAO,IAAI,CAACV,IAAI,CAACC,KAAK,EAAEC,MAAM,CAAC;IACjC,CAAC,MAAM;MACL,MAAMS,SAAS,GAAG,IAAIL,EAAE,CAACL,KAAK,EAAEC,MAAM,CAAC;MACvC,MAAMU,YAAY,GAAG,IAAI,CAACb,SAAS,CAACc,eAAe,CAACF,SAAS,CAAC;MAC9D,MAAMG,SAAS,GAAG,IAAI,CAACf,SAAS,CAACgB,gBAAgB,CAACH,YAAY,CAAC;MAC/D,IAAI,CAACE,SAAS,EAAE;QACd,MAAM,IAAIE,KAAK,CAAC,mCAAmC,CAAC;MACtD;MACAP,OAAO,GAAG,IAAI,CAACV,SAAS,CAACkB,gBAAgB,CAACH,SAAS,EAAEb,KAAK,EAAEC,MAAM,CAAC;IACrE;IACA,IAAI,CAACO,OAAO,EAAE;MACZ,OAAO,IAAI;IACb;IACA,OAAO,IAAIN,0BAAY,CAAC,IAAI,CAACJ,SAAS,EAAEU,OAAO,CAAC;EAClD;EAEAS,kBAAkBA,CAACC,QAA0B,EAAa;IACxD,OAAO,IAAAC,gCAA0B,EAAY,CAAC;EAChD;AACF;AAACC,OAAA,CAAAzB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -36,8 +36,6 @@ var _JsiSkTypefaceFontProviderFactory = require("./JsiSkTypefaceFontProviderFact
|
|
|
36
36
|
var _JsiSkFontMgrFactory = require("./JsiSkFontMgrFactory");
|
|
37
37
|
var _JsiSkAnimatedImageFactory = require("./JsiSkAnimatedImageFactory");
|
|
38
38
|
var _JsiSkParagraphBuilderFactory = require("./JsiSkParagraphBuilderFactory");
|
|
39
|
-
var _JsiSkNativeBufferFactory = require("./JsiSkNativeBufferFactory");
|
|
40
|
-
var _JsiVideo = require("./JsiVideo");
|
|
41
39
|
var _Host = require("./Host");
|
|
42
40
|
var _JsiSkottieFactory = require("./JsiSkottieFactory");
|
|
43
41
|
const JsiSkApi = CanvasKit => ({
|
|
@@ -90,9 +88,7 @@ const JsiSkApi = CanvasKit => ({
|
|
|
90
88
|
TypefaceFontProvider: new _JsiSkTypefaceFontProviderFactory.JsiSkTypefaceFontProviderFactory(CanvasKit),
|
|
91
89
|
FontMgr: new _JsiSkFontMgrFactory.JsiSkFontMgrFactory(CanvasKit),
|
|
92
90
|
ParagraphBuilder: new _JsiSkParagraphBuilderFactory.JsiSkParagraphBuilderFactory(CanvasKit),
|
|
93
|
-
NativeBuffer: new _JsiSkNativeBufferFactory.JsiSkNativeBufferFactory(CanvasKit),
|
|
94
91
|
Skottie: new _JsiSkottieFactory.JsiSkottieFactory(CanvasKit),
|
|
95
|
-
Video: _JsiVideo.createVideo.bind(null, CanvasKit),
|
|
96
92
|
Recorder: () => {
|
|
97
93
|
return (0, _Host.throwNotImplementedOnRNWeb)();
|
|
98
94
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_JsiSkPoint","require","_JsiSkPaint","_JsiSkRect","_JsiSkColor","_JsiSkSurfaceFactory","_JsiSkRRect","_JsiSkRSXform","_JsiSkContourMeasureIter","_JsiSkPictureRecorder","_JsiSkPictureFactory","_JsiSkPathFactory","_JsiSkPathBuilderFactory","_JsiSkMatrix","_JsiSkColorFilterFactory","_JsiSkTypefaceFactory","_JsiSkMaskFilterFactory","_JsiSkRuntimeEffectFactory","_JsiSkImageFilterFactory","_JsiSkShaderFactory","_JsiSkPathEffectFactory","_JsiSkDataFactory","_JsiSkImageFactory","_JsiSkSVGFactory","_JsiSkTextBlobFactory","_JsiSkFont","_JsiSkVerticesFactory","_JsiSkPath","_JsiSkTypeface","_JsiSkTypefaceFontProviderFactory","_JsiSkFontMgrFactory","_JsiSkAnimatedImageFactory","_JsiSkParagraphBuilderFactory","_JsiSkNativeBufferFactory","_JsiVideo","_Host","_JsiSkottieFactory","JsiSkApi","CanvasKit","Point","x","y","JsiSkPoint","Float32Array","of","RuntimeShaderBuilder","_","throwNotImplementedOnRNWeb","RRectXY","rect","rx","ry","JsiSkRRect","RSXform","scos","ssin","tx","ty","JsiSkRSXform","RSXformFromRadians","scale","r","px","py","s","Math","sin","c","cos","Color","ContourMeasureIter","path","forceClosed","resScale","p","JsiSkPath","pathFromValue","iter","JsiSkContourMeasureIter","delete","Paint","paint","JsiSkPaint","setAntiAlias","PictureRecorder","JsiSkPictureRecorder","Picture","JsiSkPictureFactory","Path","JsiSkPathFactory","PathBuilder","JsiSkPathBuilderFactory","Matrix","matrix","JsiSkMatrix","identity","ColorFilter","JsiSkColorFilterFactory","Font","typeface","size","JsiSkFont","undefined","JsiSkTypeface","fromValue","Typeface","JsiSkTypefaceFactory","MaskFilter","JsiSkMaskFilterFactory","RuntimeEffect","JsiSkRuntimeEffectFactory","ImageFilter","JsiSkImageFilterFactory","Shader","JsiSkShaderFactory","PathEffect","JsiSkPathEffectFactory","MakeVertices","bind","Data","JsiSkDataFactory","Image","JsiSkImageFactory","AnimatedImage","JsiSkAnimatedImageFactory","SVG","JsiSkSVGFactory","TextBlob","JsiSkTextBlobFactory","XYWHRect","width","height","JsiSkRect","Surface","JsiSkSurfaceFactory","TypefaceFontProvider","JsiSkTypefaceFontProviderFactory","FontMgr","JsiSkFontMgrFactory","ParagraphBuilder","JsiSkParagraphBuilderFactory","NativeBuffer","JsiSkNativeBufferFactory","Skottie","JsiSkottieFactory","Video","createVideo","Recorder","getNativeDevice","exports"],"sources":["JsiSkia.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n JsiRecorder,\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkPathBuilderFactory } from \"./JsiSkPathBuilderFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\nimport { JsiSkTypefaceFontProviderFactory } from \"./JsiSkTypefaceFontProviderFactory\";\nimport { JsiSkFontMgrFactory } from \"./JsiSkFontMgrFactory\";\nimport { JsiSkAnimatedImageFactory } from \"./JsiSkAnimatedImageFactory\";\nimport { JsiSkParagraphBuilderFactory } from \"./JsiSkParagraphBuilderFactory\";\nimport { JsiSkNativeBufferFactory } from \"./JsiSkNativeBufferFactory\";\nimport { createVideo } from \"./JsiVideo\";\nimport { throwNotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkottieFactory } from \"./JsiSkottieFactory\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect) => {\n return throwNotImplementedOnRNWeb<SkRuntimeShaderBuilder>();\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, rect, rx, ry),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n RSXformFromRadians: (\n scale: number,\n r: number,\n tx: number,\n ty: number,\n px: number,\n py: number\n ) => {\n const s = Math.sin(r) * scale;\n const c = Math.cos(r) * scale;\n return new JsiSkRSXform(\n CanvasKit,\n Float32Array.of(c, s, tx - c * px + s * py, ty - s * px - c * py)\n );\n },\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n (() => {\n const p = JsiSkPath.pathFromValue(path);\n const iter = new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(p, forceClosed, resScale)\n );\n p.delete();\n return iter;\n })(),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n PathBuilder: new JsiSkPathBuilderFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n AnimatedImage: new JsiSkAnimatedImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n TypefaceFontProvider: new JsiSkTypefaceFontProviderFactory(CanvasKit),\n FontMgr: new JsiSkFontMgrFactory(CanvasKit),\n ParagraphBuilder: new JsiSkParagraphBuilderFactory(CanvasKit),\n NativeBuffer: new JsiSkNativeBufferFactory(CanvasKit),\n Skottie: new JsiSkottieFactory(CanvasKit),\n Video: createVideo.bind(null, CanvasKit),\n Recorder: () => {\n return throwNotImplementedOnRNWeb<JsiRecorder>();\n },\n getNativeDevice: () => {\n return throwNotImplementedOnRNWeb<bigint>();\n },\n});\n"],"mappings":";;;;;;AAaA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,wBAAA,GAAAX,OAAA;AACA,IAAAY,YAAA,GAAAZ,OAAA;AACA,IAAAa,wBAAA,GAAAb,OAAA;AAC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_JsiSkContourMeasureIter","_JsiSkPictureRecorder","_JsiSkPictureFactory","_JsiSkPathFactory","_JsiSkPathBuilderFactory","_JsiSkMatrix","_JsiSkColorFilterFactory","_JsiSkTypefaceFactory","_JsiSkMaskFilterFactory","_JsiSkRuntimeEffectFactory","_JsiSkImageFilterFactory","_JsiSkShaderFactory","_JsiSkPathEffectFactory","_JsiSkDataFactory","_JsiSkImageFactory","_JsiSkSVGFactory","_JsiSkTextBlobFactory","_JsiSkFont","_JsiSkVerticesFactory","_JsiSkPath","_JsiSkTypeface","_JsiSkTypefaceFontProviderFactory","_JsiSkFontMgrFactory","_JsiSkAnimatedImageFactory","_JsiSkParagraphBuilderFactory","_Host","_JsiSkottieFactory","JsiSkApi","CanvasKit","Point","x","y","JsiSkPoint","Float32Array","of","RuntimeShaderBuilder","_","throwNotImplementedOnRNWeb","RRectXY","rect","rx","ry","JsiSkRRect","RSXform","scos","ssin","tx","ty","JsiSkRSXform","RSXformFromRadians","scale","r","px","py","s","Math","sin","c","cos","Color","ContourMeasureIter","path","forceClosed","resScale","p","JsiSkPath","pathFromValue","iter","JsiSkContourMeasureIter","delete","Paint","paint","JsiSkPaint","setAntiAlias","PictureRecorder","JsiSkPictureRecorder","Picture","JsiSkPictureFactory","Path","JsiSkPathFactory","PathBuilder","JsiSkPathBuilderFactory","Matrix","matrix","JsiSkMatrix","identity","ColorFilter","JsiSkColorFilterFactory","Font","typeface","size","JsiSkFont","undefined","JsiSkTypeface","fromValue","Typeface","JsiSkTypefaceFactory","MaskFilter","JsiSkMaskFilterFactory","RuntimeEffect","JsiSkRuntimeEffectFactory","ImageFilter","JsiSkImageFilterFactory","Shader","JsiSkShaderFactory","PathEffect","JsiSkPathEffectFactory","MakeVertices","bind","Data","JsiSkDataFactory","Image","JsiSkImageFactory","AnimatedImage","JsiSkAnimatedImageFactory","SVG","JsiSkSVGFactory","TextBlob","JsiSkTextBlobFactory","XYWHRect","width","height","JsiSkRect","Surface","JsiSkSurfaceFactory","TypefaceFontProvider","JsiSkTypefaceFontProviderFactory","FontMgr","JsiSkFontMgrFactory","ParagraphBuilder","JsiSkParagraphBuilderFactory","Skottie","JsiSkottieFactory","Recorder","getNativeDevice","exports"],"sources":["JsiSkia.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n JsiRecorder,\n SkContourMeasureIter,\n Skia,\n SkPath,\n SkRect,\n SkRuntimeEffect,\n SkRuntimeShaderBuilder,\n SkTypeface,\n} from \"../types\";\n\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkSurfaceFactory } from \"./JsiSkSurfaceFactory\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkRSXform } from \"./JsiSkRSXform\";\nimport { JsiSkContourMeasureIter } from \"./JsiSkContourMeasureIter\";\nimport { JsiSkPictureRecorder } from \"./JsiSkPictureRecorder\";\nimport { JsiSkPictureFactory } from \"./JsiSkPictureFactory\";\nimport { JsiSkPathFactory } from \"./JsiSkPathFactory\";\nimport { JsiSkPathBuilderFactory } from \"./JsiSkPathBuilderFactory\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkColorFilterFactory } from \"./JsiSkColorFilterFactory\";\nimport { JsiSkTypefaceFactory } from \"./JsiSkTypefaceFactory\";\nimport { JsiSkMaskFilterFactory } from \"./JsiSkMaskFilterFactory\";\nimport { JsiSkRuntimeEffectFactory } from \"./JsiSkRuntimeEffectFactory\";\nimport { JsiSkImageFilterFactory } from \"./JsiSkImageFilterFactory\";\nimport { JsiSkShaderFactory } from \"./JsiSkShaderFactory\";\nimport { JsiSkPathEffectFactory } from \"./JsiSkPathEffectFactory\";\nimport { JsiSkDataFactory } from \"./JsiSkDataFactory\";\nimport { JsiSkImageFactory } from \"./JsiSkImageFactory\";\nimport { JsiSkSVGFactory } from \"./JsiSkSVGFactory\";\nimport { JsiSkTextBlobFactory } from \"./JsiSkTextBlobFactory\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { MakeVertices } from \"./JsiSkVerticesFactory\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\nimport { JsiSkTypefaceFontProviderFactory } from \"./JsiSkTypefaceFontProviderFactory\";\nimport { JsiSkFontMgrFactory } from \"./JsiSkFontMgrFactory\";\nimport { JsiSkAnimatedImageFactory } from \"./JsiSkAnimatedImageFactory\";\nimport { JsiSkParagraphBuilderFactory } from \"./JsiSkParagraphBuilderFactory\";\nimport { throwNotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkottieFactory } from \"./JsiSkottieFactory\";\n\nexport const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({\n Point: (x: number, y: number) =>\n new JsiSkPoint(CanvasKit, Float32Array.of(x, y)),\n RuntimeShaderBuilder: (_: SkRuntimeEffect) => {\n return throwNotImplementedOnRNWeb<SkRuntimeShaderBuilder>();\n },\n RRectXY: (rect: SkRect, rx: number, ry: number) =>\n new JsiSkRRect(CanvasKit, rect, rx, ry),\n RSXform: (scos: number, ssin: number, tx: number, ty: number) =>\n new JsiSkRSXform(CanvasKit, Float32Array.of(scos, ssin, tx, ty)),\n RSXformFromRadians: (\n scale: number,\n r: number,\n tx: number,\n ty: number,\n px: number,\n py: number\n ) => {\n const s = Math.sin(r) * scale;\n const c = Math.cos(r) * scale;\n return new JsiSkRSXform(\n CanvasKit,\n Float32Array.of(c, s, tx - c * px + s * py, ty - s * px - c * py)\n );\n },\n Color,\n ContourMeasureIter: (\n path: SkPath,\n forceClosed: boolean,\n resScale: number\n ): SkContourMeasureIter =>\n (() => {\n const p = JsiSkPath.pathFromValue(path);\n const iter = new JsiSkContourMeasureIter(\n CanvasKit,\n new CanvasKit.ContourMeasureIter(p, forceClosed, resScale)\n );\n p.delete();\n return iter;\n })(),\n Paint: () => {\n const paint = new JsiSkPaint(CanvasKit, new CanvasKit.Paint());\n paint.setAntiAlias(true);\n return paint;\n },\n PictureRecorder: () =>\n new JsiSkPictureRecorder(CanvasKit, new CanvasKit.PictureRecorder()),\n Picture: new JsiSkPictureFactory(CanvasKit),\n Path: new JsiSkPathFactory(CanvasKit),\n PathBuilder: new JsiSkPathBuilderFactory(CanvasKit),\n Matrix: (matrix?: readonly number[]) =>\n new JsiSkMatrix(\n CanvasKit,\n matrix\n ? Float32Array.of(...matrix)\n : Float32Array.of(...CanvasKit.Matrix.identity())\n ),\n ColorFilter: new JsiSkColorFilterFactory(CanvasKit),\n Font: (typeface?: SkTypeface, size?: number) =>\n new JsiSkFont(\n CanvasKit,\n new CanvasKit.Font(\n typeface === undefined ? null : JsiSkTypeface.fromValue(typeface),\n size\n )\n ),\n Typeface: new JsiSkTypefaceFactory(CanvasKit),\n MaskFilter: new JsiSkMaskFilterFactory(CanvasKit),\n RuntimeEffect: new JsiSkRuntimeEffectFactory(CanvasKit),\n ImageFilter: new JsiSkImageFilterFactory(CanvasKit),\n Shader: new JsiSkShaderFactory(CanvasKit),\n PathEffect: new JsiSkPathEffectFactory(CanvasKit),\n MakeVertices: MakeVertices.bind(null, CanvasKit),\n Data: new JsiSkDataFactory(CanvasKit),\n Image: new JsiSkImageFactory(CanvasKit),\n AnimatedImage: new JsiSkAnimatedImageFactory(CanvasKit),\n SVG: new JsiSkSVGFactory(CanvasKit),\n TextBlob: new JsiSkTextBlobFactory(CanvasKit),\n XYWHRect: (x: number, y: number, width: number, height: number) => {\n return new JsiSkRect(CanvasKit, CanvasKit.XYWHRect(x, y, width, height));\n },\n Surface: new JsiSkSurfaceFactory(CanvasKit),\n TypefaceFontProvider: new JsiSkTypefaceFontProviderFactory(CanvasKit),\n FontMgr: new JsiSkFontMgrFactory(CanvasKit),\n ParagraphBuilder: new JsiSkParagraphBuilderFactory(CanvasKit),\n Skottie: new JsiSkottieFactory(CanvasKit),\n Recorder: () => {\n return throwNotImplementedOnRNWeb<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,EAAEA,CAAA,KAAM;IACd,OAAO,IAAAhG,gCAA0B,EAAc,CAAC;EAClD,CAAC;EACDiG,eAAe,EAAEA,CAAA,KAAM;IACrB,OAAO,IAAAjG,gCAA0B,EAAS,CAAC;EAC7C;AACF,CAAC,CAAC;AAACkG,OAAA,CAAA5G,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useAnimatedImageValue\";\nexport * from \"./renderHelpers\";\nexport * from \"./interpolators\";\nexport * from \"./textures\";\nexport * from \"./buffers\";\
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useAnimatedImageValue\";\nexport * from \"./renderHelpers\";\nexport * from \"./interpolators\";\nexport * from \"./textures\";\nexport * from \"./buffers\";\n"],"mappings":"AAAA,cAAc,yBAAyB;AACvC,cAAc,iBAAiB;AAC/B,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,WAAW","ignoreList":[]}
|
package/lib/module/mock/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["JsiSkApi","JsiSkImage","Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","Skia","require","Canvas","View","getPreferredHighBitDepthCanvasFormat","SkiaPictureView","SkiaGraphiteView","drawAsPicture","drawAsImage","drawAsImageFromPicture","useCanvasRef","useCanvasSize","ref","size","width","height","useValue","useComputedValue","useTiming","useLoop","useSpring","useClockValue","useValueEffect","isOnMainThread","useClock","usePathInterpolation","useImageAsTexture","useTextureValue","useTextureValueFromPicture","useRSXformBuffer","usePointBuffer","useColorBuffer","useRectBuffer","useBuffer","useRawData","useData","useFont","Font","useFonts","useTypeface","useImage","useSVG"
|
|
1
|
+
{"version":3,"names":["JsiSkApi","JsiSkImage","Noop","undefined","NoopValue","current","NoopSharedValue","value","Mock","CanvasKit","global","SkiaApi","Skia","require","Canvas","View","getPreferredHighBitDepthCanvasFormat","SkiaPictureView","SkiaGraphiteView","drawAsPicture","drawAsImage","drawAsImageFromPicture","useCanvasRef","useCanvasSize","ref","size","width","height","useValue","useComputedValue","useTiming","useLoop","useSpring","useClockValue","useValueEffect","isOnMainThread","useClock","usePathInterpolation","useImageAsTexture","useTextureValue","useTextureValueFromPicture","useRSXformBuffer","usePointBuffer","useColorBuffer","useRectBuffer","useBuffer","useRawData","useData","useFont","Font","useFonts","useTypeface","useImage","useSVG"],"sources":["index.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport { JsiSkApi } from \"../skia/web\";\nimport { JsiSkImage } from \"../skia/web/JsiSkImage\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Noop: () => any = () => undefined;\nconst NoopValue = () => ({ current: 0 });\nconst NoopSharedValue = () => ({ value: 0 });\n\nexport const Mock = (CanvasKit: CanvasKit) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n global.SkiaApi = JsiSkApi(CanvasKit);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const Skia = global.SkiaApi;\n return {\n Skia,\n ...require(\"../renderer/components\"),\n ...require(\"../skia\"),\n ...require(\"../animation\"),\n ...require(\"../dom/types\"),\n ...require(\"../dom/nodes\"),\n Canvas: require(\"react-native\").View,\n getPreferredHighBitDepthCanvasFormat: () => \"rgba16float\",\n SkiaPictureView: require(\"react-native\").View,\n SkiaGraphiteView: require(\"react-native\").View,\n JsiSkImage: JsiSkImage,\n drawAsPicture: Noop,\n drawAsImage: Noop,\n drawAsImageFromPicture: Noop,\n useCanvasRef: NoopValue,\n useCanvasSize: () => ({\n ref: {\n current: 0,\n },\n size: {\n width: 0,\n height: 0,\n },\n }),\n // Skia Animations\n useValue: NoopValue,\n useComputedValue: NoopValue,\n useTiming: NoopValue,\n useLoop: NoopValue,\n useSpring: NoopValue,\n useClockValue: NoopValue,\n useValueEffect: Noop,\n // Reanimated hooks\n isOnMainThread: () => true,\n useClock: NoopSharedValue,\n usePathInterpolation: NoopSharedValue,\n useImageAsTexture: NoopSharedValue,\n useTextureValue: NoopSharedValue,\n useTextureValueFromPicture: NoopSharedValue,\n useRSXformBuffer: NoopSharedValue,\n usePointBuffer: NoopSharedValue,\n useColorBuffer: NoopSharedValue,\n useRectBuffer: NoopSharedValue,\n useBuffer: NoopSharedValue,\n useRawData: Noop,\n useData: Noop,\n useFont: () => Skia.Font(undefined, 0),\n useFonts: Noop,\n useTypeface: () => null,\n useImage: () => null,\n useSVG: () => null,\n };\n};\n"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,aAAa;AACtC,SAASC,UAAU,QAAQ,wBAAwB;;AAEnD;AACA,MAAMC,IAAe,GAAGA,CAAA,KAAMC,SAAS;AACvC,MAAMC,SAAS,GAAGA,CAAA,MAAO;EAAEC,OAAO,EAAE;AAAE,CAAC,CAAC;AACxC,MAAMC,eAAe,GAAGA,CAAA,MAAO;EAAEC,KAAK,EAAE;AAAE,CAAC,CAAC;AAE5C,OAAO,MAAMC,IAAI,GAAIC,SAAoB,IAAK;EAC5C;EACA;EACAC,MAAM,CAACC,OAAO,GAAGX,QAAQ,CAACS,SAAS,CAAC;EACpC;EACA;EACA,MAAMG,IAAI,GAAGF,MAAM,CAACC,OAAO;EAC3B,OAAO;IACLC,IAAI;IACJ,GAAGC,OAAO,CAAC,wBAAwB,CAAC;IACpC,GAAGA,OAAO,CAAC,SAAS,CAAC;IACrB,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1B,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1B,GAAGA,OAAO,CAAC,cAAc,CAAC;IAC1BC,MAAM,EAAED,OAAO,CAAC,cAAc,CAAC,CAACE,IAAI;IACpCC,oCAAoC,EAAEA,CAAA,KAAM,aAAa;IACzDC,eAAe,EAAEJ,OAAO,CAAC,cAAc,CAAC,CAACE,IAAI;IAC7CG,gBAAgB,EAAEL,OAAO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+1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A WebGPU texture, as accepted by `Skia.Image.MakeImageFromGPUTexture` and
|
|
3
|
+
* `Skia.Surface.MakeFromGPUTexture`: a `GPUTexture` created with React Native
|
|
4
|
+
* WebGPU on the shared device, whose `nativePointer` (a non-spec extension)
|
|
5
|
+
* holds the `WGPUTexture` handle. The handle itself, as a `BigInt`, is
|
|
6
|
+
* accepted too for libraries that export textures without React Native
|
|
7
|
+
* WebGPU.
|
|
8
|
+
*/
|
|
9
|
+
export type GPUTextureHandle = {
|
|
10
|
+
readonly nativePointer: bigint;
|
|
11
|
+
} | bigint;
|
|
@@ -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","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
|
|
1
|
+
{"version":3,"names":["FilterMode","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":"AAiBA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAKtB,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAMtB,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAQvB,OAAO,MAAMC,eAAe,GAC1BC,QAAyB,IACM;EAC/B,SAAS;;EACT,OAAO,GAAG,IAAIA,QAAQ,IAAI,GAAG,IAAIA,QAAQ;AAC3C,CAAC;AAED,OAAO,MAAMC,qBAAqB,GAAG;EAAEC,CAAC,EAAE,CAAC,GAAG,GAAG;EAAEC,CAAC,EAAE,CAAC,GAAG;AAAI,CAAC;AAC/D,OAAO,MAAMC,uBAAuB,GAAG;EAAEF,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE,CAAC,GAAG;AAAI,CAAC;AAC3D,OAAO,MAAME,aAAa,GAAG;EAAEH,CAAC,EAAE,CAAC;EAAEC,CAAC,EAAE;AAAE,CAAC;AAC3C,OAAO,MAAMG,SAAS,GAAGA,CAACJ,CAAS,EAAEC,CAAS,MAAM;EAAED,CAAC;EAAEC;AAAE,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SkData } from "../Data";
|
|
2
|
-
import type {
|
|
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
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* Web only. Creates an image from a `CanvasImageSource`: an
|
|
32
|
+
* `HTMLVideoElement`, an `ImageBitmap`, a canvas, an `HTMLImageElement`...
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
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
|
-
*
|
|
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: (
|
|
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
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* the
|
|
87
|
-
*
|
|
88
|
-
*
|
|
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
|
|
95
|
-
* @returns An SkImage
|
|
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
|
-
|
|
74
|
+
MakeImageFromGPUTexture(texture: GPUTextureHandle): SkImage;
|
|
98
75
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
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 -
|
|
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
|
-
|
|
86
|
+
MakeGPUTextureFromImage(image: SkImage): bigint;
|
|
110
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AlphaType"],"sources":["ImageFactory.ts"],"sourcesContent":["import type { SkData } from \"../Data\";\nimport type {
|
|
1
|
+
{"version":3,"names":["AlphaType"],"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":"AAMA,WAAYA,SAAS,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 {
|
|
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
|
|
40
|
-
*
|
|
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
|
|
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":[]}
|