@shopify/react-native-skia 2.5.4 → 2.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.
- package/android/src/main/java/com/shopify/reactnative/skia/WebGPUViewManager.java +7 -7
- package/apple/{WebGPUView.h → SkiaWebGPUView.h} +1 -1
- package/apple/{WebGPUView.mm → SkiaWebGPUView.mm} +7 -7
- package/cpp/api/CustomBlendModes.h +1 -0
- package/cpp/api/JsiSkApi.h +4 -0
- package/cpp/api/JsiSkCanvas.h +2 -2
- package/cpp/api/JsiSkContourMeasureIter.h +1 -1
- package/cpp/api/JsiSkPath.h +483 -355
- package/cpp/api/JsiSkPathBuilder.h +415 -0
- package/cpp/api/JsiSkPathBuilderFactory.h +53 -0
- package/cpp/api/JsiSkPathEffectFactory.h +2 -2
- package/cpp/api/JsiSkPathFactory.h +274 -3
- package/cpp/api/recorder/DataTypes.h +1 -1
- package/cpp/api/recorder/Drawings.h +6 -2
- package/cpp/rnskia/RNDawnContext.h +21 -0
- package/cpp/rnskia/RNDawnUtils.h +115 -113
- package/lib/commonjs/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/commonjs/animation/functions/interpolatePaths.js +5 -4
- package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.d.ts +11 -2
- package/lib/commonjs/external/reanimated/interpolators.js +21 -4
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
- package/lib/commonjs/skia/types/Path/PathBuilder.d.ts +201 -0
- package/lib/commonjs/skia/types/Path/PathBuilder.js +6 -0
- package/lib/commonjs/skia/types/Path/PathBuilder.js.map +1 -0
- package/lib/commonjs/skia/types/Path/PathBuilderFactory.d.ts +13 -0
- package/lib/commonjs/skia/types/Path/PathBuilderFactory.js +6 -0
- package/lib/commonjs/skia/types/Path/PathBuilderFactory.js.map +1 -0
- package/lib/commonjs/skia/types/Path/PathFactory.d.ts +87 -1
- package/lib/commonjs/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/commonjs/skia/types/Path/index.d.ts +2 -0
- package/lib/commonjs/skia/types/Path/index.js +22 -0
- package/lib/commonjs/skia/types/Path/index.js.map +1 -1
- package/lib/commonjs/skia/types/Skia.d.ts +2 -1
- package/lib/commonjs/skia/types/Skia.js.map +1 -1
- package/lib/commonjs/skia/web/Host.js +1 -3
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -2
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +4 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +42 -30
- package/lib/commonjs/skia/web/JsiSkPath.js +302 -111
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathBuilder.d.ts +45 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilder.js +192 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilder.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilderFactory.d.ts +9 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilderFactory.js +26 -0
- package/lib/commonjs/skia/web/JsiSkPathBuilderFactory.js.map +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +6 -2
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +13 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +140 -5
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +8 -1
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js +18 -6
- package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +2 -2
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js +2 -3
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/WebGPUViewNativeComponent.d.ts +2 -2
- package/lib/commonjs/specs/WebGPUViewNativeComponent.js +2 -3
- package/lib/commonjs/specs/WebGPUViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/WebGPUViewNativeComponent.web.js +2 -0
- package/lib/commonjs/specs/WebGPUViewNativeComponent.web.js.map +1 -1
- package/lib/module/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/module/animation/functions/interpolatePaths.js +5 -4
- package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.d.ts +11 -2
- package/lib/module/external/reanimated/interpolators.js +21 -4
- package/lib/module/external/reanimated/interpolators.js.map +1 -1
- package/lib/module/skia/types/Path/PathBuilder.d.ts +201 -0
- package/lib/module/skia/types/Path/PathBuilder.js +2 -0
- package/lib/module/skia/types/Path/PathBuilder.js.map +1 -0
- package/lib/module/skia/types/Path/PathBuilderFactory.d.ts +13 -0
- package/lib/module/skia/types/Path/PathBuilderFactory.js +2 -0
- package/lib/module/skia/types/Path/PathBuilderFactory.js.map +1 -0
- package/lib/module/skia/types/Path/PathFactory.d.ts +87 -1
- package/lib/module/skia/types/Path/PathFactory.js.map +1 -1
- package/lib/module/skia/types/Path/index.d.ts +2 -0
- package/lib/module/skia/types/Path/index.js +2 -0
- package/lib/module/skia/types/Path/index.js.map +1 -1
- package/lib/module/skia/types/Skia.d.ts +2 -1
- package/lib/module/skia/types/Skia.js.map +1 -1
- package/lib/module/skia/web/Host.js +1 -3
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +6 -2
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js +4 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +42 -30
- package/lib/module/skia/web/JsiSkPath.js +300 -110
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathBuilder.d.ts +45 -0
- package/lib/module/skia/web/JsiSkPathBuilder.js +186 -0
- package/lib/module/skia/web/JsiSkPathBuilder.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathBuilderFactory.d.ts +9 -0
- package/lib/module/skia/web/JsiSkPathBuilderFactory.js +19 -0
- package/lib/module/skia/web/JsiSkPathBuilderFactory.js.map +1 -0
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +6 -2
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.d.ts +13 -1
- package/lib/module/skia/web/JsiSkPathFactory.js +141 -6
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +8 -1
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Drawing.js +18 -6
- package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +2 -2
- package/lib/module/specs/SkiaPictureViewNativeComponent.js +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.js.map +1 -1
- package/lib/module/specs/WebGPUViewNativeComponent.d.ts +2 -2
- package/lib/module/specs/WebGPUViewNativeComponent.js +2 -2
- package/lib/module/specs/WebGPUViewNativeComponent.js.map +1 -1
- package/lib/module/specs/WebGPUViewNativeComponent.web.js +2 -0
- package/lib/module/specs/WebGPUViewNativeComponent.web.js.map +1 -1
- package/lib/typescript/lib/commonjs/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/typescript/lib/commonjs/external/reanimated/interpolators.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/types/Path/PathBuilder.d.ts +1 -0
- package/lib/typescript/lib/commonjs/skia/types/Path/PathBuilderFactory.d.ts +1 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPath.d.ts +33 -25
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathBuilder.d.ts +46 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathBuilderFactory.d.ts +7 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkPathFactory.d.ts +12 -0
- package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +2 -0
- package/lib/typescript/lib/commonjs/specs/SkiaPictureViewNativeComponent.d.ts +2 -1
- package/lib/typescript/lib/commonjs/specs/WebGPUViewNativeComponent.d.ts +2 -1
- package/lib/typescript/lib/module/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/typescript/lib/module/external/reanimated/interpolators.d.ts +1 -1
- package/lib/typescript/lib/module/mock/index.d.ts +1 -1
- package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Path/PathBuilder.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Path/PathBuilderFactory.d.ts +1 -0
- package/lib/typescript/lib/module/skia/types/Path/index.d.ts +2 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPath.d.ts +38 -25
- package/lib/typescript/lib/module/skia/web/JsiSkPathBuilder.d.ts +45 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPathBuilderFactory.d.ts +6 -0
- package/lib/typescript/lib/module/skia/web/JsiSkPathFactory.d.ts +12 -0
- package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +2 -0
- package/lib/typescript/lib/module/specs/SkiaPictureViewNativeComponent.d.ts +1 -1
- package/lib/typescript/lib/module/specs/WebGPUViewNativeComponent.d.ts +1 -1
- package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +1 -1
- package/lib/typescript/src/external/reanimated/interpolators.d.ts +11 -2
- package/lib/typescript/src/skia/types/Path/PathBuilder.d.ts +201 -0
- package/lib/typescript/src/skia/types/Path/PathBuilderFactory.d.ts +13 -0
- package/lib/typescript/src/skia/types/Path/PathFactory.d.ts +87 -1
- package/lib/typescript/src/skia/types/Path/index.d.ts +2 -0
- package/lib/typescript/src/skia/types/Skia.d.ts +2 -1
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +42 -30
- package/lib/typescript/src/skia/web/JsiSkPathBuilder.d.ts +45 -0
- package/lib/typescript/src/skia/web/JsiSkPathBuilderFactory.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkPathFactory.d.ts +13 -1
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.d.ts +2 -2
- package/lib/typescript/src/specs/WebGPUViewNativeComponent.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/install-libs.js +16 -6
- package/src/animation/functions/interpolatePaths.ts +5 -6
- package/src/external/reanimated/interpolators.ts +25 -5
- package/src/skia/types/Path/PathBuilder.ts +303 -0
- package/src/skia/types/Path/PathBuilderFactory.ts +15 -0
- package/src/skia/types/Path/PathFactory.ts +108 -1
- package/src/skia/types/Path/index.ts +2 -0
- package/src/skia/types/Skia.ts +2 -1
- package/src/skia/web/Host.ts +7 -1
- package/src/skia/web/JsiSkCanvas.ts +6 -6
- package/src/skia/web/JsiSkContourMeasure.ts +4 -4
- package/src/skia/web/JsiSkPath.ts +451 -168
- package/src/skia/web/JsiSkPathBuilder.ts +293 -0
- package/src/skia/web/JsiSkPathBuilderFactory.ts +32 -0
- package/src/skia/web/JsiSkPathEffectFactory.ts +6 -2
- package/src/skia/web/JsiSkPathFactory.ts +231 -8
- package/src/skia/web/JsiSkia.ts +11 -8
- package/src/sksg/Recorder/commands/Drawing.ts +20 -7
- package/src/specs/SkiaPictureViewNativeComponent.ts +1 -2
- package/src/specs/WebGPUViewNativeComponent.ts +3 -3
- package/src/specs/WebGPUViewNativeComponent.web.ts +2 -0
|
@@ -5,24 +5,24 @@ import com.facebook.react.uimanager.ThemedReactContext;
|
|
|
5
5
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
6
6
|
import com.facebook.react.views.view.ReactViewGroup;
|
|
7
7
|
import com.facebook.react.views.view.ReactViewManager;
|
|
8
|
-
import com.facebook.react.viewmanagers.
|
|
9
|
-
import com.facebook.react.viewmanagers.
|
|
8
|
+
import com.facebook.react.viewmanagers.SkiaWebGPUViewManagerDelegate;
|
|
9
|
+
import com.facebook.react.viewmanagers.SkiaWebGPUViewManagerInterface;
|
|
10
10
|
|
|
11
11
|
import androidx.annotation.NonNull;
|
|
12
12
|
import androidx.annotation.Nullable;
|
|
13
13
|
|
|
14
14
|
@ReactModule(name = WebGPUViewManager.NAME)
|
|
15
|
-
public class WebGPUViewManager extends ReactViewManager implements
|
|
15
|
+
public class WebGPUViewManager extends ReactViewManager implements SkiaWebGPUViewManagerInterface<WebGPUView> {
|
|
16
16
|
|
|
17
|
-
public static final String NAME = "
|
|
17
|
+
public static final String NAME = "SkiaWebGPUView";
|
|
18
18
|
|
|
19
|
-
protected
|
|
19
|
+
protected SkiaWebGPUViewManagerDelegate mDelegate;
|
|
20
20
|
|
|
21
21
|
public WebGPUViewManager() {
|
|
22
|
-
mDelegate = new
|
|
22
|
+
mDelegate = new SkiaWebGPUViewManagerDelegate(this);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
protected
|
|
25
|
+
protected SkiaWebGPUViewManagerDelegate getDelegate() {
|
|
26
26
|
return mDelegate;
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
2
2
|
|
|
3
|
-
#import "
|
|
3
|
+
#import "SkiaWebGPUView.h"
|
|
4
4
|
|
|
5
5
|
#import <react/renderer/components/rnskia/ComponentDescriptors.h>
|
|
6
6
|
#import <react/renderer/components/rnskia/EventEmitters.h>
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
|
|
13
13
|
using namespace facebook::react;
|
|
14
14
|
|
|
15
|
-
@implementation
|
|
15
|
+
@implementation SkiaWebGPUView
|
|
16
16
|
|
|
17
17
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
18
18
|
if (self = [super initWithFrame:frame]) {
|
|
19
|
-
static const auto defaultProps = std::make_shared<const
|
|
19
|
+
static const auto defaultProps = std::make_shared<const SkiaWebGPUViewProps>();
|
|
20
20
|
_props = defaultProps;
|
|
21
21
|
}
|
|
22
22
|
return self;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
26
|
-
return concreteComponentDescriptorProvider<
|
|
26
|
+
return concreteComponentDescriptorProvider<SkiaWebGPUViewComponentDescriptor>();
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
- (void)prepareForRecycle {
|
|
@@ -46,9 +46,9 @@ using namespace facebook::react;
|
|
|
46
46
|
- (void)updateProps:(const Props::Shared &)props
|
|
47
47
|
oldProps:(const Props::Shared &)oldProps {
|
|
48
48
|
const auto &oldViewProps =
|
|
49
|
-
*std::static_pointer_cast<const
|
|
49
|
+
*std::static_pointer_cast<const SkiaWebGPUViewProps>(_props);
|
|
50
50
|
const auto &newViewProps =
|
|
51
|
-
*std::static_pointer_cast<const
|
|
51
|
+
*std::static_pointer_cast<const SkiaWebGPUViewProps>(props);
|
|
52
52
|
|
|
53
53
|
if (newViewProps.contextId != oldViewProps.contextId) {
|
|
54
54
|
/*
|
|
@@ -72,6 +72,6 @@ using namespace facebook::react;
|
|
|
72
72
|
|
|
73
73
|
@end
|
|
74
74
|
|
|
75
|
-
Class<RCTComponentViewProtocol>
|
|
75
|
+
Class<RCTComponentViewProtocol> SkiaWebGPUViewCls(void) { return SkiaWebGPUView.class; }
|
|
76
76
|
|
|
77
77
|
#endif // RCT_NEW_ARCH_ENABLED
|
package/cpp/api/JsiSkApi.h
CHANGED
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
#include "JsiSkParagraphBuilder.h"
|
|
35
35
|
#include "JsiSkParagraphBuilderFactory.h"
|
|
36
36
|
#include "JsiSkPath.h"
|
|
37
|
+
#include "JsiSkPathBuilder.h"
|
|
38
|
+
#include "JsiSkPathBuilderFactory.h"
|
|
37
39
|
#include "JsiSkPathEffect.h"
|
|
38
40
|
#include "JsiSkPathEffectFactory.h"
|
|
39
41
|
#include "JsiSkPathFactory.h"
|
|
@@ -116,6 +118,8 @@ public:
|
|
|
116
118
|
std::make_shared<JsiSkPathEffectFactory>(context));
|
|
117
119
|
installReadonlyProperty("Path",
|
|
118
120
|
std::make_shared<JsiSkPathFactory>(context));
|
|
121
|
+
installReadonlyProperty("PathBuilder",
|
|
122
|
+
std::make_shared<JsiSkPathBuilderFactory>(context));
|
|
119
123
|
installReadonlyProperty("ColorFilter",
|
|
120
124
|
std::make_shared<JsiSkColorFilterFactory>(context));
|
|
121
125
|
installReadonlyProperty("MaskFilter",
|
package/cpp/api/JsiSkCanvas.h
CHANGED
|
@@ -352,7 +352,7 @@ public:
|
|
|
352
352
|
auto path = JsiSkPath::fromValue(runtime, arguments[0]);
|
|
353
353
|
auto paint = JsiSkPaint::fromValue(runtime, arguments[1]);
|
|
354
354
|
|
|
355
|
-
_canvas->drawPath(
|
|
355
|
+
_canvas->drawPath(path->snapshot(), *paint);
|
|
356
356
|
|
|
357
357
|
return jsi::Value::undefined();
|
|
358
358
|
}
|
|
@@ -439,7 +439,7 @@ public:
|
|
|
439
439
|
auto path = JsiSkPath::fromValue(runtime, arguments[0]);
|
|
440
440
|
auto op = (SkClipOp)arguments[1].asNumber();
|
|
441
441
|
auto doAntiAlias = arguments[2].getBool();
|
|
442
|
-
_canvas->clipPath(
|
|
442
|
+
_canvas->clipPath(path->snapshot(), op, doAntiAlias);
|
|
443
443
|
return jsi::Value::undefined();
|
|
444
444
|
}
|
|
445
445
|
|
|
@@ -69,7 +69,7 @@ public:
|
|
|
69
69
|
auto resScale = arguments[2].asNumber();
|
|
70
70
|
// Return the newly constructed object
|
|
71
71
|
auto iter = std::make_shared<JsiSkContourMeasureIter>(
|
|
72
|
-
std::move(context),
|
|
72
|
+
std::move(context), path->snapshot(), forceClosed, resScale);
|
|
73
73
|
return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(runtime, iter,
|
|
74
74
|
context);
|
|
75
75
|
};
|