Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,7 @@ SPEC CHECKSUMS:
React-Mapbuffer: 0502faf46cab8fb89cfc7bf3e6c6109b6ef9b5de
React-microtasksnativemodule: 663bc64e3a96c5fc91081923ae7481adc1359a78
react-native-safe-area-context: 286b3e7b5589795bb85ffc38faf4c0706c48a092
react-native-skia: 440cfe000ba2f25f03315d727c129cb976db7377
react-native-skia: 0457c9311947ef4642e3f55d5647220c5e529eb2
react-native-slider: 27263d134d55db948a4706f1e47d0ec88fb354dd
React-NativeModulesApple: 16fbd5b040ff6c492dacc361d49e63cba7a6a7a1
React-perflogger: ab51b7592532a0ea45bf6eed7e6cae14a368b678
Expand Down
12 changes: 7 additions & 5 deletions packages/skia/cpp/api/JsiNativeBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <jsi/jsi.h>

#include "JsiSkImage.h"
#include "JsiArgParser.h"
#include "JsiArgParserTypes.h"

namespace RNSkia {

Expand All @@ -18,17 +20,17 @@ namespace jsi = facebook::jsi;
class JsiNativeBufferFactory : public JsiSkHostObject {
public:
JSI_HOST_FUNCTION(MakeFromImage) {
auto image = JsiSkImage::fromValue(runtime, arguments[0]);
ArgParser parser(runtime, arguments, count);
auto image = parser.next<sk_sp<SkImage>>();
image->makeNonTextureImage();
uint64_t pointer = getContext()->makeNativeBuffer(image);
return jsi::BigInt::fromUint64(runtime, pointer);
}

JSI_HOST_FUNCTION(Release) {

jsi::BigInt pointer = arguments[0].asBigInt(runtime);
const uintptr_t nativeBufferPointer = pointer.asUint64(runtime);

ArgParser parser(runtime, arguments, count);
auto pointer = parser.next<jsi::Value>();
const uintptr_t nativeBufferPointer = pointer.asBigInt(runtime).asUint64(runtime);
getContext()->releaseNativeBuffer(nativeBufferPointer);
return jsi::Value::undefined();
}
Expand Down
Loading
Loading