@shopify/react-native-skia 0.1.180 → 0.1.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +6 -1
- package/cpp/api/JsiSkData.h +7 -0
- package/cpp/api/JsiSkImage.h +7 -1
- package/cpp/api/JsiSkSVG.h +7 -0
- package/cpp/api/JsiSkTypeface.h +7 -0
- package/cpp/jsi/RuntimeAwareCache.cpp +0 -2
- package/cpp/rnskia/RNSkDomView.cpp +2 -2
- package/cpp/rnskia/RNSkPlatformContext.h +2 -2
- package/cpp/rnskia/dom/base/DerivedNodeProp.h +1 -1
- package/cpp/rnskia/dom/base/JsiDependencyManager.h +10 -6
- package/cpp/rnskia/dom/base/JsiDomNode.h +133 -78
- package/cpp/rnskia/dom/base/JsiDomRenderNode.h +17 -5
- package/cpp/rnskia/dom/base/NodeProp.h +5 -5
- package/cpp/rnskia/dom/base/NodePropsContainer.h +8 -2
- package/cpp/rnskia/dom/props/ClipProp.h +13 -20
- package/cpp/rnskia/dom/props/PathProp.h +16 -14
- package/cpp/rnskia/dom/props/PointProp.h +1 -1
- package/cpp/rnskia/dom/props/RRectProp.h +39 -61
- package/cpp/rnskia/dom/props/RectProp.h +27 -25
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +0 -2
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +56 -54
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +30 -9
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +1 -0
- package/lib/commonjs/renderer/HostComponents.js +6 -1
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.js +3 -1
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +2 -2
- package/lib/commonjs/skia/core/Data.js +5 -0
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.d.ts +2 -2
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.d.ts +2 -2
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.d.ts +3 -0
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkData.js +3 -0
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkImage.js +4 -0
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.js +4 -0
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js +5 -1
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +55 -54
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/renderer/Canvas.js +29 -10
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +1 -0
- package/lib/module/renderer/HostComponents.js +3 -0
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/Reconciler.js +2 -1
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +2 -2
- package/lib/module/skia/core/Data.js +5 -0
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/types/Data/Data.d.ts +2 -2
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/types/Image/Image.d.ts +2 -2
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.d.ts +3 -0
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/module/skia/types/SVG/SVG.js.map +1 -1
- package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.d.ts +1 -0
- package/lib/module/skia/web/JsiSkData.js +3 -0
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.d.ts +1 -0
- package/lib/module/skia/web/JsiSkImage.js +4 -0
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.d.ts +1 -0
- package/lib/module/skia/web/JsiSkTypeface.js +4 -0
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +5 -1
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/typescript/src/renderer/HostComponents.d.ts +1 -0
- package/lib/typescript/src/skia/core/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/Data/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/Image/Image.d.ts +2 -2
- package/lib/typescript/src/skia/types/JsiInstance.d.ts +3 -0
- package/lib/typescript/src/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/typescript/src/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkImage.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +1 -0
- package/package.json +1 -1
- package/src/dom/nodes/JsiSkDOM.ts +55 -54
- package/src/renderer/Canvas.tsx +34 -14
- package/src/renderer/HostComponents.ts +4 -0
- package/src/renderer/Reconciler.tsx +2 -1
- package/src/skia/core/Data.ts +14 -6
- package/src/skia/types/Data/Data.ts +2 -2
- package/src/skia/types/Image/Image.ts +2 -2
- package/src/skia/types/JsiInstance.ts +4 -0
- package/src/skia/types/SVG/SVG.ts +2 -2
- package/src/skia/types/Typeface/Typeface.ts +2 -2
- package/src/skia/web/JsiSkData.ts +4 -0
- package/src/skia/web/JsiSkImage.ts +4 -0
- package/src/skia/web/JsiSkTypeface.ts +4 -0
- package/src/views/SkiaBaseWebView.tsx +5 -0
|
@@ -22,32 +22,34 @@ public:
|
|
|
22
22
|
_pathProp = defineProperty<NodeProp>(name);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
setDerivedValue(nullptr);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (_pathProp->value().getType() == PropType::HostObject) {
|
|
25
|
+
static std::shared_ptr<SkPath> processPath(const JsiValue &value) {
|
|
26
|
+
if (value.getType() == PropType::HostObject) {
|
|
32
27
|
// Try reading as Path
|
|
33
|
-
auto ptr = std::dynamic_pointer_cast<JsiSkPath>(
|
|
34
|
-
_pathProp->value().getAsHostObject());
|
|
28
|
+
auto ptr = std::dynamic_pointer_cast<JsiSkPath>(value.getAsHostObject());
|
|
35
29
|
if (ptr != nullptr) {
|
|
36
|
-
|
|
30
|
+
return ptr->getObject();
|
|
37
31
|
}
|
|
38
|
-
} else if (
|
|
32
|
+
} else if (value.getType() == PropType::String) {
|
|
39
33
|
// Read as string
|
|
40
|
-
auto pathString =
|
|
34
|
+
auto pathString = value.getAsString();
|
|
41
35
|
SkPath result;
|
|
42
36
|
|
|
43
37
|
if (SkParsePath::FromSVGString(pathString.c_str(), &result)) {
|
|
44
|
-
|
|
38
|
+
return std::make_shared<SkPath>(result);
|
|
45
39
|
} else {
|
|
46
40
|
throw std::runtime_error("Could not parse path from string.");
|
|
47
41
|
}
|
|
48
|
-
}
|
|
42
|
+
}
|
|
43
|
+
return nullptr;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
void updateDerivedValue() override {
|
|
47
|
+
if (!_pathProp->isSet()) {
|
|
49
48
|
setDerivedValue(nullptr);
|
|
49
|
+
return;
|
|
50
50
|
}
|
|
51
|
+
auto value = _pathProp->value();
|
|
52
|
+
setDerivedValue(PathProp::processPath(value));
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
private:
|
|
@@ -29,7 +29,7 @@ public:
|
|
|
29
29
|
void updateDerivedValue() override {
|
|
30
30
|
if (_pointProp->isSet()) {
|
|
31
31
|
// Check for JsiSkRect and JsiSkPoint
|
|
32
|
-
setDerivedValue(
|
|
32
|
+
setDerivedValue(processValue(_pointProp->value()));
|
|
33
33
|
} else {
|
|
34
34
|
setDerivedValue(nullptr);
|
|
35
35
|
}
|
|
@@ -33,35 +33,33 @@ public:
|
|
|
33
33
|
_prop = defineProperty<NodeProp>(name);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
auto
|
|
57
|
-
auto
|
|
58
|
-
auto
|
|
59
|
-
auto
|
|
60
|
-
auto rx = _prop->value().getValue(PropNameRx);
|
|
61
|
-
auto ry = _prop->value().getValue(PropNameRy);
|
|
36
|
+
static std::shared_ptr<SkRRect> processRRect(const JsiValue &value) {
|
|
37
|
+
if (value.getType() == PropType::HostObject) {
|
|
38
|
+
// Try reading as rect
|
|
39
|
+
auto rectPtr =
|
|
40
|
+
std::dynamic_pointer_cast<JsiSkRRect>(value.getAsHostObject());
|
|
41
|
+
if (rectPtr != nullptr) {
|
|
42
|
+
auto rrect = rectPtr->getObject();
|
|
43
|
+
return std::make_shared<SkRRect>(
|
|
44
|
+
SkRRect::MakeRectXY(rrect->rect(), rrect->getSimpleRadii().x(),
|
|
45
|
+
rrect->getSimpleRadii().y()));
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
if (value.getType() == PropType::Object) {
|
|
49
|
+
if (value.hasValue(PropNameRect) && value.hasValue(PropNameRx) &&
|
|
50
|
+
value.hasValue(PropNameRy)) {
|
|
51
|
+
auto rect = value.getValue(PropNameRect);
|
|
52
|
+
if (rect.hasValue(PropNameX) && rect.hasValue(PropNameY) &&
|
|
53
|
+
rect.hasValue(PropNameWidth) && rect.hasValue(PropNameHeight)) {
|
|
54
|
+
auto x = rect.getValue(PropNameX);
|
|
55
|
+
auto y = rect.getValue(PropNameY);
|
|
56
|
+
auto width = rect.getValue(PropNameWidth);
|
|
57
|
+
auto height = rect.getValue(PropNameHeight);
|
|
58
|
+
auto rx = value.getValue(PropNameRx);
|
|
59
|
+
auto ry = value.getValue(PropNameRy);
|
|
62
60
|
|
|
63
61
|
// Update cache from js object value
|
|
64
|
-
|
|
62
|
+
return std::make_shared<SkRRect>(SkRRect::MakeRectXY(
|
|
65
63
|
SkRect::MakeXYWH(x.getAsNumber(), y.getAsNumber(),
|
|
66
64
|
width.getAsNumber(), height.getAsNumber()),
|
|
67
65
|
rx.getAsNumber(), ry.getAsNumber()));
|
|
@@ -69,6 +67,14 @@ public:
|
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
69
|
}
|
|
70
|
+
return nullptr;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
void updateDerivedValue() override {
|
|
74
|
+
if (_prop->isSet()) {
|
|
75
|
+
auto value = _prop->value();
|
|
76
|
+
setDerivedValue(RRectProp::processRRect(value));
|
|
77
|
+
}
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
private:
|
|
@@ -150,40 +156,12 @@ public:
|
|
|
150
156
|
}
|
|
151
157
|
|
|
152
158
|
void updateDerivedValue() override {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (rectPtr != nullptr) {
|
|
160
|
-
auto rect = rectPtr->getObject();
|
|
161
|
-
setDerivedValue(SkRRect::MakeRect(*rect));
|
|
162
|
-
// 2. box is SkRRect
|
|
163
|
-
} else if (rrectPtr != nullptr) {
|
|
164
|
-
setDerivedValue(rrectPtr->getObject());
|
|
165
|
-
}
|
|
166
|
-
} else if (_boxProp->value().getType() == PropType::Object) {
|
|
167
|
-
if (_boxProp->value().hasValue(PropNameRect)) {
|
|
168
|
-
// 3. box is { rect: { x, y, width, height }, rx, ry }
|
|
169
|
-
auto rectProp = _boxProp->value().getValue(PropNameRect);
|
|
170
|
-
auto x = rectProp.getValue(PropNameX).getAsNumber();
|
|
171
|
-
auto y = rectProp.getValue(PropNameY).getAsNumber();
|
|
172
|
-
auto width = rectProp.getValue(PropNameWidth).getAsNumber();
|
|
173
|
-
auto height = rectProp.getValue(PropNameHeight).getAsNumber();
|
|
174
|
-
auto rx = _boxProp->value().getValue(PropNameRx).getAsNumber();
|
|
175
|
-
auto ry = _boxProp->value().getValue(PropNameRy).getAsNumber();
|
|
176
|
-
setDerivedValue(
|
|
177
|
-
SkRRect::MakeRectXY(SkRect::MakeXYWH(x, y, width, height), rx, ry));
|
|
178
|
-
} else {
|
|
179
|
-
// 4. box is { x, y, width, height }
|
|
180
|
-
auto x = _boxProp->value().getValue(PropNameX).getAsNumber();
|
|
181
|
-
auto y = _boxProp->value().getValue(PropNameY).getAsNumber();
|
|
182
|
-
auto width = _boxProp->value().getValue(PropNameWidth).getAsNumber();
|
|
183
|
-
auto height = _boxProp->value().getValue(PropNameHeight).getAsNumber();
|
|
184
|
-
setDerivedValue(
|
|
185
|
-
SkRRect::MakeRect(SkRect::MakeXYWH(x, y, width, height)));
|
|
186
|
-
}
|
|
159
|
+
auto value = _boxProp->value();
|
|
160
|
+
auto rect = RectProp::processRect(value);
|
|
161
|
+
if (rect) {
|
|
162
|
+
setDerivedValue(SkRRect::MakeRect(*rect));
|
|
163
|
+
} else {
|
|
164
|
+
setDerivedValue(RRectProp::processRRect(value));
|
|
187
165
|
}
|
|
188
166
|
}
|
|
189
167
|
|
|
@@ -31,33 +31,35 @@ public:
|
|
|
31
31
|
_prop = defineProperty<NodeProp>(name);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
static std::shared_ptr<SkRect> processRect(const JsiValue &value) {
|
|
35
|
+
if (value.getType() == PropType::HostObject) {
|
|
36
|
+
auto rectPtr =
|
|
37
|
+
std::dynamic_pointer_cast<JsiSkRect>(value.getAsHostObject());
|
|
38
|
+
if (rectPtr != nullptr) {
|
|
39
|
+
return std::make_shared<SkRect>(SkRect::MakeXYWH(
|
|
40
|
+
rectPtr->getObject()->x(), rectPtr->getObject()->y(),
|
|
41
|
+
rectPtr->getObject()->width(), rectPtr->getObject()->height()));
|
|
42
|
+
}
|
|
43
|
+
} else if (value.getType() == PropType::Object &&
|
|
44
|
+
value.hasValue(PropNameX) && value.hasValue(PropNameY) &&
|
|
45
|
+
value.hasValue(PropNameWidth) &&
|
|
46
|
+
value.hasValue(PropNameHeight)) {
|
|
47
|
+
// Save props for fast access
|
|
48
|
+
auto x = value.getValue(PropNameX);
|
|
49
|
+
auto y = value.getValue(PropNameY);
|
|
50
|
+
auto width = value.getValue(PropNameWidth);
|
|
51
|
+
auto height = value.getValue(PropNameHeight);
|
|
52
|
+
// Update cache from js object value
|
|
53
|
+
return std::make_shared<SkRect>(
|
|
54
|
+
SkRect::MakeXYWH(x.getAsNumber(), y.getAsNumber(),
|
|
55
|
+
width.getAsNumber(), height.getAsNumber()));
|
|
56
|
+
}
|
|
57
|
+
return nullptr;
|
|
58
|
+
}
|
|
59
|
+
|
|
34
60
|
void updateDerivedValue() override {
|
|
35
61
|
if (_prop->isSet()) {
|
|
36
|
-
|
|
37
|
-
if (_prop->value().getType() == PropType::HostObject) {
|
|
38
|
-
auto rectPtr = std::dynamic_pointer_cast<JsiSkRect>(
|
|
39
|
-
_prop->value().getAsHostObject());
|
|
40
|
-
if (rectPtr != nullptr) {
|
|
41
|
-
setDerivedValue(SkRect::MakeXYWH(
|
|
42
|
-
rectPtr->getObject()->x(), rectPtr->getObject()->y(),
|
|
43
|
-
rectPtr->getObject()->width(), rectPtr->getObject()->height()));
|
|
44
|
-
}
|
|
45
|
-
} else {
|
|
46
|
-
auto p = _prop->value();
|
|
47
|
-
if (p.hasValue(PropNameX) && p.hasValue(PropNameY) &&
|
|
48
|
-
p.hasValue(PropNameWidth) && p.hasValue(PropNameHeight)) {
|
|
49
|
-
// Save props for fast access
|
|
50
|
-
auto x = p.getValue(PropNameX);
|
|
51
|
-
auto y = p.getValue(PropNameY);
|
|
52
|
-
auto width = p.getValue(PropNameWidth);
|
|
53
|
-
auto height = p.getValue(PropNameHeight);
|
|
54
|
-
|
|
55
|
-
// Update cache from js object value
|
|
56
|
-
setDerivedValue(SkRect::MakeXYWH(x.getAsNumber(), y.getAsNumber(),
|
|
57
|
-
width.getAsNumber(),
|
|
58
|
-
height.getAsNumber()));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
62
|
+
setDerivedValue(RectProp::processRect(_prop->value()));
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
#include <thread>
|
|
5
5
|
#include <utility>
|
|
6
6
|
|
|
7
|
-
#include <RNSkMeasureTime.h>
|
|
8
7
|
#include <SkiaMetalRenderer.h>
|
|
9
8
|
|
|
10
9
|
#pragma clang diagnostic push
|
|
@@ -20,7 +19,6 @@ void RNSkiOSPlatformContext::performStreamOperation(
|
|
|
20
19
|
const std::string &sourceUri,
|
|
21
20
|
const std::function<void(std::unique_ptr<SkStreamAsset>)> &op) {
|
|
22
21
|
|
|
23
|
-
RNSkMeasureTime("PlatformContext::performStreamOperation");
|
|
24
22
|
auto loader = [=]() {
|
|
25
23
|
NSURL *url = [[NSURL alloc]
|
|
26
24
|
initWithString:[NSString stringWithUTF8String:sourceUri.c_str()]];
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.JsiSkDOM = void 0;
|
|
7
7
|
|
|
8
|
+
var _HostComponents = require("../../renderer/HostComponents");
|
|
9
|
+
|
|
8
10
|
var _drawings = require("./drawings");
|
|
9
11
|
|
|
10
12
|
var _paint = require("./paint");
|
|
@@ -27,139 +29,139 @@ class JsiSkDOM {
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
Layer(props) {
|
|
30
|
-
return
|
|
32
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LayerNode(props ?? {}) : new _LayerNode.LayerNode(this.ctx, props ?? {});
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
Group(props) {
|
|
34
|
-
return
|
|
36
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.GroupNode(props ?? {}) : new _GroupNode.GroupNode(this.ctx, props ?? {});
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
Paint(props) {
|
|
38
|
-
return
|
|
40
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PaintNode(props ?? {}) : new _PaintNode.PaintNode(this.ctx, props);
|
|
39
41
|
} // Drawings
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
Fill(props) {
|
|
43
|
-
return
|
|
45
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.FillNode(props ?? {}) : new _drawings.FillNode(this.ctx, props);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
Image(props) {
|
|
47
|
-
return
|
|
49
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ImageNode(props ?? {}) : new _drawings.ImageNode(this.ctx, props);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
Circle(props) {
|
|
51
|
-
return
|
|
53
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.CircleNode(props ?? {}) : new _drawings.CircleNode(this.ctx, props);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
Path(props) {
|
|
55
|
-
return
|
|
57
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PathNode(props ?? {}) : new _drawings.PathNode(this.ctx, props);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
CustomDrawing(props) {
|
|
59
|
-
return
|
|
61
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.CustomDrawingNode(props ?? {}) : new _drawings.CustomDrawingNode(this.ctx, props);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
Line(props) {
|
|
63
|
-
return
|
|
65
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LineNode(props ?? {}) : new _drawings.LineNode(this.ctx, props);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
Oval(props) {
|
|
67
|
-
return
|
|
69
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.OvalNode(props ?? {}) : new _drawings.OvalNode(this.ctx, props);
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
Patch(props) {
|
|
71
|
-
return
|
|
73
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PatchNode(props ?? {}) : new _drawings.PatchNode(this.ctx, props);
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
Points(props) {
|
|
75
|
-
return
|
|
77
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PointsNode(props ?? {}) : new _drawings.PointsNode(this.ctx, props);
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
Rect(props) {
|
|
79
|
-
return
|
|
81
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.RectNode(props) : new _drawings.RectNode(this.ctx, props);
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
RRect(props) {
|
|
83
|
-
return
|
|
85
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.RRectNode(props) : new _drawings.RRectNode(this.ctx, props);
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
Vertices(props) {
|
|
87
|
-
return
|
|
89
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.VerticesNode(props) : new _drawings.VerticesNode(this.ctx, props);
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
Text(props) {
|
|
91
|
-
return
|
|
93
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TextNode(props) : new _drawings.TextNode(this.ctx, props);
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
TextPath(props) {
|
|
95
|
-
return
|
|
97
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TextPathNode(props) : new _drawings.TextPathNode(this.ctx, props);
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
TextBlob(props) {
|
|
99
|
-
return
|
|
101
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TextBlobNode(props) : new _drawings.TextBlobNode(this.ctx, props);
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
Glyphs(props) {
|
|
103
|
-
return
|
|
105
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.GlyphsNode(props) : new _drawings.GlyphsNode(this.ctx, props);
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
DiffRect(props) {
|
|
107
|
-
return
|
|
109
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DiffRectNode(props) : new _drawings.DiffRectNode(this.ctx, props);
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
Picture(props) {
|
|
111
|
-
return
|
|
113
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.PictureNode(props) : new _drawings.PictureNode(this.ctx, props);
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
ImageSVG(props) {
|
|
115
|
-
return
|
|
117
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ImageSVGNode(props) : new _drawings.ImageSVGNode(this.ctx, props);
|
|
116
118
|
} // BlurMaskFilters
|
|
117
119
|
|
|
118
120
|
|
|
119
121
|
BlurMaskFilter(props) {
|
|
120
|
-
return
|
|
122
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlurMaskFilterNode(props) : new _paint.BlurMaskFilterNode(this.ctx, props);
|
|
121
123
|
} // ImageFilters
|
|
122
124
|
|
|
123
125
|
|
|
124
126
|
BlendImageFilter(props) {
|
|
125
|
-
return
|
|
127
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlendImageFilterNode(props) : new _paint.BlendImageFilterNode(this.ctx, props);
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
DropShadowImageFilter(props) {
|
|
129
|
-
return
|
|
131
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DropShadowImageFilterNode(props) : new _paint.DropShadowImageFilterNode(this.ctx, props);
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
DisplacementMapImageFilter(props) {
|
|
133
|
-
return
|
|
135
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DisplacementMapImageFilterNode(props) : new _paint.DisplacementMapImageFilterNode(this.ctx, props);
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
BlurImageFilter(props) {
|
|
137
|
-
return
|
|
139
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlurImageFilterNode(props) : new _paint.BlurImageFilterNode(this.ctx, props);
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
OffsetImageFilter(props) {
|
|
141
|
-
return
|
|
143
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.OffsetImageFilterNode(props) : new _paint.OffsetImageFilterNode(this.ctx, props);
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
MorphologyImageFilter(props) {
|
|
145
|
-
return
|
|
147
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.MorphologyImageFilterNode(props) : new _ImageFilters.MorphologyImageFilterNode(this.ctx, props);
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
RuntimeShaderImageFilter(props) {
|
|
149
|
-
return
|
|
151
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.RuntimeShaderImageFilterNode(props) : new _paint.RuntimeShaderImageFilterNode(this.ctx, props);
|
|
150
152
|
} // Color Filters
|
|
151
153
|
|
|
152
154
|
|
|
153
155
|
MatrixColorFilter(props) {
|
|
154
|
-
return
|
|
156
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.MatrixColorFilterNode(props) : new _ColorFilters.MatrixColorFilterNode(this.ctx, props);
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
BlendColorFilter(props) {
|
|
158
|
-
return
|
|
160
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlendColorFilterNode(props) : new _ColorFilters.BlendColorFilterNode(this.ctx, props);
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
LumaColorFilter() {
|
|
162
|
-
return
|
|
164
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LumaColorFilterNode() : new _ColorFilters.LumaColorFilterNode(this.ctx);
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
LinearToSRGBGammaColorFilter() {
|
|
@@ -171,89 +173,89 @@ class JsiSkDOM {
|
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
LerpColorFilter(props) {
|
|
174
|
-
return
|
|
176
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LerpColorFilterNode(props) : new _ColorFilters.LerpColorFilterNode(this.ctx, props);
|
|
175
177
|
} // Shaders
|
|
176
178
|
|
|
177
179
|
|
|
178
180
|
Shader(props) {
|
|
179
|
-
return
|
|
181
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ShaderNode(props) : new _Shaders.ShaderNode(this.ctx, props);
|
|
180
182
|
}
|
|
181
183
|
|
|
182
184
|
ImageShader(props) {
|
|
183
|
-
return
|
|
185
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ImageShaderNode(props) : new _Shaders.ImageShaderNode(this.ctx, props);
|
|
184
186
|
}
|
|
185
187
|
|
|
186
188
|
ColorShader(props) {
|
|
187
|
-
return
|
|
189
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.ColorShaderNode(props) : new _Shaders.ColorNode(this.ctx, props);
|
|
188
190
|
}
|
|
189
191
|
|
|
190
192
|
SweepGradient(props) {
|
|
191
|
-
return
|
|
193
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.SweepGradientNode(props) : new _Shaders.SweepGradientNode(this.ctx, props);
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
Turbulence(props) {
|
|
195
|
-
return
|
|
197
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TurbulenceNode(props) : new _Shaders.TurbulenceNode(this.ctx, props);
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
FractalNoise(props) {
|
|
199
|
-
return
|
|
201
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.FractalNoiseNode(props) : new _Shaders.FractalNoiseNode(this.ctx, props);
|
|
200
202
|
}
|
|
201
203
|
|
|
202
204
|
LinearGradient(props) {
|
|
203
|
-
return
|
|
205
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.LinearGradientNode(props) : new _Shaders.LinearGradientNode(this.ctx, props);
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
RadialGradient(props) {
|
|
207
|
-
return
|
|
209
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.RadialGradientNode(props) : new _Shaders.RadialGradientNode(this.ctx, props);
|
|
208
210
|
}
|
|
209
211
|
|
|
210
212
|
TwoPointConicalGradient(props) {
|
|
211
|
-
return
|
|
213
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.TwoPointConicalGradientNode(props) : new _Shaders.TwoPointConicalGradientNode(this.ctx, props);
|
|
212
214
|
} // Path Effects
|
|
213
215
|
|
|
214
216
|
|
|
215
217
|
CornerPathEffect(props) {
|
|
216
|
-
return
|
|
218
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.CornerPathEffectNode(props) : new _paint.CornerPathEffectNode(this.ctx, props);
|
|
217
219
|
}
|
|
218
220
|
|
|
219
221
|
DiscretePathEffect(props) {
|
|
220
|
-
return
|
|
222
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DiscretePathEffectNode(props) : new _paint.DiscretePathEffectNode(this.ctx, props);
|
|
221
223
|
}
|
|
222
224
|
|
|
223
225
|
DashPathEffect(props) {
|
|
224
|
-
return
|
|
226
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.DashPathEffectNode(props) : new _paint.DashPathEffectNode(this.ctx, props);
|
|
225
227
|
}
|
|
226
228
|
|
|
227
229
|
Path1DPathEffect(props) {
|
|
228
|
-
return
|
|
230
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.Path1DPathEffectNode(props) : new _paint.Path1DPathEffectNode(this.ctx, props);
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
Path2DPathEffect(props) {
|
|
232
|
-
return
|
|
234
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.Path2DPathEffectNode(props) : new _paint.Path2DPathEffectNode(this.ctx, props);
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
SumPathEffect() {
|
|
236
|
-
return
|
|
238
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.SumPathEffectNode() : new _paint.SumPathEffectNode(this.ctx);
|
|
237
239
|
}
|
|
238
240
|
|
|
239
241
|
Line2DPathEffect(props) {
|
|
240
|
-
return
|
|
242
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.Line2DPathEffectNode(props) : new _paint.Line2DPathEffectNode(this.ctx, props);
|
|
241
243
|
}
|
|
242
244
|
|
|
243
245
|
Blend(props) {
|
|
244
|
-
return
|
|
246
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BlendNode(props) : new _paint.BlendNode(this.ctx, props);
|
|
245
247
|
}
|
|
246
248
|
|
|
247
249
|
BackdropFilter(props) {
|
|
248
|
-
return
|
|
250
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BackdropFilterNode(props) : new _drawings.BackdropFilterNode(this.ctx, props);
|
|
249
251
|
}
|
|
250
252
|
|
|
251
253
|
Box(props) {
|
|
252
|
-
return
|
|
254
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BoxNode(props) : new _drawings.BoxNode(this.ctx, props);
|
|
253
255
|
}
|
|
254
256
|
|
|
255
257
|
BoxShadow(props) {
|
|
256
|
-
return
|
|
258
|
+
return _HostComponents.NATIVE_DOM ? global.SkiaDomApi.BoxShadowNode(props) : new _drawings.BoxShadowNode(this.ctx, props);
|
|
257
259
|
}
|
|
258
260
|
|
|
259
261
|
}
|