@nativescript/canvas 2.0.0-alpha.20 → 2.0.0-alpha.22
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 -24
- 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 +2391 -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 +6457 -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 +4380 -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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 28/04/2022.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include "EXT_blend_minmaxImpl.h"
|
|
6
|
+
#include "Caches.h"
|
|
7
|
+
#include "Helpers.h"
|
|
8
|
+
|
|
9
|
+
v8::Local<v8::FunctionTemplate> EXT_blend_minmaxImpl::GetCtor(v8::Isolate *isolate) {
|
|
10
|
+
auto cache = Caches::Get(isolate);
|
|
11
|
+
auto ctor = cache->EXT_blend_minmaxTmpl.get();
|
|
12
|
+
if (ctor != nullptr) {
|
|
13
|
+
return ctor->Get(isolate);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
17
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
18
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "EXT_blend_minmax"));
|
|
19
|
+
|
|
20
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
21
|
+
tmpl->SetInternalFieldCount(1);
|
|
22
|
+
|
|
23
|
+
tmpl->Set(ConvertToV8String(isolate, "MIN_EXT"),
|
|
24
|
+
v8::Number::New(isolate, 0x8007));
|
|
25
|
+
|
|
26
|
+
tmpl->Set(ConvertToV8String(isolate, "MAX_EXT"),
|
|
27
|
+
v8::Number::New(isolate, 0x8008));
|
|
28
|
+
|
|
29
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
30
|
+
ConvertToV8String(isolate, "EXT_blend_minmax"));
|
|
31
|
+
|
|
32
|
+
cache->EXT_blend_minmaxTmpl =
|
|
33
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
34
|
+
return ctorTmpl;
|
|
35
|
+
}
|
|
@@ -4,13 +4,33 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
#include "Common.h"
|
|
8
8
|
#include <vector>
|
|
9
|
+
#include "Helpers.h"
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
class EXT_blend_minmaxImpl {
|
|
12
|
+
public:
|
|
13
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
static v8::Local<v8::Object>
|
|
16
|
+
NewInstance(v8::Isolate *isolate, EXT_blend_minmaxImpl *minmax) {
|
|
17
|
+
auto context = isolate->GetCurrentContext();
|
|
18
|
+
v8::EscapableHandleScope scope(isolate);
|
|
19
|
+
auto object = EXT_blend_minmaxImpl::GetCtor(isolate)->GetFunction(
|
|
20
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
21
|
+
SetNativeType(isolate, object, NativeType::EXT_blend_minmax);
|
|
22
|
+
auto ext = v8::External::New(isolate, minmax);
|
|
23
|
+
object->SetInternalField(0, ext);
|
|
24
|
+
object->Set(context, ConvertToV8String(isolate, "ext_name"),
|
|
25
|
+
ConvertToV8String(isolate, "EXT_blend_minmax"));
|
|
26
|
+
return scope.Escape(object);
|
|
27
|
+
}
|
|
14
28
|
|
|
15
|
-
|
|
29
|
+
static EXT_blend_minmaxImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
30
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
31
|
+
if (ptr == nullptr) {
|
|
32
|
+
return nullptr;
|
|
33
|
+
}
|
|
34
|
+
return static_cast<EXT_blend_minmaxImpl *>(ptr);
|
|
35
|
+
}
|
|
16
36
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 28/04/2022.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include "EXT_color_buffer_half_floatImpl.h"
|
|
6
|
+
#include "Caches.h"
|
|
7
|
+
#include "Helpers.h"
|
|
8
|
+
|
|
9
|
+
v8::Local<v8::FunctionTemplate> EXT_color_buffer_half_floatImpl::GetCtor(v8::Isolate *isolate) {
|
|
10
|
+
auto cache = Caches::Get(isolate);
|
|
11
|
+
auto ctor = cache->EXT_color_buffer_half_floatTmpl.get();
|
|
12
|
+
if (ctor != nullptr) {
|
|
13
|
+
return ctor->Get(isolate);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
17
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
18
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "EXT_color_buffer_half_float"));
|
|
19
|
+
|
|
20
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
21
|
+
tmpl->SetInternalFieldCount(1);
|
|
22
|
+
|
|
23
|
+
tmpl->Set(ConvertToV8String(isolate, "RGBA16F_EXT"),
|
|
24
|
+
v8::Number::New(isolate, 0x881A));
|
|
25
|
+
|
|
26
|
+
tmpl->Set(ConvertToV8String(isolate, "RGB16F_EXT"),
|
|
27
|
+
v8::Number::New(isolate, 0x881B));
|
|
28
|
+
|
|
29
|
+
tmpl->Set(ConvertToV8String(isolate, "FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT"),
|
|
30
|
+
v8::Number::New(isolate, 0x8211));
|
|
31
|
+
|
|
32
|
+
tmpl->Set(ConvertToV8String(isolate, "UNSIGNED_NORMALIZED_EXT"),
|
|
33
|
+
v8::Number::New(isolate, 0x8C17));
|
|
34
|
+
|
|
35
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
36
|
+
ConvertToV8String(isolate, "EXT_color_buffer_half_float"));
|
|
37
|
+
|
|
38
|
+
cache->EXT_color_buffer_half_floatTmpl =
|
|
39
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
40
|
+
return ctorTmpl;
|
|
41
|
+
}
|
|
@@ -4,14 +4,34 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
#include "Common.h"
|
|
8
8
|
#include <vector>
|
|
9
|
+
#include "Helpers.h"
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
class EXT_color_buffer_half_floatImpl {
|
|
12
|
+
public:
|
|
13
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
static v8::Local<v8::Object>
|
|
16
|
+
NewInstance(v8::Isolate *isolate, EXT_color_buffer_half_floatImpl *buffer) {
|
|
17
|
+
auto context = isolate->GetCurrentContext();
|
|
18
|
+
v8::EscapableHandleScope scope(isolate);
|
|
19
|
+
auto object = EXT_color_buffer_half_floatImpl::GetCtor(isolate)->GetFunction(
|
|
20
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
21
|
+
SetNativeType(isolate, object, NativeType::EXT_color_buffer_half_float);
|
|
22
|
+
auto ext = v8::External::New(isolate, buffer);
|
|
23
|
+
object->SetInternalField(0, ext);
|
|
24
|
+
object->Set(context, ConvertToV8String(isolate, "ext_name"),
|
|
25
|
+
ConvertToV8String(isolate, "EXT_color_buffer_half_float"));
|
|
26
|
+
return scope.Escape(object);
|
|
27
|
+
}
|
|
14
28
|
|
|
15
|
-
|
|
29
|
+
static EXT_color_buffer_half_floatImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
30
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
31
|
+
if (ptr == nullptr) {
|
|
32
|
+
return nullptr;
|
|
33
|
+
}
|
|
34
|
+
return static_cast<EXT_color_buffer_half_floatImpl *>(ptr);
|
|
35
|
+
}
|
|
16
36
|
};
|
|
17
37
|
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 28/04/2022.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#include "EXT_disjoint_timer_queryImpl.h"
|
|
6
|
+
#include "Caches.h"
|
|
7
|
+
|
|
8
|
+
EXT_disjoint_timer_queryImpl::EXT_disjoint_timer_queryImpl(
|
|
9
|
+
EXT_disjoint_timer_query* query) : query_(query) {}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
v8::Local<v8::FunctionTemplate> EXT_disjoint_timer_queryImpl::GetCtor(v8::Isolate *isolate) {
|
|
13
|
+
auto cache = Caches::Get(isolate);
|
|
14
|
+
auto ctor = cache->EXT_disjoint_timer_queryTmpl.get();
|
|
15
|
+
if (ctor != nullptr) {
|
|
16
|
+
return ctor->Get(isolate);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
20
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
21
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "EXT_disjoint_timer_query"));
|
|
22
|
+
|
|
23
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
24
|
+
tmpl->SetInternalFieldCount(1);
|
|
25
|
+
|
|
26
|
+
tmpl->Set(ConvertToV8String(isolate, "QUERY_COUNTER_BITS_EXT"),
|
|
27
|
+
v8::Number::New(isolate, 0x8864));
|
|
28
|
+
|
|
29
|
+
tmpl->Set(ConvertToV8String(isolate, "CURRENT_QUERY_EXT"),
|
|
30
|
+
v8::Number::New(isolate, 0x8865));
|
|
31
|
+
|
|
32
|
+
tmpl->Set(ConvertToV8String(isolate, "QUERY_RESULT_EXT"),
|
|
33
|
+
v8::Number::New(isolate, 0x8866));
|
|
34
|
+
|
|
35
|
+
tmpl->Set(ConvertToV8String(isolate, "QUERY_RESULT_AVAILABLE_EXT"),
|
|
36
|
+
v8::Number::New(isolate, 0x8867));
|
|
37
|
+
|
|
38
|
+
tmpl->Set(ConvertToV8String(isolate, "TIME_ELAPSED_EXT"),
|
|
39
|
+
v8::Number::New(isolate, 0x88BF));
|
|
40
|
+
|
|
41
|
+
tmpl->Set(ConvertToV8String(isolate, "TIMESTAMP_EXT"),
|
|
42
|
+
v8::Number::New(isolate, 0x8E28));
|
|
43
|
+
|
|
44
|
+
tmpl->Set(ConvertToV8String(isolate, "GPU_DISJOINT_EXT"),
|
|
45
|
+
v8::Number::New(isolate, 0x8FBB));
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
tmpl->Set(ConvertToV8String(isolate, "createQueryExt"),
|
|
49
|
+
v8::FunctionTemplate::New(isolate, &CreateQueryExt));
|
|
50
|
+
tmpl->Set(ConvertToV8String(isolate, "deleteQueryExt"),
|
|
51
|
+
v8::FunctionTemplate::New(isolate, &DeleteQueryExt));
|
|
52
|
+
tmpl->Set(ConvertToV8String(isolate, "isQueryExt"),
|
|
53
|
+
v8::FunctionTemplate::New(isolate, &IsQueryExt));
|
|
54
|
+
tmpl->Set(ConvertToV8String(isolate, "beginQueryExt"),
|
|
55
|
+
v8::FunctionTemplate::New(isolate, &BeginQueryExt));
|
|
56
|
+
tmpl->Set(ConvertToV8String(isolate, "endQueryExt"),
|
|
57
|
+
v8::FunctionTemplate::New(isolate, &EndQueryExt));
|
|
58
|
+
tmpl->Set(ConvertToV8String(isolate, "queryCounterExt"),
|
|
59
|
+
v8::FunctionTemplate::New(isolate, &QueryCounterExt));
|
|
60
|
+
tmpl->Set(ConvertToV8String(isolate, "getQueryExt"),
|
|
61
|
+
v8::FunctionTemplate::New(isolate, &GetQueryExt));
|
|
62
|
+
tmpl->Set(ConvertToV8String(isolate, "getQueryObjectExt"),
|
|
63
|
+
v8::FunctionTemplate::New(isolate, &GetQueryObjectExt));
|
|
64
|
+
tmpl->Set(ConvertToV8String(isolate, "getQueryParameterExt"),
|
|
65
|
+
v8::FunctionTemplate::New(isolate, &GetQueryParameterExt));
|
|
66
|
+
|
|
67
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
68
|
+
ConvertToV8String(isolate, "EXT_disjoint_timer_query"));
|
|
69
|
+
|
|
70
|
+
cache->EXT_disjoint_timer_queryTmpl =
|
|
71
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
72
|
+
return ctorTmpl;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
EXT_disjoint_timer_queryImpl *
|
|
76
|
+
EXT_disjoint_timer_queryImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
77
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
78
|
+
if (ptr == nullptr) {
|
|
79
|
+
return nullptr;
|
|
80
|
+
}
|
|
81
|
+
return static_cast<EXT_disjoint_timer_queryImpl *>(ptr);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
void EXT_disjoint_timer_queryImpl::CreateQueryExt(
|
|
85
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
86
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
87
|
+
if (ptr == nullptr) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
auto isolate = args.GetIsolate();
|
|
91
|
+
auto context = isolate->GetCurrentContext();
|
|
92
|
+
|
|
93
|
+
auto ret = canvas_native_webgl_ext_disjoint_timer_query_create_query_ext(
|
|
94
|
+
ptr->GetQuery());
|
|
95
|
+
|
|
96
|
+
auto object = new WebGLQuery(
|
|
97
|
+
ret);
|
|
98
|
+
|
|
99
|
+
auto value = WebGLQuery::GetCtor(isolate)->GetFunction(context).ToLocalChecked()->NewInstance(
|
|
100
|
+
context).ToLocalChecked();
|
|
101
|
+
value->SetInternalField(0, v8::External::New(isolate, object));
|
|
102
|
+
SetNativeType(isolate, value, NativeType::WebGLQuery);
|
|
103
|
+
args.GetReturnValue().Set(value);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
void EXT_disjoint_timer_queryImpl::DeleteQueryExt(
|
|
107
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
108
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
109
|
+
if (ptr == nullptr) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
auto isolate = args.GetIsolate();
|
|
113
|
+
auto value = args[0];
|
|
114
|
+
if (value->IsObject()) {
|
|
115
|
+
auto type = GetNativeType(isolate, value.As<v8::Object>());
|
|
116
|
+
|
|
117
|
+
if (type == NativeType::WebGLQuery) {
|
|
118
|
+
auto query = WebGLQuery::GetPointer(value.As<v8::Object>());
|
|
119
|
+
if (query ==
|
|
120
|
+
nullptr) { return; }
|
|
121
|
+
canvas_native_webgl_ext_disjoint_timer_query_delete_query_ext(
|
|
122
|
+
query->GetQuery(),
|
|
123
|
+
ptr->GetQuery());
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
void EXT_disjoint_timer_queryImpl::IsQueryExt(
|
|
130
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
131
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
132
|
+
if (ptr == nullptr) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
auto isolate = args.GetIsolate();
|
|
136
|
+
auto value = args[0];
|
|
137
|
+
if (value->IsObject()) {
|
|
138
|
+
auto type = GetNativeType(isolate, value.As<v8::Object>());
|
|
139
|
+
|
|
140
|
+
if (type == NativeType::WebGLQuery) {
|
|
141
|
+
auto query = WebGLQuery::GetPointer(value.As<v8::Object>());
|
|
142
|
+
if (query != nullptr) {
|
|
143
|
+
auto ret = canvas_native_webgl_ext_disjoint_timer_query_is_query_ext(
|
|
144
|
+
query->GetQuery(),
|
|
145
|
+
ptr->GetQuery());
|
|
146
|
+
|
|
147
|
+
args.GetReturnValue().Set(ret);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
args.GetReturnValue().Set(false);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
void EXT_disjoint_timer_queryImpl::BeginQueryExt(
|
|
157
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
158
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
159
|
+
if (ptr == nullptr) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
auto isolate = args.GetIsolate();
|
|
163
|
+
auto context = isolate->GetCurrentContext();
|
|
164
|
+
auto targetValue = args[0];
|
|
165
|
+
auto queryValue = args[1];
|
|
166
|
+
|
|
167
|
+
if (targetValue->IsNumber() &&
|
|
168
|
+
queryValue->IsObject()) {
|
|
169
|
+
auto target = (uint32_t) targetValue->NumberValue(context).ToChecked();
|
|
170
|
+
auto type = GetNativeType(isolate, queryValue.As<v8::Object>());
|
|
171
|
+
if (type == NativeType::WebGLQuery) {
|
|
172
|
+
auto query = WebGLQuery::GetPointer(queryValue.As<v8::Object>());
|
|
173
|
+
|
|
174
|
+
canvas_native_webgl_ext_disjoint_timer_query_begin_query_ext(
|
|
175
|
+
target,
|
|
176
|
+
query->GetQuery(),
|
|
177
|
+
ptr->GetQuery()
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
void EXT_disjoint_timer_queryImpl::EndQueryExt(
|
|
184
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
185
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
186
|
+
if (ptr == nullptr) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
auto isolate = args.GetIsolate();
|
|
190
|
+
auto context = isolate->GetCurrentContext();
|
|
191
|
+
|
|
192
|
+
auto value = args[0];
|
|
193
|
+
if (value->IsNumber()) {
|
|
194
|
+
auto target = (uint32_t) value->NumberValue(context).ToChecked();
|
|
195
|
+
canvas_native_webgl_ext_disjoint_timer_query_end_query_ext(
|
|
196
|
+
target,
|
|
197
|
+
ptr->GetQuery()
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
void EXT_disjoint_timer_queryImpl::QueryCounterExt(
|
|
203
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
204
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
205
|
+
if (ptr == nullptr) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
auto isolate = args.GetIsolate();
|
|
209
|
+
auto context = isolate->GetCurrentContext();
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
auto queryValue = args[0];
|
|
213
|
+
auto targetValue = args[1];
|
|
214
|
+
|
|
215
|
+
if (targetValue->IsNumber() &&
|
|
216
|
+
queryValue->IsObject()) {
|
|
217
|
+
auto target = (uint32_t) targetValue->NumberValue(context).ToChecked();
|
|
218
|
+
auto type = GetNativeType(isolate, queryValue.As<v8::Object>());
|
|
219
|
+
if (type == NativeType::WebGLQuery) {
|
|
220
|
+
auto query = WebGLQuery::GetPointer(queryValue.As<v8::Object>());
|
|
221
|
+
|
|
222
|
+
canvas_native_webgl_ext_disjoint_timer_query_query_counter_ext(
|
|
223
|
+
query->GetQuery(),
|
|
224
|
+
target,
|
|
225
|
+
ptr->GetQuery()
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
void EXT_disjoint_timer_queryImpl::GetQueryExt(
|
|
232
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
233
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
234
|
+
if (ptr == nullptr) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
auto isolate = args.GetIsolate();
|
|
238
|
+
auto context = isolate->GetCurrentContext();
|
|
239
|
+
|
|
240
|
+
auto target = (uint32_t) args[0]->NumberValue(context).ToChecked();
|
|
241
|
+
auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
|
|
242
|
+
auto ret = canvas_native_webgl_ext_disjoint_timer_query_get_query_ext(
|
|
243
|
+
target,
|
|
244
|
+
pname,
|
|
245
|
+
ptr->GetQuery()
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
args.GetReturnValue().Set(ret);
|
|
249
|
+
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
void EXT_disjoint_timer_queryImpl::GetQueryObjectExt(
|
|
253
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
254
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
255
|
+
if (ptr == nullptr) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
auto isolate = args.GetIsolate();
|
|
259
|
+
auto context = isolate->GetCurrentContext();
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
auto query = WebGLQuery::GetPointer(args[0].As<v8::Object>());
|
|
263
|
+
auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
|
|
264
|
+
|
|
265
|
+
auto ret = canvas_native_webgl_ext_disjoint_timer_query_get_query_object_ext(
|
|
266
|
+
query->GetQuery(),
|
|
267
|
+
pname,
|
|
268
|
+
ptr->GetQuery()
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
// GL_QUERY_RESULT_AVAILABLE_EXT
|
|
273
|
+
if (pname == 0x8867) {
|
|
274
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_bool(
|
|
275
|
+
ret));
|
|
276
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
282
|
+
ret));
|
|
283
|
+
|
|
284
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
void EXT_disjoint_timer_queryImpl::GetQueryParameterExt(
|
|
289
|
+
const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
290
|
+
EXT_disjoint_timer_queryImpl *ptr = GetPointer(args.This());
|
|
291
|
+
if (ptr == nullptr) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
auto isolate = args.GetIsolate();
|
|
295
|
+
auto context = isolate->GetCurrentContext();
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
auto query = WebGLQuery::GetPointer(args[0].As<v8::Object>());
|
|
299
|
+
auto pname = (uint32_t) args[1]->NumberValue(context).ToChecked();
|
|
300
|
+
|
|
301
|
+
auto ret = canvas_native_webgl_ext_disjoint_timer_query_get_query_object_ext(
|
|
302
|
+
query->GetQuery(),
|
|
303
|
+
pname,
|
|
304
|
+
ptr->GetQuery()
|
|
305
|
+
);
|
|
306
|
+
|
|
307
|
+
// GL_QUERY_RESULT_AVAILABLE_EXT
|
|
308
|
+
if (pname == 0x8867) {
|
|
309
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_bool(
|
|
310
|
+
ret));
|
|
311
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
args.GetReturnValue().Set(canvas_native_webgl_result_get_i32(
|
|
316
|
+
ret));
|
|
317
|
+
canvas_native_webgl_WebGLResult_destroy(ret);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
EXT_disjoint_timer_query* EXT_disjoint_timer_queryImpl::GetQuery() {
|
|
322
|
+
return this->query_;
|
|
323
|
+
}
|
|
@@ -4,25 +4,59 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#include "
|
|
8
|
-
#include "
|
|
9
|
-
#
|
|
10
|
-
#include "webgl2/WebGLQuery.h"
|
|
7
|
+
#include "Helpers.h"
|
|
8
|
+
#include "Common.h"
|
|
9
|
+
#include "WebGLQuery.h"
|
|
11
10
|
#include <vector>
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
using namespace org::nativescript::canvas;
|
|
15
|
-
|
|
16
|
-
class JSI_EXPORT EXT_disjoint_timer_queryImpl : public jsi::HostObject {
|
|
12
|
+
class EXT_disjoint_timer_queryImpl {
|
|
17
13
|
public:
|
|
18
|
-
EXT_disjoint_timer_queryImpl(
|
|
14
|
+
EXT_disjoint_timer_queryImpl(EXT_disjoint_timer_query* query);
|
|
15
|
+
|
|
16
|
+
~EXT_disjoint_timer_queryImpl(){
|
|
17
|
+
canvas_native_webgl_EXT_disjoint_timer_query_destroy(this->GetQuery());
|
|
18
|
+
this->query_ = nullptr;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
EXT_disjoint_timer_query* GetQuery();
|
|
22
|
+
|
|
23
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
24
|
+
|
|
25
|
+
static v8::Local<v8::Object>
|
|
26
|
+
NewInstance(v8::Isolate *isolate, EXT_disjoint_timer_queryImpl *query) {
|
|
27
|
+
auto context = isolate->GetCurrentContext();
|
|
28
|
+
v8::EscapableHandleScope scope(isolate);
|
|
29
|
+
auto object = EXT_disjoint_timer_queryImpl::GetCtor(isolate)->GetFunction(
|
|
30
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
31
|
+
SetNativeType(isolate, object, NativeType::EXT_disjoint_timer_query);
|
|
32
|
+
auto ext = v8::External::New(isolate, query);
|
|
33
|
+
object->SetInternalField(0, ext);
|
|
34
|
+
object->Set(context, ConvertToV8String(isolate, "ext_name"),
|
|
35
|
+
ConvertToV8String(isolate, "EXT_disjoint_timer_query"));
|
|
36
|
+
return scope.Escape(object);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static EXT_disjoint_timer_queryImpl *GetPointer(const v8::Local<v8::Object> &object);
|
|
40
|
+
|
|
41
|
+
static void CreateQueryExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
42
|
+
|
|
43
|
+
static void DeleteQueryExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
44
|
+
|
|
45
|
+
static void IsQueryExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
46
|
+
|
|
47
|
+
static void BeginQueryExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
48
|
+
|
|
49
|
+
static void EndQueryExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
50
|
+
|
|
51
|
+
static void QueryCounterExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
52
|
+
|
|
53
|
+
static void GetQueryExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
19
54
|
|
|
20
|
-
|
|
55
|
+
static void GetQueryObjectExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
21
56
|
|
|
22
|
-
|
|
57
|
+
static void GetQueryParameterExt(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
23
58
|
|
|
24
|
-
EXT_disjoint_timer_query &GetQuery();
|
|
25
59
|
|
|
26
60
|
private:
|
|
27
|
-
|
|
61
|
+
EXT_disjoint_timer_query* query_;
|
|
28
62
|
};
|
|
@@ -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 "Caches.h"
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
class EXT_sRGBImpl {
|
|
13
|
+
public:
|
|
14
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
15
|
+
auto cache = Caches::Get(isolate);
|
|
16
|
+
auto ctor = cache->EXT_sRGBTmpl.get();
|
|
17
|
+
if (ctor != nullptr) {
|
|
18
|
+
return ctor->Get(isolate);
|
|
19
|
+
}
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
22
|
+
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(1);
|
|
23
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "EXT_sRGB"));
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
26
|
+
tmpl->SetInternalFieldCount(1);
|
|
27
|
+
tmpl->Set(ConvertToV8String(isolate, "SRGB_EXT"),
|
|
28
|
+
v8::Number::New(isolate, (double) GL_SRGB_EXT));
|
|
29
|
+
tmpl->Set(ConvertToV8String(isolate, "SRGB_ALPHA_EXT"),
|
|
30
|
+
v8::Number::New(isolate, (double) GL_SRGB_ALPHA_EXT));
|
|
31
|
+
tmpl->Set(ConvertToV8String(isolate, "SRGB8_ALPHA8_EXT"),
|
|
32
|
+
v8::Number::New(isolate, (double) GL_SRGB8_ALPHA8_EXT));
|
|
33
|
+
tmpl->Set(ConvertToV8String(isolate, "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT"),
|
|
34
|
+
v8::Number::New(isolate, (double) GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT));
|
|
35
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"), ConvertToV8String(isolate, "EXT_sRGB"));
|
|
36
|
+
|
|
37
|
+
cache->EXT_sRGBTmpl =
|
|
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, EXT_sRGBImpl *extSrgb) {
|
|
44
|
+
auto context = isolate->GetCurrentContext();
|
|
45
|
+
v8::EscapableHandleScope scope(isolate);
|
|
46
|
+
auto object = EXT_sRGBImpl::GetCtor(isolate)->GetFunction(
|
|
47
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
48
|
+
SetNativeType(isolate, object, NativeType::EXT_sRGB);
|
|
49
|
+
auto ext = v8::External::New(isolate, extSrgb);
|
|
50
|
+
object->SetInternalField(0, ext);
|
|
51
|
+
return scope.Escape(object);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static EXT_sRGBImpl *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<EXT_sRGBImpl *>(ptr);
|
|
60
|
+
}
|
|
18
61
|
};
|
|
@@ -4,26 +4,48 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
#include "Caches.h"
|
|
8
|
+
#include "Common.h"
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class JSI_EXPORT EXT_shader_texture_lodImpl : public jsi::HostObject {
|
|
10
|
+
class EXT_shader_texture_lodImpl {
|
|
12
11
|
public:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate) {
|
|
13
|
+
auto cache = Caches::Get(isolate);
|
|
14
|
+
auto ctor = cache->EXT_shader_texture_lodTmpl.get();
|
|
15
|
+
if (ctor != nullptr) {
|
|
16
|
+
return ctor->Get(isolate);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate);
|
|
20
|
+
ctorTmpl->SetClassName(ConvertToV8String(isolate, "EXT_shader_texture_lod"));
|
|
21
|
+
|
|
22
|
+
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
23
|
+
|
|
24
|
+
tmpl->Set(ConvertToV8String(isolate, "ext_name"),
|
|
25
|
+
ConvertToV8String(isolate, "EXT_shader_texture_lod"));
|
|
26
|
+
|
|
27
|
+
cache->EXT_shader_texture_lodTmpl =
|
|
28
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
29
|
+
return ctorTmpl;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
static v8::Local<v8::Object>
|
|
33
|
+
NewInstance(v8::Isolate *isolate, EXT_shader_texture_lodImpl *texture) {
|
|
34
|
+
auto context = isolate->GetCurrentContext();
|
|
35
|
+
v8::EscapableHandleScope scope(isolate);
|
|
36
|
+
auto object = EXT_shader_texture_lodImpl::GetCtor(isolate)->GetFunction(
|
|
37
|
+
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
38
|
+
SetNativeType(isolate, object, NativeType::EXT_shader_texture_lod);
|
|
39
|
+
auto ext = v8::External::New(isolate, texture);
|
|
40
|
+
object->SetInternalField(0, ext);
|
|
41
|
+
return scope.Escape(object);
|
|
42
|
+
}
|
|
22
43
|
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
static EXT_shader_texture_lodImpl *GetPointer(const v8::Local<v8::Object> &object) {
|
|
45
|
+
auto ptr = object->GetInternalField(0).As<v8::External>()->Value();
|
|
46
|
+
if (ptr == nullptr) {
|
|
47
|
+
return nullptr;
|
|
25
48
|
}
|
|
26
|
-
|
|
27
|
-
return jsi::Value::undefined();
|
|
49
|
+
return static_cast<EXT_shader_texture_lodImpl *>(ptr);
|
|
28
50
|
}
|
|
29
51
|
};
|