@pompadour/react-native-skia 1.5.25 → 1.5.26
Sign up to get free protection for your applications and to get access to all the features.
- package/ios/RNSkiaModule.mm +2 -25
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/ios/libskia.xcframework/Info.plist +5 -5
- package/libs/ios/libskottie.xcframework/Info.plist +5 -5
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
- package/package.json +1 -1
- package/cpp/api/JsiNeatPlayer.cpp +0 -39
- package/cpp/api/JsiNeatPlayer.h +0 -32
package/ios/RNSkiaModule.mm
CHANGED
@@ -1,14 +1,11 @@
|
|
1
|
+
|
1
2
|
#import "RNSkiaModule.h"
|
2
3
|
#import <React/RCTBridge+Private.h>
|
3
4
|
#import <ReactCommon/RCTTurboModule.h>
|
4
|
-
#import <jsi/jsi.h>
|
5
|
-
#include "JsiNeatPlayer.h"
|
6
|
-
#include "NeatPlayer.h"
|
7
5
|
|
8
6
|
@implementation RNSkiaModule {
|
9
7
|
SkiaManager *skiaManager;
|
10
8
|
std::shared_ptr<facebook::react::CallInvoker> jsInvoker;
|
11
|
-
std::shared_ptr<RNSkia::JsiNeatPlayer> jsiNeatPlayer;
|
12
9
|
}
|
13
10
|
|
14
11
|
RCT_EXPORT_MODULE()
|
@@ -30,7 +27,6 @@ RCT_EXPORT_MODULE()
|
|
30
27
|
[skiaManager invalidate];
|
31
28
|
}
|
32
29
|
skiaManager = nil;
|
33
|
-
jsiNeatPlayer = nullptr;
|
34
30
|
}
|
35
31
|
|
36
32
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) {
|
@@ -43,28 +39,9 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) {
|
|
43
39
|
jsInvoker = bridge.jsCallInvoker;
|
44
40
|
}
|
45
41
|
skiaManager = [[SkiaManager alloc] initWithBridge:bridge jsInvoker:jsInvoker];
|
46
|
-
|
47
|
-
// Install JsiNeatPlayer
|
48
|
-
[self installJsiNeatPlayer:bridge];
|
49
|
-
|
50
42
|
return @true;
|
51
43
|
}
|
52
44
|
|
53
|
-
- (void)installJsiNeatPlayer:(RCTBridge *)bridge {
|
54
|
-
RCTCxxBridge *cxxBridge = (RCTCxxBridge *)bridge;
|
55
|
-
if (!cxxBridge.runtime) {
|
56
|
-
return;
|
57
|
-
}
|
58
|
-
|
59
|
-
facebook::jsi::Runtime &jsiRuntime = *(facebook::jsi::Runtime *)cxxBridge.runt ime;
|
60
|
-
|
61
|
-
auto neatPlayer = std::make_shared<NeatPlayer>();
|
62
|
-
jsiNeatPlayer = std::make_shared<RNSkia::JsiNeatPlayer>(neatPlayer);
|
63
|
-
|
64
|
-
auto neatPlayerObj = facebook::jsi::Object::createFromHostObject(jsiRuntime, jsiNeatPlayer);
|
65
|
-
jsiRuntime.global().setProperty(jsiRuntime, "NeatPlayer", std::move(neatPlayerObj));
|
66
|
-
}
|
67
|
-
|
68
45
|
#ifdef RCT_NEW_ARCH_ENABLED
|
69
46
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
70
47
|
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
@@ -73,4 +50,4 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) {
|
|
73
50
|
}
|
74
51
|
#endif
|
75
52
|
|
76
|
-
@end
|
53
|
+
@end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -8,34 +8,34 @@
|
|
8
8
|
<key>BinaryPath</key>
|
9
9
|
<string>libskia.a</string>
|
10
10
|
<key>LibraryIdentifier</key>
|
11
|
-
<string>ios-
|
11
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
12
12
|
<key>LibraryPath</key>
|
13
13
|
<string>libskia.a</string>
|
14
14
|
<key>SupportedArchitectures</key>
|
15
15
|
<array>
|
16
16
|
<string>arm64</string>
|
17
17
|
<string>arm64e</string>
|
18
|
+
<string>x86_64</string>
|
18
19
|
</array>
|
19
20
|
<key>SupportedPlatform</key>
|
20
21
|
<string>ios</string>
|
22
|
+
<key>SupportedPlatformVariant</key>
|
23
|
+
<string>simulator</string>
|
21
24
|
</dict>
|
22
25
|
<dict>
|
23
26
|
<key>BinaryPath</key>
|
24
27
|
<string>libskia.a</string>
|
25
28
|
<key>LibraryIdentifier</key>
|
26
|
-
<string>ios-
|
29
|
+
<string>ios-arm64_arm64e</string>
|
27
30
|
<key>LibraryPath</key>
|
28
31
|
<string>libskia.a</string>
|
29
32
|
<key>SupportedArchitectures</key>
|
30
33
|
<array>
|
31
34
|
<string>arm64</string>
|
32
35
|
<string>arm64e</string>
|
33
|
-
<string>x86_64</string>
|
34
36
|
</array>
|
35
37
|
<key>SupportedPlatform</key>
|
36
38
|
<string>ios</string>
|
37
|
-
<key>SupportedPlatformVariant</key>
|
38
|
-
<string>simulator</string>
|
39
39
|
</dict>
|
40
40
|
</array>
|
41
41
|
<key>CFBundlePackageType</key>
|
@@ -8,34 +8,34 @@
|
|
8
8
|
<key>BinaryPath</key>
|
9
9
|
<string>libskottie.a</string>
|
10
10
|
<key>LibraryIdentifier</key>
|
11
|
-
<string>ios-
|
11
|
+
<string>ios-arm64_arm64e</string>
|
12
12
|
<key>LibraryPath</key>
|
13
13
|
<string>libskottie.a</string>
|
14
14
|
<key>SupportedArchitectures</key>
|
15
15
|
<array>
|
16
16
|
<string>arm64</string>
|
17
17
|
<string>arm64e</string>
|
18
|
-
<string>x86_64</string>
|
19
18
|
</array>
|
20
19
|
<key>SupportedPlatform</key>
|
21
20
|
<string>ios</string>
|
22
|
-
<key>SupportedPlatformVariant</key>
|
23
|
-
<string>simulator</string>
|
24
21
|
</dict>
|
25
22
|
<dict>
|
26
23
|
<key>BinaryPath</key>
|
27
24
|
<string>libskottie.a</string>
|
28
25
|
<key>LibraryIdentifier</key>
|
29
|
-
<string>ios-
|
26
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
30
27
|
<key>LibraryPath</key>
|
31
28
|
<string>libskottie.a</string>
|
32
29
|
<key>SupportedArchitectures</key>
|
33
30
|
<array>
|
34
31
|
<string>arm64</string>
|
35
32
|
<string>arm64e</string>
|
33
|
+
<string>x86_64</string>
|
36
34
|
</array>
|
37
35
|
<key>SupportedPlatform</key>
|
38
36
|
<string>ios</string>
|
37
|
+
<key>SupportedPlatformVariant</key>
|
38
|
+
<string>simulator</string>
|
39
39
|
</dict>
|
40
40
|
</array>
|
41
41
|
<key>CFBundlePackageType</key>
|
Binary file
|
Binary file
|
@@ -8,34 +8,34 @@
|
|
8
8
|
<key>BinaryPath</key>
|
9
9
|
<string>libskshaper.a</string>
|
10
10
|
<key>LibraryIdentifier</key>
|
11
|
-
<string>ios-
|
11
|
+
<string>ios-arm64_arm64e</string>
|
12
12
|
<key>LibraryPath</key>
|
13
13
|
<string>libskshaper.a</string>
|
14
14
|
<key>SupportedArchitectures</key>
|
15
15
|
<array>
|
16
16
|
<string>arm64</string>
|
17
17
|
<string>arm64e</string>
|
18
|
-
<string>x86_64</string>
|
19
18
|
</array>
|
20
19
|
<key>SupportedPlatform</key>
|
21
20
|
<string>ios</string>
|
22
|
-
<key>SupportedPlatformVariant</key>
|
23
|
-
<string>simulator</string>
|
24
21
|
</dict>
|
25
22
|
<dict>
|
26
23
|
<key>BinaryPath</key>
|
27
24
|
<string>libskshaper.a</string>
|
28
25
|
<key>LibraryIdentifier</key>
|
29
|
-
<string>ios-
|
26
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
30
27
|
<key>LibraryPath</key>
|
31
28
|
<string>libskshaper.a</string>
|
32
29
|
<key>SupportedArchitectures</key>
|
33
30
|
<array>
|
34
31
|
<string>arm64</string>
|
35
32
|
<string>arm64e</string>
|
33
|
+
<string>x86_64</string>
|
36
34
|
</array>
|
37
35
|
<key>SupportedPlatform</key>
|
38
36
|
<string>ios</string>
|
37
|
+
<key>SupportedPlatformVariant</key>
|
38
|
+
<string>simulator</string>
|
39
39
|
</dict>
|
40
40
|
</array>
|
41
41
|
<key>CFBundlePackageType</key>
|
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.
|
10
|
+
"version": "1.5.26",
|
11
11
|
"description": "High-performance React Native Graphics using Skia",
|
12
12
|
"main": "lib/module/index.js",
|
13
13
|
"react-native": "src/index.ts",
|
@@ -1,39 +0,0 @@
|
|
1
|
-
#include "JsiNeatPlayer.h"
|
2
|
-
#include <utility>
|
3
|
-
|
4
|
-
namespace RNSkia {
|
5
|
-
|
6
|
-
JsiNeatPlayer::JsiNeatPlayer(std::shared_ptr<NeatPlayer> player)
|
7
|
-
: player_(std::move(player)) {}
|
8
|
-
|
9
|
-
JSI_HOST_FUNCTION(JsiNeatPlayer, load) {
|
10
|
-
player_->load();
|
11
|
-
return jsi::Value::undefined();
|
12
|
-
}
|
13
|
-
|
14
|
-
JSI_HOST_FUNCTION(JsiNeatPlayer, update) {
|
15
|
-
if (count < 1) {
|
16
|
-
throw jsi::JSError(runtime, "NeatPlayer.update() requires a deltaTime argument");
|
17
|
-
}
|
18
|
-
double deltaTime = arguments[0].asNumber();
|
19
|
-
player_->update(deltaTime);
|
20
|
-
return jsi::Value::undefined();
|
21
|
-
}
|
22
|
-
|
23
|
-
JSI_HOST_FUNCTION(JsiNeatPlayer, render) {
|
24
|
-
// Note: This is a simplified version. You may need to handle canvas creation and passing differently.
|
25
|
-
// For now, we'll assume the canvas is passed as a pointer wrapped in a number.
|
26
|
-
if (count < 1) {
|
27
|
-
throw jsi::JSError(runtime, "NeatPlayer.render() requires a canvas argument");
|
28
|
-
}
|
29
|
-
SkCanvas* canvas = reinterpret_cast<SkCanvas*>(arguments[0].asNumber());
|
30
|
-
player_->render(canvas);
|
31
|
-
return jsi::Value::undefined();
|
32
|
-
}
|
33
|
-
|
34
|
-
JSI_HOST_FUNCTION(JsiNeatPlayer, togglePlayPause) {
|
35
|
-
player_->togglePlayPause();
|
36
|
-
return jsi::Value::undefined();
|
37
|
-
}
|
38
|
-
|
39
|
-
} // namespace RNSkia
|
package/cpp/api/JsiNeatPlayer.h
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
#ifndef PACKAGE_CPP_API_JSINEATPLAYER_H_
|
2
|
-
#define PACKAGE_CPP_API_JSINEATPLAYER_H_
|
3
|
-
|
4
|
-
#include <jsi/jsi.h>
|
5
|
-
#include <memory>
|
6
|
-
#include "NeatPlayer.h"
|
7
|
-
|
8
|
-
namespace jsi = facebook::jsi;
|
9
|
-
|
10
|
-
namespace RNSkia {
|
11
|
-
|
12
|
-
class JsiNeatPlayer : public jsi::HostObject {
|
13
|
-
public:
|
14
|
-
explicit JsiNeatPlayer(std::shared_ptr<NeatPlayer> player);
|
15
|
-
|
16
|
-
jsi::Value load(jsi::Runtime& runtime, const jsi::Value& thisValue, const jsi::Value* arguments, size_t count);
|
17
|
-
jsi::Value update(jsi::Runtime& runtime, const jsi::Value& thisValue, const jsi::Value* arguments, size_t count);
|
18
|
-
jsi::Value render(jsi::Runtime& runtime, const jsi::Value& thisValue, const jsi::Value* arguments, size_t count);
|
19
|
-
jsi::Value togglePlayPause(jsi::Runtime& runtime, const jsi::Value& thisValue, const jsi::Value* arguments, size_t count);
|
20
|
-
|
21
|
-
JSI_HOST_FUNCTION(load);
|
22
|
-
JSI_HOST_FUNCTION(update);
|
23
|
-
JSI_HOST_FUNCTION(render);
|
24
|
-
JSI_HOST_FUNCTION(togglePlayPause);
|
25
|
-
|
26
|
-
private:
|
27
|
-
std::shared_ptr<NeatPlayer> player_;
|
28
|
-
};
|
29
|
-
|
30
|
-
} // namespace RNSkia
|
31
|
-
|
32
|
-
#endif // PACKAGE_CPP_API_JSINEATPLAYER_H_
|