Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages/skia/cpp/api/JsiSkConverters.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ template <typename T> struct JsiOptional : std::optional<T> {

} // namespace RNSkia

namespace rnwgpu {
namespace RNJsi {

/**
* sk_sp<T> arguments (SkImage, SkShader, ...). Delegates to the wrapper
Expand Down Expand Up @@ -407,4 +407,4 @@ template <> struct JSIConverter<SkISize> {
}
};

} // namespace rnwgpu
} // namespace RNJsi
18 changes: 9 additions & 9 deletions packages/skia/cpp/api/JsiSkNativeObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* be expressed as typed signatures (heterogeneous argument dispatch, typed
* array construction, lenient options objects, promises) — everything else
* uses installMethod/installGetter/installChainableMethod with typed C++
* signatures converted through rnwgpu::JSIConverter.
* signatures converted through RNJsi::JSIConverter.
*/
#define JSI_HOST_FUNCTION(NAME) \
jsi::Value NAME(jsi::Runtime &runtime, const jsi::Value &thisValue, \
Expand All @@ -36,7 +36,7 @@ namespace jsi = facebook::jsi;

// Minimum memory pressure reported for any native object — aliased from the
// NativeObject infrastructure so dispose() and create() agree on the floor.
static constexpr size_t kMinMemoryPressure = rnwgpu::kMinMemoryPressure;
static constexpr size_t kMinMemoryPressure = RNJsi::kMinMemoryPressure;

/**
* Creates the JS object for a wrapper instance (a class based on the
Expand Down Expand Up @@ -102,16 +102,16 @@ std::shared_ptr<T> getJsiObject(jsi::Runtime &runtime,
*
* Most methods use typed C++ signatures installed with installMethod /
* installGetter / installChainableMethod (arguments and results converted
* through rnwgpu::JSIConverter, see JsiSkConverters.h). Methods that cannot
* through RNJsi::JSIConverter, see JsiSkConverters.h). Methods that cannot
* be typed keep the classic JSI_HOST_FUNCTION signature and are installed
* with installHostMethod, which resolves the C++ instance from `this` via
* native state.
*/
template <typename Derived>
class JsiSkNativeObject : public rnwgpu::NativeObject<Derived> {
class JsiSkNativeObject : public RNJsi::NativeObject<Derived> {
public:
explicit JsiSkNativeObject(std::shared_ptr<RNSkPlatformContext> context)
: rnwgpu::NativeObject<Derived>(Derived::CLASS_NAME),
: RNJsi::NativeObject<Derived>(Derived::CLASS_NAME),
_context(std::move(context)) {}

/**
Expand All @@ -120,7 +120,7 @@ class JsiSkNativeObject : public rnwgpu::NativeObject<Derived> {
*/
static std::shared_ptr<Derived> fromThis(jsi::Runtime &runtime,
const jsi::Value &thisValue) {
return rnwgpu::NativeObject<Derived>::fromValue(runtime, thisValue);
return RNJsi::NativeObject<Derived>::fromValue(runtime, thisValue);
}

protected:
Expand Down Expand Up @@ -222,7 +222,7 @@ class JsiSkNativeObject : public rnwgpu::NativeObject<Derived> {
/**
* Installs a typed mutating method that returns `this` for chaining
* (e.g. path.moveTo(...).lineTo(...)). Arguments are converted through
* rnwgpu::JSIConverter like installMethod; the member function's return
* RNJsi::JSIConverter like installMethod; the member function's return
* value (if any) is ignored and the JS function returns thisValue.
*/
template <typename ReturnType, typename... Args>
Expand Down Expand Up @@ -270,7 +270,7 @@ class JsiSkNativeObject : public rnwgpu::NativeObject<Derived> {
ReturnType (Derived::*method)(Args...),
jsi::Runtime &runtime, const jsi::Value *args,
std::index_sequence<Is...>, size_t count) {
(obj->*method)(rnwgpu::JSIConverter<std::decay_t<Args>>::fromJSI(
(obj->*method)(RNJsi::JSIConverter<std::decay_t<Args>>::fromJSI(
runtime, args[Is], Is >= count)...);
}

Expand All @@ -280,7 +280,7 @@ class JsiSkNativeObject : public rnwgpu::NativeObject<Derived> {
jsi::Runtime &runtime, const jsi::Value *args, std::index_sequence<Is...>,
size_t count) {
(obj->*method)(runtime,
rnwgpu::JSIConverter<std::decay_t<Args>>::fromJSI(
RNJsi::JSIConverter<std::decay_t<Args>>::fromJSI(
runtime, args[Is], Is >= count)...);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/skia/cpp/api/JsiSkRuntimeEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct RuntimeEffectUniform {

} // namespace RNSkia

namespace rnwgpu {
namespace RNJsi {

// RuntimeEffectUniform -> {columns, rows, slot, isInteger}
template <> struct JSIConverter<RNSkia::RuntimeEffectUniform> {
Expand All @@ -54,7 +54,7 @@ template <> struct JSIConverter<RNSkia::RuntimeEffectUniform> {
}
};

} // namespace rnwgpu
} // namespace RNJsi

namespace RNSkia {

Expand Down
4 changes: 2 additions & 2 deletions packages/skia/cpp/jsi/EnumMapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdexcept>
#include <string>

namespace rnwgpu {
namespace RNJsi {

namespace EnumMapper {
// Add these two methods in namespace "EnumMapper" to allow parsing a custom
Expand Down Expand Up @@ -60,4 +60,4 @@ static void convertEnumToJSUnion(TEnum, std::string *) {
}
} // namespace EnumMapper

} // namespace rnwgpu
} // namespace RNJsi
4 changes: 2 additions & 2 deletions packages/skia/cpp/jsi/JSIConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <cxxabi.h>
#endif

namespace rnwgpu {
namespace RNJsi {

namespace jsi = facebook::jsi;

Expand Down Expand Up @@ -495,4 +495,4 @@ template <> struct JSIConverter<std::unordered_set<std::string>> {
}
};

} // namespace rnwgpu
} // namespace RNJsi
26 changes: 13 additions & 13 deletions packages/skia/cpp/jsi/NativeObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
#include "jsi/RuntimeAwareCache.h" // Use Skia's RuntimeAwareCache

// Forward declare to avoid circular dependency
namespace rnwgpu {
namespace RNJsi {
template <typename ArgType, typename SFINAE> struct JSIConverter;
} // namespace rnwgpu
} // namespace RNJsi

// Include the converter - must come after forward declaration
#include "JSIConverter.h"

namespace rnwgpu {
namespace RNJsi {

namespace jsi = facebook::jsi;

Expand Down Expand Up @@ -452,7 +452,7 @@ class NativeObject : public jsi::NativeState,
return jsi::Value::undefined();
} else {
ReturnType result = (native.get()->*getter)();
return rnwgpu::JSIConverter<std::decay_t<ReturnType>>::toJSI(
return RNJsi::JSIConverter<std::decay_t<ReturnType>>::toJSI(
rt, std::move(result));
}
});
Expand Down Expand Up @@ -487,7 +487,7 @@ class NativeObject : public jsi::NativeState,
throw jsi::JSError(rt, "Setter requires a value argument");
}
auto native = NativeObject<Derived>::fromValue(rt, thisVal);
auto value = rnwgpu::JSIConverter<std::decay_t<ValueType>>::fromJSI(
auto value = RNJsi::JSIConverter<std::decay_t<ValueType>>::fromJSI(
rt, args[0], false);
(native.get()->*setter)(std::move(value));
return jsi::Value::undefined();
Expand Down Expand Up @@ -535,7 +535,7 @@ class NativeObject : public jsi::NativeState,
const jsi::Value *args, size_t count) -> jsi::Value {
auto native = NativeObject<Derived>::fromValue(rt, thisVal);
ReturnType result = (native.get()->*getter)();
return rnwgpu::JSIConverter<std::decay_t<ReturnType>>::toJSI(
return RNJsi::JSIConverter<std::decay_t<ReturnType>>::toJSI(
rt, std::move(result));
});

Expand All @@ -548,7 +548,7 @@ class NativeObject : public jsi::NativeState,
throw jsi::JSError(rt, "Setter requires a value argument");
}
auto native = NativeObject<Derived>::fromValue(rt, thisVal);
auto value = rnwgpu::JSIConverter<std::decay_t<ValueType>>::fromJSI(
auto value = RNJsi::JSIConverter<std::decay_t<ValueType>>::fromJSI(
rt, args[0], false);
(native.get()->*setter)(std::move(value));
return jsi::Value::undefined();
Expand Down Expand Up @@ -579,9 +579,9 @@ class NativeObject : public jsi::NativeState,
jsi::Runtime &runtime, const jsi::Value *args,
std::index_sequence<Is...>, size_t count) {
ReturnType result = (obj->*method)(
runtime, rnwgpu::JSIConverter<std::decay_t<Args>>::fromJSI(
runtime, RNJsi::JSIConverter<std::decay_t<Args>>::fromJSI(
runtime, args[Is], Is >= count)...);
return rnwgpu::JSIConverter<std::decay_t<ReturnType>>::toJSI(
return RNJsi::JSIConverter<std::decay_t<ReturnType>>::toJSI(
runtime, std::move(result));
}

Expand All @@ -592,7 +592,7 @@ class NativeObject : public jsi::NativeState,
jsi::Runtime &runtime, const jsi::Value *args,
std::index_sequence<Is...>, size_t count) {
if constexpr (std::is_same_v<ReturnType, void>) {
(obj->*method)(rnwgpu::JSIConverter<std::decay_t<Args>>::fromJSI(
(obj->*method)(RNJsi::JSIConverter<std::decay_t<Args>>::fromJSI(
runtime, args[Is], Is >= count)...);
return jsi::Value::undefined();
} else if constexpr (std::is_same_v<ReturnType, jsi::Value>) {
Expand All @@ -601,9 +601,9 @@ class NativeObject : public jsi::NativeState,
return (obj->*method)(runtime, jsi::Value::undefined(), args, count);
} else {
ReturnType result =
(obj->*method)(rnwgpu::JSIConverter<std::decay_t<Args>>::fromJSI(
(obj->*method)(RNJsi::JSIConverter<std::decay_t<Args>>::fromJSI(
runtime, args[Is], Is >= count)...);
return rnwgpu::JSIConverter<std::decay_t<ReturnType>>::toJSI(
return RNJsi::JSIConverter<std::decay_t<ReturnType>>::toJSI(
runtime, std::move(result));
}
}
Expand All @@ -616,4 +616,4 @@ template <typename T>
struct is_native_object<std::shared_ptr<T>>
: std::bool_constant<std::is_base_of_v<NativeObject<T>, T>> {};

} // namespace rnwgpu
} // namespace RNJsi
4 changes: 2 additions & 2 deletions packages/skia/cpp/jsi/Promise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <utility>
#include <vector>

namespace rnwgpu {
namespace RNJsi {

namespace jsi = facebook::jsi;

Expand Down Expand Up @@ -45,4 +45,4 @@ void Promise::reject(std::string message) {
_rejecter.call(runtime, error.value());
}

} // namespace rnwgpu
} // namespace RNJsi
4 changes: 2 additions & 2 deletions packages/skia/cpp/jsi/Promise.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <utility>
#include <vector>

namespace rnwgpu {
namespace RNJsi {

namespace jsi = facebook::jsi;

Expand Down Expand Up @@ -34,4 +34,4 @@ class Promise {
static jsi::Value createPromise(jsi::Runtime &runtime, RunPromise run);
};

} // namespace rnwgpu
} // namespace RNJsi
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16689,9 +16689,9 @@ __metadata:
linkType: hard

"fast-uri@npm:^3.0.1":
version: 3.1.4
resolution: "fast-uri@npm:3.1.4"
checksum: 6e1262dd5901f4f095eeb4c446111f5818320f05a8f11eaa46d9117eec3b5fd6114507a66338c564004eaa002b0eb865ca998b34780373fd205d53b5182c3bd2
version: 3.1.5
resolution: "fast-uri@npm:3.1.5"
checksum: 8a95af13e0730ac5c3abeb7f3939dee9fa95f2652e0ebac7a072b5597f836200084340c9bc2030f392318cdb49ec04e3fd6f558fa24c58d6d373557b9c01d7fb
languageName: node
linkType: hard

Expand Down Expand Up @@ -18902,9 +18902,9 @@ __metadata:
linkType: hard

"ip-address@npm:^10.0.1":
version: 10.2.0
resolution: "ip-address@npm:10.2.0"
checksum: 3ffba04dc4cdaf81ed2ed6edc47eee1494bb97550ef73f1918ca28405d175c03efa416b8337e868123b08c2cc677e3a07c5ce03eda3b1aeb2741c149bd37ddf9
version: 10.4.0
resolution: "ip-address@npm:10.4.0"
checksum: 04e729990bc597bb0c86a02f71ffb8a19a47cd78e635209923079137fa06b8a27291d62fdddfeaf67b8e710ee51c46d2bbee1d1bf92f5101305e8276359c3df6
languageName: node
linkType: hard

Expand Down
Loading