@nativescript/canvas 2.0.0-alpha.20 → 2.0.0-alpha.21
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/Canvas/common.d.ts +2 -0
- package/Canvas/common.js +6 -0
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +0 -2
- package/Canvas/index.android.js +8 -22
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +7 -0
- package/Canvas/index.ios.d.ts +0 -2
- package/Canvas/index.ios.js +7 -26
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasGradient/index.d.ts +1 -3
- package/Canvas2D/CanvasGradient/index.js +1 -10
- package/Canvas2D/CanvasGradient/index.js.map +1 -1
- package/Canvas2D/CanvasPattern/index.d.ts +1 -3
- package/Canvas2D/CanvasPattern/index.js +1 -10
- package/Canvas2D/CanvasPattern/index.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +0 -2
- package/Canvas2D/CanvasRenderingContext2D/index.js +120 -138
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.js +3 -3
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js +5 -5
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/Canvas2D/Path2D/index.d.ts +0 -2
- package/Canvas2D/Path2D/index.js +34 -39
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/ImageAsset/index.d.ts +2 -2
- package/ImageAsset/index.js +33 -37
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.d.ts +0 -2
- package/ImageBitmap/index.js +23 -29
- package/ImageBitmap/index.js.map +1 -1
- package/SVG/SVG.js +1 -1
- package/TextDecoder/index.d.ts +0 -2
- package/TextDecoder/index.js +3 -12
- package/TextDecoder/index.js.map +1 -1
- package/TextEncoder/index.d.ts +0 -2
- package/TextEncoder/index.js +4 -13
- package/TextEncoder/index.js.map +1 -1
- package/WebGL/WebGLExtensions/index.d.ts +0 -9
- package/WebGL/WebGLExtensions/index.js +17 -74
- package/WebGL/WebGLExtensions/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/common.d.ts +0 -2
- package/WebGL/WebGLRenderingContext/common.js +0 -10
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js +159 -298
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js +107 -195
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/angular/esm2020/index.mjs +5 -5
- package/angular/fesm2015/nativescript-canvas-angular.mjs +4 -4
- package/angular/fesm2015/nativescript-canvas-angular.mjs.map +1 -1
- package/angular/fesm2020/nativescript-canvas-angular.mjs +4 -4
- package/angular/fesm2020/nativescript-canvas-angular.mjs.map +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/android/include.gradle +15 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +87 -57
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +10 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +142 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2589 -110
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -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/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +1174 -89
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +2 -2
- 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/CanvasNative-Swift.h +174 -114
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +10 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +142 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2589 -110
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -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/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +1174 -89
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1174 -89
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +42 -31
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/Podfile +3 -0
- package/platforms/ios/build.xcconfig +3 -3
- package/platforms/ios/src/CanvasModule.h +0 -2
- package/platforms/ios/src/CanvasModule.mm +4 -4
- package/platforms/ios/src/NSOperationQueueWrapper.h +11 -0
- package/platforms/ios/src/NSOperationQueueWrapper.mm +74 -0
- package/platforms/ios/src/cpp/Caches.cpp +35 -0
- package/platforms/ios/src/cpp/Caches.h +186 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +1582 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.h +7 -34
- package/platforms/ios/src/cpp/Common.h +30 -0
- package/platforms/ios/src/cpp/ConcurrentMap.h +54 -0
- package/platforms/ios/src/cpp/Helpers.h +304 -38
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +802 -0
- package/platforms/ios/src/cpp/ImageAssetImpl.h +44 -12
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +189 -0
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +22 -16
- package/platforms/ios/src/cpp/JSICallback.h +61 -5
- package/platforms/ios/src/cpp/JSIReadFileCallback.h +86 -6
- package/platforms/ios/src/cpp/JSIRuntime.cpp +21 -0
- package/platforms/ios/src/cpp/JSIRuntime.h +7 -0
- package/platforms/ios/src/cpp/OneByteStringResource.cpp +25 -0
- package/platforms/ios/src/cpp/OneByteStringResource.h +21 -0
- package/platforms/ios/src/cpp/RafImpl.cpp +8 -0
- package/platforms/ios/src/cpp/RafImpl.h +11 -8
- package/platforms/ios/src/cpp/TextDecoderImpl.cpp +188 -0
- package/platforms/ios/src/cpp/TextDecoderImpl.h +20 -14
- package/platforms/ios/src/cpp/TextEncoderImpl.cpp +139 -0
- package/platforms/ios/src/cpp/TextEncoderImpl.h +20 -11
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.cpp +71 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +27 -13
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +89 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +26 -13
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +2402 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +264 -21
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +203 -0
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +26 -12
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +800 -0
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +172 -13
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +449 -0
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +41 -12
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.cpp +253 -0
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +50 -12
- package/platforms/ios/src/cpp/gl.h +57 -7
- package/platforms/ios/src/cpp/gl3stub.c +425 -0
- package/platforms/ios/src/cpp/gl3stub.h +665 -0
- package/platforms/ios/src/cpp/gles3jni.h +37 -0
- package/platforms/ios/src/cpp/include/robin_hood.h +2544 -0
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp +93 -0
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +33 -13
- package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +41 -6
- package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +46 -10
- package/platforms/ios/src/cpp/webgl/WebGLProgram.h +40 -5
- package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +40 -6
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +6691 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +261 -390
- package/platforms/ios/src/cpp/webgl/{WebGLRenderingContextBase.mm → WebGLRenderingContextBase.cpp} +17 -16
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.h +15 -36
- package/platforms/ios/src/cpp/webgl/WebGLShader.h +40 -6
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.cpp +50 -0
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +66 -11
- package/platforms/ios/src/cpp/webgl/WebGLTexture.h +40 -6
- package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +44 -8
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp +126 -0
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +25 -12
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp +35 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +25 -5
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp +41 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +25 -5
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp +323 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +47 -13
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +49 -6
- package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +37 -15
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +47 -6
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +49 -6
- package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +36 -15
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +44 -6
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +38 -15
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +37 -16
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +41 -6
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +40 -16
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.cpp +102 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +69 -14
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +51 -8
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +49 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +49 -8
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +76 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +57 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +53 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +59 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +46 -6
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp +43 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +126 -14
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.cpp +32 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +61 -12
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +4517 -0
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +139 -343
- package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +40 -4
- package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +42 -3
- package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +44 -11
- package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +42 -4
- package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +43 -4
- package/platforms/ios/src/module.modulemap +1 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.mm +0 -1105
- package/platforms/ios/src/cpp/ImageAssetImpl.mm +0 -417
- package/platforms/ios/src/cpp/ImageBitmapImpl.mm +0 -126
- package/platforms/ios/src/cpp/RafImpl.mm +0 -10
- package/platforms/ios/src/cpp/TextDecoderImpl.mm +0 -97
- package/platforms/ios/src/cpp/TextEncoderImpl.mm +0 -60
- package/platforms/ios/src/cpp/VecMutableBuffer.h +0 -46
- package/platforms/ios/src/cpp/canvas-cxx/src/lib.rs.cc +0 -6156
- package/platforms/ios/src/cpp/canvas-cxx/src/lib.rs.h +0 -2867
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.mm +0 -42
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.mm +0 -49
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.mm +0 -1972
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.mm +0 -68
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.mm +0 -149
- package/platforms/ios/src/cpp/canvas2d/Path2D.mm +0 -335
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.mm +0 -68
- package/platforms/ios/src/cpp/rust/cxx.cc +0 -793
- package/platforms/ios/src/cpp/rust/cxx.h +0 -1111
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.mm +0 -39
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.mm +0 -5958
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.mm +0 -40
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.mm +0 -108
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.mm +0 -28
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.mm +0 -42
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.mm +0 -295
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.mm +0 -40
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.mm +0 -37
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.mm +0 -28
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.mm +0 -31
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.mm +0 -28
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.mm +0 -127
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.mm +0 -45
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.mm +0 -45
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.mm +0 -31
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.mm +0 -70
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.mm +0 -47
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.mm +0 -46
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.mm +0 -49
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.mm +0 -30
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.mm +0 -177
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.mm +0 -64
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.mm +0 -4551
- /package/platforms/ios/src/cpp/{OnRafCallback.mm → OnRafCallback.cpp} +0 -0
|
@@ -4,29 +4,84 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#include "canvas-cxx/src/lib.rs.h"
|
|
8
|
-
#include "rust/cxx.h"
|
|
9
|
-
#import <NativeScript/JSIRuntime.h>
|
|
10
7
|
#include "gl.h"
|
|
11
|
-
#include "
|
|
8
|
+
#include "WebGLVertexArrayObject.h"
|
|
12
9
|
#include "Helpers.h"
|
|
13
10
|
#include <vector>
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
using namespace org::nativescript::canvas;
|
|
17
|
-
|
|
18
|
-
class JSI_EXPORT OES_vertex_array_objectImpl : public jsi::HostObject {
|
|
12
|
+
class OES_vertex_array_objectImpl {
|
|
19
13
|
public:
|
|
20
|
-
OES_vertex_array_objectImpl(
|
|
14
|
+
OES_vertex_array_objectImpl(OES_vertex_array_object* object);
|
|
15
|
+
~OES_vertex_array_objectImpl(){
|
|
16
|
+
canvas_native_webgl_OES_vertex_array_object_destroy(this->GetVertexArrayObject());
|
|
17
|
+
this->object_ = nullptr;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
21
|
+
auto cache = Caches::Get(isolate);
|
|
22
|
+
auto ctor = cache->OES_vertex_array_objectTmpl.get();
|
|
23
|
+
if (ctor != nullptr) {
|
|
24
|
+
return ctor->Get(isolate);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
28
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
29
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "OES_vertex_array_object"));
|
|
21
30
|
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
32
|
+
tmpl->SetInternalFieldCount(1);
|
|
33
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
34
|
+
ConvertToV8String(isolate, "OES_vertex_array_object"));
|
|
35
|
+
tmpl->Set(ConvertToV8String(isolate, "VERTEX_ARRAY_BINDING_OES"),
|
|
36
|
+
v8::Number::New(isolate, (double) GL_VERTEX_ARRAY_BINDING_OES));
|
|
37
|
+
tmpl->Set(ConvertToV8String(isolate, "createVertexArrayOES"),
|
|
38
|
+
v8::FunctionTemplate::New(isolate, &CreateVertexArrayOES));
|
|
39
|
+
tmpl->Set(ConvertToV8String(isolate, "deleteVertexArrayOES"),
|
|
40
|
+
v8::FunctionTemplate::New(isolate, &DeleteVertexArrayOES));
|
|
41
|
+
tmpl->Set(ConvertToV8String(isolate, "isVertexArrayOES"),
|
|
42
|
+
v8::FunctionTemplate::New(isolate, &IsVertexArrayOES));
|
|
43
|
+
tmpl->Set(ConvertToV8String(isolate, "bindVertexArrayOES"),
|
|
44
|
+
v8::FunctionTemplate::New(isolate, &BindVertexArrayOES));
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
cache->OES_vertex_array_objectTmpl =
|
|
48
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
49
|
+
return ctorTmpl;
|
|
24
50
|
}
|
|
25
51
|
|
|
26
|
-
|
|
52
|
+
static v8::Local<v8::Object>
|
|
53
|
+
NewInstance(v8::Isolate *isolate, OES_vertex_array_objectImpl *vertexArrayObject) {
|
|
54
|
+
auto context = isolate->GetCurrentContext();
|
|
55
|
+
v8::EscapableHandleScope scope(isolate);
|
|
56
|
+
auto object = OES_vertex_array_objectImpl::GetCtor(isolate)->GetFunction(
|
|
57
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
58
|
+
SetNativeType(isolate, object, NativeType::OES_vertex_array_object);
|
|
59
|
+
auto ext = v8::External::New(isolate, vertexArrayObject);
|
|
60
|
+
object->SetInternalField(0, ext);
|
|
61
|
+
return scope.Escape(object);
|
|
62
|
+
}
|
|
27
63
|
|
|
28
|
-
|
|
64
|
+
static OES_vertex_array_objectImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
65
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
66
|
+
if (ptr == nullptr) {
|
|
67
|
+
return nullptr;
|
|
68
|
+
}
|
|
69
|
+
return static_cast<OES_vertex_array_objectImpl *>(ptr);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static void CreateVertexArrayOES(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
73
|
+
|
|
74
|
+
static void DeleteVertexArrayOES(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
75
|
+
|
|
76
|
+
static void IsVertexArrayOES(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
77
|
+
|
|
78
|
+
static void BindVertexArrayOES(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
OES_vertex_array_object * GetVertexArrayObject() {
|
|
82
|
+
return this->object_;
|
|
83
|
+
}
|
|
29
84
|
|
|
30
85
|
private:
|
|
31
|
-
|
|
86
|
+
OES_vertex_array_object* object_;
|
|
32
87
|
};
|
|
@@ -4,17 +4,60 @@
|
|
|
4
4
|
|
|
5
5
|
#define once
|
|
6
6
|
|
|
7
|
-
#include "rust/cxx.h"
|
|
8
|
-
#import <NativeScript/JSIRuntime.h>
|
|
9
7
|
#include "gl.h"
|
|
10
8
|
#include <vector>
|
|
9
|
+
#include "Helpers.h"
|
|
10
|
+
#include "Common.h"
|
|
11
|
+
#include "Caches.h"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class JSI_EXPORT WEBGL_color_buffer_floatImpl : public jsi::HostObject {
|
|
13
|
+
class WEBGL_color_buffer_floatImpl {
|
|
15
14
|
public:
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
16
|
+
auto cache = Caches::Get(isolate);
|
|
17
|
+
auto ctor = cache->WEBGL_color_buffer_floatTmpl.get();
|
|
18
|
+
if (ctor != nullptr) {
|
|
19
|
+
return ctor->Get(isolate);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
23
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
24
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "WEBGL_color_buffer_float"));
|
|
25
|
+
|
|
26
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
27
|
+
tmpl->SetInternalFieldCount(1);
|
|
28
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
29
|
+
ConvertToV8String(isolate, "WEBGL_color_buffer_float"));
|
|
30
|
+
|
|
31
|
+
tmpl->Set(ConvertToV8String(isolate, "RGBA32F_EXT"),
|
|
32
|
+
v8::Number::New(isolate, (double) GL_RGBA32F_EXT));
|
|
33
|
+
tmpl->Set(ConvertToV8String(isolate, "RGB32F_EXT"),
|
|
34
|
+
v8::Number::New(isolate, (double) GL_RGB32F_EXT));
|
|
35
|
+
tmpl->Set(ConvertToV8String(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT"),
|
|
36
|
+
v8::Number::New(isolate, (double) GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT));
|
|
37
|
+
tmpl->Set(ConvertToV8String(isolate, "UNSIGNED_NORMALIZED_EXT"),
|
|
38
|
+
v8::Number::New(isolate, (double) GL_UNSIGNED_NORMALIZED_EXT));
|
|
39
|
+
cache->WEBGL_color_buffer_floatTmpl =
|
|
40
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
41
|
+
return ctorTmpl;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static v8::Local<v8::Object>
|
|
45
|
+
NewInstance(v8::Isolate *isolate, WEBGL_color_buffer_floatImpl *buffer) {
|
|
46
|
+
auto context = isolate->GetCurrentContext();
|
|
47
|
+
v8::EscapableHandleScope scope(isolate);
|
|
48
|
+
auto object = WEBGL_color_buffer_floatImpl::GetCtor(isolate)->GetFunction(
|
|
49
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
50
|
+
SetNativeType(isolate, object, NativeType::WEBGL_color_buffer_float);
|
|
51
|
+
auto ext = v8::External::New(isolate, buffer);
|
|
52
|
+
object->SetInternalField(0, ext);
|
|
53
|
+
return scope.Escape(object);
|
|
54
|
+
}
|
|
18
55
|
|
|
19
|
-
|
|
56
|
+
static WEBGL_color_buffer_floatImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
57
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
58
|
+
if (ptr == nullptr) {
|
|
59
|
+
return nullptr;
|
|
60
|
+
}
|
|
61
|
+
return static_cast<WEBGL_color_buffer_floatImpl *>(ptr);
|
|
62
|
+
}
|
|
20
63
|
};
|
|
@@ -4,15 +4,58 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#include "rust/cxx.h"
|
|
8
|
-
#import <NativeScript/JSIRuntime.h>
|
|
9
7
|
#include "gl.h"
|
|
10
8
|
#include <vector>
|
|
9
|
+
#include "Helpers.h"
|
|
10
|
+
#include "Common.h"
|
|
11
|
+
#include "Caches.h"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
class WEBGL_compressed_texture_atcImpl {
|
|
14
|
+
public:
|
|
15
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
16
|
+
auto cache = Caches::Get(isolate);
|
|
17
|
+
auto ctor = cache->WEBGL_compressed_texture_atcTmpl.get();
|
|
18
|
+
if (ctor != nullptr) {
|
|
19
|
+
return ctor->Get(isolate);
|
|
20
|
+
}
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
23
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
24
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "WEBGL_compressed_texture_atc"));
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
27
|
+
tmpl->SetInternalFieldCount(1);
|
|
28
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
29
|
+
ConvertToV8String(isolate, "WEBGL_compressed_texture_atc"));
|
|
30
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_ATC_WEBGL"),
|
|
31
|
+
v8::Number::New(isolate, (double) GL_ATC_RGB_AMD));
|
|
32
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL"),
|
|
33
|
+
v8::Number::New(isolate, (double) GL_ATC_RGBA_EXPLICIT_ALPHA_AMD));
|
|
34
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL"),
|
|
35
|
+
v8::Number::New(isolate, (double) GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD));
|
|
36
|
+
|
|
37
|
+
cache->WEBGL_compressed_texture_atcTmpl =
|
|
38
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
39
|
+
return ctorTmpl;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static v8::Local<v8::Object>
|
|
43
|
+
NewInstance(v8::Isolate *isolate, WEBGL_compressed_texture_atcImpl *compressedTextureAtc) {
|
|
44
|
+
auto context = isolate->GetCurrentContext();
|
|
45
|
+
v8::EscapableHandleScope scope(isolate);
|
|
46
|
+
auto object = WEBGL_compressed_texture_atcImpl::GetCtor(isolate)->GetFunction(
|
|
47
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
48
|
+
SetNativeType(isolate, object, NativeType::WEBGL_compressed_texture_atc);
|
|
49
|
+
auto ext = v8::External::New(isolate, compressedTextureAtc);
|
|
50
|
+
object->SetInternalField(0, ext);
|
|
51
|
+
return scope.Escape(object);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static WEBGL_compressed_texture_atcImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
55
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
56
|
+
if (ptr == nullptr) {
|
|
57
|
+
return nullptr;
|
|
58
|
+
}
|
|
59
|
+
return static_cast<WEBGL_compressed_texture_atcImpl *>(ptr);
|
|
60
|
+
}
|
|
18
61
|
};
|
|
@@ -4,15 +4,56 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
7
|
+
#include "gl.h"
|
|
8
|
+
#include <vector>
|
|
9
|
+
#include "Common.h"
|
|
10
|
+
#include "Caches.h"
|
|
11
|
+
#include "Helpers.h"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
class WEBGL_compressed_texture_etc1Impl {
|
|
14
|
+
public:
|
|
15
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
16
|
+
auto cache = Caches::Get(isolate);
|
|
17
|
+
auto ctor = cache->WEBGL_compressed_texture_etc1Tmpl.get();
|
|
18
|
+
if (ctor != nullptr) {
|
|
19
|
+
return ctor->Get(isolate);
|
|
20
|
+
}
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
23
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
24
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "WEBGL_compressed_texture_etc1"));
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
27
|
+
tmpl->SetInternalFieldCount(1);
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
31
|
+
ConvertToV8String(isolate, "WEBGL_compressed_texture_etc1"));
|
|
32
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_ETC1_WEBGL"),
|
|
33
|
+
v8::Number::New(isolate, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG));
|
|
34
|
+
|
|
35
|
+
cache->WEBGL_compressed_texture_etc1Tmpl =
|
|
36
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
37
|
+
return ctorTmpl;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static v8::Local<v8::Object>
|
|
41
|
+
NewInstance(v8::Isolate *isolate, WEBGL_compressed_texture_etc1Impl *compressedTextureEtc1) {
|
|
42
|
+
auto context = isolate->GetCurrentContext();
|
|
43
|
+
v8::EscapableHandleScope scope(isolate);
|
|
44
|
+
auto object = WEBGL_compressed_texture_etc1Impl::GetCtor(isolate)->GetFunction(
|
|
45
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
46
|
+
SetNativeType(isolate, object, NativeType::WEBGL_compressed_texture_etc1);
|
|
47
|
+
auto ext = v8::External::New(isolate, compressedTextureEtc1);
|
|
48
|
+
object->SetInternalField(0, ext);
|
|
49
|
+
return scope.Escape(object);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static WEBGL_compressed_texture_etc1Impl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
53
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
54
|
+
if (ptr == nullptr) {
|
|
55
|
+
return nullptr;
|
|
56
|
+
}
|
|
57
|
+
return static_cast<WEBGL_compressed_texture_etc1Impl *>(ptr);
|
|
58
|
+
}
|
|
18
59
|
};
|
|
@@ -4,15 +4,85 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#include "rust/cxx.h"
|
|
8
|
-
#import <NativeScript/JSIRuntime.h>
|
|
9
7
|
#include "gl.h"
|
|
10
8
|
#include <vector>
|
|
9
|
+
#include "Helpers.h"
|
|
10
|
+
#include "Common.h"
|
|
11
|
+
#include "Caches.h"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
class WEBGL_compressed_texture_etcImpl {
|
|
14
|
+
public:
|
|
15
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
16
|
+
auto cache = Caches::Get(isolate);
|
|
17
|
+
auto ctor = cache->WEBGL_compressed_texture_etcTmpl.get();
|
|
18
|
+
if (ctor != nullptr) {
|
|
19
|
+
return ctor->Get(isolate);
|
|
20
|
+
}
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
23
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
24
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "WEBGL_compressed_texture_etc"));
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
27
|
+
tmpl->SetInternalFieldCount(1);
|
|
28
|
+
|
|
29
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_R11_EAC"),
|
|
30
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_R11_EAC));
|
|
31
|
+
|
|
32
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SIGNED_R11_EAC"),
|
|
33
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SIGNED_R11_EAC));
|
|
34
|
+
|
|
35
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RG11_EAC"),
|
|
36
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RG11_EAC));
|
|
37
|
+
|
|
38
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SIGNED_RG11_EAC"),
|
|
39
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SIGNED_RG11_EAC));
|
|
40
|
+
|
|
41
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB8_ETC2"),
|
|
42
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGB8_ETC2));
|
|
43
|
+
|
|
44
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA8_ETC2_EAC"),
|
|
45
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA8_ETC2_EAC));
|
|
46
|
+
|
|
47
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB8_ETC2"),
|
|
48
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB8_ETC2));
|
|
49
|
+
|
|
50
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"),
|
|
51
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC));
|
|
52
|
+
|
|
53
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"),
|
|
54
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2));
|
|
55
|
+
|
|
56
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"),
|
|
57
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2));
|
|
58
|
+
|
|
59
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
60
|
+
ConvertToV8String(isolate, "WEBGL_compressed_texture_etc"));
|
|
61
|
+
|
|
62
|
+
cache->WEBGL_compressed_texture_etcTmpl =
|
|
63
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
64
|
+
return ctorTmpl;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static v8::Local<v8::Object>
|
|
68
|
+
NewInstance(v8::Isolate *isolate, WEBGL_compressed_texture_etcImpl *compressedTextureEtc) {
|
|
69
|
+
auto context = isolate->GetCurrentContext();
|
|
70
|
+
v8::EscapableHandleScope scope(isolate);
|
|
71
|
+
auto object = WEBGL_compressed_texture_etcImpl::GetCtor(isolate)->GetFunction(
|
|
72
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
73
|
+
SetNativeType(isolate, object, NativeType::WEBGL_compressed_texture_etc);
|
|
74
|
+
auto ext = v8::External::New(isolate, compressedTextureEtc);
|
|
75
|
+
object->SetInternalField(0, ext);
|
|
76
|
+
object->Set(context, ConvertToV8String(isolate, "ext_name"),
|
|
77
|
+
ConvertToV8String(isolate, "WEBGL_compressed_texture_etc"));
|
|
78
|
+
return scope.Escape(object);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static WEBGL_compressed_texture_etcImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
82
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
83
|
+
if (ptr == nullptr) {
|
|
84
|
+
return nullptr;
|
|
85
|
+
}
|
|
86
|
+
return static_cast<WEBGL_compressed_texture_etcImpl *>(ptr);
|
|
87
|
+
}
|
|
18
88
|
};
|
|
@@ -4,15 +4,66 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#include "rust/cxx.h"
|
|
8
|
-
#import <NativeScript/JSIRuntime.h>
|
|
9
7
|
#include "gl.h"
|
|
10
8
|
#include <vector>
|
|
9
|
+
#include "Helpers.h"
|
|
10
|
+
#include "Common.h"
|
|
11
|
+
#include "Caches.h"
|
|
11
12
|
|
|
12
|
-
using namespace facebook;
|
|
13
13
|
|
|
14
|
-
class
|
|
15
|
-
|
|
14
|
+
class WEBGL_compressed_texture_pvrtcImpl {
|
|
15
|
+
public:
|
|
16
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
17
|
+
auto cache = Caches::Get(isolate);
|
|
18
|
+
auto ctor = cache->WEBGL_compressed_texture_pvrtcTmpl.get();
|
|
19
|
+
if (ctor != nullptr) {
|
|
20
|
+
return ctor->Get(isolate);
|
|
21
|
+
}
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
24
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
25
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "WEBGL_compressed_texture_pvrtc"));
|
|
26
|
+
|
|
27
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
28
|
+
tmpl->SetInternalFieldCount(1);
|
|
29
|
+
|
|
30
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_PVRTC_4BPPV1_IMG"),
|
|
31
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG));
|
|
32
|
+
|
|
33
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"),
|
|
34
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG));
|
|
35
|
+
|
|
36
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_PVRTC_2BPPV1_IMG"),
|
|
37
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG));
|
|
38
|
+
|
|
39
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_PVRTC_2BPPV1_IMG"),
|
|
40
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG));
|
|
41
|
+
|
|
42
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
43
|
+
ConvertToV8String(isolate, "WEBGL_compressed_texture_pvrtc"));
|
|
44
|
+
|
|
45
|
+
cache->WEBGL_compressed_texture_pvrtcTmpl =
|
|
46
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
47
|
+
return ctorTmpl;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static v8::Local<v8::Object>
|
|
51
|
+
NewInstance(v8::Isolate *isolate, WEBGL_compressed_texture_pvrtcImpl *compressedTexturePvrtc) {
|
|
52
|
+
auto context = isolate->GetCurrentContext();
|
|
53
|
+
v8::EscapableHandleScope scope(isolate);
|
|
54
|
+
auto object = WEBGL_compressed_texture_pvrtcImpl::GetCtor(isolate)->GetFunction(
|
|
55
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
56
|
+
SetNativeType(isolate, object, NativeType::WEBGL_compressed_texture_pvrtc);
|
|
57
|
+
auto ext = v8::External::New(isolate, compressedTexturePvrtc);
|
|
58
|
+
object->SetInternalField(0, ext);
|
|
59
|
+
return scope.Escape(object);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static WEBGL_compressed_texture_pvrtcImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
63
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
64
|
+
if (ptr == nullptr) {
|
|
65
|
+
return nullptr;
|
|
66
|
+
}
|
|
67
|
+
return static_cast<WEBGL_compressed_texture_pvrtcImpl *>(ptr);
|
|
68
|
+
}
|
|
18
69
|
};
|
|
@@ -4,15 +4,62 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#include "rust/cxx.h"
|
|
8
|
-
#import <NativeScript/JSIRuntime.h>
|
|
9
7
|
#include "gl.h"
|
|
10
8
|
#include <vector>
|
|
9
|
+
#include "Helpers.h"
|
|
10
|
+
#include "Common.h"
|
|
11
|
+
#include "Caches.h"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
class WEBGL_compressed_texture_s3tcImpl {
|
|
14
|
+
public:
|
|
15
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
16
|
+
auto cache = Caches::Get(isolate);
|
|
17
|
+
auto ctor = cache->WEBGL_compressed_texture_s3tcTmpl.get();
|
|
18
|
+
if (ctor != nullptr) {
|
|
19
|
+
return ctor->Get(isolate);
|
|
20
|
+
}
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
23
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
24
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "WEBGL_compressed_texture_s3tc"));
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
27
|
+
tmpl->SetInternalFieldCount(1);
|
|
28
|
+
|
|
29
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGB_S3TC_DXT1_EXT"),
|
|
30
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGB_S3TC_DXT1_EXT));
|
|
31
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_S3TC_DXT1_EXT"),
|
|
32
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_S3TC_DXT1_EXT));
|
|
33
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_S3TC_DXT3_EXT"),
|
|
34
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_S3TC_DXT3_EXT));
|
|
35
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_RGBA_S3TC_DXT5_EXT"),
|
|
36
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_RGBA_S3TC_DXT5_EXT));
|
|
37
|
+
|
|
38
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
39
|
+
ConvertToV8String(isolate, "WEBGL_compressed_texture_s3tc"));
|
|
40
|
+
|
|
41
|
+
cache->WEBGL_compressed_texture_s3tcTmpl =
|
|
42
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
43
|
+
return ctorTmpl;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static v8::Local<v8::Object>
|
|
47
|
+
NewInstance(v8::Isolate *isolate, WEBGL_compressed_texture_s3tcImpl *textureS3Tc) {
|
|
48
|
+
auto context = isolate->GetCurrentContext();
|
|
49
|
+
v8::EscapableHandleScope scope(isolate);
|
|
50
|
+
auto object = WEBGL_compressed_texture_s3tcImpl::GetCtor(isolate)->GetFunction(
|
|
51
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
52
|
+
SetNativeType(isolate, object, NativeType::WEBGL_compressed_texture_s3tc);
|
|
53
|
+
auto ext = v8::External::New(isolate, textureS3Tc);
|
|
54
|
+
object->SetInternalField(0, ext);
|
|
55
|
+
return scope.Escape(object);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static WEBGL_compressed_texture_s3tcImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
59
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
60
|
+
if (ptr == nullptr) {
|
|
61
|
+
return nullptr;
|
|
62
|
+
}
|
|
63
|
+
return static_cast<WEBGL_compressed_texture_s3tcImpl *>(ptr);
|
|
64
|
+
}
|
|
18
65
|
};
|
|
@@ -4,16 +4,69 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#include "rust/cxx.h"
|
|
8
|
-
#import <NativeScript/JSIRuntime.h>
|
|
9
7
|
#include "gl.h"
|
|
10
8
|
#include <vector>
|
|
9
|
+
#include "Caches.h"
|
|
10
|
+
#include "Common.h"
|
|
11
|
+
#include "Helpers.h"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
class WEBGL_compressed_texture_s3tc_srgbImpl {
|
|
14
|
+
public:
|
|
15
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
16
|
+
auto cache = Caches::Get(isolate);
|
|
17
|
+
auto ctor = cache->WEBGL_compressed_texture_s3tc_srgbTmpl.get();
|
|
18
|
+
if (ctor != nullptr) {
|
|
19
|
+
return ctor->Get(isolate);
|
|
20
|
+
}
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
23
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
24
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "WEBGL_compressed_texture_s3tc_srgb"));
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
27
|
+
tmpl->SetInternalFieldCount(1);
|
|
28
|
+
|
|
29
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB_S3TC_DXT1_EXT"),
|
|
30
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB_S3TC_DXT1_EXT));
|
|
31
|
+
|
|
32
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT"),
|
|
33
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT));
|
|
34
|
+
|
|
35
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT"),
|
|
36
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT));
|
|
37
|
+
|
|
38
|
+
tmpl->Set(ConvertToV8String(isolate, "COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT"),
|
|
39
|
+
v8::Number::New(isolate, (double) GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT));
|
|
40
|
+
|
|
41
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
42
|
+
ConvertToV8String(isolate, "WEBGL_compressed_texture_s3tc_srgb"));
|
|
43
|
+
|
|
44
|
+
cache->WEBGL_compressed_texture_s3tc_srgbTmpl =
|
|
45
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
46
|
+
return ctorTmpl;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static v8::Local<v8::Object>
|
|
50
|
+
NewInstance(v8::Isolate *isolate,
|
|
51
|
+
WEBGL_compressed_texture_s3tc_srgbImpl *compressedTextureS3TcSrgb) {
|
|
52
|
+
auto context = isolate->GetCurrentContext();
|
|
53
|
+
v8::EscapableHandleScope scope(isolate);
|
|
54
|
+
auto object = WEBGL_compressed_texture_s3tc_srgbImpl::GetCtor(isolate)->GetFunction(
|
|
55
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
56
|
+
SetNativeType(isolate, object, NativeType::WEBGL_compressed_texture_s3tc_srgb);
|
|
57
|
+
auto ext = v8::External::New(isolate, compressedTextureS3TcSrgb);
|
|
58
|
+
object->SetInternalField(0, ext);
|
|
59
|
+
object->Set(context, ConvertToV8String(isolate, "ext_name"),
|
|
60
|
+
ConvertToV8String(isolate, "WEBGL_compressed_texture_s3tc_srgb"));
|
|
61
|
+
return scope.Escape(object);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static WEBGL_compressed_texture_s3tc_srgbImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
65
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
66
|
+
if (ptr == nullptr) {
|
|
67
|
+
return nullptr;
|
|
68
|
+
}
|
|
69
|
+
return static_cast<WEBGL_compressed_texture_s3tc_srgbImpl *>(ptr);
|
|
70
|
+
}
|
|
18
71
|
};
|
|
19
72
|
|