@shopify/react-native-skia 1.5.9 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/android/cpp/jni/include/JniSkiaBaseView.h +6 -4
  2. package/android/cpp/jni/include/JniSkiaDomView.h +6 -4
  3. package/android/cpp/jni/include/JniSkiaPictureView.h +6 -4
  4. package/android/cpp/rnskia-android/MainThreadDispatcher.h +5 -0
  5. package/android/cpp/rnskia-android/OpenGLContext.h +37 -10
  6. package/android/cpp/rnskia-android/OpenGLWindowContext.cpp +0 -1
  7. package/android/cpp/rnskia-android/RNSkAndroidView.h +10 -9
  8. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +42 -36
  9. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +2 -2
  10. package/android/src/main/java/com/shopify/reactnative/skia/SkiaAHBView.java +113 -0
  11. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +45 -54
  12. package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseViewManager.java +5 -0
  13. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomView.java +2 -2
  14. package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +2 -2
  15. package/android/src/main/java/com/shopify/reactnative/skia/SkiaSurfaceView.java +42 -0
  16. package/android/src/main/java/com/shopify/reactnative/skia/SkiaTextureView.java +90 -0
  17. package/android/src/main/java/com/shopify/reactnative/skia/SkiaViewAPI.java +16 -0
  18. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerDelegate.java +3 -0
  19. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaDomViewManagerInterface.java +1 -0
  20. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerDelegate.java +3 -1
  21. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerInterface.java +1 -0
  22. package/cpp/rnskia/RNSkDomView.cpp +0 -20
  23. package/cpp/rnskia/RNSkDomView.h +0 -2
  24. package/cpp/rnskia/RNSkPictureView.h +5 -12
  25. package/cpp/rnskia/RNSkPlatformContext.h +1 -2
  26. package/cpp/rnskia/RNSkView.h +13 -24
  27. package/ios/RNSkia-iOS/SkiaCVPixelBufferUtils.mm +4 -8
  28. package/ios/RNSkia-iOS/SkiaDomViewManager.mm +5 -0
  29. package/ios/RNSkia-iOS/SkiaPictureView.mm +1 -0
  30. package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +5 -0
  31. package/ios/RNSkia-iOS/SkiaUIView.h +1 -0
  32. package/ios/RNSkia-iOS/SkiaUIView.mm +5 -0
  33. package/lib/commonjs/skia/types/Image/ColorType.d.ts +21 -0
  34. package/lib/commonjs/skia/types/Image/ColorType.js +29 -0
  35. package/lib/commonjs/skia/types/Image/ColorType.js.map +1 -0
  36. package/lib/commonjs/skia/types/Image/ColorType.web.d.ts +19 -0
  37. package/lib/commonjs/skia/types/Image/ColorType.web.js +27 -0
  38. package/lib/commonjs/skia/types/Image/ColorType.web.js.map +1 -0
  39. package/lib/commonjs/skia/types/Image/ImageFactory.d.ts +1 -19
  40. package/lib/commonjs/skia/types/Image/ImageFactory.js +1 -21
  41. package/lib/commonjs/skia/types/Image/ImageFactory.js.map +1 -1
  42. package/lib/commonjs/skia/types/Image/index.d.ts +1 -0
  43. package/lib/commonjs/skia/types/Image/index.js +11 -0
  44. package/lib/commonjs/skia/types/Image/index.js.map +1 -1
  45. package/lib/commonjs/specs/SkiaDomViewNativeComponent.d.ts +0 -1
  46. package/lib/commonjs/specs/SkiaDomViewNativeComponent.js.map +1 -1
  47. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
  48. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -1
  49. package/lib/commonjs/views/SkiaDomView.js +3 -1
  50. package/lib/commonjs/views/SkiaDomView.js.map +1 -1
  51. package/lib/commonjs/views/SkiaPictureView.js +5 -1
  52. package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
  53. package/lib/commonjs/views/types.d.ts +2 -0
  54. package/lib/commonjs/views/types.js.map +1 -1
  55. package/lib/module/skia/types/Image/ColorType.d.ts +21 -0
  56. package/lib/module/skia/types/Image/ColorType.js +23 -0
  57. package/lib/module/skia/types/Image/ColorType.js.map +1 -0
  58. package/lib/module/skia/types/Image/ColorType.web.d.ts +19 -0
  59. package/lib/module/skia/types/Image/ColorType.web.js +21 -0
  60. package/lib/module/skia/types/Image/ColorType.web.js.map +1 -0
  61. package/lib/module/skia/types/Image/ImageFactory.d.ts +1 -19
  62. package/lib/module/skia/types/Image/ImageFactory.js +0 -20
  63. package/lib/module/skia/types/Image/ImageFactory.js.map +1 -1
  64. package/lib/module/skia/types/Image/index.d.ts +1 -0
  65. package/lib/module/skia/types/Image/index.js +1 -0
  66. package/lib/module/skia/types/Image/index.js.map +1 -1
  67. package/lib/module/specs/SkiaDomViewNativeComponent.d.ts +0 -1
  68. package/lib/module/specs/SkiaDomViewNativeComponent.js.map +1 -1
  69. package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
  70. package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -1
  71. package/lib/module/views/SkiaDomView.js +3 -1
  72. package/lib/module/views/SkiaDomView.js.map +1 -1
  73. package/lib/module/views/SkiaPictureView.js +5 -1
  74. package/lib/module/views/SkiaPictureView.js.map +1 -1
  75. package/lib/module/views/types.d.ts +2 -0
  76. package/lib/module/views/types.js.map +1 -1
  77. package/lib/typescript/lib/commonjs/skia/types/Image/ColorType.d.ts +2 -0
  78. package/lib/typescript/lib/commonjs/skia/types/Image/ColorType.web.d.ts +2 -0
  79. package/lib/typescript/lib/commonjs/skia/types/Image/ImageFactory.d.ts +0 -1
  80. package/lib/typescript/lib/module/skia/types/Image/ColorType.d.ts +1 -0
  81. package/lib/typescript/lib/module/skia/types/Image/ColorType.web.d.ts +1 -0
  82. package/lib/typescript/lib/module/skia/types/Image/ImageFactory.d.ts +0 -1
  83. package/lib/typescript/lib/module/skia/types/Image/index.d.ts +1 -0
  84. package/lib/typescript/src/skia/types/Image/ColorType.d.ts +21 -0
  85. package/lib/typescript/src/skia/types/Image/ColorType.web.d.ts +19 -0
  86. package/lib/typescript/src/skia/types/Image/ImageFactory.d.ts +1 -19
  87. package/lib/typescript/src/skia/types/Image/index.d.ts +1 -0
  88. package/lib/typescript/src/specs/SkiaDomViewNativeComponent.d.ts +0 -1
  89. package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
  90. package/lib/typescript/src/views/types.d.ts +2 -0
  91. package/package.json +1 -1
  92. package/src/skia/__tests__/Enums.spec.ts +2 -2
  93. package/src/skia/types/Image/ColorType.ts +21 -0
  94. package/src/skia/types/Image/ColorType.web.ts +19 -0
  95. package/src/skia/types/Image/ImageFactory.ts +1 -20
  96. package/src/skia/types/Image/index.ts +1 -0
  97. package/src/specs/SkiaDomViewNativeComponent.ts +0 -1
  98. package/src/specs/SkiaPictureViewNativeComponent.ts +1 -0
  99. package/src/views/SkiaDomView.tsx +2 -1
  100. package/src/views/SkiaPictureView.tsx +4 -1
  101. package/src/views/types.ts +3 -0
