@nativescript/canvas 2.0.0-beta.4 → 2.0.0-beta.6
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/Canvas2D/CanvasRenderingContext2D/index.d.ts +2 -0
- package/Canvas2D/CanvasRenderingContext2D/index.js +6 -0
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/Path2D/index.d.ts +2 -1
- package/Canvas2D/Path2D/index.js +3 -12
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/Dom/Dom.d.ts +3 -1
- package/Dom/Dom.js +7 -2
- package/Dom/Dom.js.map +1 -1
- package/Dom/Group.d.ts +1 -0
- package/Dom/Group.js +1 -0
- package/Dom/Group.js.map +1 -1
- package/Dom/Paint.d.ts +3 -0
- package/Dom/Paint.js +10 -5
- package/Dom/Paint.js.map +1 -1
- package/Dom/Text.js +2 -1
- package/Dom/Text.js.map +1 -1
- package/Dom/shapes/Circle.js +1 -0
- package/Dom/shapes/Circle.js.map +1 -1
- package/Dom/shapes/Line.js +2 -1
- package/Dom/shapes/Line.js.map +1 -1
- package/Dom/shapes/Oval.d.ts +12 -0
- package/Dom/shapes/Oval.js +87 -0
- package/Dom/shapes/Oval.js.map +1 -0
- package/Dom/shapes/Path.d.ts +19 -2
- package/Dom/shapes/Path.js +65 -4
- package/Dom/shapes/Path.js.map +1 -1
- package/Dom/shapes/Points.js +3 -1
- package/Dom/shapes/Points.js.map +1 -1
- package/Dom/shapes/Rect.js +1 -0
- package/Dom/shapes/Rect.js.map +1 -1
- package/Dom/shapes/RoundedRect.js +2 -1
- package/Dom/shapes/RoundedRect.js.map +1 -1
- package/Dom/shapes/index.d.ts +5 -0
- package/Dom/shapes/index.js +4 -0
- package/Dom/shapes/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +14 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +146 -146
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +14 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +6 -6
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +495 -495
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +441 -441
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +67 -10
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +46 -0
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +19 -48
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +19 -0
|
@@ -86,13 +86,19 @@ v8::CFunction CanvasRenderingContext2DImpl::fast_clear_rect_(
|
|
|
86
86
|
v8::CFunction CanvasRenderingContext2DImpl::fast_fill_rect_(
|
|
87
87
|
v8::CFunction::Make(CanvasRenderingContext2DImpl::FastFillRect));
|
|
88
88
|
|
|
89
|
+
v8::CFunction CanvasRenderingContext2DImpl::fast_fill_oval_(
|
|
90
|
+
v8::CFunction::Make(CanvasRenderingContext2DImpl::FastFillOval));
|
|
91
|
+
|
|
92
|
+
|
|
89
93
|
v8::CFunction CanvasRenderingContext2DImpl::fast_stroke_rect_(
|
|
90
94
|
v8::CFunction::Make(CanvasRenderingContext2DImpl::FastStrokeRect));
|
|
91
95
|
|
|
96
|
+
v8::CFunction CanvasRenderingContext2DImpl::fast_stroke_oval_(
|
|
97
|
+
v8::CFunction::Make(CanvasRenderingContext2DImpl::FastStrokeOval));
|
|
98
|
+
|
|
92
99
|
v8::CFunction CanvasRenderingContext2DImpl::fast_rotate_(
|
|
93
100
|
v8::CFunction::Make(CanvasRenderingContext2DImpl::FastRotate));
|
|
94
101
|
|
|
95
|
-
|
|
96
102
|
v8::CFunction CanvasRenderingContext2DImpl::fast_fill_(
|
|
97
103
|
v8::CFunction::Make(CanvasRenderingContext2DImpl::FastFill));
|
|
98
104
|
|
|
@@ -395,6 +401,10 @@ v8::Local<v8::FunctionTemplate> CanvasRenderingContext2DImpl::GetCtor(v8::Isolat
|
|
|
395
401
|
|
|
396
402
|
tmpl->Set(ConvertToV8String(isolate, "fillText"),
|
|
397
403
|
v8::FunctionTemplate::New(isolate, &FillText));
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
SetFastMethod(isolate, tmpl, "fillOval", FillOval, &fast_fill_oval_, v8::Local<v8::Value>());
|
|
407
|
+
|
|
398
408
|
tmpl->Set(ConvertToV8String(isolate, "getImageData"),
|
|
399
409
|
v8::FunctionTemplate::New(isolate, &GetImageData));
|
|
400
410
|
tmpl->Set(ConvertToV8String(isolate, "getLineDash"),
|
|
@@ -474,6 +484,10 @@ v8::Local<v8::FunctionTemplate> CanvasRenderingContext2DImpl::GetCtor(v8::Isolat
|
|
|
474
484
|
tmpl->Set(ConvertToV8String(isolate, "strokeText"),
|
|
475
485
|
v8::FunctionTemplate::New(isolate, &StrokeText));
|
|
476
486
|
|
|
487
|
+
|
|
488
|
+
SetFastMethod(isolate, tmpl, "strokeOval", StrokeOval, &fast_stroke_oval_,
|
|
489
|
+
v8::Local<v8::Value>());
|
|
490
|
+
|
|
477
491
|
SetFastMethod(isolate, tmpl, "transform", Transform, &fast_transform_, v8::Local<v8::Value>());
|
|
478
492
|
|
|
479
493
|
|
|
@@ -573,15 +587,15 @@ void CanvasRenderingContext2DImpl::DrawPoints(const v8::FunctionCallbackInfo<v8:
|
|
|
573
587
|
if (ptr == nullptr) {
|
|
574
588
|
return;
|
|
575
589
|
}
|
|
576
|
-
|
|
590
|
+
|
|
577
591
|
auto isolate = args.GetIsolate();
|
|
578
592
|
auto context = isolate->GetCurrentContext();
|
|
579
|
-
|
|
580
|
-
|
|
593
|
+
|
|
594
|
+
|
|
581
595
|
auto mode = args[0];
|
|
582
596
|
auto points = args[1].As<v8::Array>();
|
|
583
597
|
auto size = points->Length();
|
|
584
|
-
|
|
598
|
+
|
|
585
599
|
if (size == 0){return;}
|
|
586
600
|
uint32_t pointMode = 0;
|
|
587
601
|
if(mode->IsUint32() && mode->Uint32Value(context).To(&pointMode)){
|
|
@@ -589,10 +603,10 @@ void CanvasRenderingContext2DImpl::DrawPoints(const v8::FunctionCallbackInfo<v8:
|
|
|
589
603
|
auto len = size * 2;
|
|
590
604
|
store.reserve(len);
|
|
591
605
|
for (int i = 0; i < size; i++) {
|
|
592
|
-
|
|
606
|
+
|
|
593
607
|
auto object = points->Get(
|
|
594
608
|
context, i).ToLocalChecked().As<v8::Object>();
|
|
595
|
-
|
|
609
|
+
|
|
596
610
|
auto x = object->Get(context,
|
|
597
611
|
ConvertToV8String(isolate, "x")).ToLocalChecked()->NumberValue(
|
|
598
612
|
context).ToChecked();
|
|
@@ -602,12 +616,12 @@ void CanvasRenderingContext2DImpl::DrawPoints(const v8::FunctionCallbackInfo<v8:
|
|
|
602
616
|
store.emplace_back((float) x);
|
|
603
617
|
store.emplace_back((float) y);
|
|
604
618
|
}
|
|
605
|
-
|
|
619
|
+
|
|
606
620
|
canvas_native_context_draw_points(
|
|
607
621
|
ptr->GetContext(), pointMode,
|
|
608
622
|
store.data(), store.size());
|
|
609
|
-
|
|
610
|
-
|
|
623
|
+
|
|
624
|
+
|
|
611
625
|
ptr->UpdateInvalidateState();
|
|
612
626
|
}
|
|
613
627
|
}
|
|
@@ -2161,6 +2175,26 @@ CanvasRenderingContext2DImpl::FillText(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
2161
2175
|
|
|
2162
2176
|
}
|
|
2163
2177
|
|
|
2178
|
+
|
|
2179
|
+
void
|
|
2180
|
+
CanvasRenderingContext2DImpl::FillOval(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2181
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(args.This());
|
|
2182
|
+
if (ptr == nullptr) {
|
|
2183
|
+
return;
|
|
2184
|
+
}
|
|
2185
|
+
auto isolate = args.GetIsolate();
|
|
2186
|
+
auto context = isolate->GetCurrentContext();
|
|
2187
|
+
|
|
2188
|
+
auto x = static_cast<float>(args[0]->NumberValue(context).ToChecked());
|
|
2189
|
+
auto y = static_cast<float>(args[1]->NumberValue(context).ToChecked());
|
|
2190
|
+
auto width = static_cast<float>(args[2]->NumberValue(context).ToChecked());
|
|
2191
|
+
auto height = static_cast<float>(args[3]->NumberValue(context).ToChecked());
|
|
2192
|
+
canvas_native_context_fill_oval(
|
|
2193
|
+
ptr->GetContext(), x, y, width,
|
|
2194
|
+
height);
|
|
2195
|
+
ptr->UpdateInvalidateState();
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2164
2198
|
void
|
|
2165
2199
|
CanvasRenderingContext2DImpl::GetImageData(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2166
2200
|
CanvasRenderingContext2DImpl *ptr = GetPointer(args.This());
|
|
@@ -2747,6 +2781,29 @@ CanvasRenderingContext2DImpl::StrokeText(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2747
2781
|
}
|
|
2748
2782
|
}
|
|
2749
2783
|
|
|
2784
|
+
void
|
|
2785
|
+
CanvasRenderingContext2DImpl::StrokeOval(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2786
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(args.This());
|
|
2787
|
+
|
|
2788
|
+
auto isolate = args.GetIsolate();
|
|
2789
|
+
auto context = isolate->GetCurrentContext();
|
|
2790
|
+
|
|
2791
|
+
if (args.Length() == 4) {
|
|
2792
|
+
auto x = static_cast<float>(args[0]->NumberValue(context).ToChecked());
|
|
2793
|
+
auto y = static_cast<float>(args[1]->NumberValue(context).ToChecked());
|
|
2794
|
+
auto width = static_cast<float>(args[2]->NumberValue(context).ToChecked());
|
|
2795
|
+
auto height = static_cast<float>(args[3]->NumberValue(context).ToChecked());
|
|
2796
|
+
canvas_native_context_stroke_oval(
|
|
2797
|
+
ptr->GetContext(), x, y,
|
|
2798
|
+
width,
|
|
2799
|
+
height);
|
|
2800
|
+
ptr->UpdateInvalidateState();
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
|
|
2805
|
+
|
|
2806
|
+
|
|
2750
2807
|
void
|
|
2751
2808
|
CanvasRenderingContext2DImpl::Transform(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
2752
2809
|
CanvasRenderingContext2DImpl *ptr = GetPointer(args.This());
|
|
@@ -106,12 +106,16 @@ public:
|
|
|
106
106
|
|
|
107
107
|
static v8::CFunction fast_fill_rect_;
|
|
108
108
|
|
|
109
|
+
static v8::CFunction fast_fill_oval_;
|
|
110
|
+
|
|
109
111
|
static v8::CFunction fast_stroke_;
|
|
110
112
|
|
|
111
113
|
static v8::CFunction fast_stroke_path_;
|
|
112
114
|
|
|
113
115
|
static v8::CFunction fast_stroke_rect_;
|
|
114
116
|
|
|
117
|
+
static v8::CFunction fast_stroke_oval_;
|
|
118
|
+
|
|
115
119
|
static v8::CFunction fast_rotate_;
|
|
116
120
|
|
|
117
121
|
static v8::CFunction fast_reset_transform_;
|
|
@@ -900,6 +904,27 @@ public:
|
|
|
900
904
|
|
|
901
905
|
static void FillText(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
902
906
|
|
|
907
|
+
|
|
908
|
+
static void FillOval(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
static void FastFillOval(v8::Local<v8::Object> receiver_obj, double x, double y, double width,
|
|
912
|
+
double height) {
|
|
913
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(receiver_obj);
|
|
914
|
+
if (ptr == nullptr) {
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
canvas_native_context_fill_oval(
|
|
919
|
+
ptr->GetContext(),
|
|
920
|
+
static_cast<float>(x),
|
|
921
|
+
static_cast<float>(y),
|
|
922
|
+
static_cast<float>(width),
|
|
923
|
+
static_cast<float>(height)
|
|
924
|
+
);
|
|
925
|
+
ptr->UpdateInvalidateState();
|
|
926
|
+
}
|
|
927
|
+
|
|
903
928
|
static void GetImageData(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
904
929
|
|
|
905
930
|
static void GetLineDash(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
@@ -1325,6 +1350,27 @@ public:
|
|
|
1325
1350
|
|
|
1326
1351
|
static void StrokeText(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1327
1352
|
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
static void StrokeOval(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
static void FastStrokeOval(v8::Local<v8::Object> receiver_obj, double x, double y, double width,
|
|
1359
|
+
double height) {
|
|
1360
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(receiver_obj);
|
|
1361
|
+
if (ptr == nullptr) {
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
canvas_native_context_stroke_oval(
|
|
1366
|
+
ptr->GetContext(), static_cast<float>(x),
|
|
1367
|
+
static_cast<float>(y),
|
|
1368
|
+
static_cast<float>(width),
|
|
1369
|
+
static_cast<float>(height));
|
|
1370
|
+
ptr->UpdateInvalidateState();
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
|
|
1328
1374
|
static void Transform(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1329
1375
|
|
|
1330
1376
|
static void
|
|
@@ -51,9 +51,6 @@ v8::CFunction Path2D::fast_quadratic_curve_to_(v8::CFunction::Make(Path2D::FastQ
|
|
|
51
51
|
|
|
52
52
|
v8::CFunction Path2D::fast_rect_(v8::CFunction::Make(Path2D::FastRect));
|
|
53
53
|
|
|
54
|
-
//v8::CFunction Path2D::fast_round_rect_(v8::CFunction::Make(Path2D::FastRoundRect));
|
|
55
|
-
|
|
56
|
-
|
|
57
54
|
v8::CFunction Path2D::fast_round_rect_(
|
|
58
55
|
v8::CFunction::Make(Path2D::FastRoundRect));
|
|
59
56
|
|
|
@@ -65,6 +62,8 @@ const v8::CFunction fast_round_rect_overloads_[] = {
|
|
|
65
62
|
Path2D::fast_round_rect_array_
|
|
66
63
|
};
|
|
67
64
|
|
|
65
|
+
v8::CFunction Path2D::fast_trim_(v8::CFunction::Make(Path2D::FastTrim));
|
|
66
|
+
|
|
68
67
|
|
|
69
68
|
|
|
70
69
|
//v8::CFunction Path2D::fast_to_svg_(v8::CFunction::Make(Path2D::FastToSVG));
|
|
@@ -76,7 +75,7 @@ void Path2D::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
76
75
|
|
|
77
76
|
auto ret = args.This();
|
|
78
77
|
|
|
79
|
-
SetNativeType(
|
|
78
|
+
SetNativeType(ret, NativeType::Path2D);
|
|
80
79
|
|
|
81
80
|
if (count > 0) {
|
|
82
81
|
if (value->IsString()) {
|
|
@@ -385,6 +384,21 @@ void Path2D::RoundRect(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
385
384
|
args.GetReturnValue().SetUndefined();
|
|
386
385
|
}
|
|
387
386
|
|
|
387
|
+
void Path2D::Trim(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
388
|
+
Path2D *ptr = GetPointer(args.This());
|
|
389
|
+
if (ptr == nullptr) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
auto isolate = args.GetIsolate();
|
|
394
|
+
auto context = isolate->GetCurrentContext();
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
canvas_native_path_trim(ptr->GetPath(),
|
|
398
|
+
static_cast<float>(args[0]->NumberValue(context).ToChecked()),
|
|
399
|
+
static_cast<float>(args[1]->NumberValue(context).ToChecked()));
|
|
400
|
+
}
|
|
401
|
+
|
|
388
402
|
void Path2D::__toSVG(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
389
403
|
Path2D *ptr = GetPointer(args.This());
|
|
390
404
|
if (ptr == nullptr) {
|
|
@@ -443,50 +457,7 @@ v8::Local<v8::FunctionTemplate> Path2D::GetCtor(v8::Isolate *isolate) {
|
|
|
443
457
|
SetFastMethodWithOverLoads(isolate, tmpl, "roundRect", RoundRect,
|
|
444
458
|
fast_round_rect_overloads_, v8::Local<v8::Value>());
|
|
445
459
|
|
|
446
|
-
|
|
447
|
-
// ConvertToV8String(isolate, "addPath"),
|
|
448
|
-
// v8::FunctionTemplate::New(isolate, &AddPath));
|
|
449
|
-
|
|
450
|
-
// tmpl->Set(
|
|
451
|
-
// ConvertToV8String(isolate, "arc"),
|
|
452
|
-
// v8::FunctionTemplate::New(isolate, &Arc));
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
// tmpl->Set(
|
|
456
|
-
// ConvertToV8String(isolate, "bezierCurveTo"),
|
|
457
|
-
// v8::FunctionTemplate::New(isolate, &BezierCurveTo));
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
// tmpl->Set(
|
|
461
|
-
// ConvertToV8String(isolate, "closePath"),
|
|
462
|
-
// v8::FunctionTemplate::New(isolate, &ClosePath));
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
// tmpl->Set(
|
|
466
|
-
// ConvertToV8String(isolate, "ellipse"),
|
|
467
|
-
// v8::FunctionTemplate::New(isolate, &Ellipse));
|
|
468
|
-
|
|
469
|
-
// tmpl->Set(
|
|
470
|
-
// ConvertToV8String(isolate, "lineTo"),
|
|
471
|
-
// v8::FunctionTemplate::New(isolate, &LineTo));
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
// tmpl->Set(
|
|
475
|
-
// ConvertToV8String(isolate, "moveTo"),
|
|
476
|
-
// v8::FunctionTemplate::New(isolate, &MoveTo));
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
// tmpl->Set(
|
|
480
|
-
// ConvertToV8String(isolate, "quadraticCurveTo"),
|
|
481
|
-
// v8::FunctionTemplate::New(isolate, &QuadraticCurveTo));
|
|
482
|
-
|
|
483
|
-
// tmpl->Set(
|
|
484
|
-
// ConvertToV8String(isolate, "rect"),
|
|
485
|
-
// v8::FunctionTemplate::New(isolate, &Rect));
|
|
486
|
-
|
|
487
|
-
// tmpl->Set(
|
|
488
|
-
// ConvertToV8String(isolate, "roundRect"),
|
|
489
|
-
// v8::FunctionTemplate::New(isolate, &RoundRect));
|
|
460
|
+
SetFastMethod(isolate, tmpl, "trim", Trim, &fast_trim_, v8::Local<v8::Value>());
|
|
490
461
|
|
|
491
462
|
tmpl->Set(
|
|
492
463
|
ConvertToV8String(isolate, "__toSVG"),
|
|
@@ -64,6 +64,8 @@ public:
|
|
|
64
64
|
static v8::CFunction fast_round_rect_array_;
|
|
65
65
|
// static v8::CFunction fast_to_svg_; // todo after v8 upgrade
|
|
66
66
|
|
|
67
|
+
static v8::CFunction fast_trim_;
|
|
68
|
+
|
|
67
69
|
|
|
68
70
|
static void Arc(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
69
71
|
|
|
@@ -429,6 +431,23 @@ public:
|
|
|
429
431
|
|
|
430
432
|
static void RoundRect(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
431
433
|
|
|
434
|
+
static void Trim(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
435
|
+
|
|
436
|
+
static void
|
|
437
|
+
FastTrim(v8::Local<v8::Object> receiver_obj, double start, double end) {
|
|
438
|
+
|
|
439
|
+
Path2D *ptr = GetPointer(receiver_obj);
|
|
440
|
+
if (ptr == nullptr) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
canvas_native_path_trim(
|
|
445
|
+
ptr->GetPath(),
|
|
446
|
+
static_cast<float>(start),
|
|
447
|
+
static_cast<float>(end)
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
|
|
432
451
|
static void __toSVG(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
433
452
|
|
|
434
453
|
|