@shopify/react-native-skia 1.12.1 → 1.12.3

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 (140) hide show
  1. package/apple/MetalContext.h +129 -0
  2. package/apple/MetalContext.mm +34 -0
  3. package/apple/MetalWindowContext.h +39 -0
  4. package/apple/MetalWindowContext.mm +64 -0
  5. package/apple/RNSkApplePlatformContext.h +79 -0
  6. package/apple/RNSkApplePlatformContext.mm +303 -0
  7. package/apple/RNSkAppleVideo.h +51 -0
  8. package/apple/RNSkAppleVideo.mm +137 -0
  9. package/apple/RNSkAppleView.h +37 -0
  10. package/apple/RNSkAppleView.mm +35 -0
  11. package/apple/RNSkMetalCanvasProvider.h +38 -0
  12. package/apple/RNSkMetalCanvasProvider.mm +108 -0
  13. package/apple/RNSkiaModule.h +20 -0
  14. package/apple/RNSkiaModule.mm +55 -0
  15. package/apple/SkiaCVPixelBufferUtils.h +119 -0
  16. package/apple/SkiaCVPixelBufferUtils.mm +344 -0
  17. package/apple/SkiaManager.h +25 -0
  18. package/apple/SkiaManager.mm +62 -0
  19. package/apple/SkiaPictureView.h +7 -0
  20. package/apple/SkiaPictureView.mm +66 -0
  21. package/apple/SkiaPictureViewManager.h +8 -0
  22. package/apple/SkiaPictureViewManager.mm +55 -0
  23. package/apple/SkiaUIView.h +45 -0
  24. package/apple/SkiaUIView.mm +172 -0
  25. package/apple/ViewScreenshotService.h +25 -0
  26. package/apple/ViewScreenshotService.mm +89 -0
  27. package/cpp/api/JsiSkShaderFactory.h +43 -8
  28. package/cpp/api/JsiSkVertices.h +14 -3
  29. package/lib/commonjs/__tests__/setup.d.ts +18 -0
  30. package/lib/commonjs/headless/index.d.ts +1 -0
  31. package/lib/commonjs/headless/index.js +12 -0
  32. package/lib/commonjs/headless/index.js.map +1 -1
  33. package/lib/commonjs/skia/web/Host.d.ts +3 -3
  34. package/lib/commonjs/skia/web/Host.js +16 -4
  35. package/lib/commonjs/skia/web/Host.js.map +1 -1
  36. package/lib/commonjs/skia/web/JsiSkCanvas.js +15 -15
  37. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  38. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
  39. package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  40. package/lib/commonjs/skia/web/JsiSkFont.js +2 -2
  41. package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
  42. package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
  43. package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
  44. package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
  45. package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
  46. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +3 -3
  47. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  48. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
  49. package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  50. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
  51. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  52. package/lib/commonjs/skia/web/JsiSkPath.js +4 -4
  53. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  54. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +1 -1
  55. package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  56. package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
  57. package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
  58. package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
  59. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  60. package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
  61. package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
  62. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +1 -1
  63. package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
  64. package/lib/module/__tests__/setup.d.ts +18 -0
  65. package/lib/module/headless/index.d.ts +1 -0
  66. package/lib/module/headless/index.js +1 -0
  67. package/lib/module/headless/index.js.map +1 -1
  68. package/lib/module/skia/web/Host.d.ts +3 -3
  69. package/lib/module/skia/web/Host.js +16 -4
  70. package/lib/module/skia/web/Host.js.map +1 -1
  71. package/lib/module/skia/web/JsiSkCanvas.js +15 -15
  72. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  73. package/lib/module/skia/web/JsiSkColorFilterFactory.js +1 -1
  74. package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
  75. package/lib/module/skia/web/JsiSkFont.js +2 -2
  76. package/lib/module/skia/web/JsiSkFont.js.map +1 -1
  77. package/lib/module/skia/web/JsiSkImage.js +6 -6
  78. package/lib/module/skia/web/JsiSkImage.js.map +1 -1
  79. package/lib/module/skia/web/JsiSkImageFactory.js +2 -2
  80. package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
  81. package/lib/module/skia/web/JsiSkImageFilterFactory.js +3 -3
  82. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  83. package/lib/module/skia/web/JsiSkMaskFilterFactory.js +1 -1
  84. package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
  85. package/lib/module/skia/web/JsiSkPaint.js +3 -3
  86. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  87. package/lib/module/skia/web/JsiSkPath.js +4 -4
  88. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  89. package/lib/module/skia/web/JsiSkPathEffectFactory.js +1 -1
  90. package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
  91. package/lib/module/skia/web/JsiSkPathFactory.js +1 -1
  92. package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
  93. package/lib/module/skia/web/JsiSkPicture.js +1 -1
  94. package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
  95. package/lib/module/skia/web/JsiSkShaderFactory.js +5 -5
  96. package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
  97. package/lib/module/skia/web/JsiSkVerticesFactory.js +1 -1
  98. package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
  99. package/lib/typescript/lib/commonjs/mock/index.d.ts +1 -1
  100. package/lib/typescript/lib/commonjs/skia/index.d.ts +1 -1
  101. package/lib/typescript/lib/commonjs/skia/web/Host.d.ts +2 -2
  102. package/lib/typescript/lib/module/headless/index.d.ts +1 -0
  103. package/lib/typescript/lib/module/mock/index.d.ts +1 -1
  104. package/lib/typescript/lib/module/skia/Skia.d.ts +1 -1
  105. package/lib/typescript/lib/module/skia/web/Host.d.ts +2 -2
  106. package/lib/typescript/src/__tests__/setup.d.ts +18 -0
  107. package/lib/typescript/src/headless/index.d.ts +1 -0
  108. package/lib/typescript/src/skia/web/Host.d.ts +3 -3
  109. package/package.json +4 -4
  110. package/src/__tests__/setup.ts +67 -1
  111. package/src/headless/index.ts +2 -1
  112. package/src/renderer/__tests__/e2e/Matrix4.spec.tsx +1 -2
  113. package/src/renderer/__tests__/e2e/Paths.spec.tsx +13 -11
  114. package/src/skia/__tests__/Enums.spec.ts +24 -2
  115. package/src/skia/__tests__/Path.spec.ts +2 -2
  116. package/src/skia/web/Host.ts +24 -7
  117. package/src/skia/web/JsiSkCanvas.ts +17 -17
  118. package/src/skia/web/JsiSkColorFilterFactory.ts +1 -1
  119. package/src/skia/web/JsiSkFont.ts +2 -2
  120. package/src/skia/web/JsiSkImage.ts +14 -10
  121. package/src/skia/web/JsiSkImageFactory.ts +2 -2
  122. package/src/skia/web/JsiSkImageFilterFactory.ts +4 -4
  123. package/src/skia/web/JsiSkMaskFilterFactory.ts +1 -1
  124. package/src/skia/web/JsiSkPaint.ts +3 -3
  125. package/src/skia/web/JsiSkPath.ts +4 -4
  126. package/src/skia/web/JsiSkPathEffectFactory.ts +1 -1
  127. package/src/skia/web/JsiSkPathFactory.ts +1 -1
  128. package/src/skia/web/JsiSkPicture.ts +3 -3
  129. package/src/skia/web/JsiSkShaderFactory.ts +5 -5
  130. package/src/skia/web/JsiSkVerticesFactory.ts +1 -1
  131. package/lib/commonjs/skia/types/Image/ColorType.web.d.ts +0 -19
  132. package/lib/commonjs/skia/types/Image/ColorType.web.js +0 -43
  133. package/lib/commonjs/skia/types/Image/ColorType.web.js.map +0 -1
  134. package/lib/module/skia/types/Image/ColorType.web.d.ts +0 -19
  135. package/lib/module/skia/types/Image/ColorType.web.js +0 -37
  136. package/lib/module/skia/types/Image/ColorType.web.js.map +0 -1
  137. package/lib/typescript/lib/commonjs/skia/types/Image/ColorType.web.d.ts +0 -2
  138. package/lib/typescript/lib/module/skia/types/Image/ColorType.web.d.ts +0 -1
  139. package/lib/typescript/src/skia/types/Image/ColorType.web.d.ts +0 -19
  140. package/src/skia/types/Image/ColorType.web.ts +0 -19
