Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old reconciler #2896

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions apps/paper/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-wgpu (0.1.19):
- react-native-wgpu (0.1.20):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1694,7 +1694,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNSVG (15.9.0):
- RNSVG (15.11.1):
- React-Core
- SocketRocket (0.7.0)
- Yoga (0.0.0)
Expand Down Expand Up @@ -1959,7 +1959,7 @@ SPEC CHECKSUMS:
react-native-safe-area-context: ab8f4a3d8180913bd78ae75dd599c94cce3d5e9a
react-native-skia: abdd2ba5abed61445a25d9461b0a87bc08c50f64
react-native-slider: 97ce0bd921f40de79cead9754546d5e4e7ba44f8
react-native-wgpu: 8d0437a304318e0e3d6ccbfed2a39880f8eae4dd
react-native-wgpu: efaa8c7c3ae15b346d887d13cca2fe72ed5ea105
React-nativeconfig: 57781b79e11d5af7573e6f77cbf1143b71802a6d
React-NativeModulesApple: 7ff2e2cfb2e5fa5bdedcecf28ce37e696c6ef1e1
React-perflogger: 8a360ccf603de6ddbe9ff8f54383146d26e6c936
Expand Down Expand Up @@ -1989,7 +1989,7 @@ SPEC CHECKSUMS:
RNGestureHandler: 939f21fabf5d45a725c0bf175eb819dd25cf2e70
RNReanimated: 9d20a811e6987cba268ef4f56242dfabd40e85c1
RNScreens: b03d696c70cc5235ce4587fcc27ae1a93a48f98c
RNSVG: 3d2bdcaef51c8071880a9c0072fe324f4423a3ba
RNSVG: 669ed128ab9005090c612a0d627dbecb6ab5c76f
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Yoga: 2a45d7e59592db061217551fd3bbe2dd993817ae

Expand Down
6 changes: 3 additions & 3 deletions apps/paper/src/Tests/Tests.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable no-eval */
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { SkiaDomView } from "@shopify/react-native-skia";
import {
Canvas,
Group,
makeImageFromView,
Skia,
useCanvasRef,
} from "@shopify/react-native-skia";
import React, { useEffect, useRef, useState } from "react";
import { PixelRatio, Text, View } from "react-native";
Expand All @@ -27,7 +27,7 @@ interface TestsProps {

export const Tests = ({ assets }: TestsProps) => {
const viewRef = useRef<View>(null);
const ref = useRef<SkiaDomView>(null);
const ref = useCanvasRef();
const [client, hostname] = useClient();
const [drawing, setDrawing] = useState<any>(null);
const [screen, setScreen] = useState<any>(null);
Expand Down Expand Up @@ -94,7 +94,7 @@ export const Tests = ({ assets }: TestsProps) => {
};
}
return;
}, [client, drawing]);
}, [client, drawing, ref]);
useEffect(() => {
if (screen) {
const it = setTimeout(async () => {
Expand Down
8 changes: 4 additions & 4 deletions apps/paper/src/components/ExportableCanvas.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { CanvasProps, SkiaDomView } from "@shopify/react-native-skia";
import { ImageFormat, Canvas } from "@shopify/react-native-skia";
import React, { useCallback, useRef } from "react";
import type { CanvasProps } from "@shopify/react-native-skia";
import { ImageFormat, Canvas, useCanvasRef } from "@shopify/react-native-skia";
import React, { useCallback } from "react";
import { Alert, Pressable, Share } from "react-native";

export const ExportableCanvas = ({ children, style }: CanvasProps) => {
const ref = useRef<SkiaDomView>(null);
const ref = useCanvasRef();

const handleShare = useCallback(() => {
const image = ref.current?.makeImageSnapshot();
Expand Down
8 changes: 0 additions & 8 deletions packages/skia/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ add_library(
"${PROJECT_SOURCE_DIR}/../cpp/jsi/JsiPromises.cpp"

"${PROJECT_SOURCE_DIR}/../cpp/rnskia/RNSkManager.cpp"
"${PROJECT_SOURCE_DIR}/../cpp/rnskia/RNSkDomView.cpp"

"${PROJECT_SOURCE_DIR}/../cpp/rnskia/dom/base/DrawingContext.cpp"
"${PROJECT_SOURCE_DIR}/../cpp/rnskia/dom/base/ConcatablePaint.cpp"

"${PROJECT_SOURCE_DIR}/../cpp/api/third_party/CSSColorParser.cpp"
"${PROJECT_SOURCE_DIR}/../cpp/api/third_party/base64.cpp"
Expand Down Expand Up @@ -122,10 +118,6 @@ target_include_directories(
../cpp/jsi
../cpp/rnskia
../cpp/rnskia/values
../cpp/rnskia/dom
../cpp/rnskia/dom/base
../cpp/rnskia/dom/nodes
../cpp/rnskia/dom/props
../cpp/utils

${libfbjni_include_DIRS}
Expand Down
2 changes: 0 additions & 2 deletions packages/skia/android/cpp/jni/JniLoad.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "JniPlatformContext.h"
#include "JniSkiaDomView.h"
#include "JniSkiaManager.h"
#include "JniSkiaPictureView.h"
#include <fbjni/fbjni.h>
Expand All @@ -9,7 +8,6 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
return facebook::jni::initialize(vm, [] {
RNSkia::JniSkiaManager::registerNatives();
RNSkia::JniSkiaPictureView::registerNatives();
RNSkia::JniSkiaDomView::registerNatives();
RNSkia::JniPlatformContext::registerNatives();
});
}
82 changes: 0 additions & 82 deletions packages/skia/android/cpp/jni/include/JniSkiaDomView.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public NativeModule getModule(String s, ReactApplicationContext reactApplication

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Arrays.<ViewManager>asList(new SkiaPictureViewManager(), new SkiaDomViewManager());
return Arrays.<ViewManager>asList(new SkiaPictureViewManager());
}

@Override
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

21 changes: 5 additions & 16 deletions packages/skia/cpp/jsi/ViewProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <string>
#include <variant>

#include "JsiDomRenderNode.h"
#include "JsiSkPicture.h"

namespace RNJsi {
Expand All @@ -18,32 +17,22 @@ class ViewProperty {
auto object = value.asObject(runtime);
if (object.isHostObject(runtime)) {
auto hostObject = object.asHostObject(runtime);
auto dom =
std::dynamic_pointer_cast<RNSkia::JsiDomRenderNode>(hostObject);
if (dom) {
_value = dom;
} else {
auto jsiPicture =
std::dynamic_pointer_cast<RNSkia::JsiSkPicture>(hostObject);
if (jsiPicture) {
_value = jsiPicture->getObject();
}
auto jsiPicture =
std::dynamic_pointer_cast<RNSkia::JsiSkPicture>(hostObject);
if (jsiPicture) {
_value = jsiPicture->getObject();
}
}
}
}

bool isNull() { return std::holds_alternative<nullptr_t>(_value); }

std::shared_ptr<RNSkia::JsiDomRenderNode> getDomRenderNode() {
return std::get<std::shared_ptr<RNSkia::JsiDomRenderNode>>(_value);
}

sk_sp<SkPicture> getPicture() { return std::get<sk_sp<SkPicture>>(_value); }

private:
std::variant<nullptr_t, sk_sp<SkPicture>,
std::shared_ptr<RNSkia::JsiDomRenderNode>>
std::variant<nullptr_t, sk_sp<SkPicture>>
_value = nullptr;
};
} // namespace RNJsi
Loading
Loading