@shopify/react-native-skia 2.12.0 → 2.13.1
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/LICENSE.md +2 -1
- package/Package.swift +4 -4
- package/android/CMakeLists.txt +22 -177
- package/android/build.gradle +40 -209
- package/android/cpp/jni/JniSkiaManager.cpp +3 -45
- package/android/cpp/jni/include/JniPlatformContext.h +1 -1
- package/android/cpp/jni/include/JniSkiaBaseView.h +18 -11
- package/android/cpp/jni/include/JniSkiaManager.h +3 -4
- package/android/cpp/jni/include/JniSkiaPictureView.h +5 -5
- package/android/cpp/rnskia-android/OpenGLContext.h +1 -1
- package/android/cpp/rnskia-android/RNSkAndroidView.h +6 -6
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +4 -4
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +2 -2
- package/android/cpp/rnskia-android/gl/Surface.h +1 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/PlatformContext.java +1 -1
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/RNSkVideo.java +1 -1
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/RNSkiaModule.java +1 -8
- package/android/src/main/java/com/reactnative/skia/RNSkiaPackage.java +57 -0
- package/android/src/main/java/com/reactnative/skia/SkiaBaseView.java +185 -0
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/SkiaBaseViewManager.java +20 -1
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/SkiaManager.java +11 -6
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/SkiaPictureView.java +3 -3
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/SkiaPictureViewManager.java +1 -1
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/SkiaSurfaceView.java +13 -3
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/SkiaTextureView.java +5 -3
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/SkiaViewAPI.java +1 -1
- package/android/src/main/java/com/{shopify/reactnative → reactnative}/skia/ViewScreenshotService.java +1 -1
- package/apple/MetalContext.mm +1 -1
- package/apple/RNSkiaModule.h +1 -10
- package/apple/RNSkiaModule.mm +2 -10
- package/apple/SkiaManager.h +0 -2
- package/apple/SkiaManager.mm +4 -6
- package/apple/SkiaPictureView.h +2 -2
- package/apple/SkiaPictureView.mm +0 -4
- package/apple/SkiaUIView.h +3 -18
- package/apple/SkiaUIView.mm +0 -30
- package/cpp/api/CustomBlendModes.h +17 -0
- package/cpp/api/JsiSkCanvas.h +19 -10
- package/cpp/api/JsiSkImage.h +1 -1
- package/cpp/api/JsiSkImageFilter.h +3 -1
- package/cpp/api/JsiSkParagraph.h +2 -1
- package/cpp/api/JsiSkParagraphBuilder.h +1 -1
- package/cpp/api/JsiSkParagraphBuilderFactory.h +1 -1
- package/cpp/api/JsiSkPath.h +11 -4
- package/cpp/api/JsiSkPathBuilder.h +11 -4
- package/cpp/api/JsiSkPictureRecorder.h +2 -1
- package/cpp/api/JsiSkShader.h +3 -1
- package/cpp/api/JsiSkSkottie.h +27 -25
- package/cpp/api/recorder/Command.h +1 -1
- package/cpp/api/recorder/Convertor.h +1 -1
- package/cpp/api/recorder/DataTypes.h +1 -1
- package/cpp/api/recorder/DrawingCtx.h +1 -1
- package/cpp/api/recorder/JsiRecorder.h +7 -4
- package/cpp/api/third_party/base64.cpp +1 -1
- package/cpp/jsi/JSICache.cpp +23 -0
- package/cpp/jsi/JSICache.h +28 -1
- package/cpp/jsi/NativeObject.h +36 -7
- package/cpp/jsi/ViewProperty.h +0 -4
- package/cpp/rnskia/RNDawnContext.h +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js +18 -0
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/commonjs/mock/index.js +0 -1
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +11 -3
- package/lib/commonjs/renderer/Canvas.js +8 -6
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +9 -4
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +2 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.d.ts +3 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.js +3 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.js +2 -12
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +19 -8
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.js +18 -0
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/module/mock/index.js +0 -1
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.d.ts +11 -3
- package/lib/module/renderer/Canvas.js +7 -5
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +9 -4
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +2 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.d.ts +3 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.js +3 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.js +2 -12
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/types.d.ts +19 -8
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/lib/commonjs/mock/index.d.ts +0 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +2 -2
- package/lib/typescript/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.d.ts +3 -1
- package/lib/typescript/lib/module/mock/index.d.ts +0 -1
- package/lib/typescript/lib/module/renderer/Canvas.d.ts +2 -2
- package/lib/typescript/lib/module/specs/SkiaPictureViewNativeComponent.web.d.ts +3 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +11 -3
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +2 -0
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.web.d.ts +3 -1
- package/lib/typescript/src/views/types.d.ts +19 -8
- package/package.json +3 -3
- package/react-native-skia.podspec +4 -10
- package/src/animation/functions/interpolatePaths.ts +24 -0
- package/src/mock/index.ts +0 -1
- package/src/renderer/Canvas.tsx +23 -5
- package/src/skia/web/JsiSkCanvas.ts +14 -9
- package/src/specs/SkiaPictureViewNativeComponent.ts +5 -0
- package/src/specs/SkiaPictureViewNativeComponent.web.ts +5 -0
- package/src/views/SkiaPictureView.tsx +2 -10
- package/src/views/types.ts +23 -10
- package/android/src/latest/java/com/shopify/reactnative/skia/ReactNativeCompatible.java +0 -11
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +0 -79
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaAHBView.java +0 -113
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +0 -136
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerDelegate.java +0 -41
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerInterface.java +0 -20
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaWebGPUViewManagerDelegate.java +0 -35
- package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaWebGPUViewManagerInterface.java +0 -17
- package/android/src/paper/java/com/shopify/reactnative/skia/NativeSkiaModuleSpec.java +0 -38
- package/android/src/reactnative74/java/com/shopify/reactnative/skia/ReactNativeCompatible.java +0 -14
- package/apple/SkiaPictureViewManager.h +0 -8
- package/apple/SkiaPictureViewManager.mm +0 -60
- package/apple/SkiaWebGPUView.h +0 -20
- package/apple/WebGPUMetalView.h +0 -12
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaPictureViewManagerInterface.java
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
|
|
15
|
-
public interface SkiaPictureViewManagerInterface<T extends View> {
|
|
16
|
-
void setDebug(T view, boolean value);
|
|
17
|
-
void setOpaque(T view, boolean value);
|
|
18
|
-
void setColorSpace(T view, @Nullable String value);
|
|
19
|
-
void setAndroidWarmup(T view, boolean value);
|
|
20
|
-
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaWebGPUViewManagerDelegate.java
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
15
|
-
import com.facebook.react.uimanager.BaseViewManager;
|
|
16
|
-
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
17
|
-
|
|
18
|
-
public class SkiaWebGPUViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & SkiaWebGPUViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
19
|
-
public SkiaWebGPUViewManagerDelegate(U viewManager) {
|
|
20
|
-
super(viewManager);
|
|
21
|
-
}
|
|
22
|
-
@Override
|
|
23
|
-
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
24
|
-
switch (propName) {
|
|
25
|
-
case "contextId":
|
|
26
|
-
mViewManager.setContextId(view, value == null ? 0 : ((Double) value).intValue());
|
|
27
|
-
break;
|
|
28
|
-
case "transparent":
|
|
29
|
-
mViewManager.setTransparent(view, value != null && (boolean) value);
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
super.setProperty(view, propName, value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaWebGPUViewManagerInterface.java
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
|
|
14
|
-
public interface SkiaWebGPUViewManagerInterface<T extends View> {
|
|
15
|
-
void setContextId(T view, int value);
|
|
16
|
-
void setTransparent(T view, boolean value);
|
|
17
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
-
*
|
|
10
|
-
* @nolint
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
package com.shopify.reactnative.skia;
|
|
14
|
-
|
|
15
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
17
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
18
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
19
|
-
import com.facebook.react.bridge.ReactModuleWithSpec;
|
|
20
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
21
|
-
import javax.annotation.Nonnull;
|
|
22
|
-
|
|
23
|
-
public abstract class NativeSkiaModuleSpec extends ReactContextBaseJavaModule implements ReactModuleWithSpec, TurboModule {
|
|
24
|
-
public static final String NAME = "RNSkiaModule";
|
|
25
|
-
|
|
26
|
-
public NativeSkiaModuleSpec(ReactApplicationContext reactContext) {
|
|
27
|
-
super(reactContext);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Override
|
|
31
|
-
public @Nonnull String getName() {
|
|
32
|
-
return NAME;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
36
|
-
@DoNotStrip
|
|
37
|
-
public abstract boolean install();
|
|
38
|
-
}
|
package/android/src/reactnative74/java/com/shopify/reactnative/skia/ReactNativeCompatible.java
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
package com.shopify.reactnative.skia;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.OptIn;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.bridge.ReactContext;
|
|
6
|
-
import com.facebook.react.bridge.RuntimeExecutor;
|
|
7
|
-
import com.facebook.react.common.annotations.FrameworkAPI;
|
|
8
|
-
|
|
9
|
-
/* package */ final class ReactNativeCompatible {
|
|
10
|
-
@OptIn(markerClass = FrameworkAPI.class)
|
|
11
|
-
public static RuntimeExecutor getRuntimeExecutor(ReactContext context) {
|
|
12
|
-
return context.getRuntimeExecutor();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#include "SkiaPictureViewManager.h"
|
|
3
|
-
#include <React/RCTBridge+Private.h>
|
|
4
|
-
|
|
5
|
-
#include "RNSkAppleView.h"
|
|
6
|
-
#include "RNSkPictureView.h"
|
|
7
|
-
#include "RNSkPlatformContext.h"
|
|
8
|
-
|
|
9
|
-
#include "RNSkiaModule.h"
|
|
10
|
-
#include "SkiaManager.h"
|
|
11
|
-
#include "SkiaUIView.h"
|
|
12
|
-
|
|
13
|
-
@implementation SkiaPictureViewManager
|
|
14
|
-
|
|
15
|
-
RCT_EXPORT_MODULE(SkiaPictureView)
|
|
16
|
-
|
|
17
|
-
- (SkiaManager *)skiaManager {
|
|
18
|
-
auto bridge = self.bridge;
|
|
19
|
-
RCTAssert(bridge, @"Bridge must not be nil.");
|
|
20
|
-
auto skiaModule = (RNSkiaModule *)[bridge moduleForName:@"RNSkiaModule"];
|
|
21
|
-
return [skiaModule manager];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
RCT_CUSTOM_VIEW_PROPERTY(nativeID, NSNumber, SkiaUIView) {
|
|
25
|
-
// Get parameter
|
|
26
|
-
int nativeId = [[RCTConvert NSString:json] intValue];
|
|
27
|
-
[(SkiaUIView *)view setNativeId:nativeId];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
RCT_CUSTOM_VIEW_PROPERTY(debug, BOOL, SkiaUIView) {
|
|
31
|
-
bool debug = json != NULL ? [RCTConvert BOOL:json] : false;
|
|
32
|
-
[(SkiaUIView *)view setDebugMode:debug];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
RCT_CUSTOM_VIEW_PROPERTY(opaque, BOOL, SkiaUIView) {
|
|
36
|
-
bool opaque = json != NULL ? [RCTConvert BOOL:json] : false;
|
|
37
|
-
[(SkiaUIView *)view setOpaque:opaque];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
RCT_CUSTOM_VIEW_PROPERTY(highBitDepth, BOOL, SkiaUIView) {
|
|
41
|
-
bool highBitDepth = json != NULL ? [RCTConvert BOOL:json] : false;
|
|
42
|
-
[(SkiaUIView *)view setHighBitDepth:highBitDepth];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
#if !TARGET_OS_OSX
|
|
46
|
-
- (UIView *)view {
|
|
47
|
-
#else
|
|
48
|
-
- (RCTUIView *)view {
|
|
49
|
-
#endif // !TARGET_OS_OSX
|
|
50
|
-
auto skManager = [[self skiaManager] skManager];
|
|
51
|
-
// Pass SkManager as a raw pointer to avoid circular dependenciesr
|
|
52
|
-
return [[SkiaUIView alloc]
|
|
53
|
-
initWithManager:skManager.get()
|
|
54
|
-
factory:[](std::shared_ptr<RNSkia::RNSkPlatformContext> context) {
|
|
55
|
-
return std::make_shared<RNSkAppleView<RNSkia::RNSkPictureView>>(
|
|
56
|
-
context);
|
|
57
|
-
}];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@end
|
package/apple/SkiaWebGPUView.h
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
|
-
|
|
5
|
-
#import "WebGPUMetalView.h"
|
|
6
|
-
#import <React/RCTViewComponentView.h>
|
|
7
|
-
#if !TARGET_OS_OSX
|
|
8
|
-
#import <UIKit/UIKit.h>
|
|
9
|
-
#else
|
|
10
|
-
#import <AppKit/AppKit.h>
|
|
11
|
-
#endif
|
|
12
|
-
|
|
13
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
-
|
|
15
|
-
@interface SkiaWebGPUView : RCTViewComponentView
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
NS_ASSUME_NONNULL_END
|
|
19
|
-
|
|
20
|
-
#endif // RCT_NEW_ARCH_ENABLED
|