@@ -0,0 +1,2 @@
1
+ export const __esModule: boolean;
2
+ export const ColorType: {};
@@ -0,0 +1,2 @@
1
+ export const __esModule: boolean;
2
+ export const ColorTypeCanvasKit: {};
@@ -1,3 +1,2 @@
1
1
  export const __esModule: boolean;
2
2
  export const AlphaType: {};
3
- export const ColorType: {};
@@ -0,0 +1 @@
1
+ export let ColorType: {};
@@ -0,0 +1 @@
1
+ export let ColorTypeCanvasKit: {};
@@ -1,2 +1 @@
1
1
  export let AlphaType: {};
2
- export let ColorType: {};
@@ -1,2 +1,3 @@
1
1
  export * from "./Image";
2
2
  export * from "./ImageFactory";
3
+ export * from "./ColorType";
@@ -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,2 +1,3 @@
1
1
  export * from "./Image";
2
2
  export * from "./ImageFactory";
3
+ export * from "./ColorType";
@@ -1,6 +1,5 @@
1
1
  import type { ViewProps } from "react-native";
2
2
  export interface NativeProps extends ViewProps {
3
- mode: string;
4
3
  debug?: boolean;
5
4
  }
6
5
  declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
@@ -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.5.9",
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(ColorType, CanvasKit.ColorType);
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
@@ -1,2 +1,3 @@
1
1
  export * from "./Image";
2
2
  export * from "./ImageFactory";
3
+ export * from "./ColorType";
@@ -2,7 +2,6 @@ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNati
2
2
  import type { ViewProps } from "react-native";
3
3
 
4
4
  export interface NativeProps extends ViewProps {
5
- mode: string;
6
5
  debug?: boolean;
7
6
  }
8
7
 
@@ -3,6 +3,7 @@ import type { ViewProps } from "react-native";
3
3
 
4
4
  export interface NativeProps extends ViewProps {
5
5
  debug?: boolean;
6
+ opaque?: boolean;
6
7
  }
7
8
 
8
9
  // eslint-disable-next-line import/no-default-export
@@ -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
  );
@@ -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 {