@@ -1,37 +0,0 @@
1
- export let ColorTypeCanvasKit = /*#__PURE__*/function (ColorTypeCanvasKit) {
2
- ColorTypeCanvasKit[ColorTypeCanvasKit["Unknown"] = 0] = "Unknown";
3
- // uninitialized
4
- ColorTypeCanvasKit[ColorTypeCanvasKit["Alpha_8"] = 1] = "Alpha_8";
5
- // pixel with alpha in 8-bit byte
6
- ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_565"] = 2] = "RGB_565";
7
- // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
8
- ColorTypeCanvasKit[ColorTypeCanvasKit["ARGB_4444"] = 3] = "ARGB_4444";
9
- // pixel with 4 bits for alpha, red, green, blue; in 16-bit word
10
- ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_8888"] = 4] = "RGBA_8888";
11
- // pixel with 8 bits for red, green, blue, alpha; in 32-bit word
12
- ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_888x"] = 5] = "RGB_888x";
13
- // pixel with 8 bits each for red, green, blue; in 32-bit word
14
- ColorTypeCanvasKit[ColorTypeCanvasKit["BGRA_8888"] = 6] = "BGRA_8888";
15
- // pixel with 8 bits for blue, green, red, alpha; in 32-bit word
16
- ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_1010102"] = 7] = "RGBA_1010102";
17
- // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
18
- ColorTypeCanvasKit[ColorTypeCanvasKit["BGRA_1010102"] = 8] = "BGRA_1010102";
19
- // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
20
- ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_101010x"] = 9] = "RGB_101010x";
21
- // pixel with 10 bits each for red, green, blue; in 32-bit word
22
- ColorTypeCanvasKit[ColorTypeCanvasKit["BGR_101010x"] = 10] = "BGR_101010x";
23
- // pixel with 10 bits each for blue, green, red; in 32-bit word
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
26
- ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_10x6"] = 12] = "RGBA_10x6";
27
- // pixel with 10 used bits (most significant) followed by 6 unused
28
- ColorTypeCanvasKit[ColorTypeCanvasKit["Gray_8"] = 13] = "Gray_8";
29
- // pixel with grayscale level in 8-bit byte
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
32
- ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F16"] = 15] = "RGBA_F16";
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
35
- return ColorTypeCanvasKit;
36
- }({});
37
- //# sourceMappingURL=ColorType.web.js.map
@@ -1 +0,0 @@
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,2 +0,0 @@
1
- export const __esModule: boolean;
2
- export const ColorTypeCanvasKit: {};
@@ -1 +0,0 @@
1
- export let ColorTypeCanvasKit: {};
@@ -1,19 +0,0 @@
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,19 +0,0 @@
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
- }