@shopify/react-native-skia 1.11.5 → 1.11.6
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +0 -1
- package/cpp/api/JsiSkParagraph.h +1 -3
- package/cpp/api/recorder/Convertor.h +19 -17
- package/cpp/api/recorder/Drawings.h +7 -10
- package/cpp/jsi/ViewProperty.h +1 -3
- package/lib/commonjs/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +2 -2
- package/lib/commonjs/dom/types/NodeType.js +8 -0
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/external/reanimated/buffers.d.ts +1 -1
- package/lib/commonjs/renderer/__tests__/setup.d.ts +1 -1
- package/lib/commonjs/skia/types/Image/ColorType.js +20 -2
- package/lib/commonjs/skia/types/Image/ColorType.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ColorType.web.js +18 -2
- package/lib/commonjs/skia/types/Image/ColorType.web.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js +14 -0
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/commonjs/skia/types/MaskFilter.js +5 -2
- package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/BlendMode.js +31 -2
- package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.js +14 -0
- package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.js +4 -0
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -1
- package/lib/commonjs/sksg/Container.d.ts +1 -4
- package/lib/commonjs/sksg/Container.js +8 -9
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Core.js +2 -0
- package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
- package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +6 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js +33 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.js +32 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.js.map +1 -0
- package/lib/commonjs/views/types.d.ts +1 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js +1 -2
- package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.d.ts +2 -2
- package/lib/module/dom/types/NodeType.js +8 -0
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/external/reanimated/buffers.d.ts +1 -1
- package/lib/module/renderer/__tests__/setup.d.ts +1 -1
- package/lib/module/skia/types/Image/ColorType.js +20 -2
- package/lib/module/skia/types/Image/ColorType.js.map +1 -1
- package/lib/module/skia/types/Image/ColorType.web.js +18 -2
- package/lib/module/skia/types/Image/ColorType.web.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilter.js +14 -0
- package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/module/skia/types/MaskFilter.js +5 -2
- package/lib/module/skia/types/MaskFilter.js.map +1 -1
- package/lib/module/skia/types/Paint/BlendMode.js +31 -2
- package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/module/skia/types/Paragraph/ParagraphBuilder.js +14 -0
- package/lib/module/skia/types/Paragraph/ParagraphBuilder.js.map +1 -1
- package/lib/module/skia/types/Path/Path.js +4 -0
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/module/skia/web/JsiSkImage.d.ts +2 -2
- package/lib/module/skia/web/JsiSkPaint.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPicture.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPoint.d.ts +1 -1
- package/lib/module/skia/web/JsiSkRRect.d.ts +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/module/skia/web/JsiSkRect.d.ts +1 -1
- package/lib/module/sksg/Container.d.ts +1 -4
- package/lib/module/sksg/Container.js +8 -9
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/Recorder/Core.js +2 -0
- package/lib/module/sksg/Recorder/Core.js.map +1 -1
- package/lib/module/specs/NativeSkiaModule.web.d.ts +6 -0
- package/lib/module/specs/NativeSkiaModule.web.js +30 -1
- package/lib/module/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.js +26 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.js.map +1 -0
- package/lib/module/views/types.d.ts +1 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/lib/commonjs/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/typescript/lib/commonjs/renderer/components/image/ImageShader.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkColor.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +1 -1
- package/lib/typescript/lib/commonjs/specs/NativeSkiaModule.web.d.ts +1 -0
- package/lib/typescript/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.d.ts +10 -0
- package/lib/typescript/lib/module/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/typescript/lib/module/mock/index.d.ts +2 -2
- package/lib/typescript/lib/module/renderer/components/image/ImageShader.d.ts +1 -1
- package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkColor.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +1 -1
- package/lib/typescript/lib/module/specs/NativeSkiaModule.web.d.ts +1 -0
- package/lib/typescript/lib/module/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
- package/lib/typescript/src/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +2 -2
- package/lib/typescript/src/external/reanimated/buffers.d.ts +1 -1
- package/lib/typescript/src/renderer/__tests__/setup.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkImage.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -1
- package/lib/typescript/src/sksg/Container.d.ts +1 -4
- package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +6 -0
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
- package/lib/typescript/src/views/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/sksg/Container.ts +7 -12
- package/src/specs/NativeSkiaModule.web.ts +38 -0
- package/src/specs/SkiaPictureViewNativeComponent.web.ts +39 -0
- package/src/views/types.ts +1 -0
- package/cpp/jsi/JsiValue.cpp +0 -345
- package/cpp/jsi/JsiValue.h +0 -222
- package/lib/commonjs/renderer/Canvas.web.d.ts +0 -11
- package/lib/commonjs/renderer/Canvas.web.js +0 -112
- package/lib/commonjs/renderer/Canvas.web.js.map +0 -1
- package/lib/module/renderer/Canvas.web.d.ts +0 -11
- package/lib/module/renderer/Canvas.web.js +0 -105
- package/lib/module/renderer/Canvas.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas.web.d.ts +0 -2
- package/lib/typescript/lib/module/renderer/Canvas.web.d.ts +0 -2
- package/lib/typescript/src/renderer/Canvas.web.d.ts +0 -11
- package/src/renderer/Canvas.web.tsx +0 -134
@@ -24,7 +24,7 @@ export declare let fonts: {
|
|
24
24
|
DinMedium: SkFont;
|
25
25
|
};
|
26
26
|
export declare const wait: (ms: number) => Promise<unknown>;
|
27
|
-
export declare const resolveFile: (uri: string) => Buffer
|
27
|
+
export declare const resolveFile: (uri: string) => Buffer<ArrayBufferLike>;
|
28
28
|
export declare const resolveFont: (uri: string) => number[];
|
29
29
|
export declare const testingFonts: {
|
30
30
|
Roboto: number[][];
|
@@ -1,23 +1,41 @@
|
|
1
1
|
export let ColorType = /*#__PURE__*/function (ColorType) {
|
2
2
|
ColorType[ColorType["Unknown"] = 0] = "Unknown";
|
3
|
+
// uninitialized
|
3
4
|
ColorType[ColorType["Alpha_8"] = 1] = "Alpha_8";
|
5
|
+
// pixel with alpha in 8-bit byte
|
4
6
|
ColorType[ColorType["RGB_565"] = 2] = "RGB_565";
|
7
|
+
// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
5
8
|
ColorType[ColorType["ARGB_4444"] = 3] = "ARGB_4444";
|
9
|
+
// pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
6
10
|
ColorType[ColorType["RGBA_8888"] = 4] = "RGBA_8888";
|
11
|
+
// pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
7
12
|
ColorType[ColorType["RGB_888x"] = 5] = "RGB_888x";
|
13
|
+
// pixel with 8 bits each for red, green, blue; in 32-bit word
|
8
14
|
ColorType[ColorType["BGRA_8888"] = 6] = "BGRA_8888";
|
15
|
+
// pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
9
16
|
ColorType[ColorType["RGBA_1010102"] = 7] = "RGBA_1010102";
|
17
|
+
// 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
10
18
|
ColorType[ColorType["BGRA_1010102"] = 8] = "BGRA_1010102";
|
19
|
+
// 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
11
20
|
ColorType[ColorType["RGB_101010x"] = 9] = "RGB_101010x";
|
21
|
+
// pixel with 10 bits each for red, green, blue; in 32-bit word
|
12
22
|
ColorType[ColorType["BGR_101010x"] = 10] = "BGR_101010x";
|
23
|
+
// pixel with 10 bits each for blue, green, red; in 32-bit word
|
13
24
|
ColorType[ColorType["BGR_101010x_XR"] = 11] = "BGR_101010x_XR";
|
25
|
+
// pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
14
26
|
ColorType[ColorType["BGRA_10101010_XR"] = 12] = "BGRA_10101010_XR";
|
27
|
+
// pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range
|
15
28
|
ColorType[ColorType["RGBA_10x6"] = 13] = "RGBA_10x6";
|
29
|
+
// pixel with 10 used bits (most significant) followed by 6 unused
|
16
30
|
ColorType[ColorType["Gray_8"] = 14] = "Gray_8";
|
31
|
+
// pixel with grayscale level in 8-bit byte
|
17
32
|
ColorType[ColorType["RGBA_F16Norm"] = 15] = "RGBA_F16Norm";
|
33
|
+
// pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
18
34
|
ColorType[ColorType["RGBA_F16"] = 16] = "RGBA_F16";
|
35
|
+
// pixel with half floats for red, green, blue, alpha; in 64-bit word
|
19
36
|
ColorType[ColorType["RGB_F16F16F16x"] = 17] = "RGB_F16F16F16x";
|
20
|
-
|
37
|
+
// pixel with half floats for red, green, blue; in 64-bit word
|
38
|
+
ColorType[ColorType["RGBA_F32"] = 18] = "RGBA_F32"; // pixel using C float for red, green, blue, alpha; in 128-bit word
|
21
39
|
return ColorType;
|
22
|
-
}({});
|
40
|
+
}({});
|
23
41
|
//# sourceMappingURL=ColorType.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ColorType"],"sources":["ColorType.ts"],"sourcesContent":["export enum ColorType {\n Unknown, // uninitialized\n Alpha_8, // pixel with alpha in 8-bit byte\n RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word\n ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word\n RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word\n RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word\n BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word\n RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word\n BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word\n RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word\n BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word\n BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range\n BGRA_10101010_XR, // pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range\n RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused\n Gray_8, // pixel with grayscale level in 8-bit byte\n RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word\n RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word\n RGB_F16F16F16x, // pixel with half floats for red, green, blue; in 64-bit word\n RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word\n}\n"],"mappings":"AAAA,WAAYA,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;
|
1
|
+
{"version":3,"names":["ColorType"],"sources":["ColorType.ts"],"sourcesContent":["export enum ColorType {\n Unknown, // uninitialized\n Alpha_8, // pixel with alpha in 8-bit byte\n RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word\n ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word\n RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word\n RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word\n BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word\n RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word\n BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word\n RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word\n BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word\n BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range\n BGRA_10101010_XR, // pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range\n RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused\n Gray_8, // pixel with grayscale level in 8-bit byte\n RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word\n RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word\n RGB_F16F16F16x, // pixel with half floats for red, green, blue; in 64-bit word\n RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word\n}\n"],"mappings":"AAAA,WAAYA,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EACV;EADCA,SAAS,CAATA,SAAS;EAEV;EAFCA,SAAS,CAATA,SAAS;EAGV;EAHCA,SAAS,CAATA,SAAS;EAIR;EAJDA,SAAS,CAATA,SAAS;EAKR;EALDA,SAAS,CAATA,SAAS;EAMT;EANAA,SAAS,CAATA,SAAS;EAOR;EAPDA,SAAS,CAATA,SAAS;EAQL;EARJA,SAAS,CAATA,SAAS;EASL;EATJA,SAAS,CAATA,SAAS;EAUN;EAVHA,SAAS,CAATA,SAAS;EAWN;EAXHA,SAAS,CAATA,SAAS;EAYH;EAZNA,SAAS,CAATA,SAAS;EAaD;EAbRA,SAAS,CAATA,SAAS;EAcR;EAdDA,SAAS,CAATA,SAAS;EAeX;EAfEA,SAAS,CAATA,SAAS;EAgBL;EAhBJA,SAAS,CAATA,SAAS;EAiBT;EAjBAA,SAAS,CAATA,SAAS;EAkBH;EAlBNA,SAAS,CAATA,SAAS,iCAmBT;EAAA,OAnBAA,SAAS;AAAA","ignoreList":[]}
|
@@ -1,21 +1,37 @@
|
|
1
1
|
export let ColorTypeCanvasKit = /*#__PURE__*/function (ColorTypeCanvasKit) {
|
2
2
|
ColorTypeCanvasKit[ColorTypeCanvasKit["Unknown"] = 0] = "Unknown";
|
3
|
+
// uninitialized
|
3
4
|
ColorTypeCanvasKit[ColorTypeCanvasKit["Alpha_8"] = 1] = "Alpha_8";
|
5
|
+
// pixel with alpha in 8-bit byte
|
4
6
|
ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_565"] = 2] = "RGB_565";
|
7
|
+
// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
5
8
|
ColorTypeCanvasKit[ColorTypeCanvasKit["ARGB_4444"] = 3] = "ARGB_4444";
|
9
|
+
// pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
6
10
|
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_8888"] = 4] = "RGBA_8888";
|
11
|
+
// pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
7
12
|
ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_888x"] = 5] = "RGB_888x";
|
13
|
+
// pixel with 8 bits each for red, green, blue; in 32-bit word
|
8
14
|
ColorTypeCanvasKit[ColorTypeCanvasKit["BGRA_8888"] = 6] = "BGRA_8888";
|
15
|
+
// pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
9
16
|
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_1010102"] = 7] = "RGBA_1010102";
|
17
|
+
// 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
10
18
|
ColorTypeCanvasKit[ColorTypeCanvasKit["BGRA_1010102"] = 8] = "BGRA_1010102";
|
19
|
+
// 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
11
20
|
ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_101010x"] = 9] = "RGB_101010x";
|
21
|
+
// pixel with 10 bits each for red, green, blue; in 32-bit word
|
12
22
|
ColorTypeCanvasKit[ColorTypeCanvasKit["BGR_101010x"] = 10] = "BGR_101010x";
|
23
|
+
// pixel with 10 bits each for blue, green, red; in 32-bit word
|
13
24
|
ColorTypeCanvasKit[ColorTypeCanvasKit["BGR_101010x_XR"] = 11] = "BGR_101010x_XR";
|
25
|
+
// pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
14
26
|
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_10x6"] = 12] = "RGBA_10x6";
|
27
|
+
// pixel with 10 used bits (most significant) followed by 6 unused
|
15
28
|
ColorTypeCanvasKit[ColorTypeCanvasKit["Gray_8"] = 13] = "Gray_8";
|
29
|
+
// pixel with grayscale level in 8-bit byte
|
16
30
|
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F16Norm"] = 14] = "RGBA_F16Norm";
|
31
|
+
// pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
17
32
|
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F16"] = 15] = "RGBA_F16";
|
18
|
-
|
33
|
+
// pixel with half floats for red, green, blue, alpha; in 64-bit word
|
34
|
+
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F32"] = 16] = "RGBA_F32"; // pixel using C float for red, green, blue, alpha; in 128-bit word
|
19
35
|
return ColorTypeCanvasKit;
|
20
|
-
}({});
|
36
|
+
}({});
|
21
37
|
//# sourceMappingURL=ColorType.web.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ColorTypeCanvasKit"],"sources":["ColorType.web.ts"],"sourcesContent":["export enum ColorTypeCanvasKit {\n Unknown, // uninitialized\n Alpha_8, // pixel with alpha in 8-bit byte\n RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word\n ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word\n RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word\n RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word\n BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word\n RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word\n BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word\n RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word\n BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word\n BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range\n RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused\n Gray_8, // pixel with grayscale level in 8-bit byte\n RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word\n RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word\n RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word\n}\n"],"mappings":"AAAA,WAAYA,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;
|
1
|
+
{"version":3,"names":["ColorTypeCanvasKit"],"sources":["ColorType.web.ts"],"sourcesContent":["export enum ColorTypeCanvasKit {\n Unknown, // uninitialized\n Alpha_8, // pixel with alpha in 8-bit byte\n RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word\n ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word\n RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word\n RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word\n BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word\n RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word\n BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word\n RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word\n BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word\n BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range\n RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused\n Gray_8, // pixel with grayscale level in 8-bit byte\n RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word\n RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word\n RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word\n}\n"],"mappings":"AAAA,WAAYA,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EACnB;EADCA,kBAAkB,CAAlBA,kBAAkB;EAEnB;EAFCA,kBAAkB,CAAlBA,kBAAkB;EAGnB;EAHCA,kBAAkB,CAAlBA,kBAAkB;EAIjB;EAJDA,kBAAkB,CAAlBA,kBAAkB;EAKjB;EALDA,kBAAkB,CAAlBA,kBAAkB;EAMlB;EANAA,kBAAkB,CAAlBA,kBAAkB;EAOjB;EAPDA,kBAAkB,CAAlBA,kBAAkB;EAQd;EARJA,kBAAkB,CAAlBA,kBAAkB;EASd;EATJA,kBAAkB,CAAlBA,kBAAkB;EAUf;EAVHA,kBAAkB,CAAlBA,kBAAkB;EAWf;EAXHA,kBAAkB,CAAlBA,kBAAkB;EAYZ;EAZNA,kBAAkB,CAAlBA,kBAAkB;EAajB;EAbDA,kBAAkB,CAAlBA,kBAAkB;EAcpB;EAdEA,kBAAkB,CAAlBA,kBAAkB;EAed;EAfJA,kBAAkB,CAAlBA,kBAAkB;EAgBlB;EAhBAA,kBAAkB,CAAlBA,kBAAkB,iCAiBlB;EAAA,OAjBAA,kBAAkB;AAAA","ignoreList":[]}
|
@@ -1,7 +1,21 @@
|
|
1
1
|
export let TileMode = /*#__PURE__*/function (TileMode) {
|
2
|
+
/**
|
3
|
+
* Replicate the edge color if the shader draws outside of its
|
4
|
+
* original bounds.
|
5
|
+
*/
|
2
6
|
TileMode[TileMode["Clamp"] = 0] = "Clamp";
|
7
|
+
/**
|
8
|
+
* Repeat the shader's image horizontally and vertically.
|
9
|
+
*/
|
3
10
|
TileMode[TileMode["Repeat"] = 1] = "Repeat";
|
11
|
+
/**
|
12
|
+
* Repeat the shader's image horizontally and vertically, alternating
|
13
|
+
* mirror images so that adjacent images always seam.
|
14
|
+
*/
|
4
15
|
TileMode[TileMode["Mirror"] = 2] = "Mirror";
|
16
|
+
/**
|
17
|
+
* Only draw within the original domain, return transparent-black everywhere else.
|
18
|
+
*/
|
5
19
|
TileMode[TileMode["Decal"] = 3] = "Decal";
|
6
20
|
return TileMode;
|
7
21
|
}({});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["TileMode","isImageFilter","obj","__typename__"],"sources":["ImageFilter.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport enum TileMode {\n /**\n * Replicate the edge color if the shader draws outside of its\n * original bounds.\n */\n Clamp,\n\n /**\n * Repeat the shader's image horizontally and vertically.\n */\n Repeat,\n\n /**\n * Repeat the shader's image horizontally and vertically, alternating\n * mirror images so that adjacent images always seam.\n */\n Mirror,\n\n /**\n * Only draw within the original domain, return transparent-black everywhere else.\n */\n Decal,\n}\n\nexport const isImageFilter = (\n obj: SkJSIInstance<string> | null\n): obj is SkImageFilter => obj !== null && obj.__typename__ === \"ImageFilter\";\n\nexport type SkImageFilter = SkJSIInstance<\"ImageFilter\">;\n"],"mappings":"AAEA,WAAYA,QAAQ,0BAARA,QAAQ;
|
1
|
+
{"version":3,"names":["TileMode","isImageFilter","obj","__typename__"],"sources":["ImageFilter.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport enum TileMode {\n /**\n * Replicate the edge color if the shader draws outside of its\n * original bounds.\n */\n Clamp,\n\n /**\n * Repeat the shader's image horizontally and vertically.\n */\n Repeat,\n\n /**\n * Repeat the shader's image horizontally and vertically, alternating\n * mirror images so that adjacent images always seam.\n */\n Mirror,\n\n /**\n * Only draw within the original domain, return transparent-black everywhere else.\n */\n Decal,\n}\n\nexport const isImageFilter = (\n obj: SkJSIInstance<string> | null\n): obj is SkImageFilter => obj !== null && obj.__typename__ === \"ImageFilter\";\n\nexport type SkImageFilter = SkJSIInstance<\"ImageFilter\">;\n"],"mappings":"AAEA,WAAYA,QAAQ,0BAARA,QAAQ;EAClB;AACF;AACA;AACA;EAJYA,QAAQ,CAARA,QAAQ;EAOlB;AACF;AACA;EATYA,QAAQ,CAARA,QAAQ;EAYlB;AACF;AACA;AACA;EAfYA,QAAQ,CAARA,QAAQ;EAkBlB;AACF;AACA;EApBYA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAwBpB,OAAO,MAAMC,aAAa,GACxBC,GAAiC,IACRA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,aAAa","ignoreList":[]}
|
@@ -1,10 +1,13 @@
|
|
1
1
|
export let BlurStyle = /*#__PURE__*/function (BlurStyle) {
|
2
2
|
BlurStyle[BlurStyle["Normal"] = 0] = "Normal";
|
3
|
+
//!< fuzzy inside and outside
|
3
4
|
BlurStyle[BlurStyle["Solid"] = 1] = "Solid";
|
5
|
+
//!< solid inside, fuzzy outside
|
4
6
|
BlurStyle[BlurStyle["Outer"] = 2] = "Outer";
|
5
|
-
|
7
|
+
//!< nothing inside, fuzzy outside
|
8
|
+
BlurStyle[BlurStyle["Inner"] = 3] = "Inner"; //!< fuzzy inside, nothing outside
|
6
9
|
return BlurStyle;
|
7
|
-
}({});
|
10
|
+
}({});
|
8
11
|
export const isMaskFilter = obj => obj !== null && obj.__typename__ === "MaskFilter";
|
9
12
|
|
10
13
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BlurStyle","isMaskFilter","obj","__typename__"],"sources":["MaskFilter.ts"],"sourcesContent":["import type { SkJSIInstance } from \"./JsiInstance\";\n\nexport enum BlurStyle {\n Normal, //!< fuzzy inside and outside\n Solid, //!< solid inside, fuzzy outside\n Outer, //!< nothing inside, fuzzy outside\n Inner, //!< fuzzy inside, nothing outside\n}\n\nexport const isMaskFilter = (\n obj: SkJSIInstance<string> | null\n): obj is SkMaskFilter => obj !== null && obj.__typename__ === \"MaskFilter\";\n\nexport type SkMaskFilter = SkJSIInstance<\"MaskFilter\">;\n\n/**\n * See SkMaskFilter.h for more details.\n */\nexport interface MaskFilterFactory {\n /**\n * Create a blur maskfilter\n * @param style\n * @param sigma - Standard deviation of the Gaussian blur to apply. Must be > 0.\n * @param respectCTM - if true the blur's sigma is modified by the CTM.\n */\n MakeBlur(style: BlurStyle, sigma: number, respectCTM: boolean): SkMaskFilter;\n}\n"],"mappings":"AAEA,WAAYA,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;
|
1
|
+
{"version":3,"names":["BlurStyle","isMaskFilter","obj","__typename__"],"sources":["MaskFilter.ts"],"sourcesContent":["import type { SkJSIInstance } from \"./JsiInstance\";\n\nexport enum BlurStyle {\n Normal, //!< fuzzy inside and outside\n Solid, //!< solid inside, fuzzy outside\n Outer, //!< nothing inside, fuzzy outside\n Inner, //!< fuzzy inside, nothing outside\n}\n\nexport const isMaskFilter = (\n obj: SkJSIInstance<string> | null\n): obj is SkMaskFilter => obj !== null && obj.__typename__ === \"MaskFilter\";\n\nexport type SkMaskFilter = SkJSIInstance<\"MaskFilter\">;\n\n/**\n * See SkMaskFilter.h for more details.\n */\nexport interface MaskFilterFactory {\n /**\n * Create a blur maskfilter\n * @param style\n * @param sigma - Standard deviation of the Gaussian blur to apply. Must be > 0.\n * @param respectCTM - if true the blur's sigma is modified by the CTM.\n */\n MakeBlur(style: BlurStyle, sigma: number, respectCTM: boolean): SkMaskFilter;\n}\n"],"mappings":"AAEA,WAAYA,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EACX;EADEA,SAAS,CAATA,SAAS;EAEZ;EAFGA,SAAS,CAATA,SAAS;EAGZ;EAHGA,SAAS,CAATA,SAAS,0BAIZ;EAAA,OAJGA,SAAS;AAAA;AAOrB,OAAO,MAAMC,YAAY,GACvBC,GAAiC,IACTA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,YAAY;;AAI3E;AACA;AACA","ignoreList":[]}
|
@@ -27,34 +27,63 @@
|
|
27
27
|
*/
|
28
28
|
export let BlendMode = /*#__PURE__*/function (BlendMode) {
|
29
29
|
BlendMode[BlendMode["Clear"] = 0] = "Clear";
|
30
|
+
//!< r = 0
|
30
31
|
BlendMode[BlendMode["Src"] = 1] = "Src";
|
32
|
+
//!< r = s
|
31
33
|
BlendMode[BlendMode["Dst"] = 2] = "Dst";
|
34
|
+
//!< r = d
|
32
35
|
BlendMode[BlendMode["SrcOver"] = 3] = "SrcOver";
|
36
|
+
//!< r = s + (1-sa)*d
|
33
37
|
BlendMode[BlendMode["DstOver"] = 4] = "DstOver";
|
38
|
+
//!< r = d + (1-da)*s
|
34
39
|
BlendMode[BlendMode["SrcIn"] = 5] = "SrcIn";
|
40
|
+
//!< r = s * da
|
35
41
|
BlendMode[BlendMode["DstIn"] = 6] = "DstIn";
|
42
|
+
//!< r = d * sa
|
36
43
|
BlendMode[BlendMode["SrcOut"] = 7] = "SrcOut";
|
44
|
+
//!< r = s * (1-da)
|
37
45
|
BlendMode[BlendMode["DstOut"] = 8] = "DstOut";
|
46
|
+
//!< r = d * (1-sa)
|
38
47
|
BlendMode[BlendMode["SrcATop"] = 9] = "SrcATop";
|
48
|
+
//!< r = s*da + d*(1-sa)
|
39
49
|
BlendMode[BlendMode["DstATop"] = 10] = "DstATop";
|
50
|
+
//!< r = d*sa + s*(1-da)
|
40
51
|
BlendMode[BlendMode["Xor"] = 11] = "Xor";
|
52
|
+
//!< r = s*(1-da) + d*(1-sa)
|
41
53
|
BlendMode[BlendMode["Plus"] = 12] = "Plus";
|
54
|
+
//!< r = min(s + d, 1)
|
42
55
|
BlendMode[BlendMode["Modulate"] = 13] = "Modulate";
|
56
|
+
//!< r = s*d
|
43
57
|
BlendMode[BlendMode["Screen"] = 14] = "Screen";
|
58
|
+
//!< r = s + d - s*d
|
44
59
|
BlendMode[BlendMode["Overlay"] = 15] = "Overlay";
|
60
|
+
//!< multiply or screen, depending on destination
|
45
61
|
BlendMode[BlendMode["Darken"] = 16] = "Darken";
|
62
|
+
//!< rc = s + d - max(s*da, d*sa), ra = kSrcOver
|
46
63
|
BlendMode[BlendMode["Lighten"] = 17] = "Lighten";
|
64
|
+
//!< rc = s + d - min(s*da, d*sa), ra = kSrcOver
|
47
65
|
BlendMode[BlendMode["ColorDodge"] = 18] = "ColorDodge";
|
66
|
+
//!< brighten destination to reflect source
|
48
67
|
BlendMode[BlendMode["ColorBurn"] = 19] = "ColorBurn";
|
68
|
+
//!< darken destination to reflect source
|
49
69
|
BlendMode[BlendMode["HardLight"] = 20] = "HardLight";
|
70
|
+
//!< multiply or screen, depending on source
|
50
71
|
BlendMode[BlendMode["SoftLight"] = 21] = "SoftLight";
|
72
|
+
//!< lighten or darken, depending on source
|
51
73
|
BlendMode[BlendMode["Difference"] = 22] = "Difference";
|
74
|
+
//!< rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
|
52
75
|
BlendMode[BlendMode["Exclusion"] = 23] = "Exclusion";
|
76
|
+
//!< rc = s + d - two(s*d), ra = kSrcOver
|
53
77
|
BlendMode[BlendMode["Multiply"] = 24] = "Multiply";
|
78
|
+
//!< r = s*(1-da) + d*(1-sa) + s*d
|
54
79
|
BlendMode[BlendMode["Hue"] = 25] = "Hue";
|
80
|
+
//!< hue of source with saturation and luminosity of destination
|
55
81
|
BlendMode[BlendMode["Saturation"] = 26] = "Saturation";
|
82
|
+
//!< saturation of source with hue and luminosity of
|
83
|
+
//!< destination
|
56
84
|
BlendMode[BlendMode["Color"] = 27] = "Color";
|
57
|
-
|
85
|
+
//!< hue and saturation of source with luminosity of destination
|
86
|
+
BlendMode[BlendMode["Luminosity"] = 28] = "Luminosity"; //!< luminosity of source with hue and saturation of
|
58
87
|
return BlendMode;
|
59
|
-
}({});
|
88
|
+
}({});
|
60
89
|
//# sourceMappingURL=BlendMode.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BlendMode"],"sources":["BlendMode.ts"],"sourcesContent":["/**\n * Blends are operators that take in two colors (source, destination) and\n * return a new color. Many of these operate the same on all 4 components: red,\n * green, blue, alpha. For these, we just document what happens to one\n * component, rather than naming each one separately.\n *\n * Different SkColorTypes have different representations for color components:\n * 8-bit: 0..255\n * 6-bit: 0..63\n * 5-bit: 0..31\n * 4-bit: 0..15\n * floats: 0...1\n *\n * The documentation is expressed as if the component values are always 0..1\n * (floats).\n *\n * For brevity, the documentation uses the following abbreviations\n * s : source\n * d : destination\n * sa : source alpha\n * da : destination alpha\n *\n * Results are abbreviated\n * r : if all 4 components are computed in the same manner\n * ra : result alpha component\n * rc : result \"color\": red, green, blue components\n */\nexport enum BlendMode {\n Clear, //!< r = 0\n Src, //!< r = s\n Dst, //!< r = d\n SrcOver, //!< r = s + (1-sa)*d\n DstOver, //!< r = d + (1-da)*s\n SrcIn, //!< r = s * da\n DstIn, //!< r = d * sa\n SrcOut, //!< r = s * (1-da)\n DstOut, //!< r = d * (1-sa)\n SrcATop, //!< r = s*da + d*(1-sa)\n DstATop, //!< r = d*sa + s*(1-da)\n Xor, //!< r = s*(1-da) + d*(1-sa)\n Plus, //!< r = min(s + d, 1)\n Modulate, //!< r = s*d\n Screen, //!< r = s + d - s*d\n\n Overlay, //!< multiply or screen, depending on destination\n Darken, //!< rc = s + d - max(s*da, d*sa), ra = kSrcOver\n Lighten, //!< rc = s + d - min(s*da, d*sa), ra = kSrcOver\n ColorDodge, //!< brighten destination to reflect source\n ColorBurn, //!< darken destination to reflect source\n HardLight, //!< multiply or screen, depending on source\n SoftLight, //!< lighten or darken, depending on source\n Difference, //!< rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver\n Exclusion, //!< rc = s + d - two(s*d), ra = kSrcOver\n Multiply, //!< r = s*(1-da) + d*(1-sa) + s*d\n\n Hue, //!< hue of source with saturation and luminosity of destination\n Saturation, //!< saturation of source with hue and luminosity of\n //!< destination\n Color, //!< hue and saturation of source with luminosity of destination\n Luminosity, //!< luminosity of source with hue and saturation of\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;
|
1
|
+
{"version":3,"names":["BlendMode"],"sources":["BlendMode.ts"],"sourcesContent":["/**\n * Blends are operators that take in two colors (source, destination) and\n * return a new color. Many of these operate the same on all 4 components: red,\n * green, blue, alpha. For these, we just document what happens to one\n * component, rather than naming each one separately.\n *\n * Different SkColorTypes have different representations for color components:\n * 8-bit: 0..255\n * 6-bit: 0..63\n * 5-bit: 0..31\n * 4-bit: 0..15\n * floats: 0...1\n *\n * The documentation is expressed as if the component values are always 0..1\n * (floats).\n *\n * For brevity, the documentation uses the following abbreviations\n * s : source\n * d : destination\n * sa : source alpha\n * da : destination alpha\n *\n * Results are abbreviated\n * r : if all 4 components are computed in the same manner\n * ra : result alpha component\n * rc : result \"color\": red, green, blue components\n */\nexport enum BlendMode {\n Clear, //!< r = 0\n Src, //!< r = s\n Dst, //!< r = d\n SrcOver, //!< r = s + (1-sa)*d\n DstOver, //!< r = d + (1-da)*s\n SrcIn, //!< r = s * da\n DstIn, //!< r = d * sa\n SrcOut, //!< r = s * (1-da)\n DstOut, //!< r = d * (1-sa)\n SrcATop, //!< r = s*da + d*(1-sa)\n DstATop, //!< r = d*sa + s*(1-da)\n Xor, //!< r = s*(1-da) + d*(1-sa)\n Plus, //!< r = min(s + d, 1)\n Modulate, //!< r = s*d\n Screen, //!< r = s + d - s*d\n\n Overlay, //!< multiply or screen, depending on destination\n Darken, //!< rc = s + d - max(s*da, d*sa), ra = kSrcOver\n Lighten, //!< rc = s + d - min(s*da, d*sa), ra = kSrcOver\n ColorDodge, //!< brighten destination to reflect source\n ColorBurn, //!< darken destination to reflect source\n HardLight, //!< multiply or screen, depending on source\n SoftLight, //!< lighten or darken, depending on source\n Difference, //!< rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver\n Exclusion, //!< rc = s + d - two(s*d), ra = kSrcOver\n Multiply, //!< r = s*(1-da) + d*(1-sa) + s*d\n\n Hue, //!< hue of source with saturation and luminosity of destination\n Saturation, //!< saturation of source with hue and luminosity of\n //!< destination\n Color, //!< hue and saturation of source with luminosity of destination\n Luminosity, //!< luminosity of source with hue and saturation of\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EACZ;EADGA,SAAS,CAATA,SAAS;EAEd;EAFKA,SAAS,CAATA,SAAS;EAGd;EAHKA,SAAS,CAATA,SAAS;EAIV;EAJCA,SAAS,CAATA,SAAS;EAKV;EALCA,SAAS,CAATA,SAAS;EAMZ;EANGA,SAAS,CAATA,SAAS;EAOZ;EAPGA,SAAS,CAATA,SAAS;EAQX;EAREA,SAAS,CAATA,SAAS;EASX;EATEA,SAAS,CAATA,SAAS;EAUV;EAVCA,SAAS,CAATA,SAAS;EAWV;EAXCA,SAAS,CAATA,SAAS;EAYd;EAZKA,SAAS,CAATA,SAAS;EAab;EAbIA,SAAS,CAATA,SAAS;EAcT;EAdAA,SAAS,CAATA,SAAS;EAeX;EAfEA,SAAS,CAATA,SAAS;EAiBV;EAjBCA,SAAS,CAATA,SAAS;EAkBX;EAlBEA,SAAS,CAATA,SAAS;EAmBV;EAnBCA,SAAS,CAATA,SAAS;EAoBP;EApBFA,SAAS,CAATA,SAAS;EAqBR;EArBDA,SAAS,CAATA,SAAS;EAsBR;EAtBDA,SAAS,CAATA,SAAS;EAuBR;EAvBDA,SAAS,CAATA,SAAS;EAwBP;EAxBFA,SAAS,CAATA,SAAS;EAyBR;EAzBDA,SAAS,CAATA,SAAS;EA0BT;EA1BAA,SAAS,CAATA,SAAS;EA4Bd;EA5BKA,SAAS,CAATA,SAAS;EA6BP;EACZ;EA9BUA,SAAS,CAATA,SAAS;EA+BZ;EA/BGA,SAAS,CAATA,SAAS,qCAgCP;EAAA,OAhCFA,SAAS;AAAA","ignoreList":[]}
|
@@ -1,9 +1,23 @@
|
|
1
1
|
export let PlaceholderAlignment = /*#__PURE__*/function (PlaceholderAlignment) {
|
2
|
+
/// Match the baseline of the placeholder with the baseline.
|
2
3
|
PlaceholderAlignment[PlaceholderAlignment["Baseline"] = 0] = "Baseline";
|
4
|
+
/// Align the bottom edge of the placeholder with the baseline such that the
|
5
|
+
/// placeholder sits on top of the baseline.
|
3
6
|
PlaceholderAlignment[PlaceholderAlignment["AboveBaseline"] = 1] = "AboveBaseline";
|
7
|
+
/// Align the top edge of the placeholder with the baseline specified in
|
8
|
+
/// such that the placeholder hangs below the baseline.
|
4
9
|
PlaceholderAlignment[PlaceholderAlignment["BelowBaseline"] = 2] = "BelowBaseline";
|
10
|
+
/// Align the top edge of the placeholder with the top edge of the font.
|
11
|
+
/// When the placeholder is very tall, the extra space will hang from
|
12
|
+
/// the top and extend through the bottom of the line.
|
5
13
|
PlaceholderAlignment[PlaceholderAlignment["Top"] = 3] = "Top";
|
14
|
+
/// Align the bottom edge of the placeholder with the top edge of the font.
|
15
|
+
/// When the placeholder is very tall, the extra space will rise from
|
16
|
+
/// the bottom and extend through the top of the line.
|
6
17
|
PlaceholderAlignment[PlaceholderAlignment["Bottom"] = 4] = "Bottom";
|
18
|
+
/// Align the middle of the placeholder with the middle of the text. When the
|
19
|
+
/// placeholder is very tall, the extra space will grow equally from
|
20
|
+
/// the top and bottom of the line.
|
7
21
|
PlaceholderAlignment[PlaceholderAlignment["Middle"] = 5] = "Middle";
|
8
22
|
return PlaceholderAlignment;
|
9
23
|
}({});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["PlaceholderAlignment"],"sources":["ParagraphBuilder.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkPaint } from \"../Paint\";\n\nimport type { SkParagraph } from \"./Paragraph\";\nimport type { SkParagraphStyle } from \"./ParagraphStyle\";\nimport type { SkTextStyle, TextBaseline } from \"./TextStyle\";\nimport type { SkTypefaceFontProvider } from \"./TypefaceFontProvider\";\n\nexport interface ParagraphBuilderFactory {\n /**\n * Creates a new ParagraphBuilder object from custom fonts.\n * @param paragraphStyle Initial paragraph style\n * @param typefaceProvider Typeface provider\n */\n Make(\n paragraphStyle?: SkParagraphStyle,\n typefaceProvider?: SkTypefaceFontProvider\n ): SkParagraphBuilder;\n}\n\nexport enum PlaceholderAlignment {\n /// Match the baseline of the placeholder with the baseline.\n Baseline = 0,\n\n /// Align the bottom edge of the placeholder with the baseline such that the\n /// placeholder sits on top of the baseline.\n AboveBaseline,\n\n /// Align the top edge of the placeholder with the baseline specified in\n /// such that the placeholder hangs below the baseline.\n BelowBaseline,\n\n /// Align the top edge of the placeholder with the top edge of the font.\n /// When the placeholder is very tall, the extra space will hang from\n /// the top and extend through the bottom of the line.\n Top,\n\n /// Align the bottom edge of the placeholder with the top edge of the font.\n /// When the placeholder is very tall, the extra space will rise from\n /// the bottom and extend through the top of the line.\n Bottom,\n\n /// Align the middle of the placeholder with the middle of the text. When the\n /// placeholder is very tall, the extra space will grow equally from\n /// the top and bottom of the line.\n Middle,\n}\n\nexport interface SkParagraphBuilder extends SkJSIInstance<\"ParagraphBuilder\"> {\n /**\n * Creates a Paragraph object from the builder and the inputs given to the builder.\n */\n build(): SkParagraph;\n /**\n * Restores the builder to its initial empty state.\n */\n reset(): void;\n /**\n * Pushes a text-style to the builder\n * @param style Style to push\n * @param foregroundPaint Foreground paint object\n * @param backgroundPaint Background paint object\n * @returns The builder\n */\n pushStyle: (\n style: SkTextStyle,\n foregroundPaint?: SkPaint | undefined,\n backgroundPaint?: SkPaint | undefined\n ) => SkParagraphBuilder;\n /**\n * Pops the current text style from the builder\n * @returns The builder\n */\n pop: () => SkParagraphBuilder;\n /**\n * Adds text to the builder\n * @param text\n * @returns The builder\n */\n addText: (text: string) => SkParagraphBuilder;\n /**\n * Pushes the information required to leave an open space.\n * @param width\n * @param height\n * @param alignment\n * @param baseline\n * @param offset\n */\n addPlaceholder(\n width?: number,\n height?: number,\n alignment?: PlaceholderAlignment,\n baseline?: TextBaseline,\n offset?: number\n ): SkParagraphBuilder;\n}\n"],"mappings":"AAoBA,WAAYA,oBAAoB,0BAApBA,oBAAoB;
|
1
|
+
{"version":3,"names":["PlaceholderAlignment"],"sources":["ParagraphBuilder.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkPaint } from \"../Paint\";\n\nimport type { SkParagraph } from \"./Paragraph\";\nimport type { SkParagraphStyle } from \"./ParagraphStyle\";\nimport type { SkTextStyle, TextBaseline } from \"./TextStyle\";\nimport type { SkTypefaceFontProvider } from \"./TypefaceFontProvider\";\n\nexport interface ParagraphBuilderFactory {\n /**\n * Creates a new ParagraphBuilder object from custom fonts.\n * @param paragraphStyle Initial paragraph style\n * @param typefaceProvider Typeface provider\n */\n Make(\n paragraphStyle?: SkParagraphStyle,\n typefaceProvider?: SkTypefaceFontProvider\n ): SkParagraphBuilder;\n}\n\nexport enum PlaceholderAlignment {\n /// Match the baseline of the placeholder with the baseline.\n Baseline = 0,\n\n /// Align the bottom edge of the placeholder with the baseline such that the\n /// placeholder sits on top of the baseline.\n AboveBaseline,\n\n /// Align the top edge of the placeholder with the baseline specified in\n /// such that the placeholder hangs below the baseline.\n BelowBaseline,\n\n /// Align the top edge of the placeholder with the top edge of the font.\n /// When the placeholder is very tall, the extra space will hang from\n /// the top and extend through the bottom of the line.\n Top,\n\n /// Align the bottom edge of the placeholder with the top edge of the font.\n /// When the placeholder is very tall, the extra space will rise from\n /// the bottom and extend through the top of the line.\n Bottom,\n\n /// Align the middle of the placeholder with the middle of the text. When the\n /// placeholder is very tall, the extra space will grow equally from\n /// the top and bottom of the line.\n Middle,\n}\n\nexport interface SkParagraphBuilder extends SkJSIInstance<\"ParagraphBuilder\"> {\n /**\n * Creates a Paragraph object from the builder and the inputs given to the builder.\n */\n build(): SkParagraph;\n /**\n * Restores the builder to its initial empty state.\n */\n reset(): void;\n /**\n * Pushes a text-style to the builder\n * @param style Style to push\n * @param foregroundPaint Foreground paint object\n * @param backgroundPaint Background paint object\n * @returns The builder\n */\n pushStyle: (\n style: SkTextStyle,\n foregroundPaint?: SkPaint | undefined,\n backgroundPaint?: SkPaint | undefined\n ) => SkParagraphBuilder;\n /**\n * Pops the current text style from the builder\n * @returns The builder\n */\n pop: () => SkParagraphBuilder;\n /**\n * Adds text to the builder\n * @param text\n * @returns The builder\n */\n addText: (text: string) => SkParagraphBuilder;\n /**\n * Pushes the information required to leave an open space.\n * @param width\n * @param height\n * @param alignment\n * @param baseline\n * @param offset\n */\n addPlaceholder(\n width?: number,\n height?: number,\n alignment?: PlaceholderAlignment,\n baseline?: TextBaseline,\n offset?: number\n ): SkParagraphBuilder;\n}\n"],"mappings":"AAoBA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAC9B;EADUA,oBAAoB,CAApBA,oBAAoB;EAI9B;EACA;EALUA,oBAAoB,CAApBA,oBAAoB;EAQ9B;EACA;EATUA,oBAAoB,CAApBA,oBAAoB;EAY9B;EACA;EACA;EAdUA,oBAAoB,CAApBA,oBAAoB;EAiB9B;EACA;EACA;EAnBUA,oBAAoB,CAApBA,oBAAoB;EAsB9B;EACA;EACA;EAxBUA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
|
@@ -11,9 +11,13 @@ export let FillType = /*#__PURE__*/function (FillType) {
|
|
11
11
|
}({});
|
12
12
|
export let PathOp = /*#__PURE__*/function (PathOp) {
|
13
13
|
PathOp[PathOp["Difference"] = 0] = "Difference";
|
14
|
+
//!< subtract the op path from the first path
|
14
15
|
PathOp[PathOp["Intersect"] = 1] = "Intersect";
|
16
|
+
//!< intersect the two paths
|
15
17
|
PathOp[PathOp["Union"] = 2] = "Union";
|
18
|
+
//!< union (inclusive-or) the two paths
|
16
19
|
PathOp[PathOp["XOR"] = 3] = "XOR";
|
20
|
+
//!< exclusive-or the two paths
|
17
21
|
PathOp[PathOp["ReverseDifference"] = 4] = "ReverseDifference";
|
18
22
|
return PathOp;
|
19
23
|
}({});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["FillType","PathOp","PathVerb","isPath","obj","__typename__"],"sources":["Path.ts"],"sourcesContent":["import type { SkRect } from \"../Rect\";\nimport type { SkPoint } from \"../Point\";\nimport type { InputRRect } from \"../RRect\";\nimport type { StrokeJoin, StrokeCap } from \"../Paint\";\nimport type { InputMatrix, SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\n\n/**\n * Options used for Path.stroke(). If an option is omitted, a sensible default will be used.\n */\nexport interface StrokeOpts {\n /** The width of the stroked lines. */\n width?: number;\n miter_limit?: number;\n /**\n * if > 1, increase precision, else if (0 < resScale < 1) reduce precision to\n * favor speed and size\n */\n precision?: number;\n join?: StrokeJoin;\n cap?: StrokeCap;\n}\n\nexport enum FillType {\n Winding,\n EvenOdd,\n InverseWinding,\n InverseEvenOdd,\n}\n\nexport enum PathOp {\n Difference, //!< subtract the op path from the first path\n Intersect, //!< intersect the two paths\n Union, //!< union (inclusive-or) the two paths\n XOR, //!< exclusive-or the two paths\n ReverseDifference,\n}\n\nexport enum PathVerb {\n Move,\n Line,\n Quad,\n Conic,\n Cubic,\n Close,\n}\n\nexport type PathCommand = number[];\n\nexport const isPath = (obj: SkJSIInstance<string> | null): obj is SkPath => {\n \"worklet\";\n return obj !== null && obj.__typename__ === \"Path\";\n};\n\nexport interface SkPath extends SkJSIInstance<\"Path\"> {\n /**\n * Appends arc to Path, as the start of new contour. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngle\n * @param sweepAngle\n */\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ): SkPath;\n\n /**\n * Adds oval to Path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.\n * Oval is upright ellipse bounded by Rect oval with radii equal to half oval width\n * and half oval height. Oval begins at start and continues clockwise by default.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param isCCW - if the path should be drawn counter-clockwise or not\n * @param startIndex - index of initial point of ellipse\n */\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): SkPath;\n\n /**\n * Returns the number of points in this path. Initially zero.\n */\n countPoints(): number;\n\n /**\n * Adds contour created from array of n points, adding (count - 1) line segments.\n * Contour added starts at pts[0], then adds a line for every additional point\n * in pts array. If close is true, appends kClose_Verb to Path, connecting\n * pts[count - 1] and pts[0].\n * Returns the modified path for easier chaining.\n * @param points\n * @param close - if true, will add a line connecting last point to the first point.\n */\n addPoly(points: SkPoint[], close: boolean): SkPath;\n\n /** Adds beginning of contour at SkPoint (x, y).\n\n @param x x-axis value of contour start\n @param y y-axis value of contour start\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_moveTo\n */\n moveTo(x: number, y: number): SkPath;\n /** Adds line from last point to (x, y). If SkPath is empty, or last SkPath::Verb is\n kClose_Verb, last point is set to (0, 0) before adding line.\n\n lineTo() appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed.\n lineTo() then appends kLine_Verb to verb array and (x, y) to SkPoint array.\n\n @param x end of added line on x-axis\n @param y end of added line on y-axis\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_lineTo\n */\n lineTo(x: number, y: number): SkPath;\n\n /**\n * Returns a new path that covers the same area as the original path, but with the\n * Winding FillType. This may re-draw some contours in the path as counter-clockwise\n * instead of clockwise to achieve that effect. If such a transformation cannot\n * be done, null is returned.\n */\n makeAsWinding(): SkPath | null;\n\n /**\n * Translates all the points in the path by dx, dy.\n * @param dx\n * @param dy\n */\n offset(dx: number, dy: number): SkPath;\n\n /**\n * Relative version of arcToRotated.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param dx\n * @param dy\n */\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ): SkPath;\n\n /**\n * Relative version of conicTo.\n * @param dx1\n * @param dy1\n * @param dx2\n * @param dy2\n * @param w\n */\n rConicTo(\n dx1: number,\n dy1: number,\n dx2: number,\n dy2: number,\n w: number\n ): SkPath;\n\n /**\n * Relative version of cubicTo.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Relative version of moveTo.\n * @param x\n * @param y\n */\n rMoveTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of lineTo.\n * @param x\n * @param y\n */\n rLineTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of quadTo.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\n rQuadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Sets FillType, the rule used to fill Path.\n * @param fill\n */\n setFillType(fill: FillType): SkPath;\n\n /**\n * Specifies whether Path is volatile; whether it will be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false.\n *\n * Mark animating or temporary paths as volatile to improve performance.\n * Mark unchanging Path non-volatile to improve repeated rendering.\n * @param volatile\n */\n setIsVolatile(volatile: boolean): SkPath;\n\n /**\n * Turns this path into the filled equivalent of the stroked path. Returns false if the operation\n * fails (e.g. the path is a hairline).\n * @param opts - describe how stroked path should look.\n * If such a transformation cannot be done, null is returned.\n */\n stroke(opts?: StrokeOpts): null | SkPath;\n\n /**\n * Appends CLOSE_VERB to Path. A closed contour connects the first and last point\n * with a line, forming a continuous loop.\n */\n close(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is released\n */\n reset(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is *not* released.\n * Use rewind() instead of reset() if Path storage will be reused and performance\n * is critical.\n */\n rewind(): SkPath;\n\n /**\n * Returns minimum and maximum axes values of the lines and curves in Path.\n * Returns (0, 0, 0, 0) if Path contains no points.\n * Returned bounds width and height may be larger or smaller than area affected\n * when Path is drawn.\n *\n * Behaves identically to getBounds() when Path contains\n * only lines. If Path contains curves, computed bounds includes\n * the maximum extent of the quad, conic, or cubic; is slower than getBounds();\n * and unlike getBounds(), does not cache the result.\n */\n computeTightBounds(): SkRect;\n\n /**\n * Appends arc to Path. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngleInDegrees\n * @param sweepAngleInDegrees\n * @param forceMoveTo\n */\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ): SkPath;\n\n /**\n * Appends arc to Path. Arc is implemented by one or more conics weighted to\n * describe part of oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc\n * curves from last Path Point to (x, y), choosing one of four possible routes:\n * clockwise or counterclockwise, and smaller or larger. See SkPath.h for more details.\n * Returns the modified path for easier chaining.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param x\n * @param y\n */\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Appends arc to Path, after appending line if needed. Arc is implemented by conic\n * weighted to describe part of circle. Arc is contained by tangent from\n * last Path point to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc\n * is part of circle sized to radius, positioned so it touches both tangent lines.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param radius\n */\n arcToTangent(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n radius: number\n ): SkPath;\n\n /**\n * Adds conic from last point towards (x1, y1), to (x2, y2), weighted by w.\n * If Path is empty, or path is closed, the last point is set to (0, 0)\n * before adding conic.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param w\n */\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number): SkPath;\n\n /**\n * Returns true if the point (x, y) is contained by Path, taking into\n * account FillType.\n * @param x\n * @param y\n */\n contains(x: number, y: number): boolean;\n\n /**\n * Returns a copy of this Path.\n */\n copy(): SkPath;\n\n /**\n * Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at\n * (x3, y3). If Path is empty, or path is closed, the last point is set to\n * (0, 0) before adding cubic.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Changes this path to be the dashed version of itself. This is the same effect as creating\n * a DashPathEffect and calling filterPath on this path.\n * @param on\n * @param off\n * @param phase\n */\n dash(on: number, off: number, phase: number): boolean;\n\n /**\n * Returns true if other path is equal to this path.\n * @param other\n */\n equals(other: SkPath): boolean;\n\n /**\n * Returns minimum and maximum axes values of Point array.\n * Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may\n * be larger or smaller than area affected when Path is drawn.\n */\n getBounds(): SkRect;\n\n /**\n * Return the FillType for this path.\n */\n getFillType(): FillType;\n\n /**\n Adds quad from last point towards (x1, y1), to (x2, y2).\n\n If SkPath is empty, or last SkPath::Verb is kClose_Verb, last point is set to (0, 0) before adding quad.\n\n Appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed; then appends kQuad_Verb to verb array;\n and (x1, y1), (x2, y2) to SkPoint array.\n\n Parameters\n x1\tcontrol SkPoint of quad on x-axis\n y1\tcontrol SkPoint of quad on y-axis\n x2\tend SkPoint of quad on x-axis\n y2\tend SkPoint of quad on y-axis\n Returns\n reference to SkPath\n example: https://fiddle.skia.org/c/@Path_quadTo\n */\n quadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,\n * starting with top-left corner of Rect; followed by top-right, bottom-right,\n * and bottom-left if isCCW is false; or followed by bottom-left,\n * bottom-right, and top-right if isCCW is true.\n * Returns the modified path for easier chaining.\n * @param rect\n * @param isCCW\n */\n addRect(rect: SkRect, isCCW?: boolean): SkPath;\n\n /**\n * Adds rrect to Path, creating a new closed contour.\n * Returns the modified path for easier chaining.\n * @param rrect\n * @param isCCW\n */\n addRRect(rrect: InputRRect, isCCW?: boolean): SkPath;\n\n /** Appends src to SkPath, transformed by matrix. Transformed curves may have\n different verbs, SkPoint, and conic weights.\n\n If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic\n weights are added unaltered. If mode is kExtend_AddPathMode, add line\n before appending verbs, SkPoint, and conic weights.\n\n @param src SkPath verbs, SkPoint, and conic weights to add\n @param matrix transform applied to src\n @param extend extends path with line if true\n @return reference to SkPath\n */\n addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): SkPath;\n\n /**\n * Returns the Point at index in Point array. Valid range for index is\n * 0 to countPoints() - 1.\n * @param index\n */\n getPoint(index: number): SkPoint;\n\n /**\n * Returns true if there are no verbs in the path.\n */\n isEmpty(): boolean;\n\n /**\n * Returns true if the path is volatile; it will not be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false, allowing\n * Surface to attach a cache of data which speeds repeated drawing. If true, Surface\n * may not speed repeated drawing.\n */\n isVolatile(): boolean;\n\n /** Adds circle centered at (x, y) of size radius to SkPath, appending kMove_Verb,\n four kConic_Verb, and kClose_Verb. Circle begins at: (x + radius, y), continuing\n clockwise if dir is kCW_Direction, and counterclockwise if dir is kCCW_Direction.\n\n Has no effect if radius is zero or negative.\n\n @param x center of circle\n @param y center of circle\n @param radius distance from center to edge \n @return reference to SkPath\n */\n addCircle(x: number, y: number, r: number): SkPath;\n\n getLastPt(): { x: number; y: number };\n\n /** Set this path to the result of applying the Op to this path and the\n specified path: this = (this op operand).\n The resulting path will be constructed from non-overlapping contours.\n The curve order is reduced where possible so that cubics may be turned\n into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param path The second path (for difference, the subtrahend)\n @param op The operator to apply.\n @param result The product of the operands. The result may be one of the\n inputs.\n @return True if the operation succeeded.\n */\n op(path: SkPath, op: PathOp): boolean;\n\n /** Set this path to a set of non-overlapping contours that describe the\n same area as the original path.\n The curve order is reduced where possible so that cubics may\n be turned into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param result The simplified path. The result may be the input.\n @return True if simplification succeeded.\n */\n simplify(): boolean;\n\n /**\n * Returns this path as an SVG string.\n */\n toSVGString(): string;\n\n /**\n * Take start and stop \"t\" values (values between 0...1), and modify this path such that\n * it is a subset of the original path.\n * The trim values apply to the entire path, so if it contains several contours, all of them\n * are including in the calculation.\n * Null is returned if either input value is NaN.\n * @param startT - a value in the range [0.0, 1.0]. 0.0 is the beginning of the path.\n * @param stopT - a value in the range [0.0, 1.0]. 1.0 is the end of the path.\n * @param isComplement\n */\n trim(startT: number, stopT: number, isComplement: boolean): null | SkPath;\n\n /**\n * Transforms the path by the specified matrix.\n */\n transform(m3: InputMatrix): SkPath;\n\n /**\n * Interpolates between Path with point array of equal size.\n * Copy verb array and weights to result, and set result path to a weighted\n * average of this path array and ending path.\n\n * weight is most useful when between zero (ending path) and\n one (this path); will work with values outside of this\n range.\n\n * interpolate() returns undefined if path is not\n * the same size as ending path. Call isInterpolatable() to check Path\n * compatibility prior to calling interpolate().\n\n * @param ending path to interpolate with\n * @param weight contribution of this path, and\n * one minus contribution of ending path\n * @param output path to be replaced with the interpolated averages\n * @return Path replaced by interpolated averages or null if \n * not interpolatable\n * */\n interpolate(end: SkPath, weight: number, output?: SkPath): SkPath | null;\n\n /** Returns true if Path contain equal verbs and equal weights.\n * @param compare path to compare\n * @return true if Path can be interpolated equivalent\n *\n * */\n isInterpolatable(compare: SkPath): boolean;\n\n /**\n * Serializes the contents of this path as a series of commands.\n */\n toCmds(): PathCommand[];\n}\n"],"mappings":"AAOA;AACA;AACA;;AAcA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAOpB,WAAYC,MAAM,0BAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAQlB,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAWpB,OAAO,MAAMC,MAAM,GAAIC,GAAiC,IAAoB;EAC1E,SAAS;;EACT,OAAOA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,MAAM;AACpD,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["FillType","PathOp","PathVerb","isPath","obj","__typename__"],"sources":["Path.ts"],"sourcesContent":["import type { SkRect } from \"../Rect\";\nimport type { SkPoint } from \"../Point\";\nimport type { InputRRect } from \"../RRect\";\nimport type { StrokeJoin, StrokeCap } from \"../Paint\";\nimport type { InputMatrix, SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\n\n/**\n * Options used for Path.stroke(). If an option is omitted, a sensible default will be used.\n */\nexport interface StrokeOpts {\n /** The width of the stroked lines. */\n width?: number;\n miter_limit?: number;\n /**\n * if > 1, increase precision, else if (0 < resScale < 1) reduce precision to\n * favor speed and size\n */\n precision?: number;\n join?: StrokeJoin;\n cap?: StrokeCap;\n}\n\nexport enum FillType {\n Winding,\n EvenOdd,\n InverseWinding,\n InverseEvenOdd,\n}\n\nexport enum PathOp {\n Difference, //!< subtract the op path from the first path\n Intersect, //!< intersect the two paths\n Union, //!< union (inclusive-or) the two paths\n XOR, //!< exclusive-or the two paths\n ReverseDifference,\n}\n\nexport enum PathVerb {\n Move,\n Line,\n Quad,\n Conic,\n Cubic,\n Close,\n}\n\nexport type PathCommand = number[];\n\nexport const isPath = (obj: SkJSIInstance<string> | null): obj is SkPath => {\n \"worklet\";\n return obj !== null && obj.__typename__ === \"Path\";\n};\n\nexport interface SkPath extends SkJSIInstance<\"Path\"> {\n /**\n * Appends arc to Path, as the start of new contour. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngle\n * @param sweepAngle\n */\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ): SkPath;\n\n /**\n * Adds oval to Path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.\n * Oval is upright ellipse bounded by Rect oval with radii equal to half oval width\n * and half oval height. Oval begins at start and continues clockwise by default.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param isCCW - if the path should be drawn counter-clockwise or not\n * @param startIndex - index of initial point of ellipse\n */\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number): SkPath;\n\n /**\n * Returns the number of points in this path. Initially zero.\n */\n countPoints(): number;\n\n /**\n * Adds contour created from array of n points, adding (count - 1) line segments.\n * Contour added starts at pts[0], then adds a line for every additional point\n * in pts array. If close is true, appends kClose_Verb to Path, connecting\n * pts[count - 1] and pts[0].\n * Returns the modified path for easier chaining.\n * @param points\n * @param close - if true, will add a line connecting last point to the first point.\n */\n addPoly(points: SkPoint[], close: boolean): SkPath;\n\n /** Adds beginning of contour at SkPoint (x, y).\n\n @param x x-axis value of contour start\n @param y y-axis value of contour start\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_moveTo\n */\n moveTo(x: number, y: number): SkPath;\n /** Adds line from last point to (x, y). If SkPath is empty, or last SkPath::Verb is\n kClose_Verb, last point is set to (0, 0) before adding line.\n\n lineTo() appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed.\n lineTo() then appends kLine_Verb to verb array and (x, y) to SkPoint array.\n\n @param x end of added line on x-axis\n @param y end of added line on y-axis\n @return reference to SkPath\n\n example: https://fiddle.skia.org/c/@Path_lineTo\n */\n lineTo(x: number, y: number): SkPath;\n\n /**\n * Returns a new path that covers the same area as the original path, but with the\n * Winding FillType. This may re-draw some contours in the path as counter-clockwise\n * instead of clockwise to achieve that effect. If such a transformation cannot\n * be done, null is returned.\n */\n makeAsWinding(): SkPath | null;\n\n /**\n * Translates all the points in the path by dx, dy.\n * @param dx\n * @param dy\n */\n offset(dx: number, dy: number): SkPath;\n\n /**\n * Relative version of arcToRotated.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param dx\n * @param dy\n */\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ): SkPath;\n\n /**\n * Relative version of conicTo.\n * @param dx1\n * @param dy1\n * @param dx2\n * @param dy2\n * @param w\n */\n rConicTo(\n dx1: number,\n dy1: number,\n dx2: number,\n dy2: number,\n w: number\n ): SkPath;\n\n /**\n * Relative version of cubicTo.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Relative version of moveTo.\n * @param x\n * @param y\n */\n rMoveTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of lineTo.\n * @param x\n * @param y\n */\n rLineTo(x: number, y: number): SkPath;\n\n /**\n * Relative version of quadTo.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n */\n rQuadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Sets FillType, the rule used to fill Path.\n * @param fill\n */\n setFillType(fill: FillType): SkPath;\n\n /**\n * Specifies whether Path is volatile; whether it will be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false.\n *\n * Mark animating or temporary paths as volatile to improve performance.\n * Mark unchanging Path non-volatile to improve repeated rendering.\n * @param volatile\n */\n setIsVolatile(volatile: boolean): SkPath;\n\n /**\n * Turns this path into the filled equivalent of the stroked path. Returns false if the operation\n * fails (e.g. the path is a hairline).\n * @param opts - describe how stroked path should look.\n * If such a transformation cannot be done, null is returned.\n */\n stroke(opts?: StrokeOpts): null | SkPath;\n\n /**\n * Appends CLOSE_VERB to Path. A closed contour connects the first and last point\n * with a line, forming a continuous loop.\n */\n close(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is released\n */\n reset(): SkPath;\n\n /**\n * Sets Path to its initial state.\n * Removes verb array, point array, and weights, and sets FillType to Winding.\n * Internal storage associated with Path is *not* released.\n * Use rewind() instead of reset() if Path storage will be reused and performance\n * is critical.\n */\n rewind(): SkPath;\n\n /**\n * Returns minimum and maximum axes values of the lines and curves in Path.\n * Returns (0, 0, 0, 0) if Path contains no points.\n * Returned bounds width and height may be larger or smaller than area affected\n * when Path is drawn.\n *\n * Behaves identically to getBounds() when Path contains\n * only lines. If Path contains curves, computed bounds includes\n * the maximum extent of the quad, conic, or cubic; is slower than getBounds();\n * and unlike getBounds(), does not cache the result.\n */\n computeTightBounds(): SkRect;\n\n /**\n * Appends arc to Path. Arc added is part of ellipse\n * bounded by oval, from startAngle through sweepAngle. Both startAngle and\n * sweepAngle are measured in degrees, where zero degrees is aligned with the\n * positive x-axis, and positive sweeps extends arc clockwise.\n * Returns the modified path for easier chaining.\n * @param oval\n * @param startAngleInDegrees\n * @param sweepAngleInDegrees\n * @param forceMoveTo\n */\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ): SkPath;\n\n /**\n * Appends arc to Path. Arc is implemented by one or more conics weighted to\n * describe part of oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc\n * curves from last Path Point to (x, y), choosing one of four possible routes:\n * clockwise or counterclockwise, and smaller or larger. See SkPath.h for more details.\n * Returns the modified path for easier chaining.\n * @param rx\n * @param ry\n * @param xAxisRotate\n * @param useSmallArc\n * @param isCCW\n * @param x\n * @param y\n */\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Appends arc to Path, after appending line if needed. Arc is implemented by conic\n * weighted to describe part of circle. Arc is contained by tangent from\n * last Path point to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc\n * is part of circle sized to radius, positioned so it touches both tangent lines.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param radius\n */\n arcToTangent(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n radius: number\n ): SkPath;\n\n /**\n * Adds conic from last point towards (x1, y1), to (x2, y2), weighted by w.\n * If Path is empty, or path is closed, the last point is set to (0, 0)\n * before adding conic.\n * Returns the modified path for easier chaining.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param w\n */\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number): SkPath;\n\n /**\n * Returns true if the point (x, y) is contained by Path, taking into\n * account FillType.\n * @param x\n * @param y\n */\n contains(x: number, y: number): boolean;\n\n /**\n * Returns a copy of this Path.\n */\n copy(): SkPath;\n\n /**\n * Adds cubic from last point towards (x1, y1), then towards (x2, y2), ending at\n * (x3, y3). If Path is empty, or path is closed, the last point is set to\n * (0, 0) before adding cubic.\n * @param cpx1\n * @param cpy1\n * @param cpx2\n * @param cpy2\n * @param x\n * @param y\n */\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ): SkPath;\n\n /**\n * Changes this path to be the dashed version of itself. This is the same effect as creating\n * a DashPathEffect and calling filterPath on this path.\n * @param on\n * @param off\n * @param phase\n */\n dash(on: number, off: number, phase: number): boolean;\n\n /**\n * Returns true if other path is equal to this path.\n * @param other\n */\n equals(other: SkPath): boolean;\n\n /**\n * Returns minimum and maximum axes values of Point array.\n * Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may\n * be larger or smaller than area affected when Path is drawn.\n */\n getBounds(): SkRect;\n\n /**\n * Return the FillType for this path.\n */\n getFillType(): FillType;\n\n /**\n Adds quad from last point towards (x1, y1), to (x2, y2).\n\n If SkPath is empty, or last SkPath::Verb is kClose_Verb, last point is set to (0, 0) before adding quad.\n\n Appends kMove_Verb to verb array and (0, 0) to SkPoint array, if needed; then appends kQuad_Verb to verb array;\n and (x1, y1), (x2, y2) to SkPoint array.\n\n Parameters\n x1\tcontrol SkPoint of quad on x-axis\n y1\tcontrol SkPoint of quad on y-axis\n x2\tend SkPoint of quad on x-axis\n y2\tend SkPoint of quad on y-axis\n Returns\n reference to SkPath\n example: https://fiddle.skia.org/c/@Path_quadTo\n */\n quadTo(x1: number, y1: number, x2: number, y2: number): SkPath;\n\n /**\n * Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,\n * starting with top-left corner of Rect; followed by top-right, bottom-right,\n * and bottom-left if isCCW is false; or followed by bottom-left,\n * bottom-right, and top-right if isCCW is true.\n * Returns the modified path for easier chaining.\n * @param rect\n * @param isCCW\n */\n addRect(rect: SkRect, isCCW?: boolean): SkPath;\n\n /**\n * Adds rrect to Path, creating a new closed contour.\n * Returns the modified path for easier chaining.\n * @param rrect\n * @param isCCW\n */\n addRRect(rrect: InputRRect, isCCW?: boolean): SkPath;\n\n /** Appends src to SkPath, transformed by matrix. Transformed curves may have\n different verbs, SkPoint, and conic weights.\n\n If mode is kAppend_AddPathMode, src verb array, SkPoint array, and conic\n weights are added unaltered. If mode is kExtend_AddPathMode, add line\n before appending verbs, SkPoint, and conic weights.\n\n @param src SkPath verbs, SkPoint, and conic weights to add\n @param matrix transform applied to src\n @param extend extends path with line if true\n @return reference to SkPath\n */\n addPath(src: SkPath, matrix?: SkMatrix, extend?: boolean): SkPath;\n\n /**\n * Returns the Point at index in Point array. Valid range for index is\n * 0 to countPoints() - 1.\n * @param index\n */\n getPoint(index: number): SkPoint;\n\n /**\n * Returns true if there are no verbs in the path.\n */\n isEmpty(): boolean;\n\n /**\n * Returns true if the path is volatile; it will not be altered or discarded\n * by the caller after it is drawn. Path by default have volatile set false, allowing\n * Surface to attach a cache of data which speeds repeated drawing. If true, Surface\n * may not speed repeated drawing.\n */\n isVolatile(): boolean;\n\n /** Adds circle centered at (x, y) of size radius to SkPath, appending kMove_Verb,\n four kConic_Verb, and kClose_Verb. Circle begins at: (x + radius, y), continuing\n clockwise if dir is kCW_Direction, and counterclockwise if dir is kCCW_Direction.\n\n Has no effect if radius is zero or negative.\n\n @param x center of circle\n @param y center of circle\n @param radius distance from center to edge \n @return reference to SkPath\n */\n addCircle(x: number, y: number, r: number): SkPath;\n\n getLastPt(): { x: number; y: number };\n\n /** Set this path to the result of applying the Op to this path and the\n specified path: this = (this op operand).\n The resulting path will be constructed from non-overlapping contours.\n The curve order is reduced where possible so that cubics may be turned\n into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param path The second path (for difference, the subtrahend)\n @param op The operator to apply.\n @param result The product of the operands. The result may be one of the\n inputs.\n @return True if the operation succeeded.\n */\n op(path: SkPath, op: PathOp): boolean;\n\n /** Set this path to a set of non-overlapping contours that describe the\n same area as the original path.\n The curve order is reduced where possible so that cubics may\n be turned into quadratics, and quadratics maybe turned into lines.\n\n Returns true if operation was able to produce a result;\n otherwise, result is unmodified.\n\n @param result The simplified path. The result may be the input.\n @return True if simplification succeeded.\n */\n simplify(): boolean;\n\n /**\n * Returns this path as an SVG string.\n */\n toSVGString(): string;\n\n /**\n * Take start and stop \"t\" values (values between 0...1), and modify this path such that\n * it is a subset of the original path.\n * The trim values apply to the entire path, so if it contains several contours, all of them\n * are including in the calculation.\n * Null is returned if either input value is NaN.\n * @param startT - a value in the range [0.0, 1.0]. 0.0 is the beginning of the path.\n * @param stopT - a value in the range [0.0, 1.0]. 1.0 is the end of the path.\n * @param isComplement\n */\n trim(startT: number, stopT: number, isComplement: boolean): null | SkPath;\n\n /**\n * Transforms the path by the specified matrix.\n */\n transform(m3: InputMatrix): SkPath;\n\n /**\n * Interpolates between Path with point array of equal size.\n * Copy verb array and weights to result, and set result path to a weighted\n * average of this path array and ending path.\n\n * weight is most useful when between zero (ending path) and\n one (this path); will work with values outside of this\n range.\n\n * interpolate() returns undefined if path is not\n * the same size as ending path. Call isInterpolatable() to check Path\n * compatibility prior to calling interpolate().\n\n * @param ending path to interpolate with\n * @param weight contribution of this path, and\n * one minus contribution of ending path\n * @param output path to be replaced with the interpolated averages\n * @return Path replaced by interpolated averages or null if \n * not interpolatable\n * */\n interpolate(end: SkPath, weight: number, output?: SkPath): SkPath | null;\n\n /** Returns true if Path contain equal verbs and equal weights.\n * @param compare path to compare\n * @return true if Path can be interpolated equivalent\n *\n * */\n isInterpolatable(compare: SkPath): boolean;\n\n /**\n * Serializes the contents of this path as a series of commands.\n */\n toCmds(): PathCommand[];\n}\n"],"mappings":"AAOA;AACA;AACA;;AAcA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAOpB,WAAYC,MAAM,0BAANA,MAAM;EAANA,MAAM,CAANA,MAAM;EACJ;EADFA,MAAM,CAANA,MAAM;EAEL;EAFDA,MAAM,CAANA,MAAM;EAGT;EAHGA,MAAM,CAANA,MAAM;EAIX;EAJKA,MAAM,CAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAQlB,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAWpB,OAAO,MAAMC,MAAM,GAAIC,GAAiC,IAAoB;EAC1E,SAAS;;EACT,OAAOA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,MAAM;AACpD,CAAC","ignoreList":[]}
|
@@ -43,5 +43,5 @@ export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements
|
|
43
43
|
concat(m: SkMatrix | number[]): void;
|
44
44
|
drawPicture(skp: SkPicture): void;
|
45
45
|
drawAtlas(atlas: SkImage, srcs: SkRect[], dsts: SkRSXform[], paint: SkPaint, blendMode?: BlendMode, colors?: SkColor[], sampling?: CubicResampler | FilterOptions): void;
|
46
|
-
readPixels(srcX: number, srcY: number, imageInfo: ImageInfo): Float32Array | Uint8Array | null;
|
46
|
+
readPixels(srcX: number, srcY: number, imageInfo: ImageInfo): Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | null;
|
47
47
|
}
|
@@ -9,9 +9,9 @@ export declare class JsiSkImage extends HostObject<Image, "Image"> implements Sk
|
|
9
9
|
getImageInfo(): ImageInfo;
|
10
10
|
makeShaderOptions(tx: TileMode, ty: TileMode, fm: FilterMode, mm: MipmapMode, localMatrix?: SkMatrix): SkShader;
|
11
11
|
makeShaderCubic(tx: TileMode, ty: TileMode, B: number, C: number, localMatrix?: SkMatrix): SkShader;
|
12
|
-
encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array
|
12
|
+
encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array<ArrayBufferLike>;
|
13
13
|
encodeToBase64(fmt?: ImageFormat, quality?: number): string;
|
14
|
-
readPixels(srcX?: number, srcY?: number, imageInfo?: ImageInfo): Float32Array | Uint8Array | null;
|
14
|
+
readPixels(srcX?: number, srcY?: number, imageInfo?: ImageInfo): Float32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | null;
|
15
15
|
dispose: () => void;
|
16
16
|
makeNonTextureImage(): SkImage;
|
17
17
|
getNativeTextureUnstable(): unknown;
|
@@ -8,7 +8,7 @@ export declare class JsiSkPaint extends HostObject<Paint, "Paint"> implements Sk
|
|
8
8
|
assign(paint: JsiSkPaint): void;
|
9
9
|
reset(): void;
|
10
10
|
getAlphaf(): number;
|
11
|
-
getColor():
|
11
|
+
getColor(): import("canvaskit-wasm").Color;
|
12
12
|
getStrokeCap(): number;
|
13
13
|
getStrokeJoin(): number;
|
14
14
|
getStrokeMiter(): number;
|
@@ -6,5 +6,5 @@ export declare class JsiSkPicture extends HostObject<Picture, "Picture"> impleme
|
|
6
6
|
constructor(CanvasKit: CanvasKit, ref: Picture);
|
7
7
|
dispose: () => void;
|
8
8
|
makeShader(tmx: TileMode, tmy: TileMode, mode: FilterMode, localMatrix?: SkMatrix, tileRect?: SkRect): JsiSkShader;
|
9
|
-
serialize(): Uint8Array | null;
|
9
|
+
serialize(): Uint8Array<ArrayBufferLike> | null;
|
10
10
|
}
|
@@ -2,7 +2,7 @@ import type { CanvasKit, Point } from "canvaskit-wasm";
|
|
2
2
|
import type { SkPoint } from "../types";
|
3
3
|
import { BaseHostObject } from "./Host";
|
4
4
|
export declare class JsiSkPoint extends BaseHostObject<Point, "Point"> implements SkPoint {
|
5
|
-
static fromValue(point: SkPoint): Float32Array
|
5
|
+
static fromValue(point: SkPoint): Float32Array<ArrayBuffer>;
|
6
6
|
constructor(CanvasKit: CanvasKit, ref: Point);
|
7
7
|
dispose: () => void;
|
8
8
|
get x(): number;
|
@@ -4,7 +4,7 @@ import { BaseHostObject } from "./Host";
|
|
4
4
|
import { JsiSkRect } from "./JsiSkRect";
|
5
5
|
export declare class JsiSkRRect extends BaseHostObject<RRect, "RRect"> implements SkRRect {
|
6
6
|
dispose: () => void;
|
7
|
-
static fromValue(CanvasKit: CanvasKit, rect: InputRRect): Float32Array
|
7
|
+
static fromValue(CanvasKit: CanvasKit, rect: InputRRect): Float32Array<ArrayBuffer>;
|
8
8
|
constructor(CanvasKit: CanvasKit, rect: SkRect, rx: number, ry: number);
|
9
9
|
get rx(): number;
|
10
10
|
get ry(): number;
|
@@ -3,7 +3,7 @@ import type { SkRSXform } from "../types";
|
|
3
3
|
import { BaseHostObject } from "./Host";
|
4
4
|
export type RSXform = Float32Array;
|
5
5
|
export declare class JsiSkRSXform extends BaseHostObject<RSXform, "RSXform"> implements SkRSXform {
|
6
|
-
static fromValue(rsxform: SkRSXform): Float32Array
|
6
|
+
static fromValue(rsxform: SkRSXform): Float32Array<ArrayBuffer>;
|
7
7
|
constructor(CanvasKit: CanvasKit, ref: RSXform);
|
8
8
|
set(scos: number, ssin: number, tx: number, ty: number): void;
|
9
9
|
get scos(): number;
|
@@ -2,7 +2,7 @@ import type { CanvasKit, Rect } from "canvaskit-wasm";
|
|
2
2
|
import type { SkHostRect, SkRect } from "../types";
|
3
3
|
import { BaseHostObject } from "./Host";
|
4
4
|
export declare class JsiSkRect extends BaseHostObject<Rect, "Rect"> implements SkHostRect {
|
5
|
-
static fromValue(CanvasKit: CanvasKit, rect: SkRect):
|
5
|
+
static fromValue(CanvasKit: CanvasKit, rect: SkRect): Rect;
|
6
6
|
dispose: () => void;
|
7
7
|
constructor(CanvasKit: CanvasKit, ref: Rect);
|
8
8
|
setXYWH(x: number, y: number, width: number, height: number): void;
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import type { Skia, SkCanvas } from "../skia/types";
|
2
|
-
import type { ISkiaViewApi } from "../views/types";
|
3
2
|
import type { Node } from "./Node";
|
4
3
|
import type { Recording } from "./Recorder/Recorder";
|
5
|
-
|
6
|
-
var SkiaViewApi: ISkiaViewApi;
|
7
|
-
}
|
4
|
+
import "../views/api";
|
8
5
|
export declare abstract class Container {
|
9
6
|
protected Skia: Skia;
|
10
7
|
protected nativeId: number;
|
@@ -8,6 +8,7 @@ import { visit } from "./Recorder/Visitor";
|
|
8
8
|
import { replay } from "./Recorder/Player";
|
9
9
|
import { createDrawingContext } from "./Recorder/DrawingContext";
|
10
10
|
import { ReanimatedRecorder } from "./Recorder/ReanimatedRecorder";
|
11
|
+
import "../views/api";
|
11
12
|
const drawOnscreen = (Skia, nativeId, recording) => {
|
12
13
|
"worklet";
|
13
14
|
|
@@ -21,8 +22,6 @@ const drawOnscreen = (Skia, nativeId, recording) => {
|
|
21
22
|
//const end = performance.now();
|
22
23
|
//console.log("Recording time: ", end - start);
|
23
24
|
SkiaViewApi.setJsiProperty(nativeId, "picture", picture);
|
24
|
-
rec.dispose();
|
25
|
-
picture.dispose();
|
26
25
|
};
|
27
26
|
const nativeDrawOnscreen = (nativeId, recorder) => {
|
28
27
|
"worklet";
|
@@ -131,6 +130,11 @@ class NativeReanimatedContainer extends Container {
|
|
131
130
|
visit(recorder, this.root);
|
132
131
|
const sharedValues = recorder.getSharedValues();
|
133
132
|
const sharedRecorder = recorder.getRecorder();
|
133
|
+
Rea.runOnUI(() => {
|
134
|
+
"worklet";
|
135
|
+
|
136
|
+
nativeDrawOnscreen(nativeId, sharedRecorder);
|
137
|
+
})();
|
134
138
|
if (sharedValues.length > 0) {
|
135
139
|
this.mapperId = Rea.startMapper(() => {
|
136
140
|
"worklet";
|
@@ -139,17 +143,12 @@ class NativeReanimatedContainer extends Container {
|
|
139
143
|
nativeDrawOnscreen(nativeId, sharedRecorder);
|
140
144
|
}, sharedValues);
|
141
145
|
}
|
142
|
-
Rea.runOnUI(() => {
|
143
|
-
"worklet";
|
144
|
-
|
145
|
-
nativeDrawOnscreen(nativeId, sharedRecorder);
|
146
|
-
})();
|
147
146
|
}
|
148
147
|
}
|
149
148
|
export const createContainer = (Skia, nativeId) => {
|
150
|
-
const
|
149
|
+
const web = global.SkiaViewApi && global.SkiaViewApi.web;
|
151
150
|
if (HAS_REANIMATED_3 && nativeId !== -1) {
|
152
|
-
if (
|
151
|
+
if (!web) {
|
153
152
|
return new NativeReanimatedContainer(Skia, nativeId);
|
154
153
|
} else {
|
155
154
|
return new ReanimatedContainer(Skia, nativeId);
|