@shopify/react-native-skia 1.5.9 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/jni/include/JniSkiaBaseView.h +6 -4
- package/android/cpp/jni/include/JniSkiaDomView.h +6 -4
- package/android/cpp/jni/include/JniSkiaPictureView.h +6 -4
- package/android/cpp/rnskia-android/MainThreadDispatcher.h +5 -0
- package/android/cpp/rnskia-android/OpenGLContext.h +37 -10
- package/android/cpp/rnskia-android/OpenGLWindowContext.cpp +0 -1
- package/android/cpp/rnskia-android/RNSkAndroidView.h +10 -9
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +42 -36
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +2 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaAHBView.java +113 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +45 -54
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseViewManager.java +5 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomView.java +2 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +2 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaSurfaceView.java +42 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaTextureView.java +90 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaViewAPI.java +16 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerDelegate.java +3 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerInterface.java +1 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerDelegate.java +3 -1
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerInterface.java +1 -0
- package/cpp/rnskia/RNSkDomView.cpp +0 -20
- package/cpp/rnskia/RNSkDomView.h +0 -2
- package/cpp/rnskia/RNSkPictureView.h +5 -12
- package/cpp/rnskia/RNSkPlatformContext.h +1 -2
- package/cpp/rnskia/RNSkView.h +13 -24
- package/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.mm +4 -8
- package/ios/RNSkia-iOS/SkiaDomViewManager.mm +5 -0
- package/ios/RNSkia-iOS/SkiaPictureView.mm +1 -0
- package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +5 -0
- package/ios/RNSkia-iOS/SkiaUIView.h +1 -0
- package/ios/RNSkia-iOS/SkiaUIView.mm +5 -0
- package/lib/commonjs/skia/types/Image/ColorType.d.ts +21 -0
- package/lib/commonjs/skia/types/Image/ColorType.js +29 -0
- package/lib/commonjs/skia/types/Image/ColorType.js.map +1 -0
- package/lib/commonjs/skia/types/Image/ColorType.web.d.ts +19 -0
- package/lib/commonjs/skia/types/Image/ColorType.web.js +27 -0
- package/lib/commonjs/skia/types/Image/ColorType.web.js.map +1 -0
- package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +1 -19
- package/lib/commonjs/skia/types/Image/ImageFactory.js +1 -21
- package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Image/index.d.ts +1 -0
- package/lib/commonjs/skia/types/Image/index.js +11 -0
- package/lib/commonjs/skia/types/Image/index.js.map +1 -1
- package/lib/commonjs/specs/SkiaDomViewNativeComponent.d.ts +0 -1
- package/lib/commonjs/specs/SkiaDomViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.js +3 -1
- package/lib/commonjs/views/SkiaDomView.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.js +5 -1
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/skia/types/Image/ColorType.d.ts +21 -0
- package/lib/module/skia/types/Image/ColorType.js +23 -0
- package/lib/module/skia/types/Image/ColorType.js.map +1 -0
- package/lib/module/skia/types/Image/ColorType.web.d.ts +19 -0
- package/lib/module/skia/types/Image/ColorType.web.js +21 -0
- package/lib/module/skia/types/Image/ColorType.web.js.map +1 -0
- package/lib/module/skia/types/Image/ImageFactory.d.ts +1 -19
- package/lib/module/skia/types/Image/ImageFactory.js +0 -20
- package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
- package/lib/module/skia/types/Image/index.d.ts +1 -0
- package/lib/module/skia/types/Image/index.js +1 -0
- package/lib/module/skia/types/Image/index.js.map +1 -1
- package/lib/module/specs/SkiaDomViewNativeComponent.d.ts +0 -1
- package/lib/module/specs/SkiaDomViewNativeComponent.js.map +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/module/views/SkiaDomView.js +3 -1
- package/lib/module/views/SkiaDomView.js.map +1 -1
- package/lib/module/views/SkiaPictureView.js +5 -1
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/lib/commonjs/skia/types/Image/ColorType.d.ts +2 -0
- package/lib/typescript/lib/commonjs/skia/types/Image/ColorType.web.d.ts +2 -0
- package/lib/typescript/lib/commonjs/skia/types/Image/ImageFactory.d.ts +0 -1
- package/lib/typescript/lib/module/skia/types/Image/ColorType.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Image/ColorType.web.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Image/ImageFactory.d.ts +0 -1
- package/lib/typescript/lib/module/skia/types/Image/index.d.ts +1 -0
- package/lib/typescript/src/skia/types/Image/ColorType.d.ts +21 -0
- package/lib/typescript/src/skia/types/Image/ColorType.web.d.ts +19 -0
- package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +1 -19
- package/lib/typescript/src/skia/types/Image/index.d.ts +1 -0
- package/lib/typescript/src/specs/SkiaDomViewNativeComponent.d.ts +0 -1
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
- package/lib/typescript/src/views/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/skia/__tests__/Enums.spec.ts +2 -2
- package/src/skia/types/Image/ColorType.ts +21 -0
- package/src/skia/types/Image/ColorType.web.ts +19 -0
- package/src/skia/types/Image/ImageFactory.ts +1 -20
- package/src/skia/types/Image/index.ts +1 -0
- package/src/specs/SkiaDomViewNativeComponent.ts +0 -1
- package/src/specs/SkiaPictureViewNativeComponent.ts +1 -0
- package/src/views/SkiaDomView.tsx +2 -1
- package/src/views/SkiaPictureView.tsx +4 -1
- package/src/views/types.ts +3 -0
@@ -0,0 +1 @@
|
|
1
|
+
export let ColorType: {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export let ColorTypeCanvasKit: {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export declare enum ColorType {
|
2
|
+
Unknown = 0,// uninitialized
|
3
|
+
Alpha_8 = 1,// pixel with alpha in 8-bit byte
|
4
|
+
RGB_565 = 2,// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
5
|
+
ARGB_4444 = 3,// pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
6
|
+
RGBA_8888 = 4,// pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
7
|
+
RGB_888x = 5,// pixel with 8 bits each for red, green, blue; in 32-bit word
|
8
|
+
BGRA_8888 = 6,// pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
9
|
+
RGBA_1010102 = 7,// 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
10
|
+
BGRA_1010102 = 8,// 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
11
|
+
RGB_101010x = 9,// pixel with 10 bits each for red, green, blue; in 32-bit word
|
12
|
+
BGR_101010x = 10,// pixel with 10 bits each for blue, green, red; in 32-bit word
|
13
|
+
BGR_101010x_XR = 11,// pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
14
|
+
BGRA_10101010_XR = 12,// pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range
|
15
|
+
RGBA_10x6 = 13,// pixel with 10 used bits (most significant) followed by 6 unused
|
16
|
+
Gray_8 = 14,// pixel with grayscale level in 8-bit byte
|
17
|
+
RGBA_F16Norm = 15,// pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
18
|
+
RGBA_F16 = 16,// pixel with half floats for red, green, blue, alpha; in 64-bit word
|
19
|
+
RGB_F16F16F16x = 17,// pixel with half floats for red, green, blue; in 64-bit word
|
20
|
+
RGBA_F32 = 18
|
21
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export declare enum ColorTypeCanvasKit {
|
2
|
+
Unknown = 0,// uninitialized
|
3
|
+
Alpha_8 = 1,// pixel with alpha in 8-bit byte
|
4
|
+
RGB_565 = 2,// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
5
|
+
ARGB_4444 = 3,// pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
6
|
+
RGBA_8888 = 4,// pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
7
|
+
RGB_888x = 5,// pixel with 8 bits each for red, green, blue; in 32-bit word
|
8
|
+
BGRA_8888 = 6,// pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
9
|
+
RGBA_1010102 = 7,// 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
10
|
+
BGRA_1010102 = 8,// 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
11
|
+
RGB_101010x = 9,// pixel with 10 bits each for red, green, blue; in 32-bit word
|
12
|
+
BGR_101010x = 10,// pixel with 10 bits each for blue, green, red; in 32-bit word
|
13
|
+
BGR_101010x_XR = 11,// pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
14
|
+
RGBA_10x6 = 12,// pixel with 10 used bits (most significant) followed by 6 unused
|
15
|
+
Gray_8 = 13,// pixel with grayscale level in 8-bit byte
|
16
|
+
RGBA_F16Norm = 14,// pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
17
|
+
RGBA_F16 = 15,// pixel with half floats for red, green, blue, alpha; in 64-bit word
|
18
|
+
RGBA_F32 = 16
|
19
|
+
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { SkData } from "../Data";
|
2
2
|
import type { NativeBuffer } from "../NativeBuffer";
|
3
|
+
import type { ColorType } from "./ColorType";
|
3
4
|
import type { SkImage } from "./Image";
|
4
5
|
export declare enum AlphaType {
|
5
6
|
Unknown = 0,
|
@@ -7,25 +8,6 @@ export declare enum AlphaType {
|
|
7
8
|
Premul = 2,
|
8
9
|
Unpremul = 3
|
9
10
|
}
|
10
|
-
export declare enum ColorType {
|
11
|
-
Unknown = 0,// uninitialized
|
12
|
-
Alpha_8 = 1,// pixel with alpha in 8-bit byte
|
13
|
-
RGB_565 = 2,// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
14
|
-
ARGB_4444 = 3,// pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
15
|
-
RGBA_8888 = 4,// pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
16
|
-
RGB_888x = 5,// pixel with 8 bits each for red, green, blue; in 32-bit word
|
17
|
-
BGRA_8888 = 6,// pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
18
|
-
RGBA_1010102 = 7,// 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
19
|
-
BGRA_1010102 = 8,// 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
20
|
-
RGB_101010x = 9,// pixel with 10 bits each for red, green, blue; in 32-bit word
|
21
|
-
BGR_101010x = 10,// pixel with 10 bits each for blue, green, red; in 32-bit word
|
22
|
-
BGR_101010x_XR = 11,// pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
23
|
-
RGBA_10x6 = 12,// pixel with 10 used bits (most significant) followed by 6 unused
|
24
|
-
Gray_8 = 13,// pixel with grayscale level in 8-bit byte
|
25
|
-
RGBA_F16Norm = 14,// pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
26
|
-
RGBA_F16 = 15,// pixel with half floats for red, green, blue, alpha; in 64-bit word
|
27
|
-
RGBA_F32 = 16
|
28
|
-
}
|
29
11
|
export interface ImageInfo {
|
30
12
|
alphaType: AlphaType;
|
31
13
|
colorType: ColorType;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ViewProps } from "react-native";
|
2
2
|
export interface NativeProps extends ViewProps {
|
3
3
|
debug?: boolean;
|
4
|
+
opaque?: boolean;
|
4
5
|
}
|
5
6
|
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
6
7
|
export default _default;
|
@@ -4,6 +4,7 @@ import type { SkImage, SkPicture, SkRect, SkSize } from "../skia/types";
|
|
4
4
|
import type { SharedValueType } from "../renderer/processors/Animations/Animations";
|
5
5
|
export type NativeSkiaViewProps = ViewProps & {
|
6
6
|
debug?: boolean;
|
7
|
+
opaque?: boolean;
|
7
8
|
};
|
8
9
|
export interface DrawingInfo {
|
9
10
|
width: number;
|
@@ -27,6 +28,7 @@ export interface SkiaBaseViewProps extends ViewProps {
|
|
27
28
|
* the Skia view is resized.
|
28
29
|
*/
|
29
30
|
onSize?: SharedValueType<SkSize>;
|
31
|
+
opaque?: boolean;
|
30
32
|
}
|
31
33
|
export interface SkiaPictureViewNativeProps extends SkiaBaseViewProps {
|
32
34
|
picture?: SkPicture;
|
package/package.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
"setup-skia-web": "./scripts/setup-canvaskit.js"
|
8
8
|
},
|
9
9
|
"title": "React Native Skia",
|
10
|
-
"version": "1.
|
10
|
+
"version": "1.6.0",
|
11
11
|
"description": "High-performance React Native Graphics using Skia",
|
12
12
|
"main": "lib/module/index.js",
|
13
13
|
"react-native": "src/index.ts",
|
@@ -4,7 +4,6 @@ import {
|
|
4
4
|
AlphaType,
|
5
5
|
BlurStyle,
|
6
6
|
ClipOp,
|
7
|
-
ColorType,
|
8
7
|
FillType,
|
9
8
|
FilterMode,
|
10
9
|
FontEdging,
|
@@ -27,6 +26,7 @@ import {
|
|
27
26
|
import { Path1DEffectStyle } from "../types/PathEffect";
|
28
27
|
import { BlendMode } from "../types/Paint/BlendMode";
|
29
28
|
import { mapKeys } from "../../renderer/typeddash";
|
29
|
+
import { ColorTypeCanvasKit } from "../types/Image/ColorType.web";
|
30
30
|
|
31
31
|
import { setupSkia } from "./setup";
|
32
32
|
|
@@ -71,7 +71,7 @@ describe("Enums", () => {
|
|
71
71
|
});
|
72
72
|
it("Should match Image enums values with CanvasKit", () => {
|
73
73
|
const { CanvasKit } = setupSkia();
|
74
|
-
checkEnum(
|
74
|
+
checkEnum(ColorTypeCanvasKit, CanvasKit.ColorType);
|
75
75
|
checkEnum(AlphaType, CanvasKit.AlphaType);
|
76
76
|
checkEnum(ImageFormat, CanvasKit.ImageFormat);
|
77
77
|
checkEnum(MipmapMode, CanvasKit.MipmapMode);
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export enum ColorType {
|
2
|
+
Unknown, // uninitialized
|
3
|
+
Alpha_8, // pixel with alpha in 8-bit byte
|
4
|
+
RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
5
|
+
ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
6
|
+
RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
7
|
+
RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word
|
8
|
+
BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
9
|
+
RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
10
|
+
BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
11
|
+
RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word
|
12
|
+
BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word
|
13
|
+
BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
14
|
+
BGRA_10101010_XR, // pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range
|
15
|
+
RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused
|
16
|
+
Gray_8, // pixel with grayscale level in 8-bit byte
|
17
|
+
RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
18
|
+
RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word
|
19
|
+
RGB_F16F16F16x, // pixel with half floats for red, green, blue; in 64-bit word
|
20
|
+
RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word
|
21
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export enum ColorTypeCanvasKit {
|
2
|
+
Unknown, // uninitialized
|
3
|
+
Alpha_8, // pixel with alpha in 8-bit byte
|
4
|
+
RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
5
|
+
ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
6
|
+
RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
7
|
+
RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word
|
8
|
+
BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
9
|
+
RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
10
|
+
BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
11
|
+
RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word
|
12
|
+
BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word
|
13
|
+
BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
14
|
+
RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused
|
15
|
+
Gray_8, // pixel with grayscale level in 8-bit byte
|
16
|
+
RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
17
|
+
RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word
|
18
|
+
RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word
|
19
|
+
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { SkData } from "../Data";
|
2
2
|
import type { NativeBuffer } from "../NativeBuffer";
|
3
3
|
|
4
|
+
import type { ColorType } from "./ColorType";
|
4
5
|
import type { SkImage } from "./Image";
|
5
6
|
|
6
7
|
export enum AlphaType {
|
@@ -10,26 +11,6 @@ export enum AlphaType {
|
|
10
11
|
Unpremul,
|
11
12
|
}
|
12
13
|
|
13
|
-
export enum ColorType {
|
14
|
-
Unknown, // uninitialized
|
15
|
-
Alpha_8, // pixel with alpha in 8-bit byte
|
16
|
-
RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
17
|
-
ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
18
|
-
RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
19
|
-
RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word
|
20
|
-
BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
21
|
-
RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
22
|
-
BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
23
|
-
RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word
|
24
|
-
BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word
|
25
|
-
BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
26
|
-
RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused
|
27
|
-
Gray_8, // pixel with grayscale level in 8-bit byte
|
28
|
-
RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
29
|
-
RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word
|
30
|
-
RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word
|
31
|
-
}
|
32
|
-
|
33
14
|
export interface ImageInfo {
|
34
15
|
alphaType: AlphaType;
|
35
16
|
// TODO: add support for color space
|
@@ -97,12 +97,13 @@ export class SkiaDomView extends React.Component<SkiaDomViewProps> {
|
|
97
97
|
}
|
98
98
|
|
99
99
|
render() {
|
100
|
-
const { debug = false, ...viewProps } = this.props;
|
100
|
+
const { debug = false, opaque = false, ...viewProps } = this.props;
|
101
101
|
return (
|
102
102
|
<NativeSkiaDomView
|
103
103
|
collapsable={false}
|
104
104
|
nativeID={`${this._nativeId}`}
|
105
105
|
debug={debug}
|
106
|
+
opaque={opaque}
|
106
107
|
{...viewProps}
|
107
108
|
/>
|
108
109
|
);
|
@@ -38,6 +38,7 @@ export class SkiaPictureView extends React.Component<SkiaPictureViewProps> {
|
|
38
38
|
}
|
39
39
|
|
40
40
|
componentDidUpdate(prevProps: SkiaPictureViewProps) {
|
41
|
+
console.log("componentDidUpdate");
|
41
42
|
const { picture, onSize } = this.props;
|
42
43
|
if (picture !== prevProps.picture) {
|
43
44
|
assertSkiaViewApi();
|
@@ -78,16 +79,18 @@ export class SkiaPictureView extends React.Component<SkiaPictureViewProps> {
|
|
78
79
|
*/
|
79
80
|
public redraw() {
|
80
81
|
assertSkiaViewApi();
|
82
|
+
console.log("Request redraw: ", this._nativeId);
|
81
83
|
SkiaViewApi.requestRedraw(this._nativeId);
|
82
84
|
}
|
83
85
|
|
84
86
|
render() {
|
85
|
-
const { mode, debug = false, ...viewProps } = this.props;
|
87
|
+
const { mode, debug = false, opaque = false, ...viewProps } = this.props;
|
86
88
|
return (
|
87
89
|
<NativeSkiaPictureView
|
88
90
|
collapsable={false}
|
89
91
|
nativeID={`${this._nativeId}`}
|
90
92
|
debug={debug}
|
93
|
+
opaque={opaque}
|
91
94
|
{...viewProps}
|
92
95
|
/>
|
93
96
|
);
|
package/src/views/types.ts
CHANGED
@@ -6,6 +6,7 @@ import type { SharedValueType } from "../renderer/processors/Animations/Animatio
|
|
6
6
|
|
7
7
|
export type NativeSkiaViewProps = ViewProps & {
|
8
8
|
debug?: boolean;
|
9
|
+
opaque?: boolean;
|
9
10
|
};
|
10
11
|
|
11
12
|
export interface DrawingInfo {
|
@@ -32,6 +33,8 @@ export interface SkiaBaseViewProps extends ViewProps {
|
|
32
33
|
* the Skia view is resized.
|
33
34
|
*/
|
34
35
|
onSize?: SharedValueType<SkSize>;
|
36
|
+
|
37
|
+
opaque?: boolean;
|
35
38
|
}
|
36
39
|
|
37
40
|
export interface SkiaPictureViewNativeProps extends SkiaBaseViewProps {
|