-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Worklets): Move shareable creation to Worklets (#6576)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary Moving `makeShareableClone` function from `NativeReanimatedModule` to `NativeWorkletsModule`. ## Test plan CI
- Loading branch information
Showing
16 changed files
with
119 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 19 additions & 1 deletion
20
...es/react-native-reanimated/Common/cpp/worklets/NativeModules/NativeWorkletsModuleSpec.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
#include <worklets/NativeModules/NativeWorkletsModuleSpec.h> | ||
|
||
#include <utility> | ||
|
||
#define WORKLETS_SPEC_PREFIX(FN_NAME) \ | ||
__hostFunction_NativeWorkletsModuleSpec_##FN_NAME | ||
|
||
namespace worklets { | ||
|
||
static jsi::Value WORKLETS_SPEC_PREFIX(makeShareableClone)( | ||
jsi::Runtime &rt, | ||
TurboModule &turboModule, | ||
const jsi::Value *args, | ||
size_t) { | ||
return static_cast<NativeWorkletsModuleSpec *>(&turboModule) | ||
->makeShareableClone( | ||
rt, std::move(args[0]), std::move(args[1]), std::move(args[2])); | ||
} | ||
|
||
NativeWorkletsModuleSpec::NativeWorkletsModuleSpec( | ||
const std::shared_ptr<CallInvoker> jsInvoker) | ||
: TurboModule("NativeWorklets", jsInvoker) {} | ||
: TurboModule("NativeWorklets", jsInvoker) { | ||
methodMap_["makeShareableClone"] = | ||
MethodMetadata{2, WORKLETS_SPEC_PREFIX(makeShareableClone)}; | ||
} | ||
|
||
} // namespace worklets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.