Skip to content

Commit 0944293

Browse files
committed
Merge branch 'main' into skiaview
2 parents 4153fa9 + 8e38749 commit 0944293

File tree

92 files changed

+20
-3807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+20
-3807
lines changed

docs/docs/animations/reanimated2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In the example below, the animation runs on the JS thread due to the use of Rean
2121

2222
```tsx twoslash
2323
import {useEffect} from "react";
24-
import {Canvas, Rect, mix, useValue} from "@shopify/react-native-skia";
24+
import {Canvas, Rect, mix} from "@shopify/react-native-skia";
2525
import {useSharedValue, withRepeat, withTiming, useDerivedValue} from "react-native-reanimated";
2626

2727
const MyComponent = () => {

docs/docs/shapes/custom-drawing.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

docs/sidebars.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const sidebars = {
5454
"shapes/vertices",
5555
"shapes/patch",
5656
"shapes/pictures",
57-
"shapes/custom-drawing",
5857
],
5958
},
6059
{

package/cpp/rnskia/RNSkAnimation.h

Lines changed: 0 additions & 65 deletions
This file was deleted.

package/cpp/rnskia/RNSkJsiViewApi.h

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "JsiHostObject.h"
1111
#include "JsiValueWrapper.h"
1212
#include "RNSkPlatformContext.h"
13-
#include "RNSkValue.h"
1413
#include "RNSkView.h"
1514
#include <jsi/jsi.h>
1615

@@ -178,59 +177,8 @@ class RNSkJsiViewApi : public RNJsi::JsiHostObject,
178177
return jsi::Value::undefined();
179178
}
180179

181-
JSI_HOST_FUNCTION(registerValuesInView) {
182-
// Check params
183-
if (!arguments[1].isObject() ||
184-
!arguments[1].asObject(runtime).isArray(runtime)) {
185-
throw jsi::JSError(runtime,
186-
"Expected array of Values as second parameter");
187-
return jsi::Value::undefined();
188-
}
189-
190-
// Get identifier of native SkiaView
191-
int nativeId = arguments[0].asNumber();
192-
193-
// Get values that should be added as dependencies
194-
auto values = arguments[1].asObject(runtime).asArray(runtime);
195-
std::vector<std::function<void()>> unsubscribers;
196-
const std::size_t size = values.size(runtime);
197-
unsubscribers.reserve(size);
198-
for (size_t i = 0; i < size; ++i) {
199-
auto value = values.getValueAtIndex(runtime, i)
200-
.asObject(runtime)
201-
.asHostObject<RNSkReadonlyValue>(runtime);
202-
203-
if (value != nullptr) {
204-
// Add change listener
205-
unsubscribers.push_back(value->addListener(
206-
[weakSelf = weak_from_this(), nativeId](jsi::Runtime &) {
207-
auto self = weakSelf.lock();
208-
if (self) {
209-
auto info = self->getEnsuredViewInfo(nativeId);
210-
if (info->view != nullptr) {
211-
info->view->requestRedraw();
212-
}
213-
}
214-
}));
215-
}
216-
}
217-
218-
// Return unsubscribe method that unsubscribes to all values
219-
// that we subscribed to.
220-
return jsi::Function::createFromHostFunction(
221-
runtime, jsi::PropNameID::forUtf8(runtime, "unsubscribe"), 0,
222-
JSI_HOST_FUNCTION_LAMBDA {
223-
// decrease dependency count on the Skia View
224-
for (auto &unsub : unsubscribers) {
225-
unsub();
226-
}
227-
return jsi::Value::undefined();
228-
});
229-
}
230-
231180
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(RNSkJsiViewApi, setJsiProperty),
232181
JSI_EXPORT_FUNC(RNSkJsiViewApi, callJsiMethod),
233-
JSI_EXPORT_FUNC(RNSkJsiViewApi, registerValuesInView),
234182
JSI_EXPORT_FUNC(RNSkJsiViewApi, requestRedraw),
235183
JSI_EXPORT_FUNC(RNSkJsiViewApi, makeImageSnapshot))
236184

package/cpp/rnskia/RNSkManager.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include <JsiSkApi.h>
99
#include <RNSkJsiViewApi.h>
10-
#include <RNSkValueApi.h>
1110
#include <RNSkView.h>
1211

1312
#include <JsiDomApi.h>
@@ -80,11 +79,6 @@ void RNSkManager::installBindings() {
8079
*_jsRuntime, "SkiaViewApi",
8180
jsi::Object::createFromHostObject(*_jsRuntime, _viewApi));
8281

83-
auto skiaValueApi = std::make_shared<RNSkValueApi>(_platformContext);
84-
_jsRuntime->global().setProperty(
85-
*_jsRuntime, "SkiaValueApi",
86-
jsi::Object::createFromHostObject(*_jsRuntime, std::move(skiaValueApi)));
87-
8882
auto skiaDomApi = std::make_shared<JsiDomApi>(_platformContext);
8983
_jsRuntime->global().setProperty(
9084
*_jsRuntime, "SkiaDomApi",

package/cpp/rnskia/RNSkValueApi.h

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)