@nativescript/canvas 2.0.0-alpha.24 → 2.0.0-alpha.25
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/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 +19 -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_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +19 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +13 -62
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +15 -3
- package/platforms/ios/src/cpp/OneByteStringResource.cpp +26 -2
- package/platforms/ios/src/cpp/OneByteStringResource.h +14 -3
- package/platforms/ios/src/cpp/TextDecoderImpl.cpp +8 -9
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +257 -268
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +8 -2
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +72 -94
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +4 -3
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp +1 -5
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +5 -5
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +103 -113
|
@@ -84,13 +84,11 @@ WebGL2RenderingContext::BeginTransformFeedback(const v8::FunctionCallbackInfo<v8
|
|
|
84
84
|
auto isolate = args.GetIsolate();
|
|
85
85
|
auto context = isolate->GetCurrentContext();
|
|
86
86
|
|
|
87
|
-
auto value = args[0];
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
);
|
|
93
|
-
}
|
|
87
|
+
auto value = args[0]->Uint32Value(context).ToChecked();
|
|
88
|
+
canvas_native_webgl2_begin_transform_feedback(
|
|
89
|
+
value,
|
|
90
|
+
ptr->GetState()
|
|
91
|
+
);
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
void WebGL2RenderingContext::BindBufferBase(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -131,7 +129,7 @@ void WebGL2RenderingContext::BindBufferRange(const v8::FunctionCallbackInfo<v8::
|
|
|
131
129
|
|
|
132
130
|
auto bufferValue = args[2];
|
|
133
131
|
auto type = GetNativeType(isolate, bufferValue);
|
|
134
|
-
if (
|
|
132
|
+
if (type == NativeType::WebGLBuffer) {
|
|
135
133
|
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
136
134
|
auto index = args[1]->Uint32Value(context).ToChecked();
|
|
137
135
|
auto offset = args[3]->NumberValue(context).ToChecked();
|
|
@@ -236,35 +234,33 @@ void WebGL2RenderingContext::BlitFramebuffer(const v8::FunctionCallbackInfo<v8::
|
|
|
236
234
|
auto isolate = args.GetIsolate();
|
|
237
235
|
auto context = isolate->GetCurrentContext();
|
|
238
236
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
);
|
|
267
|
-
}
|
|
237
|
+
auto srcX0 = args[0]->Int32Value(context).ToChecked();
|
|
238
|
+
auto srcY0 = args[1]->Int32Value(context).ToChecked();
|
|
239
|
+
|
|
240
|
+
auto srcX1 = args[2]->Int32Value(context).ToChecked();
|
|
241
|
+
auto srcY1 = args[3]->Int32Value(context).ToChecked();
|
|
242
|
+
|
|
243
|
+
auto dstX0 = args[4]->Int32Value(context).ToChecked();
|
|
244
|
+
auto dstY0 = args[5]->Int32Value(context).ToChecked();
|
|
245
|
+
|
|
246
|
+
auto dstX1 = args[6]->Int32Value(context).ToChecked();
|
|
247
|
+
auto dstY1 = args[7]->Int32Value(context).ToChecked();
|
|
248
|
+
|
|
249
|
+
auto mask = args[8]->Uint32Value(context).ToChecked();
|
|
250
|
+
auto filter = args[9]->Uint32Value(context).ToChecked();
|
|
251
|
+
canvas_native_webgl2_blit_framebuffer(
|
|
252
|
+
srcX0,
|
|
253
|
+
srcY0,
|
|
254
|
+
srcX1,
|
|
255
|
+
srcY1,
|
|
256
|
+
dstX0,
|
|
257
|
+
dstY0,
|
|
258
|
+
dstX1,
|
|
259
|
+
dstY1,
|
|
260
|
+
mask,
|
|
261
|
+
filter,
|
|
262
|
+
ptr->GetState()
|
|
263
|
+
);
|
|
268
264
|
}
|
|
269
265
|
|
|
270
266
|
void WebGL2RenderingContext::ClearBufferfv(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -573,21 +569,19 @@ void WebGL2RenderingContext::CopyBufferSubData(const v8::FunctionCallbackInfo<v8
|
|
|
573
569
|
auto isolate = args.GetIsolate();
|
|
574
570
|
auto context = isolate->GetCurrentContext();
|
|
575
571
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
);
|
|
590
|
-
}
|
|
572
|
+
auto readTarget = args[0]->Uint32Value(context).ToChecked();
|
|
573
|
+
auto writeTarget = args[1]->Uint32Value(context).ToChecked();
|
|
574
|
+
auto readOffset = args[2]->NumberValue(context).ToChecked();
|
|
575
|
+
auto writeOffset = args[3]->NumberValue(context).ToChecked();
|
|
576
|
+
auto size = args[4]->NumberValue(context).ToChecked();
|
|
577
|
+
canvas_native_webgl2_copy_buffer_sub_data(
|
|
578
|
+
readTarget,
|
|
579
|
+
writeTarget,
|
|
580
|
+
static_cast<ssize_t>(readOffset),
|
|
581
|
+
static_cast<ssize_t>(writeOffset),
|
|
582
|
+
static_cast<ssize_t>(size),
|
|
583
|
+
ptr->GetState()
|
|
584
|
+
);
|
|
591
585
|
}
|
|
592
586
|
|
|
593
587
|
void WebGL2RenderingContext::CopyTexSubImage3D(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -599,29 +593,27 @@ void WebGL2RenderingContext::CopyTexSubImage3D(const v8::FunctionCallbackInfo<v8
|
|
|
599
593
|
auto isolate = args.GetIsolate();
|
|
600
594
|
auto context = isolate->GetCurrentContext();
|
|
601
595
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
);
|
|
624
|
-
}
|
|
596
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
597
|
+
auto level = args[1]->Int32Value(context).ToChecked();
|
|
598
|
+
auto xoffset = args[2]->Int32Value(context).ToChecked();
|
|
599
|
+
auto yoffset = args[3]->Int32Value(context).ToChecked();
|
|
600
|
+
auto zoffset = args[4]->Int32Value(context).ToChecked();
|
|
601
|
+
auto x = args[5]->Int32Value(context).ToChecked();
|
|
602
|
+
auto y = args[6]->Int32Value(context).ToChecked();
|
|
603
|
+
auto width = args[7]->Int32Value(context).ToChecked();
|
|
604
|
+
auto height = args[8]->Int32Value(context).ToChecked();
|
|
605
|
+
canvas_native_webgl2_copy_tex_sub_image3d(
|
|
606
|
+
target,
|
|
607
|
+
level,
|
|
608
|
+
xoffset,
|
|
609
|
+
yoffset,
|
|
610
|
+
zoffset,
|
|
611
|
+
x,
|
|
612
|
+
y,
|
|
613
|
+
width,
|
|
614
|
+
height,
|
|
615
|
+
ptr->GetState()
|
|
616
|
+
);
|
|
625
617
|
}
|
|
626
618
|
|
|
627
619
|
void WebGL2RenderingContext::CreateQuery(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -900,14 +892,14 @@ void WebGL2RenderingContext::DrawRangeElements(const v8::FunctionCallbackInfo<v8
|
|
|
900
892
|
auto mode = args[0]->Uint32Value(context).ToChecked();
|
|
901
893
|
auto start = args[1]->Uint32Value(context).ToChecked();
|
|
902
894
|
auto end = args[2]->Uint32Value(context).ToChecked();
|
|
903
|
-
auto
|
|
895
|
+
auto count = args[3]->Int32Value(context).ToChecked();
|
|
904
896
|
auto type = args[4]->Uint32Value(context).ToChecked();
|
|
905
897
|
auto offset = args[5]->NumberValue(context).ToChecked();
|
|
906
898
|
canvas_native_webgl2_draw_range_elements(
|
|
907
899
|
mode,
|
|
908
900
|
start,
|
|
909
901
|
end,
|
|
910
|
-
|
|
902
|
+
count,
|
|
911
903
|
type,
|
|
912
904
|
static_cast<ssize_t>(offset),
|
|
913
905
|
ptr->GetState()
|
|
@@ -925,11 +917,9 @@ void WebGL2RenderingContext::EndQuery(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
925
917
|
auto isolate = args.GetIsolate();
|
|
926
918
|
auto context = isolate->GetCurrentContext();
|
|
927
919
|
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
ptr->GetState());
|
|
932
|
-
}
|
|
920
|
+
auto target = args[0]->Uint32Value(context).ToChecked();
|
|
921
|
+
canvas_native_webgl2_end_query(target,
|
|
922
|
+
ptr->GetState());
|
|
933
923
|
}
|
|
934
924
|
|
|
935
925
|
void WebGL2RenderingContext::EndTransformFeedback(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -2898,42 +2888,42 @@ void WebGL2RenderingContext::Uniform4uiv(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2898
2888
|
if (type == NativeType::WebGLUniformLocation) {
|
|
2899
2889
|
auto location = WebGLUniformLocation::GetPointer(locationValue.As<v8::Object>());
|
|
2900
2890
|
auto dataValue = args[1];
|
|
2901
|
-
if
|
|
2902
|
-
dataValue->IsUint32Array()) {
|
|
2903
|
-
|
|
2891
|
+
if(location != nullptr){
|
|
2892
|
+
if (dataValue->IsUint32Array()) {
|
|
2893
|
+
auto buf = dataValue.As<v8::Uint32Array>();
|
|
2904
2894
|
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2895
|
+
auto array = buf->Buffer();
|
|
2896
|
+
auto offset = buf->ByteOffset();
|
|
2897
|
+
auto size = buf->Length();
|
|
2898
|
+
auto data_ptr = static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
2899
|
+
auto data = static_cast<uint32_t *>((void *) data_ptr);
|
|
2910
2900
|
|
|
2911
2901
|
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2902
|
+
canvas_native_webgl2_uniform4uiv(
|
|
2903
|
+
location->GetUniformLocation(),
|
|
2904
|
+
data, size,
|
|
2905
|
+
ptr->GetState()
|
|
2906
|
+
);
|
|
2907
|
+
} else {
|
|
2908
|
+
std::vector<uint32_t> buf;
|
|
2909
|
+
auto array = dataValue.As<v8::Array>();
|
|
2910
|
+
auto len = array->Length();
|
|
2911
|
+
buf.reserve(len);
|
|
2912
|
+
for (int i = 0; i < len; i++) {
|
|
2913
|
+
auto item = array->Get(
|
|
2914
|
+
context,
|
|
2915
|
+
i).ToLocalChecked()->Uint32Value(
|
|
2916
|
+
context).ToChecked();
|
|
2917
|
+
buf.push_back(item);
|
|
2918
|
+
}
|
|
2929
2919
|
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2920
|
+
canvas_native_webgl2_uniform4uiv(
|
|
2921
|
+
location->GetUniformLocation(),
|
|
2922
|
+
buf.data(), buf.size(),
|
|
2923
|
+
ptr->GetState()
|
|
2924
|
+
);
|
|
2925
|
+
}
|
|
2935
2926
|
}
|
|
2936
|
-
|
|
2937
2927
|
}
|
|
2938
2928
|
|
|
2939
2929
|
}
|