@nativescript/canvas 2.0.0-alpha.49 → 2.0.0-alpha.50
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/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/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +219 -166
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +713 -1
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +371 -217
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1270 -4
|
@@ -247,6 +247,54 @@ public:
|
|
|
247
247
|
static v8::CFunction fast_framebuffer_texture_2d_;
|
|
248
248
|
|
|
249
249
|
|
|
250
|
+
static v8::CFunction fast_color_mask_;
|
|
251
|
+
static v8::CFunction fast_copy_tex_image_2d_;
|
|
252
|
+
static v8::CFunction fast_copy_tex_sub_image_2d_;
|
|
253
|
+
static v8::CFunction fast_cull_face_;
|
|
254
|
+
static v8::CFunction fast_depth_func_;
|
|
255
|
+
static v8::CFunction fast_depth_mask_;
|
|
256
|
+
static v8::CFunction fast_depth_range_;
|
|
257
|
+
static v8::CFunction fast_detach_shader_;
|
|
258
|
+
static v8::CFunction fast_disable_vertex_attrib_array_;
|
|
259
|
+
|
|
260
|
+
static v8::CFunction fast_finish_;
|
|
261
|
+
static v8::CFunction fast_flush_;
|
|
262
|
+
static v8::CFunction fast_framebuffer_renderbuffer_;
|
|
263
|
+
static v8::CFunction fast_front_face_;
|
|
264
|
+
static v8::CFunction fast_generate_mipmap_;
|
|
265
|
+
static v8::CFunction fast_get_vertex_attrib_offset_;
|
|
266
|
+
static v8::CFunction fast_hint_;
|
|
267
|
+
static v8::CFunction fast_is_buffer_;
|
|
268
|
+
static v8::CFunction fast_is_context_lost_;
|
|
269
|
+
static v8::CFunction fast_is_enabled_;
|
|
270
|
+
static v8::CFunction fast_is_framebuffer_;
|
|
271
|
+
static v8::CFunction fast_is_program_;
|
|
272
|
+
static v8::CFunction fast_is_renderbuffer_;
|
|
273
|
+
static v8::CFunction fast_is_shader_;
|
|
274
|
+
static v8::CFunction fast_is_texture_;
|
|
275
|
+
static v8::CFunction fast_line_width_;
|
|
276
|
+
static v8::CFunction fast_link_program_;
|
|
277
|
+
static v8::CFunction fast_pixel_storei_bool_;
|
|
278
|
+
static v8::CFunction fast_pixel_storei_;
|
|
279
|
+
static v8::CFunction fast_polygon_offset_;
|
|
280
|
+
|
|
281
|
+
static v8::CFunction fast_renderbuffer_storage_;
|
|
282
|
+
static v8::CFunction fast_sample_coverage_;
|
|
283
|
+
static v8::CFunction fast_scissor_;
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
static v8::CFunction fast_stencil_func_separate_;
|
|
287
|
+
static v8::CFunction fast_stencil_func_;
|
|
288
|
+
static v8::CFunction fast_stencil_mask_separate_;
|
|
289
|
+
static v8::CFunction fast_stencil_mask_;
|
|
290
|
+
static v8::CFunction fast_stencil_op_separate_;
|
|
291
|
+
static v8::CFunction fast_stencil_op_;
|
|
292
|
+
|
|
293
|
+
static v8::CFunction fast_tex_parameterf_;
|
|
294
|
+
static v8::CFunction fast_tex_parameteri_;
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
250
298
|
static v8::Local<v8::Object>
|
|
251
299
|
NewInstance(v8::Isolate *isolate, WebGLRenderingContext *renderingContext) {
|
|
252
300
|
auto context = isolate->GetCurrentContext();
|
|
@@ -1130,6 +1178,22 @@ public:
|
|
|
1130
1178
|
|
|
1131
1179
|
static void ColorMask(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1132
1180
|
|
|
1181
|
+
static void
|
|
1182
|
+
FastColorMask(v8::Local<v8::Object> receiver_obj, bool red, bool green, bool blue, bool alpha) {
|
|
1183
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1184
|
+
if (ptr == nullptr) {
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
canvas_native_webgl_color_mask(
|
|
1189
|
+
red,
|
|
1190
|
+
green,
|
|
1191
|
+
blue,
|
|
1192
|
+
alpha,
|
|
1193
|
+
ptr->GetState()
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1133
1197
|
static void Commit(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1134
1198
|
|
|
1135
1199
|
static void CompileShader(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
@@ -1159,8 +1223,55 @@ public:
|
|
|
1159
1223
|
|
|
1160
1224
|
static void CopyTexImage2D(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1161
1225
|
|
|
1226
|
+
static void
|
|
1227
|
+
FastCopyTexImage2D(v8::Local<v8::Object> receiver_obj, uint32_t target, int32_t level,
|
|
1228
|
+
uint32_t internalformat, int32_t x, int32_t y, int32_t width, int32_t height,
|
|
1229
|
+
int32_t border) {
|
|
1230
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1231
|
+
if (ptr == nullptr) {
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
canvas_native_webgl_copy_tex_image2d(
|
|
1236
|
+
target,
|
|
1237
|
+
level,
|
|
1238
|
+
internalformat,
|
|
1239
|
+
x,
|
|
1240
|
+
y,
|
|
1241
|
+
width,
|
|
1242
|
+
height,
|
|
1243
|
+
border,
|
|
1244
|
+
ptr->GetState()
|
|
1245
|
+
);
|
|
1246
|
+
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1162
1249
|
static void CopyTexSubImage2D(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1163
1250
|
|
|
1251
|
+
static void
|
|
1252
|
+
FastCopyTexSubImage2D(v8::Local<v8::Object> receiver_obj, uint32_t target, int32_t level,
|
|
1253
|
+
int32_t xoffset, int32_t yoffset, int32_t x, int32_t y, int32_t width,
|
|
1254
|
+
int32_t height) {
|
|
1255
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1256
|
+
if (ptr == nullptr) {
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
canvas_native_webgl_copy_tex_sub_image2d(
|
|
1262
|
+
target,
|
|
1263
|
+
level,
|
|
1264
|
+
xoffset,
|
|
1265
|
+
yoffset,
|
|
1266
|
+
x,
|
|
1267
|
+
y,
|
|
1268
|
+
width,
|
|
1269
|
+
height,
|
|
1270
|
+
ptr->GetState()
|
|
1271
|
+
);
|
|
1272
|
+
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1164
1275
|
static void CreateBuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1165
1276
|
|
|
1166
1277
|
static void CreateFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
@@ -1175,6 +1286,20 @@ public:
|
|
|
1175
1286
|
|
|
1176
1287
|
static void CullFace(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1177
1288
|
|
|
1289
|
+
static void FastCullFace(v8::Local<v8::Object> receiver_obj, uint32_t mode) {
|
|
1290
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1291
|
+
if (ptr == nullptr) {
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
canvas_native_webgl_cull_face(
|
|
1297
|
+
mode,
|
|
1298
|
+
ptr->GetState()
|
|
1299
|
+
);
|
|
1300
|
+
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1178
1303
|
static void DeleteBuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1179
1304
|
|
|
1180
1305
|
static void FastDeleteBuffer(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> value) {
|
|
@@ -1312,14 +1437,92 @@ public:
|
|
|
1312
1437
|
|
|
1313
1438
|
static void DepthFunc(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1314
1439
|
|
|
1440
|
+
static void FastDepthFunc(v8::Local<v8::Object> receiver_obj, uint32_t func) {
|
|
1441
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1442
|
+
if (ptr == nullptr) {
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
canvas_native_webgl_depth_func(
|
|
1447
|
+
func,
|
|
1448
|
+
ptr->GetState()
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1315
1452
|
static void DepthMask(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1316
1453
|
|
|
1454
|
+
static void FastDepthMask(v8::Local<v8::Object> receiver_obj, bool mask) {
|
|
1455
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1456
|
+
if (ptr == nullptr) {
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
canvas_native_webgl_depth_mask(
|
|
1460
|
+
mask,
|
|
1461
|
+
ptr->GetState()
|
|
1462
|
+
);
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1317
1465
|
static void DepthRange(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1318
1466
|
|
|
1467
|
+
static void FastDepthRange(v8::Local<v8::Object> receiver_obj, double zNear, double zFar) {
|
|
1468
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1469
|
+
if (ptr == nullptr) {
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
canvas_native_webgl_depth_range(
|
|
1474
|
+
static_cast<float>(zNear),
|
|
1475
|
+
static_cast<float>(zFar),
|
|
1476
|
+
ptr->GetState()
|
|
1477
|
+
);
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1319
1480
|
static void DetachShader(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1320
1481
|
|
|
1482
|
+
static void
|
|
1483
|
+
FastDetachShader(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> program_obj,
|
|
1484
|
+
v8::Local<v8::Object> shader_obj) {
|
|
1485
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1486
|
+
if (ptr == nullptr) {
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
auto programType = GetNativeType(program_obj);
|
|
1491
|
+
auto shaderType = GetNativeType(shader_obj);
|
|
1492
|
+
WebGLProgram *program = nullptr;
|
|
1493
|
+
WebGLShader *shader = nullptr;
|
|
1494
|
+
if (programType == NativeType::WebGLProgram) {
|
|
1495
|
+
program = WebGLProgram::GetPointer(program_obj);
|
|
1496
|
+
}
|
|
1497
|
+
if (shaderType == NativeType::WebGLShader) {
|
|
1498
|
+
shader = WebGLShader::GetPointer(shader_obj);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if (program != nullptr &&
|
|
1502
|
+
shader != nullptr) {
|
|
1503
|
+
canvas_native_webgl_detach_shader(
|
|
1504
|
+
program->GetProgram(),
|
|
1505
|
+
shader->GetShader(),
|
|
1506
|
+
ptr->GetState()
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1321
1511
|
static void DisableVertexAttribArray(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1322
1512
|
|
|
1513
|
+
static void FastDisableVertexAttribArray(v8::Local<v8::Object> receiver_obj, uint32_t index) {
|
|
1514
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1515
|
+
if (ptr == nullptr) {
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
canvas_native_webgl_disable_vertex_attrib_array(
|
|
1521
|
+
index,
|
|
1522
|
+
ptr->GetState()
|
|
1523
|
+
);
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1323
1526
|
static void Disable(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1324
1527
|
|
|
1325
1528
|
static void FastDisable(v8::Local<v8::Object> receiver_obj, uint32_t cap) {
|
|
@@ -1422,10 +1625,57 @@ public:
|
|
|
1422
1625
|
|
|
1423
1626
|
static void Finish(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1424
1627
|
|
|
1628
|
+
static void FastFinish(v8::Local<v8::Object> receiver_obj) {
|
|
1629
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1630
|
+
if (ptr == nullptr) {
|
|
1631
|
+
return;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
canvas_native_webgl_finish(
|
|
1635
|
+
ptr->GetState()
|
|
1636
|
+
);
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
static void FastFlush(v8::Local<v8::Object> receiver_obj) {
|
|
1640
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1641
|
+
if (ptr == nullptr) {
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
canvas_native_webgl_flush(
|
|
1646
|
+
ptr->GetState()
|
|
1647
|
+
);
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1425
1650
|
static void Flush(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1426
1651
|
|
|
1427
1652
|
static void FramebufferRenderbuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1428
1653
|
|
|
1654
|
+
static void FastFramebufferRenderbuffer(v8::Local<v8::Object> receiver_obj, uint32_t target,
|
|
1655
|
+
uint32_t attachment,
|
|
1656
|
+
uint32_t renderbuffertarget,
|
|
1657
|
+
v8::Local<v8::Object> renderbuffer_obj) {
|
|
1658
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1659
|
+
if (ptr == nullptr) {
|
|
1660
|
+
return;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
auto type = GetNativeType(renderbuffer_obj);
|
|
1665
|
+
if (type == NativeType::WebGLRenderbuffer) {
|
|
1666
|
+
auto renderbuffer = WebGLRenderbuffer::GetPointer(renderbuffer_obj);
|
|
1667
|
+
if (renderbuffer != nullptr) {
|
|
1668
|
+
canvas_native_webgl_framebuffer_renderbuffer(
|
|
1669
|
+
target,
|
|
1670
|
+
attachment,
|
|
1671
|
+
renderbuffertarget,
|
|
1672
|
+
renderbuffer->GetRenderBuffer(),
|
|
1673
|
+
ptr->GetState()
|
|
1674
|
+
);
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1429
1679
|
static void FramebufferTexture2D(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1430
1680
|
|
|
1431
1681
|
static void FastFramebufferTexture2D(v8::Local<v8::Object> receiver_obj, uint32_t target,
|
|
@@ -1454,8 +1704,32 @@ public:
|
|
|
1454
1704
|
|
|
1455
1705
|
static void FrontFace(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1456
1706
|
|
|
1707
|
+
static void FastFrontFace(v8::Local<v8::Object> receiver_obj, uint32_t mode) {
|
|
1708
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1709
|
+
if (ptr == nullptr) {
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
canvas_native_webgl_front_face(
|
|
1714
|
+
mode,
|
|
1715
|
+
ptr->GetState()
|
|
1716
|
+
);
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1457
1719
|
static void GenerateMipmap(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1458
1720
|
|
|
1721
|
+
static void FastGenerateMipmap(v8::Local<v8::Object> receiver_obj, uint32_t target) {
|
|
1722
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1723
|
+
if (ptr == nullptr) {
|
|
1724
|
+
return;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
canvas_native_webgl_generate_mipmap(
|
|
1728
|
+
target,
|
|
1729
|
+
ptr->GetState()
|
|
1730
|
+
);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1459
1733
|
static void GetActiveAttrib(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1460
1734
|
|
|
1461
1735
|
static void GetActiveUniform(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
@@ -1466,6 +1740,22 @@ public:
|
|
|
1466
1740
|
|
|
1467
1741
|
static void GetBufferParameter(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1468
1742
|
|
|
1743
|
+
static uint32_t
|
|
1744
|
+
FastGetBufferParameter(v8::Local<v8::Object> receiver_obj, uint32_t target, uint32_t pname) {
|
|
1745
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1746
|
+
if (ptr == nullptr) {
|
|
1747
|
+
return -1;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
return canvas_native_webgl_get_buffer_parameter(
|
|
1752
|
+
target,
|
|
1753
|
+
pname,
|
|
1754
|
+
ptr->GetState()
|
|
1755
|
+
);
|
|
1756
|
+
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1469
1759
|
static void GetContextAttributes(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1470
1760
|
|
|
1471
1761
|
static void GetError(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
@@ -1500,62 +1790,485 @@ public:
|
|
|
1500
1790
|
|
|
1501
1791
|
static void GetVertexAttribOffset(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1502
1792
|
|
|
1793
|
+
static int32_t
|
|
1794
|
+
FastGetVertexAttribOffset(v8::Local<v8::Object> receiver_obj, uint32_t index, uint32_t pname) {
|
|
1795
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1796
|
+
if (ptr == nullptr) {
|
|
1797
|
+
return 0;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
|
|
1801
|
+
return canvas_native_webgl_get_vertex_attrib_offset(
|
|
1802
|
+
index,
|
|
1803
|
+
pname,
|
|
1804
|
+
ptr->GetState());
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1503
1807
|
static void GetVertexAttrib(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1504
1808
|
|
|
1505
1809
|
static void Hint(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1506
1810
|
|
|
1811
|
+
static void FastHint(v8::Local<v8::Object> receiver_obj, uint32_t target, uint32_t mode) {
|
|
1812
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1813
|
+
if (ptr == nullptr) {
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
canvas_native_webgl_hint(target,
|
|
1818
|
+
mode,
|
|
1819
|
+
ptr->GetState());
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1507
1822
|
static void IsBuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1508
1823
|
|
|
1824
|
+
static bool FastIsBuffer(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> value) {
|
|
1825
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1826
|
+
if (ptr == nullptr) {
|
|
1827
|
+
return false;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
auto type = GetNativeType(value);
|
|
1831
|
+
if (type == NativeType::WebGLBuffer) {
|
|
1832
|
+
auto buffer = WebGLBuffer::GetPointer(value);
|
|
1833
|
+
if (buffer != nullptr) {
|
|
1834
|
+
auto ret = canvas_native_webgl_is_buffer(
|
|
1835
|
+
buffer->GetBuffer(),
|
|
1836
|
+
ptr->GetState());
|
|
1837
|
+
return ret;
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
return false;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1509
1844
|
static void IsContextLost(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1510
1845
|
|
|
1846
|
+
static bool FastIsContextLost(v8::Local<v8::Object> receiver_obj) {
|
|
1847
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1848
|
+
if (ptr == nullptr) {
|
|
1849
|
+
return false;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
auto ret = canvas_native_webgl_get_is_context_lost(
|
|
1854
|
+
ptr->GetState());
|
|
1855
|
+
|
|
1856
|
+
return ret;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1511
1859
|
static void IsEnabled(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1512
1860
|
|
|
1861
|
+
static bool FastIsEnabled(v8::Local<v8::Object> receiver_obj, uint32_t cap) {
|
|
1862
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1863
|
+
if (ptr == nullptr) {
|
|
1864
|
+
return false;
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
return canvas_native_webgl_is_enabled(
|
|
1868
|
+
cap, ptr->GetState());
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1513
1871
|
static void IsFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1514
1872
|
|
|
1873
|
+
static bool FastIsFramebuffer(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> value) {
|
|
1874
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1875
|
+
if (ptr == nullptr) {
|
|
1876
|
+
return false;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
auto type = GetNativeType(value);
|
|
1880
|
+
if (type == NativeType::WebGLFramebuffer) {
|
|
1881
|
+
auto framebuffer = WebGLFramebuffer::GetPointer(value);
|
|
1882
|
+
if (framebuffer != nullptr) {
|
|
1883
|
+
auto ret = canvas_native_webgl_is_framebuffer(
|
|
1884
|
+
framebuffer->GetFrameBuffer(),
|
|
1885
|
+
ptr->GetState());
|
|
1886
|
+
return ret;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
return false;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1515
1893
|
static void IsProgram(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1516
1894
|
|
|
1895
|
+
static bool FastIsProgram(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> value) {
|
|
1896
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1897
|
+
if (ptr == nullptr) {
|
|
1898
|
+
return false;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
auto type = GetNativeType(value);
|
|
1902
|
+
if (type == NativeType::WebGLProgram) {
|
|
1903
|
+
auto program = WebGLProgram::GetPointer(value);
|
|
1904
|
+
if (program != nullptr) {
|
|
1905
|
+
auto ret = canvas_native_webgl_is_program(
|
|
1906
|
+
program->GetProgram(),
|
|
1907
|
+
ptr->GetState());
|
|
1908
|
+
|
|
1909
|
+
return ret;
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
return false;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1517
1916
|
static void IsRenderbuffer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1518
1917
|
|
|
1918
|
+
static bool
|
|
1919
|
+
FastIsRenderbuffer(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> value) {
|
|
1920
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1921
|
+
if (ptr == nullptr) {
|
|
1922
|
+
return false;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
auto type = GetNativeType(value);
|
|
1927
|
+
if (type == NativeType::WebGLRenderbuffer) {
|
|
1928
|
+
auto renderbuffer = WebGLRenderbuffer::GetPointer(value);
|
|
1929
|
+
if (renderbuffer != nullptr) {
|
|
1930
|
+
auto ret = canvas_native_webgl_is_renderbuffer(
|
|
1931
|
+
renderbuffer->GetRenderBuffer(),
|
|
1932
|
+
ptr->GetState());
|
|
1933
|
+
|
|
1934
|
+
return ret;
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
return false;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1519
1941
|
static void IsShader(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1520
1942
|
|
|
1943
|
+
static bool FastIsShader(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> value) {
|
|
1944
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1945
|
+
if (ptr == nullptr) {
|
|
1946
|
+
return false;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
auto type = GetNativeType(value);
|
|
1950
|
+
if (type == NativeType::WebGLShader) {
|
|
1951
|
+
auto shader = WebGLShader::GetPointer(value);
|
|
1952
|
+
if (shader != nullptr) {
|
|
1953
|
+
auto ret = canvas_native_webgl_is_shader(
|
|
1954
|
+
shader->GetShader(),
|
|
1955
|
+
ptr->GetState());
|
|
1956
|
+
|
|
1957
|
+
return ret;
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
return false;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1521
1964
|
static void IsTexture(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1522
1965
|
|
|
1966
|
+
static bool FastIsTexture(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> value) {
|
|
1967
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1968
|
+
if (ptr == nullptr) {
|
|
1969
|
+
return false;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
|
|
1973
|
+
auto type = GetNativeType(value);
|
|
1974
|
+
if (type == NativeType::WebGLTexture) {
|
|
1975
|
+
auto texture = WebGLTexture::GetPointer(value);
|
|
1976
|
+
if (texture != nullptr) {
|
|
1977
|
+
auto ret = canvas_native_webgl_is_texture(
|
|
1978
|
+
texture->GetTexture(),
|
|
1979
|
+
ptr->GetState());
|
|
1980
|
+
return ret;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
return false;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1523
1987
|
static void LineWidth(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1524
1988
|
|
|
1989
|
+
static void FastLineWidth(v8::Local<v8::Object> receiver_obj, double width) {
|
|
1990
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
1991
|
+
if (ptr == nullptr) {
|
|
1992
|
+
return;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
canvas_native_webgl_line_width(
|
|
1996
|
+
static_cast<float>(width),
|
|
1997
|
+
ptr->GetState());
|
|
1998
|
+
|
|
1999
|
+
}
|
|
2000
|
+
|
|
1525
2001
|
static void LinkProgram(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1526
2002
|
|
|
2003
|
+
static void FastLinkProgram(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> value) {
|
|
2004
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2005
|
+
if (ptr == nullptr) {
|
|
2006
|
+
return;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
auto type = GetNativeType(value);
|
|
2010
|
+
if (type == NativeType::WebGLProgram) {
|
|
2011
|
+
auto program = WebGLProgram::GetPointer(value);
|
|
2012
|
+
if (program != nullptr) {
|
|
2013
|
+
canvas_native_webgl_link_program(
|
|
2014
|
+
program->GetProgram(),
|
|
2015
|
+
ptr->GetState());
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
|
|
1527
2020
|
static void PixelStorei(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1528
2021
|
|
|
2022
|
+
static void
|
|
2023
|
+
FastPixelStoreiBool(v8::Local<v8::Object> receiver_obj, uint32_t pname, bool param) {
|
|
2024
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2025
|
+
if (ptr == nullptr) {
|
|
2026
|
+
return;
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
canvas_native_webgl_pixel_storei(
|
|
2030
|
+
pname,
|
|
2031
|
+
param ? 1 : 0,
|
|
2032
|
+
ptr->GetState()
|
|
2033
|
+
);
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
static void FastPixelStorei(v8::Local<v8::Object> receiver_obj, uint32_t pname, int32_t param) {
|
|
2037
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2038
|
+
if (ptr == nullptr) {
|
|
2039
|
+
return;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
canvas_native_webgl_pixel_storei(
|
|
2043
|
+
pname,
|
|
2044
|
+
param,
|
|
2045
|
+
ptr->GetState()
|
|
2046
|
+
);
|
|
2047
|
+
}
|
|
2048
|
+
|
|
1529
2049
|
static void PolygonOffset(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1530
2050
|
|
|
2051
|
+
static void FastPolygonOffset(v8::Local<v8::Object> receiver_obj, double factor, double units) {
|
|
2052
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2053
|
+
if (ptr == nullptr) {
|
|
2054
|
+
return;
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
canvas_native_webgl_polygon_offset(
|
|
2058
|
+
static_cast<float>(factor),
|
|
2059
|
+
static_cast<float>(units),
|
|
2060
|
+
ptr->GetState()
|
|
2061
|
+
);
|
|
2062
|
+
|
|
2063
|
+
}
|
|
2064
|
+
|
|
1531
2065
|
static void ReadPixels(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1532
2066
|
|
|
1533
2067
|
static void RenderbufferStorage(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1534
2068
|
|
|
2069
|
+
static void FastRenderbufferStorage(v8::Local<v8::Object> receiver_obj, uint32_t target,
|
|
2070
|
+
uint32_t internalFormat, int32_t width, int32_t height) {
|
|
2071
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2072
|
+
if (ptr == nullptr) {
|
|
2073
|
+
return;
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
canvas_native_webgl_renderbuffer_storage(
|
|
2077
|
+
target,
|
|
2078
|
+
internalFormat,
|
|
2079
|
+
width,
|
|
2080
|
+
height,
|
|
2081
|
+
ptr->GetState()
|
|
2082
|
+
);
|
|
2083
|
+
|
|
2084
|
+
}
|
|
2085
|
+
|
|
1535
2086
|
static void SampleCoverage(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1536
2087
|
|
|
2088
|
+
static void FastSampleCoverage(v8::Local<v8::Object> receiver_obj, double value, bool invert) {
|
|
2089
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2090
|
+
if (ptr == nullptr) {
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
|
|
2094
|
+
canvas_native_webgl_sample_coverage(
|
|
2095
|
+
static_cast<float>(value),
|
|
2096
|
+
invert,
|
|
2097
|
+
ptr->GetState()
|
|
2098
|
+
);
|
|
2099
|
+
|
|
2100
|
+
}
|
|
2101
|
+
|
|
1537
2102
|
static void Scissor(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1538
2103
|
|
|
2104
|
+
static void FastScissor(v8::Local<v8::Object> receiver_obj, int32_t x, int32_t y, int32_t width,
|
|
2105
|
+
int32_t height) {
|
|
2106
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2107
|
+
if (ptr == nullptr) {
|
|
2108
|
+
return;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
canvas_native_webgl_scissor(
|
|
2112
|
+
x,
|
|
2113
|
+
y,
|
|
2114
|
+
width,
|
|
2115
|
+
height,
|
|
2116
|
+
ptr->GetState()
|
|
2117
|
+
);
|
|
2118
|
+
|
|
2119
|
+
}
|
|
2120
|
+
|
|
1539
2121
|
static void ShaderSource(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1540
2122
|
|
|
1541
2123
|
static void StencilFuncSeparate(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1542
2124
|
|
|
2125
|
+
static void
|
|
2126
|
+
FastStencilFuncSeparate(v8::Local<v8::Object> receiver_obj, uint32_t face, uint32_t func,
|
|
2127
|
+
int32_t ref, uint32_t mask) {
|
|
2128
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2129
|
+
if (ptr == nullptr) {
|
|
2130
|
+
return;
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
canvas_native_webgl_stencil_func_separate(
|
|
2134
|
+
face,
|
|
2135
|
+
func,
|
|
2136
|
+
ref,
|
|
2137
|
+
mask,
|
|
2138
|
+
ptr->GetState()
|
|
2139
|
+
);
|
|
2140
|
+
|
|
2141
|
+
}
|
|
2142
|
+
|
|
1543
2143
|
static void StencilFunc(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1544
2144
|
|
|
2145
|
+
static void
|
|
2146
|
+
FastStencilFunc(v8::Local<v8::Object> receiver_obj, uint32_t func, int32_t ref, uint32_t mask) {
|
|
2147
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2148
|
+
if (ptr == nullptr) {
|
|
2149
|
+
return;
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
canvas_native_webgl_stencil_func(
|
|
2153
|
+
func,
|
|
2154
|
+
ref,
|
|
2155
|
+
mask,
|
|
2156
|
+
ptr->GetState()
|
|
2157
|
+
);
|
|
2158
|
+
|
|
2159
|
+
}
|
|
2160
|
+
|
|
1545
2161
|
static void StencilMaskSeparate(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1546
2162
|
|
|
2163
|
+
static void
|
|
2164
|
+
FastStencilMaskSeparate(v8::Local<v8::Object> receiver_obj, uint32_t face, uint32_t mask) {
|
|
2165
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2166
|
+
if (ptr == nullptr) {
|
|
2167
|
+
return;
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
canvas_native_webgl_stencil_mask_separate(
|
|
2171
|
+
face,
|
|
2172
|
+
mask,
|
|
2173
|
+
ptr->GetState()
|
|
2174
|
+
);
|
|
2175
|
+
|
|
2176
|
+
}
|
|
2177
|
+
|
|
1547
2178
|
static void StencilMask(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1548
2179
|
|
|
2180
|
+
static void FastStencilMask(v8::Local<v8::Object> receiver_obj, uint32_t mask) {
|
|
2181
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2182
|
+
if (ptr == nullptr) {
|
|
2183
|
+
return;
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
|
|
2187
|
+
canvas_native_webgl_stencil_mask(
|
|
2188
|
+
mask,
|
|
2189
|
+
ptr->GetState()
|
|
2190
|
+
);
|
|
2191
|
+
|
|
2192
|
+
}
|
|
2193
|
+
|
|
1549
2194
|
static void StencilOpSeparate(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1550
2195
|
|
|
2196
|
+
static void
|
|
2197
|
+
FastStencilOpSeparate(v8::Local<v8::Object> receiver_obj, uint32_t face, uint32_t fail,
|
|
2198
|
+
uint32_t zfail, uint32_t zpass) {
|
|
2199
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2200
|
+
if (ptr == nullptr) {
|
|
2201
|
+
return;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
canvas_native_webgl_stencil_op_separate(
|
|
2205
|
+
face,
|
|
2206
|
+
fail,
|
|
2207
|
+
zfail,
|
|
2208
|
+
zpass,
|
|
2209
|
+
ptr->GetState()
|
|
2210
|
+
);
|
|
2211
|
+
|
|
2212
|
+
}
|
|
2213
|
+
|
|
1551
2214
|
static void StencilOp(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1552
2215
|
|
|
2216
|
+
static void FastStencilOp(v8::Local<v8::Object> receiver_obj, uint32_t fail, uint32_t zfail,
|
|
2217
|
+
uint32_t zpass) {
|
|
2218
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2219
|
+
if (ptr == nullptr) {
|
|
2220
|
+
return;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
canvas_native_webgl_stencil_op(
|
|
2224
|
+
fail,
|
|
2225
|
+
zfail,
|
|
2226
|
+
zpass,
|
|
2227
|
+
ptr->GetState()
|
|
2228
|
+
);
|
|
2229
|
+
|
|
2230
|
+
}
|
|
2231
|
+
|
|
1553
2232
|
static void TexImage2D(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1554
2233
|
|
|
1555
2234
|
static void TexParameterf(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1556
2235
|
|
|
2236
|
+
static void
|
|
2237
|
+
FastTexParameterf(v8::Local<v8::Object> receiver_obj, uint32_t target, uint32_t pname,
|
|
2238
|
+
double param) {
|
|
2239
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2240
|
+
if (ptr == nullptr) {
|
|
2241
|
+
return;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
canvas_native_webgl_tex_parameterf(
|
|
2245
|
+
target,
|
|
2246
|
+
pname,
|
|
2247
|
+
static_cast<float>(param),
|
|
2248
|
+
ptr->GetState()
|
|
2249
|
+
);
|
|
2250
|
+
|
|
2251
|
+
}
|
|
2252
|
+
|
|
1557
2253
|
static void TexParameteri(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1558
2254
|
|
|
2255
|
+
static void FastTexParameteri(v8::Local<v8::Object> receiver_obj, uint32_t target,
|
|
2256
|
+
uint32_t pname, int32_t
|
|
2257
|
+
param) {
|
|
2258
|
+
WebGLRenderingContext *ptr = GetPointer(receiver_obj);
|
|
2259
|
+
if (ptr == nullptr) {
|
|
2260
|
+
return;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
canvas_native_webgl_tex_parameteri(
|
|
2264
|
+
target,
|
|
2265
|
+
pname,
|
|
2266
|
+
param,
|
|
2267
|
+
ptr->GetState()
|
|
2268
|
+
);
|
|
2269
|
+
|
|
2270
|
+
}
|
|
2271
|
+
|
|
1559
2272
|
static void TexSubImage2D(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1560
2273
|
|
|
1561
2274
|
static void Uniform1f(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
@@ -2337,7 +3050,6 @@ public:
|
|
|
2337
3050
|
if (location != nullptr) {
|
|
2338
3051
|
|
|
2339
3052
|
float *data;
|
|
2340
|
-
|
|
2341
3053
|
value.getStorageIfAligned(&data);
|
|
2342
3054
|
auto size = value.length();
|
|
2343
3055
|
|