@shopify/react-native-skia 2.1.1 → 2.2.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.
- package/android/CMakeLists.txt +1 -1
- package/android/cpp/rnskia-android/OpenGLWindowContext.h +1 -1
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +1 -1
- package/android/cpp/rnskia-android/RNSkAndroidVideo.cpp +1 -1
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +1 -1
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +1 -1
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureViewManager.java +6 -0
- package/apple/MetalContext.h +2 -2
- package/apple/MetalWindowContext.h +2 -2
- package/apple/MetalWindowContext.mm +7 -4
- package/apple/RNSkApplePlatformContext.mm +1 -1
- package/apple/RNSkAppleView.h +7 -1
- package/apple/RNSkMetalCanvasProvider.h +4 -1
- package/apple/RNSkMetalCanvasProvider.mm +9 -4
- package/apple/SkiaPictureView.mm +4 -0
- package/apple/SkiaUIView.h +1 -0
- package/apple/SkiaUIView.mm +9 -0
- package/cpp/api/JsiSkImage.h +1 -1
- package/cpp/api/JsiSkSurface.h +1 -1
- package/cpp/api/JsiSkiaContext.h +1 -1
- package/cpp/api/recorder/ImageFilters.h +3 -3
- package/cpp/api/recorder/Paint.h +4 -0
- package/cpp/rnskia/{DawnContext.h → RNDawnContext.h} +3 -3
- package/cpp/rnskia/{DawnWindowContext.cpp → RNDawnWindowContext.cpp} +3 -3
- package/cpp/rnskia/{DawnWindowContext.h → RNDawnWindowContext.h} +2 -2
- package/cpp/rnskia/RNSkPlatformContext.h +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +2 -1
- package/lib/commonjs/renderer/Canvas.js +2 -0
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/components/ImageFilter.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +4 -0
- package/lib/commonjs/skia/types/Matrix4.js +18 -1
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Player.js +9 -3
- package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +2 -2
- package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +2 -1
- package/lib/module/renderer/Canvas.js +2 -0
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/components/ImageFilter.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +4 -0
- package/lib/module/skia/types/Matrix4.js +16 -0
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/sksg/Recorder/Player.js +9 -3
- package/lib/module/sksg/Recorder/Player.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/ImageFilters.js +2 -2
- package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +2 -1
- package/lib/typescript/lib/commonjs/skia/types/Matrix4.d.ts +1 -0
- package/lib/typescript/lib/module/mock/index.d.ts +1 -0
- package/lib/typescript/lib/module/renderer/Canvas.d.ts +2 -1
- package/lib/typescript/lib/module/skia/types/Matrix4.d.ts +1 -0
- package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +2 -1
- package/lib/typescript/src/skia/types/Matrix4.d.ts +4 -0
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +1 -0
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/apple/libpathops.xcframework/Info.plist +15 -15
- package/libs/apple/libskia.xcframework/Info.plist +11 -11
- package/libs/apple/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/macos-arm64_x86_64/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/tvos-arm64_arm64e/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/apple/libskottie.xcframework/Info.plist +16 -16
- package/libs/apple/libskparagraph.xcframework/Info.plist +8 -8
- package/libs/apple/libsksg.xcframework/Info.plist +6 -6
- package/libs/apple/libskshaper.xcframework/Info.plist +10 -10
- package/libs/apple/libskunicode_core.xcframework/Info.plist +10 -10
- package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +14 -14
- package/libs/apple/libsvg.xcframework/Info.plist +15 -15
- package/package.json +1 -1
- package/react-native-skia.podspec +5 -5
- package/src/dom/types/Drawings.ts +1 -1
- package/src/renderer/Canvas.tsx +3 -0
- package/src/renderer/__tests__/FitBox.spec.tsx +556 -4
- package/src/renderer/__tests__/e2e/ImageFilter.spec.tsx +4 -4
- package/src/renderer/__tests__/e2e/Paint.spec.tsx +18 -0
- package/src/renderer/__tests__/e2e/Skottie.spec.tsx +24 -1
- package/src/renderer/__tests__/setup.tsx +2 -0
- package/src/renderer/components/ImageFilter.tsx +1 -1
- package/src/skia/types/Matrix4.ts +16 -0
- package/src/sksg/Recorder/Player.ts +7 -7
- package/src/sksg/Recorder/commands/ImageFilters.ts +3 -6
- package/src/specs/SkiaPictureViewNativeComponent.ts +1 -0
- /package/cpp/rnskia/{DawnUtils.h → RNDawnUtils.h} +0 -0
- /package/cpp/rnskia/{ImageProvider.h → RNImageProvider.h} +0 -0
- /package/cpp/rnskia/{WindowContext.h → RNWindowContext.h} +0 -0
@@ -174,6 +174,7 @@ export const importSkia = (): typeof SkiaExports => {
|
|
174
174
|
const skia = require("../../skia");
|
175
175
|
const renderer = require("../../renderer");
|
176
176
|
const offscreen = require("../Offscreen");
|
177
|
+
const nodes = require("../../dom/nodes");
|
177
178
|
// TODO: to remove
|
178
179
|
const animation = require("../../animation");
|
179
180
|
return {
|
@@ -181,6 +182,7 @@ export const importSkia = (): typeof SkiaExports => {
|
|
181
182
|
...renderer,
|
182
183
|
...animation,
|
183
184
|
...offscreen,
|
185
|
+
...nodes,
|
184
186
|
};
|
185
187
|
};
|
186
188
|
|
@@ -354,6 +354,22 @@ export const convertToColumnMajor = (rowMajorMatrix: Matrix4) => {
|
|
354
354
|
return colMajorMatrix as unknown as Matrix4;
|
355
355
|
};
|
356
356
|
|
357
|
+
/**
|
358
|
+
* @worklet
|
359
|
+
*/
|
360
|
+
export const convertToColumnMajor3 = (rowMajorMatrix: Matrix3 | number[]) => {
|
361
|
+
"worklet";
|
362
|
+
|
363
|
+
const colMajorMatrix = new Array<number>(9);
|
364
|
+
const size = 3;
|
365
|
+
for (let row = 0; row < size; row++) {
|
366
|
+
for (let col = 0; col < size; col++) {
|
367
|
+
colMajorMatrix[col * size + row] = rowMajorMatrix[row * size + col];
|
368
|
+
}
|
369
|
+
}
|
370
|
+
return colMajorMatrix as unknown as Matrix3;
|
371
|
+
};
|
372
|
+
|
357
373
|
/**
|
358
374
|
* @worklet
|
359
375
|
*/
|
@@ -67,14 +67,14 @@ function play(ctx: DrawingContext, _command: Command) {
|
|
67
67
|
if (command.props.paint) {
|
68
68
|
ctx.paints.push(command.props.paint);
|
69
69
|
} else {
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
71
|
+
const { standalone } = command as any;
|
70
72
|
ctx.savePaint();
|
71
|
-
|
72
|
-
ctx.Skia
|
73
|
-
ctx
|
74
|
-
|
75
|
-
|
76
|
-
(command as any).standalone
|
77
|
-
);
|
73
|
+
if (standalone) {
|
74
|
+
const freshPaint = ctx.Skia.Paint();
|
75
|
+
ctx.paint.assign(freshPaint);
|
76
|
+
}
|
77
|
+
setPaintProperties(ctx.Skia, ctx, command.props, standalone);
|
78
78
|
}
|
79
79
|
} else if (isCommand(command, CommandType.RestorePaint)) {
|
80
80
|
ctx.restorePaint();
|
@@ -177,13 +177,10 @@ const declareRuntimeShaderImageFilter = (
|
|
177
177
|
ctx.imageFilters.push(imgf);
|
178
178
|
};
|
179
179
|
|
180
|
-
const declareImageFilter = (
|
181
|
-
ctx: DrawingContext,
|
182
|
-
props: ImageFilterProps
|
183
|
-
) => {
|
180
|
+
const declareImageFilter = (ctx: DrawingContext, props: ImageFilterProps) => {
|
184
181
|
"worklet";
|
185
|
-
const {
|
186
|
-
ctx.imageFilters.push(
|
182
|
+
const { filter } = props;
|
183
|
+
ctx.imageFilters.push(filter);
|
187
184
|
};
|
188
185
|
|
189
186
|
export const composeImageFilters = (ctx: DrawingContext) => {
|
File without changes
|
File without changes
|
File without changes
|