@nativescript/canvas 1.1.0 → 2.0.0-alpha.0
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 +1 -5
- package/Canvas/common.js +41 -133
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +4 -4
- package/Canvas/index.android.js +62 -52
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +0 -4
- package/Canvas/index.ios.d.ts +0 -2
- package/Canvas/index.ios.js +24 -42
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasGradient/CanvasGradient.android.d.ts +2 -0
- package/Canvas2D/CanvasGradient/CanvasGradient.android.js +10 -1
- package/Canvas2D/CanvasGradient/CanvasGradient.android.js.map +1 -1
- package/Canvas2D/CanvasPattern/CanvasPattern.android.d.ts +2 -0
- package/Canvas2D/CanvasPattern/CanvasPattern.android.js +10 -1
- package/Canvas2D/CanvasPattern/CanvasPattern.android.js.map +1 -1
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.d.ts +0 -1
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.js +0 -3
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/common.d.ts +1 -3
- package/Canvas2D/CanvasRenderingContext2D/common.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.android.d.ts +5 -6
- package/Canvas2D/CanvasRenderingContext2D/index.android.js +188 -394
- package/Canvas2D/CanvasRenderingContext2D/index.android.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +0 -6
- package/Canvas2D/CanvasRenderingContext2D/index.ios.d.ts +0 -3
- package/Canvas2D/CanvasRenderingContext2D/index.ios.js +92 -109
- package/Canvas2D/CanvasRenderingContext2D/index.ios.js.map +1 -1
- package/Canvas2D/DOMMatrix/DOMMatrix.android.d.ts +24 -0
- package/Canvas2D/DOMMatrix/DOMMatrix.android.js +81 -46
- package/Canvas2D/DOMMatrix/DOMMatrix.android.js.map +1 -1
- package/Canvas2D/DOMMatrix/DOMMatrix.d.ts +3 -2
- package/Canvas2D/DOMMatrix/common.d.ts +0 -2
- package/Canvas2D/DOMMatrix/common.js +0 -7
- package/Canvas2D/DOMMatrix/common.js.map +1 -1
- package/Canvas2D/ImageData/ImageData.android.d.ts +4 -5
- package/Canvas2D/ImageData/ImageData.android.js +48 -29
- package/Canvas2D/ImageData/ImageData.android.js.map +1 -1
- package/Canvas2D/ImageData/ImageData.d.ts +4 -2
- package/Canvas2D/ImageData/common.d.ts +0 -1
- package/Canvas2D/ImageData/common.js +1 -4
- package/Canvas2D/ImageData/common.js.map +1 -1
- package/Canvas2D/Path2D/Path2D.android.d.ts +3 -2
- package/Canvas2D/Path2D/Path2D.android.js +45 -25
- package/Canvas2D/Path2D/Path2D.android.js.map +1 -1
- package/Canvas2D/Path2D/Path2D.d.ts +0 -4
- package/Canvas2D/Path2D/Path2D.ios.d.ts +0 -2
- package/Canvas2D/Path2D/Path2D.ios.js +1 -9
- package/Canvas2D/Path2D/Path2D.ios.js.map +1 -1
- package/Canvas2D/Path2D/common.d.ts +1 -4
- package/Canvas2D/Path2D/common.js +2 -6
- package/Canvas2D/Path2D/common.js.map +1 -1
- package/Canvas2D/TextMetrics/TextMetrics.android.js +12 -12
- package/Canvas2D/TextMetrics/TextMetrics.android.js.map +1 -1
- package/Canvas2D/TextMetrics/common.d.ts +0 -1
- package/Canvas2D/TextMetrics/common.js +1 -4
- package/Canvas2D/TextMetrics/common.js.map +1 -1
- package/ImageAsset/ImageAsset.android.d.ts +11 -12
- package/ImageAsset/ImageAsset.android.js +92 -127
- package/ImageAsset/ImageAsset.android.js.map +1 -1
- package/ImageAsset/ImageAsset.d.ts +8 -12
- package/ImageAsset/ImageAsset.ios.js +3 -3
- package/ImageAsset/ImageAsset.ios.js.map +1 -1
- package/ImageAsset/common.d.ts +0 -1
- package/ImageAsset/common.js +1 -4
- package/ImageAsset/common.js.map +1 -1
- package/ImageBitmap/common.d.ts +0 -2
- package/ImageBitmap/common.js +0 -7
- package/ImageBitmap/common.js.map +1 -1
- package/ImageBitmap/index.android.d.ts +2 -2
- package/ImageBitmap/index.android.js +55 -292
- package/ImageBitmap/index.android.js.map +1 -1
- package/ImageBitmap/index.ios.d.ts +1 -2
- package/ImageBitmap/index.ios.js +34 -23
- package/ImageBitmap/index.ios.js.map +1 -1
- package/SVG/SVG.js.map +1 -1
- package/TextDecoder/TextDecoder.android.d.ts +2 -1
- package/TextDecoder/TextDecoder.android.js +19 -38
- package/TextDecoder/TextDecoder.android.js.map +1 -1
- package/TextDecoder/common.d.ts +0 -1
- package/TextDecoder/common.js +1 -4
- package/TextDecoder/common.js.map +1 -1
- package/TextEncoder/TextEncoder.android.d.ts +2 -0
- package/TextEncoder/TextEncoder.android.js +19 -5
- package/TextEncoder/TextEncoder.android.js.map +1 -1
- package/TextEncoder/common.d.ts +0 -2
- package/TextEncoder/common.js +0 -7
- package/TextEncoder/common.js.map +1 -1
- package/WebGL/WebGLActiveInfo.d.ts +5 -8
- package/WebGL/WebGLActiveInfo.js +8 -24
- package/WebGL/WebGLActiveInfo.js.map +1 -1
- package/WebGL/WebGLExtensions/index.android.d.ts +9 -0
- package/WebGL/WebGLExtensions/index.android.js +94 -57
- package/WebGL/WebGLExtensions/index.android.js.map +1 -1
- package/WebGL/WebGLProgram.d.ts +1 -0
- package/WebGL/WebGLProgram.js +3 -0
- package/WebGL/WebGLProgram.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.android.d.ts +10 -13
- package/WebGL/WebGLRenderingContext/index.android.js +449 -952
- package/WebGL/WebGLRenderingContext/index.android.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.ios.js +6 -5
- package/WebGL/WebGLRenderingContext/index.ios.js.map +1 -1
- package/WebGL/WebGLShaderPrecisionFormat.d.ts +5 -4
- package/WebGL/WebGLShaderPrecisionFormat.js +11 -4
- package/WebGL/WebGLShaderPrecisionFormat.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/common.d.ts +1 -1
- package/WebGL2/WebGL2RenderingContext/common.js +199 -199
- package/WebGL2/WebGL2RenderingContext/common.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.android.d.ts +7 -6
- package/WebGL2/WebGL2RenderingContext/index.android.js +284 -318
- package/WebGL2/WebGL2RenderingContext/index.android.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.ios.js +1 -1
- package/WebGL2/WebGL2RenderingContext/index.ios.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/angular/nativescript-canvas-angular.d.ts +5 -0
- package/angular/package.json +2 -2
- package/helpers.d.ts +5 -0
- package/helpers.js +18 -0
- package/helpers.js.map +1 -0
- package/index.js +6 -0
- package/index.js.map +1 -1
- package/package.json +2 -3
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/android/include.gradle +5 -6
- 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 +33 -89
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +1 -1
- 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/Project/arm64.swiftsourceinfo +0 -0
- 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 +22 -49
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{arm64-apple-ios.private.swiftinterface → arm64.swiftinterface} +22 -49
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/module.modulemap +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 +66 -168
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +1 -1
- 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/arm64.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/Project/x86_64.swiftsourceinfo +0 -0
- 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 +22 -49
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{arm64-apple-ios-simulator.private.swiftinterface → arm64.swiftinterface} +22 -49
- 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 +22 -49
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{x86_64-apple-ios-simulator.private.swiftinterface → x86_64.swiftinterface} +22 -49
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/module.modulemap +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +83 -50
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/utils.d.ts +1 -3
- package/utils.js +20 -7
- package/utils.js.map +1 -1
- package/LICENSE +0 -201
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +0 -1636
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +0 -75693
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +0 -1636
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -75693
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -75693
- package/typings/objc!CanvasNative.d.ts +0 -2036
- package/typings/objc!CanvasNative.js +0 -1
- package/typings/objc!CanvasNative.js.map +0 -1
|
@@ -6,294 +6,300 @@ import { WebGLFramebuffer } from '../../WebGL/WebGLFramebuffer';
|
|
|
6
6
|
import { WebGLActiveInfo } from '../../WebGL/WebGLActiveInfo';
|
|
7
7
|
import { WebGLBuffer } from '../../WebGL/WebGLBuffer';
|
|
8
8
|
import { ImageAsset } from '../../ImageAsset';
|
|
9
|
-
import { ImageSource } from '@nativescript/core';
|
|
9
|
+
import { ImageSource, Screen } from '@nativescript/core';
|
|
10
10
|
import { WebGL2RenderingContextBase } from './common';
|
|
11
11
|
import { Canvas } from '../../Canvas';
|
|
12
12
|
import { ImageBitmap } from '../../ImageBitmap';
|
|
13
|
+
import { Helpers } from '../../helpers';
|
|
14
|
+
let ctor;
|
|
13
15
|
export class WebGL2RenderingContext extends WebGL2RenderingContextBase {
|
|
14
|
-
constructor(context) {
|
|
15
|
-
super(
|
|
16
|
+
constructor(context, contextOptions) {
|
|
17
|
+
super(null);
|
|
18
|
+
this._methodCache = new Map();
|
|
19
|
+
const ctx = BigInt(context.getNativeContext().toString());
|
|
20
|
+
let direction = 0;
|
|
21
|
+
if (androidx.core.text.TextUtilsCompat.getLayoutDirectionFromLocale(java.util.Locale.getDefault()) === androidx.core.view.ViewCompat.LAYOUT_DIRECTION_RTL) {
|
|
22
|
+
direction = 1;
|
|
23
|
+
}
|
|
24
|
+
const native = ctor(contextOptions, ctx, Screen.mainScreen.scale, -16777216, Screen.mainScreen.scale * 160, direction);
|
|
25
|
+
this._context = native;
|
|
26
|
+
}
|
|
27
|
+
_getMethod(name) {
|
|
28
|
+
const cached = this._methodCache.get(name);
|
|
29
|
+
if (cached === undefined) {
|
|
30
|
+
const ret = this.native[name];
|
|
31
|
+
this._methodCache.set(name, ret);
|
|
32
|
+
return ret;
|
|
33
|
+
}
|
|
34
|
+
return cached;
|
|
16
35
|
}
|
|
17
36
|
/* Transform feedback */
|
|
18
|
-
static toPrimitive(value) {
|
|
19
|
-
if (value instanceof java.lang.Integer) {
|
|
20
|
-
return value.intValue();
|
|
21
|
-
}
|
|
22
|
-
else if (value instanceof java.lang.Long) {
|
|
23
|
-
return value.longValue();
|
|
24
|
-
}
|
|
25
|
-
else if (value instanceof java.lang.Short) {
|
|
26
|
-
return value.shortValue();
|
|
27
|
-
}
|
|
28
|
-
else if (value instanceof java.lang.Byte) {
|
|
29
|
-
return value.byteValue();
|
|
30
|
-
}
|
|
31
|
-
else if (value instanceof java.lang.Boolean) {
|
|
32
|
-
return value.booleanValue();
|
|
33
|
-
}
|
|
34
|
-
else if (value instanceof java.lang.String) {
|
|
35
|
-
return value.toString();
|
|
36
|
-
}
|
|
37
|
-
else if (value instanceof java.lang.Float) {
|
|
38
|
-
return value.floatValue();
|
|
39
|
-
}
|
|
40
|
-
else if (value instanceof java.lang.Double) {
|
|
41
|
-
return value.doubleValue();
|
|
42
|
-
}
|
|
43
|
-
return value;
|
|
44
|
-
}
|
|
45
37
|
beginQuery(target, query) {
|
|
46
38
|
this._glCheckError('beginQuery');
|
|
47
|
-
const value = query
|
|
48
|
-
this.
|
|
39
|
+
const value = query.native;
|
|
40
|
+
const beginQuery = this._getMethod('beginQuery');
|
|
41
|
+
beginQuery(target, value);
|
|
49
42
|
}
|
|
50
43
|
beginTransformFeedback(primitiveMode) {
|
|
51
44
|
this._glCheckError('beginTransformFeedback');
|
|
52
|
-
this.
|
|
45
|
+
const beginTransformFeedback = this._getMethod('beginTransformFeedback');
|
|
46
|
+
beginTransformFeedback(primitiveMode);
|
|
53
47
|
}
|
|
54
48
|
bindBufferBase(target, index, buffer) {
|
|
55
49
|
this._glCheckError('bindBufferBase');
|
|
56
|
-
const value = buffer ? buffer.native :
|
|
57
|
-
this.
|
|
50
|
+
const value = buffer ? buffer.native : null;
|
|
51
|
+
const bindBufferBase = this._getMethod('bindBufferBase');
|
|
52
|
+
bindBufferBase(target, index, value);
|
|
58
53
|
}
|
|
59
54
|
bindBufferRange(target, index, buffer, offset, size) {
|
|
60
55
|
this._glCheckError('bindBufferRange');
|
|
61
|
-
const value = buffer ? buffer.native :
|
|
62
|
-
this.
|
|
56
|
+
const value = buffer ? buffer.native : null;
|
|
57
|
+
const bindBufferRange = this._getMethod('bindBufferRange');
|
|
58
|
+
bindBufferRange(target, index, value, offset, size);
|
|
63
59
|
}
|
|
64
60
|
bindSampler(unit, sampler) {
|
|
65
61
|
this._glCheckError('bindSampler');
|
|
66
|
-
const value = sampler ? sampler.native :
|
|
67
|
-
this.
|
|
62
|
+
const value = sampler ? sampler.native : null;
|
|
63
|
+
const bindSampler = this._getMethod('bindSampler');
|
|
64
|
+
bindSampler(unit, value);
|
|
68
65
|
}
|
|
69
66
|
bindTransformFeedback(target, transformFeedback) {
|
|
70
67
|
this._glCheckError('bindTransformFeedback');
|
|
71
|
-
const value = transformFeedback ? transformFeedback.native :
|
|
72
|
-
this.
|
|
68
|
+
const value = transformFeedback ? transformFeedback.native : null;
|
|
69
|
+
const bindTransformFeedback = this._getMethod('bindTransformFeedback');
|
|
70
|
+
bindTransformFeedback(target, value);
|
|
73
71
|
}
|
|
74
72
|
bindVertexArray(vertexArray) {
|
|
75
73
|
this._glCheckError('bindVertexArray');
|
|
76
|
-
const value = vertexArray ? vertexArray.native :
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
this.native.bindVertexArray();
|
|
82
|
-
}
|
|
74
|
+
const value = vertexArray ? vertexArray.native : null;
|
|
75
|
+
const bindVertexArray = this._getMethod('bindVertexArray');
|
|
76
|
+
bindVertexArray(value);
|
|
83
77
|
}
|
|
84
78
|
blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter) {
|
|
85
79
|
this._glCheckError('blitFramebuffer');
|
|
86
|
-
this.
|
|
80
|
+
const blitFramebuffer = this._getMethod('blitFramebuffer');
|
|
81
|
+
blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
|
|
87
82
|
}
|
|
88
83
|
clearBufferfi(buffer, drawbuffer, depth, stencil) {
|
|
89
84
|
this._glCheckError('clearBufferfi');
|
|
90
|
-
const value = buffer
|
|
91
|
-
this.
|
|
85
|
+
const value = buffer.native;
|
|
86
|
+
const clearBufferfi = this._getMethod('clearBufferfi');
|
|
87
|
+
clearBufferfi(value, drawbuffer, depth, stencil);
|
|
92
88
|
}
|
|
93
89
|
clearBufferfv(buffer, drawbuffer, values) {
|
|
94
90
|
this._glCheckError('clearBufferfv');
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
this.native.clearBufferfv(value, drawbuffer, values);
|
|
91
|
+
const clearBufferfv = this._getMethod('clearBufferfv');
|
|
92
|
+
const value = buffer.native;
|
|
93
|
+
clearBufferfv(value, drawbuffer, values);
|
|
100
94
|
}
|
|
101
95
|
clearBufferiv(buffer, drawbuffer, values) {
|
|
102
96
|
this._glCheckError('clearBufferiv');
|
|
97
|
+
const clearBufferiv = this._getMethod('clearBufferiv');
|
|
103
98
|
const value = buffer ? buffer.native : 0;
|
|
104
|
-
|
|
105
|
-
values = this.toNativeArray(values, 'int');
|
|
106
|
-
}
|
|
107
|
-
this.native.clearBufferiv(value, drawbuffer, values);
|
|
99
|
+
clearBufferiv(value, drawbuffer, values);
|
|
108
100
|
}
|
|
109
101
|
clearBufferuiv(buffer, drawbuffer, values) {
|
|
110
102
|
this._glCheckError('clearBufferuiv');
|
|
103
|
+
const clearBufferuiv = this._getMethod('clearBufferuiv');
|
|
111
104
|
const value = buffer ? buffer.native : 0;
|
|
112
|
-
|
|
113
|
-
values = this.toNativeArray(values, 'int');
|
|
114
|
-
}
|
|
115
|
-
this.native.clearBufferuiv(value, drawbuffer, values);
|
|
105
|
+
clearBufferuiv(value, drawbuffer, values);
|
|
116
106
|
}
|
|
117
107
|
clientWaitSync(sync, flags, timeout) {
|
|
118
108
|
this._glCheckError('clientWaitSync');
|
|
119
|
-
const
|
|
120
|
-
|
|
109
|
+
const clientWaitSync = this._getMethod('clientWaitSync');
|
|
110
|
+
const value = sync.native;
|
|
111
|
+
return clientWaitSync(value, flags, timeout);
|
|
121
112
|
}
|
|
122
113
|
compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, srcData, srcOffset = 0, srcLengthOverride = 0) {
|
|
123
114
|
this._glCheckError('compressedTexSubImage3D');
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
else if (srcData && srcData.buffer) {
|
|
128
|
-
if (srcData instanceof Uint8Array) {
|
|
129
|
-
this.native.compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, this.toNativeArray(srcData, 'byte'), srcOffset, srcLengthOverride);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
115
|
+
const compressedTexSubImage3D = this._getMethod('compressedTexSubImage3D');
|
|
116
|
+
compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, srcData, srcOffset);
|
|
132
117
|
}
|
|
133
118
|
/* Transform feedback */
|
|
134
119
|
/* Framebuffers and renderbuffers */
|
|
135
120
|
copyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size) {
|
|
136
121
|
this._glCheckError('copyBufferSubData');
|
|
137
|
-
this.
|
|
122
|
+
const copyBufferSubData = this._getMethod('copyBufferSubData');
|
|
123
|
+
copyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
|
|
138
124
|
}
|
|
139
125
|
copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height) {
|
|
140
126
|
this._glCheckError('copyTexSubImage3D');
|
|
141
|
-
this.
|
|
127
|
+
const copyTexSubImage3D = this._getMethod('copyTexSubImage3D');
|
|
128
|
+
copyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
|
|
142
129
|
}
|
|
143
130
|
createQuery() {
|
|
144
131
|
this._glCheckError('createQuery');
|
|
145
|
-
|
|
132
|
+
const createQuery = this._getMethod('createQuery');
|
|
133
|
+
return new WebGLQuery(createQuery());
|
|
146
134
|
}
|
|
147
135
|
createSampler() {
|
|
148
136
|
this._glCheckError('createSampler');
|
|
149
|
-
|
|
137
|
+
const createSampler = this._getMethod('createSampler');
|
|
138
|
+
return new WebGLSampler(createSampler());
|
|
150
139
|
}
|
|
151
140
|
createTransformFeedback() {
|
|
152
141
|
this._glCheckError('createTransformFeedback');
|
|
153
|
-
|
|
142
|
+
const createTransformFeedback = this._getMethod('createTransformFeedback');
|
|
143
|
+
return new WebGLTransformFeedback(createTransformFeedback());
|
|
154
144
|
}
|
|
155
145
|
createVertexArray() {
|
|
156
146
|
this._glCheckError('createVertexArray');
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
this.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
this.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
147
|
+
const createVertexArray = this._getMethod('createVertexArray');
|
|
148
|
+
return new WebGLVertexArrayObject(createVertexArray());
|
|
149
|
+
}
|
|
150
|
+
deleteQuery(query) {
|
|
151
|
+
this._glCheckError('deleteQuery');
|
|
152
|
+
const deleteQuery = this._getMethod('deleteQuery');
|
|
153
|
+
const value = query.native;
|
|
154
|
+
deleteQuery(value);
|
|
155
|
+
}
|
|
156
|
+
deleteSampler(sampler) {
|
|
157
|
+
this._glCheckError('deleteSampler');
|
|
158
|
+
const deleteSampler = this._getMethod('deleteSampler');
|
|
159
|
+
const value = sampler.native;
|
|
160
|
+
deleteSampler(value);
|
|
161
|
+
}
|
|
162
|
+
deleteSync(sync) {
|
|
163
|
+
this._glCheckError('deleteSync');
|
|
164
|
+
const deleteSync = this._getMethod('deleteSync');
|
|
165
|
+
const value = sync.native;
|
|
166
|
+
deleteSync(value);
|
|
173
167
|
}
|
|
174
168
|
deleteTransformFeedback(transformFeedback) {
|
|
175
169
|
this._glCheckError('deleteTransformFeedback');
|
|
176
|
-
const
|
|
177
|
-
|
|
170
|
+
const deleteTransformFeedback = this._getMethod('deleteTransformFeedback');
|
|
171
|
+
const value = transformFeedback.native;
|
|
172
|
+
deleteTransformFeedback(value);
|
|
178
173
|
}
|
|
179
174
|
deleteVertexArray(vertexArray) {
|
|
180
175
|
this._glCheckError('deleteVertexArray');
|
|
181
|
-
const
|
|
182
|
-
|
|
176
|
+
const deleteVertexArray = this._getMethod('deleteVertexArray');
|
|
177
|
+
const value = vertexArray.native;
|
|
178
|
+
deleteVertexArray(value);
|
|
183
179
|
}
|
|
184
180
|
drawArraysInstanced(mode, first, count, instanceCount) {
|
|
185
181
|
this._glCheckError('drawArraysInstanced');
|
|
186
|
-
this.
|
|
182
|
+
const drawArraysInstanced = this._getMethod('drawArraysInstanced');
|
|
183
|
+
drawArraysInstanced(mode, first, count, instanceCount);
|
|
187
184
|
}
|
|
188
185
|
drawBuffers(buffers) {
|
|
189
186
|
this._glCheckError('drawBuffers');
|
|
190
|
-
this.
|
|
187
|
+
const drawBuffers = this._getMethod('drawBuffers');
|
|
188
|
+
drawBuffers(buffers);
|
|
191
189
|
}
|
|
192
190
|
drawElementsInstanced(mode, count, type, offset, instanceCount) {
|
|
193
191
|
this._glCheckError('drawElementsInstanced');
|
|
194
|
-
this.
|
|
192
|
+
const drawElementsInstanced = this._getMethod('drawElementsInstanced');
|
|
193
|
+
drawElementsInstanced(mode, count, type, offset, instanceCount);
|
|
195
194
|
}
|
|
196
195
|
drawRangeElements(mode, start, end, count, type, offset) {
|
|
197
196
|
this._glCheckError('drawRangeElements');
|
|
198
|
-
this.
|
|
197
|
+
const drawRangeElements = this._getMethod('drawRangeElements');
|
|
198
|
+
drawRangeElements(mode, start, end, count, type, offset);
|
|
199
199
|
}
|
|
200
200
|
endQuery(target) {
|
|
201
201
|
this._glCheckError('endQuery');
|
|
202
|
-
this.
|
|
202
|
+
const endQuery = this._getMethod('endQuery');
|
|
203
|
+
endQuery(target);
|
|
203
204
|
}
|
|
204
205
|
endTransformFeedback() {
|
|
205
206
|
this._glCheckError('endTransformFeedback');
|
|
206
|
-
this.
|
|
207
|
+
const endTransformFeedback = this._getMethod('endTransformFeedback');
|
|
208
|
+
endTransformFeedback();
|
|
207
209
|
}
|
|
208
210
|
fenceSync(condition, flags) {
|
|
209
211
|
this._glCheckError('fenceSync');
|
|
210
|
-
this.
|
|
212
|
+
const fenceSync = this._getMethod('fenceSync');
|
|
213
|
+
fenceSync(condition, flags);
|
|
211
214
|
}
|
|
212
215
|
framebufferTextureLayer(target, attachment, texture, level, layer) {
|
|
213
216
|
this._glCheckError('framebufferTextureLayer');
|
|
214
|
-
const
|
|
215
|
-
|
|
217
|
+
const framebufferTextureLayer = this._getMethod('framebufferTextureLayer');
|
|
218
|
+
const value = texture.native;
|
|
219
|
+
framebufferTextureLayer(target, attachment, value, level, layer);
|
|
216
220
|
}
|
|
217
221
|
/* Framebuffers and renderbuffers */
|
|
218
222
|
/* Uniforms */
|
|
219
223
|
getActiveUniformBlockName(program, uniformBlockIndex) {
|
|
220
224
|
this._glCheckError('getActiveUniformBlockName');
|
|
221
|
-
const
|
|
222
|
-
|
|
225
|
+
const getActiveUniformBlockName = this._getMethod('getActiveUniformBlockName');
|
|
226
|
+
const value = program.native;
|
|
227
|
+
return getActiveUniformBlockName(value, uniformBlockIndex);
|
|
223
228
|
}
|
|
224
229
|
getActiveUniformBlockParameter(program, uniformBlockIndex, pname) {
|
|
225
230
|
this._glCheckError('getActiveUniformBlockParameter');
|
|
226
|
-
const
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
return new Uint32Array(this.getJSArray(param));
|
|
230
|
-
}
|
|
231
|
-
return WebGL2RenderingContext.toPrimitive(param);
|
|
231
|
+
const getActiveUniformBlockParameter = this._getMethod('getActiveUniformBlockParameter');
|
|
232
|
+
const value = program.native;
|
|
233
|
+
return getActiveUniformBlockParameter(value, uniformBlockIndex, pname);
|
|
232
234
|
}
|
|
233
235
|
getActiveUniforms(program, uniformIndices, pname) {
|
|
234
236
|
this._glCheckError('getActiveUniforms');
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
+
const getActiveUniforms = this._getMethod('getActiveUniforms');
|
|
238
|
+
const value = program.native;
|
|
239
|
+
return getActiveUniforms(value, uniformIndices, pname);
|
|
237
240
|
}
|
|
238
241
|
getBufferSubData(target, srcByteOffset, dstData, dstOffset = 0, length = 0) {
|
|
239
242
|
this._glCheckError('getBufferSubData');
|
|
240
|
-
|
|
243
|
+
const getBufferSubData = this._getMethod('getBufferSubData');
|
|
244
|
+
getBufferSubData(target, srcByteOffset, dstData, dstOffset, length);
|
|
241
245
|
}
|
|
242
246
|
getFragDataLocation(program, name) {
|
|
243
247
|
this._glCheckError('getFragDataLocation');
|
|
244
|
-
const
|
|
245
|
-
const
|
|
248
|
+
const getFragDataLocation = this._getMethod('getFragDataLocation');
|
|
249
|
+
const value = program.native;
|
|
250
|
+
const result = getFragDataLocation(value, name);
|
|
246
251
|
return result !== -1 ? result : null;
|
|
247
252
|
}
|
|
248
253
|
getIndexedParameter(target, index) {
|
|
249
254
|
this._glCheckError('getIndexedParameter');
|
|
250
|
-
const
|
|
255
|
+
const getIndexedParameter = this._getMethod('getIndexedParameter');
|
|
256
|
+
const param = getIndexedParameter(target, index);
|
|
251
257
|
if (target === this.TRANSFORM_FEEDBACK_BUFFER_BINDING || target === this.UNIFORM_BUFFER_BINDING) {
|
|
252
258
|
return new WebGLBuffer(param);
|
|
253
259
|
}
|
|
254
|
-
return
|
|
260
|
+
return param;
|
|
255
261
|
}
|
|
256
262
|
getInternalformatParameter(target, internalformat, pname) {
|
|
257
263
|
this._glCheckError('getInternalformatParameter');
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
return new Int32Array(this.getJSArray(param));
|
|
261
|
-
}
|
|
262
|
-
return WebGL2RenderingContext.toPrimitive(param);
|
|
264
|
+
const getInternalformatParameter = this._getMethod('getInternalformatParameter');
|
|
265
|
+
return getInternalformatParameter(target, internalformat, pname);
|
|
263
266
|
}
|
|
264
267
|
getQueryParameter(query, pname) {
|
|
265
268
|
this._glCheckError('getQueryParameter');
|
|
266
|
-
const
|
|
267
|
-
const
|
|
269
|
+
const getQueryParameter = this._getMethod('getQueryParameter');
|
|
270
|
+
const value = query.native;
|
|
271
|
+
const result = getQueryParameter(value, pname);
|
|
268
272
|
if (result === 0) {
|
|
269
273
|
return null;
|
|
270
274
|
}
|
|
271
|
-
return
|
|
275
|
+
return result;
|
|
272
276
|
}
|
|
273
277
|
//@ts-ignore
|
|
274
278
|
getParameter(pname) {
|
|
275
279
|
this._glCheckError('getParameter');
|
|
276
|
-
this._checkArgs('
|
|
277
|
-
const
|
|
280
|
+
this._checkArgs('getParameter', arguments);
|
|
281
|
+
const getParameter = this._getMethod('getParameter');
|
|
282
|
+
const value = getParameter(pname);
|
|
278
283
|
switch (pname) {
|
|
279
284
|
case this.COPY_READ_BUFFER_BINDING:
|
|
280
285
|
case this.COPY_WRITE_BUFFER_BINDING:
|
|
281
286
|
if (value) {
|
|
282
|
-
new WebGLBuffer(
|
|
287
|
+
new WebGLBuffer(value);
|
|
283
288
|
}
|
|
284
289
|
return null;
|
|
285
290
|
case this.DRAW_FRAMEBUFFER_BINDING:
|
|
286
291
|
if (value) {
|
|
287
|
-
return new WebGLFramebuffer(
|
|
292
|
+
return new WebGLFramebuffer(value);
|
|
288
293
|
}
|
|
289
294
|
return null;
|
|
290
295
|
default:
|
|
291
|
-
return
|
|
296
|
+
return this._handleGetParameter(pname, value);
|
|
292
297
|
}
|
|
293
298
|
}
|
|
294
299
|
getQuery(target, pname) {
|
|
295
300
|
this._glCheckError('getQuery');
|
|
296
|
-
const
|
|
301
|
+
const getQuery = this._getMethod('getQuery');
|
|
302
|
+
const query = getQuery(target, pname);
|
|
297
303
|
if (query) {
|
|
298
304
|
return new WebGLQuery(query);
|
|
299
305
|
}
|
|
@@ -301,368 +307,328 @@ export class WebGL2RenderingContext extends WebGL2RenderingContextBase {
|
|
|
301
307
|
}
|
|
302
308
|
getSamplerParameter(sampler, pname) {
|
|
303
309
|
this._glCheckError('getSamplerParameter');
|
|
304
|
-
const
|
|
305
|
-
|
|
310
|
+
const getSamplerParameter = this._getMethod('getSamplerParameter');
|
|
311
|
+
const value = sampler.native;
|
|
312
|
+
return getSamplerParameter(value, pname);
|
|
306
313
|
}
|
|
307
314
|
getSyncParameter(sync, pname) {
|
|
308
315
|
this._glCheckError('getSyncParameter');
|
|
309
|
-
const
|
|
310
|
-
|
|
316
|
+
const getSyncParameter = this._getMethod('getSyncParameter');
|
|
317
|
+
const value = sync.native;
|
|
318
|
+
return getSyncParameter(value, pname);
|
|
311
319
|
}
|
|
312
320
|
getTransformFeedbackVarying(program, index) {
|
|
313
321
|
this._glCheckError('getTransformFeedbackVarying');
|
|
314
|
-
const value = program
|
|
315
|
-
const
|
|
322
|
+
const value = program.native;
|
|
323
|
+
const getTransformFeedbackVarying = this._getMethod('getTransformFeedbackVarying');
|
|
324
|
+
const info = getTransformFeedbackVarying(value, index);
|
|
316
325
|
if (info) {
|
|
317
|
-
return new WebGLActiveInfo(info
|
|
326
|
+
return new WebGLActiveInfo(info);
|
|
318
327
|
}
|
|
319
328
|
return null;
|
|
320
329
|
}
|
|
321
330
|
getUniformBlockIndex(program, uniformBlockName) {
|
|
322
331
|
this._glCheckError('getUniformBlockIndex');
|
|
323
|
-
const
|
|
324
|
-
|
|
332
|
+
const getUniformBlockIndex = this._getMethod('getUniformBlockIndex');
|
|
333
|
+
const value = program.native;
|
|
334
|
+
return getUniformBlockIndex(value, uniformBlockName);
|
|
325
335
|
}
|
|
326
336
|
getUniformIndices(program, uniformNames) {
|
|
327
337
|
this._glCheckError('getUniformIndices');
|
|
328
|
-
const
|
|
329
|
-
|
|
338
|
+
const getUniformIndices = this._getMethod('getUniformIndices');
|
|
339
|
+
const value = program.native;
|
|
340
|
+
return getUniformIndices(value, uniformNames);
|
|
330
341
|
}
|
|
331
342
|
invalidateFramebuffer(target, attachments) {
|
|
332
343
|
this._glCheckError('invalidateFramebuffer');
|
|
333
|
-
this.
|
|
344
|
+
const invalidateFramebuffer = this._getMethod('invalidateFramebuffer');
|
|
345
|
+
invalidateFramebuffer(target, attachments);
|
|
334
346
|
}
|
|
335
347
|
invalidateSubFramebuffer(target, attachments, x, y, width, height) {
|
|
336
348
|
this._glCheckError('invalidateSubFramebuffer');
|
|
337
|
-
this.
|
|
349
|
+
const invalidateSubFramebuffer = this._getMethod('invalidateSubFramebuffer');
|
|
350
|
+
invalidateSubFramebuffer(target, attachments, x, y, width, height);
|
|
338
351
|
}
|
|
339
352
|
isQuery(query) {
|
|
340
353
|
this._glCheckError('isQuery');
|
|
341
|
-
const
|
|
342
|
-
|
|
354
|
+
const isQuery = this._getMethod('isQuery');
|
|
355
|
+
const value = query.native;
|
|
356
|
+
return isQuery(value);
|
|
343
357
|
}
|
|
344
358
|
isSampler(sampler) {
|
|
345
359
|
this._glCheckError('isSampler');
|
|
346
|
-
const
|
|
347
|
-
|
|
360
|
+
const isSampler = this._getMethod('isSampler');
|
|
361
|
+
const value = sampler.native;
|
|
362
|
+
return isSampler(value);
|
|
348
363
|
}
|
|
349
364
|
isSync(sync) {
|
|
350
365
|
this._glCheckError('isSync');
|
|
351
|
-
const
|
|
352
|
-
|
|
366
|
+
const isSync = this._getMethod('isSync');
|
|
367
|
+
const value = sync.native;
|
|
368
|
+
return isSync(value);
|
|
353
369
|
}
|
|
354
370
|
isTransformFeedback(transformFeedback) {
|
|
355
371
|
this._glCheckError('isTransformFeedback');
|
|
356
|
-
const
|
|
357
|
-
|
|
372
|
+
const isTransformFeedback = this._getMethod('isTransformFeedback');
|
|
373
|
+
const value = transformFeedback.native;
|
|
374
|
+
return isTransformFeedback(value);
|
|
358
375
|
}
|
|
359
376
|
isVertexArray(vertexArray) {
|
|
360
377
|
this._glCheckError('isVertexArray');
|
|
361
|
-
const
|
|
362
|
-
|
|
378
|
+
const isVertexArray = this._getMethod('isVertexArray');
|
|
379
|
+
const value = vertexArray.native;
|
|
380
|
+
return isVertexArray(value);
|
|
363
381
|
}
|
|
364
382
|
pauseTransformFeedback() {
|
|
365
383
|
this._glCheckError('pauseTransformFeedback');
|
|
366
|
-
this.
|
|
384
|
+
const pauseTransformFeedback = this._getMethod('pauseTransformFeedback');
|
|
385
|
+
pauseTransformFeedback();
|
|
367
386
|
}
|
|
368
387
|
readBuffer(src) {
|
|
369
388
|
this._glCheckError('readBuffer');
|
|
370
|
-
this.
|
|
389
|
+
const readBuffer = this._getMethod('readBuffer');
|
|
390
|
+
readBuffer(src);
|
|
371
391
|
}
|
|
372
392
|
renderbufferStorageMultisample(target, samples, internalFormat, width, height) {
|
|
373
393
|
this._glCheckError('renderbufferStorageMultisample');
|
|
374
|
-
this.
|
|
394
|
+
const renderbufferStorageMultisample = this._getMethod('renderbufferStorageMultisample');
|
|
395
|
+
renderbufferStorageMultisample(target, samples, internalFormat, width, height);
|
|
375
396
|
}
|
|
376
397
|
resumeTransformFeedback() {
|
|
377
398
|
this._glCheckError('resumeTransformFeedback');
|
|
378
|
-
this.
|
|
399
|
+
const resumeTransformFeedback = this._getMethod('resumeTransformFeedback');
|
|
400
|
+
resumeTransformFeedback();
|
|
379
401
|
}
|
|
380
402
|
samplerParameterf(sampler, pname, param) {
|
|
381
403
|
this._glCheckError('samplerParameterf');
|
|
382
|
-
const
|
|
383
|
-
|
|
404
|
+
const samplerParameterf = this._getMethod('samplerParameterf');
|
|
405
|
+
const value = sampler.native;
|
|
406
|
+
samplerParameterf(value, pname, param);
|
|
384
407
|
}
|
|
385
408
|
/* Uniforms */
|
|
386
409
|
/* Sync objects */
|
|
387
410
|
samplerParameteri(sampler, pname, param) {
|
|
388
411
|
this._glCheckError('samplerParameteri');
|
|
389
|
-
const
|
|
390
|
-
|
|
412
|
+
const samplerParameteri = this._getMethod('samplerParameteri');
|
|
413
|
+
const value = sampler.native;
|
|
414
|
+
samplerParameteri(value, pname, param);
|
|
391
415
|
}
|
|
392
416
|
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source) {
|
|
393
417
|
this._glCheckError('texImage3D');
|
|
418
|
+
const texImage3D = this._getMethod('texImage3D');
|
|
394
419
|
if (typeof source === 'number') {
|
|
395
|
-
|
|
420
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source);
|
|
396
421
|
}
|
|
397
422
|
else if (source && source.buffer) {
|
|
398
|
-
|
|
399
|
-
if (source instanceof Uint8Array || source instanceof Uint8ClampedArray) {
|
|
400
|
-
this.native.texImage3DByte(target, level, internalformat, width, height, depth, border, format, type, Array.from(source));
|
|
401
|
-
}
|
|
402
|
-
else if (source instanceof Uint16Array || source instanceof Int16Array) {
|
|
403
|
-
this.native.texImage3DShort(target, level, internalformat, width, height, depth, border, format, type, Array.from(source));
|
|
404
|
-
}
|
|
405
|
-
else if (source instanceof Uint32Array || source instanceof Int32Array) {
|
|
406
|
-
this.native.texImage3DInt(target, level, internalformat, width, height, depth, border, format, type, Array.from(source));
|
|
407
|
-
}
|
|
408
|
-
else if (source instanceof Float32Array) {
|
|
409
|
-
this.native.texImage3DFloat(target, level, internalformat, width, height, depth, border, format, type, Array.from(source));
|
|
410
|
-
}
|
|
411
|
-
else if (source instanceof Float64Array) {
|
|
412
|
-
this.native.texImage3DDouble(target, level, internalformat, width, height, depth, border, format, type, Array.from(source));
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
else if (source instanceof ArrayBuffer) {
|
|
416
|
-
// @ts-ignore
|
|
417
|
-
if (source.nativeObject) {
|
|
418
|
-
// @ts-ignore
|
|
419
|
-
this.native.texImage3D(target, level, internalformat, width, height, depth, border, format, type,
|
|
420
|
-
// @ts-ignore
|
|
421
|
-
source.nativeObject);
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
this.native.texImage3DByte(target, level, internalformat, width, height, depth, border, format, type, Array.from(new Uint8Array(source)));
|
|
425
|
-
}
|
|
426
|
-
}
|
|
423
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source);
|
|
427
424
|
}
|
|
428
425
|
else if (source instanceof android.graphics.Bitmap) {
|
|
429
|
-
|
|
426
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source);
|
|
430
427
|
}
|
|
431
428
|
else if (source instanceof ImageSource) {
|
|
432
|
-
|
|
429
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source.android);
|
|
433
430
|
}
|
|
434
431
|
else if (source instanceof ImageAsset) {
|
|
435
|
-
|
|
432
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source.native);
|
|
436
433
|
}
|
|
437
|
-
else if (source instanceof ImageBitmap
|
|
438
|
-
|
|
434
|
+
else if (source instanceof ImageBitmap) {
|
|
435
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source.native);
|
|
439
436
|
}
|
|
440
437
|
else if (source && typeof source.tagName === 'string' && (source.tagName === 'IMG' || source.tagName === 'IMAGE')) {
|
|
441
438
|
if (source._imageSource instanceof ImageSource) {
|
|
442
|
-
|
|
439
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source._imageSource.android);
|
|
443
440
|
}
|
|
444
441
|
else if (source._image instanceof android.graphics.Bitmap) {
|
|
445
|
-
|
|
442
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source._image);
|
|
446
443
|
}
|
|
447
444
|
else if (source._asset instanceof ImageAsset) {
|
|
448
|
-
|
|
445
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source._asset.native);
|
|
449
446
|
}
|
|
450
447
|
else if (typeof source.src === 'string') {
|
|
451
448
|
const result = ImageSource.fromFileSync(source.src);
|
|
452
|
-
|
|
449
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, result ? result.android : null);
|
|
453
450
|
}
|
|
454
451
|
}
|
|
455
452
|
else if (source && typeof source.tagName === 'string' && source.tagName === 'CANVAS' && source._canvas instanceof Canvas) {
|
|
456
|
-
|
|
453
|
+
texImage3D(target, level, internalformat, width, height, depth, border, format, type, source._canvas.native);
|
|
457
454
|
}
|
|
458
455
|
}
|
|
459
456
|
texStorage2D(target, levels, internalformat, width, height) {
|
|
460
457
|
this._glCheckError('texStorage2D');
|
|
461
|
-
this.
|
|
458
|
+
const texStorage2D = this._getMethod('texStorage2D');
|
|
459
|
+
texStorage2D(target, levels, internalformat, width, height);
|
|
462
460
|
}
|
|
463
461
|
texStorage3D(target, levels, internalformat, width, height, depth) {
|
|
464
462
|
this._glCheckError('texStorage3D');
|
|
465
|
-
this.
|
|
463
|
+
const texStorage3D = this._getMethod('texStorage3D');
|
|
464
|
+
texStorage3D(target, levels, internalformat, width, height, depth);
|
|
466
465
|
}
|
|
467
466
|
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData, srcOffset = 0) {
|
|
468
467
|
this._glCheckError('texSubImage3D');
|
|
468
|
+
const texSubImage3D = this._getMethod('texSubImage3D');
|
|
469
469
|
if (typeof srcData === 'number') {
|
|
470
|
-
|
|
470
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData);
|
|
471
471
|
}
|
|
472
472
|
else if (srcData && srcData.buffer) {
|
|
473
|
-
|
|
474
|
-
if (srcOffset) {
|
|
475
|
-
this.native.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, this.toNativeArray(srcData, 'byte'), srcOffset);
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
this.native.texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, this.toNativeArray(srcData, 'byte'));
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
if (srcData && srcData.buffer) {
|
|
482
|
-
if (srcData instanceof Uint8Array || srcData instanceof Uint8ClampedArray) {
|
|
483
|
-
this.native.texSubImage3DByte(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, Array.from(srcData), srcOffset);
|
|
484
|
-
}
|
|
485
|
-
else if (srcData instanceof Uint16Array || srcData instanceof Int16Array) {
|
|
486
|
-
this.native.texSubImage3DShort(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, Array.from(srcData), srcOffset);
|
|
487
|
-
}
|
|
488
|
-
else if (srcData instanceof Uint32Array || srcData instanceof Int32Array) {
|
|
489
|
-
this.native.texSubImage3DInt(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, Array.from(srcData), srcOffset);
|
|
490
|
-
}
|
|
491
|
-
else if (srcData instanceof Float32Array) {
|
|
492
|
-
this.native.texSubImage3DFloat(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, Array.from(srcData), srcOffset);
|
|
493
|
-
}
|
|
494
|
-
else if (srcData instanceof Float64Array) {
|
|
495
|
-
this.native.texSubImage3DDouble(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, Array.from(srcData), srcOffset);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
else if (srcData instanceof ArrayBuffer) {
|
|
499
|
-
// @ts-ignore
|
|
500
|
-
if (source.nativeObject) {
|
|
501
|
-
this.native.texSubImage3DByte(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type,
|
|
502
|
-
// @ts-ignore
|
|
503
|
-
source.nativeObject, srcOffset);
|
|
504
|
-
}
|
|
505
|
-
else {
|
|
506
|
-
this.native.texSubImage3DDouble(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, Array.from(new Uint8Array(srcData)), srcOffset);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
473
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData, srcOffset);
|
|
509
474
|
}
|
|
510
475
|
else if (srcData instanceof android.graphics.Bitmap) {
|
|
511
|
-
|
|
476
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData);
|
|
512
477
|
}
|
|
513
478
|
else if (srcData instanceof ImageSource) {
|
|
514
|
-
|
|
479
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData.android);
|
|
515
480
|
}
|
|
516
481
|
else if (srcData instanceof ImageAsset) {
|
|
517
|
-
|
|
482
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData.native);
|
|
518
483
|
}
|
|
519
|
-
else if (srcData instanceof ImageBitmap
|
|
520
|
-
|
|
484
|
+
else if (srcData instanceof ImageBitmap) {
|
|
485
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData.native);
|
|
521
486
|
}
|
|
522
487
|
else if (srcData && typeof srcData.tagName === 'string' && (srcData.tagName === 'IMG' || srcData.tagName === 'IMAGE')) {
|
|
523
488
|
if (srcData._imageSource instanceof ImageSource) {
|
|
524
|
-
|
|
489
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData._imageSource.android);
|
|
525
490
|
}
|
|
526
491
|
else if (srcData._image instanceof android.graphics.Bitmap) {
|
|
527
|
-
|
|
492
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData._image);
|
|
528
493
|
}
|
|
529
494
|
else if (srcData._asset instanceof ImageAsset) {
|
|
530
|
-
|
|
495
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData._asset.native);
|
|
531
496
|
}
|
|
532
497
|
else if (typeof srcData.src === 'string') {
|
|
533
498
|
const result = ImageSource.fromFileSync(srcData.src);
|
|
534
|
-
|
|
499
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, result ? result.android : null);
|
|
535
500
|
}
|
|
536
501
|
}
|
|
537
502
|
else if (srcData && typeof srcData.tagName === 'string' && srcData.tagName === 'CANVAS' && srcData._canvas instanceof TNSCanvas) {
|
|
538
|
-
|
|
503
|
+
texSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, srcData._canvas.native);
|
|
539
504
|
}
|
|
540
505
|
}
|
|
541
506
|
transformFeedbackVaryings(program, varyings, bufferMode) {
|
|
542
507
|
this._glCheckError('transformFeedbackVaryings');
|
|
543
|
-
const
|
|
544
|
-
|
|
508
|
+
const transformFeedbackVaryings = this._getMethod('transformFeedbackVaryings');
|
|
509
|
+
const value = program.native;
|
|
510
|
+
transformFeedbackVaryings(value, varyings, bufferMode);
|
|
545
511
|
}
|
|
546
512
|
uniform1ui(location, v0) {
|
|
547
513
|
this._glCheckError('uniform1ui');
|
|
548
|
-
const value = location
|
|
549
|
-
this.
|
|
514
|
+
const value = location.native;
|
|
515
|
+
const uniform1ui = this._getMethod('uniform1ui');
|
|
516
|
+
uniform1ui(value, v0);
|
|
550
517
|
}
|
|
551
518
|
uniform1uiv(location, data) {
|
|
552
519
|
this._glCheckError('uniform1uiv');
|
|
553
|
-
const
|
|
554
|
-
|
|
520
|
+
const uniform1uiv = this._getMethod('uniform1uiv');
|
|
521
|
+
const value = location.native;
|
|
522
|
+
uniform1uiv(value, data);
|
|
555
523
|
}
|
|
556
524
|
uniform2ui(location, v0, v1) {
|
|
557
525
|
this._glCheckError('uniform2ui');
|
|
558
|
-
const
|
|
559
|
-
|
|
526
|
+
const uniform2ui = this._getMethod('uniform2ui');
|
|
527
|
+
const value = location.native;
|
|
528
|
+
uniform2ui(value, v0, v1);
|
|
560
529
|
}
|
|
561
530
|
uniform2uiv(location, data) {
|
|
562
531
|
this._glCheckError('uniform2uiv');
|
|
563
|
-
const
|
|
564
|
-
|
|
532
|
+
const uniform2uiv = this._getMethod('uniform2uiv');
|
|
533
|
+
const value = location.native;
|
|
534
|
+
uniform2uiv(value, data);
|
|
565
535
|
}
|
|
566
536
|
/* Sync objects */
|
|
567
537
|
/* Miscellaneous constants */
|
|
568
538
|
uniform3ui(location, v0, v1, v2) {
|
|
569
539
|
this._glCheckError('uniform3ui');
|
|
570
|
-
const
|
|
571
|
-
|
|
540
|
+
const uniform3ui = this._getMethod('uniform3ui');
|
|
541
|
+
const value = location.native;
|
|
542
|
+
uniform3ui(value, v0, v1, v2);
|
|
572
543
|
}
|
|
573
544
|
uniform3uiv(location, data) {
|
|
574
545
|
this._glCheckError('uniform3uiv');
|
|
575
|
-
const
|
|
576
|
-
|
|
546
|
+
const uniform3uiv = this._getMethod('uniform3uiv');
|
|
547
|
+
const value = location.native;
|
|
548
|
+
uniform3uiv(value, Array.from(data));
|
|
577
549
|
}
|
|
578
550
|
uniform4ui(location, v0, v1, v2, v3) {
|
|
579
551
|
this._glCheckError('uniform4ui');
|
|
580
|
-
const
|
|
581
|
-
|
|
552
|
+
const uniform4ui = this._getMethod('uniform4ui');
|
|
553
|
+
const value = location.native;
|
|
554
|
+
uniform4ui(value, v0, v1, v2, v3);
|
|
582
555
|
}
|
|
583
556
|
uniform4uiv(location, data) {
|
|
584
557
|
this._glCheckError('uniform4uiv');
|
|
585
|
-
const
|
|
586
|
-
|
|
558
|
+
const uniform4uiv = this._getMethod('uniform4uiv');
|
|
559
|
+
const value = location.native;
|
|
560
|
+
uniform4uiv(value, Array.from(data));
|
|
587
561
|
}
|
|
588
562
|
uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding) {
|
|
589
563
|
this._glCheckError('uniformBlockBinding');
|
|
590
|
-
const
|
|
591
|
-
|
|
564
|
+
const uniformBlockBindingFunc = this._getMethod('uniformBlockBinding');
|
|
565
|
+
const value = program.native;
|
|
566
|
+
uniformBlockBindingFunc(value, uniformBlockIndex, uniformBlockBinding);
|
|
592
567
|
}
|
|
593
568
|
uniformMatrix2x3fv(location, transpose, data) {
|
|
594
|
-
if (data instanceof Float32Array) {
|
|
595
|
-
data = Array.from(data); //this.toNativeArray(data as any, 'float');
|
|
596
|
-
}
|
|
597
569
|
this._glCheckError('uniformMatrix2x3fv');
|
|
598
|
-
const
|
|
599
|
-
|
|
570
|
+
const uniformMatrix2x3fv = this._getMethod('uniformMatrix2x3fv');
|
|
571
|
+
const value = location.native;
|
|
572
|
+
uniformMatrix2x3fv(value, transpose, data);
|
|
600
573
|
}
|
|
601
574
|
uniformMatrix2x4fv(location, transpose, data) {
|
|
602
|
-
if (data instanceof Float32Array) {
|
|
603
|
-
data = Array.from(data); //this.toNativeArray(data as any, 'float');
|
|
604
|
-
}
|
|
605
575
|
this._glCheckError('uniformMatrix2x4fv');
|
|
606
|
-
const
|
|
607
|
-
|
|
576
|
+
const uniformMatrix2x4fv = this._getMethod('uniformMatrix2x4fv');
|
|
577
|
+
const value = location.native;
|
|
578
|
+
uniformMatrix2x4fv(value, transpose, data);
|
|
608
579
|
}
|
|
609
580
|
uniformMatrix3x2fv(location, transpose, data) {
|
|
610
|
-
if (data instanceof Float32Array) {
|
|
611
|
-
data = Array.from(data); //this.toNativeArray(data as any, 'float');
|
|
612
|
-
}
|
|
613
581
|
this._glCheckError('uniformMatrix3x2fv');
|
|
614
|
-
const
|
|
615
|
-
|
|
582
|
+
const uniformMatrix3x2fv = this._getMethod('uniformMatrix3x2fv');
|
|
583
|
+
const value = location.native;
|
|
584
|
+
uniformMatrix3x2fv(value, transpose, data);
|
|
616
585
|
}
|
|
617
586
|
uniformMatrix3x4fv(location, transpose, data) {
|
|
618
|
-
if (data instanceof Float32Array) {
|
|
619
|
-
data = Array.from(data); //this.toNativeArray(data as any, 'float');
|
|
620
|
-
}
|
|
621
587
|
this._glCheckError('uniformMatrix3x4fv');
|
|
622
|
-
const
|
|
623
|
-
|
|
588
|
+
const uniformMatrix3x4fv = this._getMethod('uniformMatrix3x4fv');
|
|
589
|
+
const value = location.native;
|
|
590
|
+
uniformMatrix3x4fv(value, transpose, data);
|
|
624
591
|
}
|
|
625
592
|
uniformMatrix4x2fv(location, transpose, data) {
|
|
626
|
-
if (data instanceof Float32Array) {
|
|
627
|
-
data = Array.from(data); //this.toNativeArray(data as any, 'float');
|
|
628
|
-
}
|
|
629
593
|
this._glCheckError('uniformMatrix4x2fv');
|
|
630
|
-
const
|
|
631
|
-
|
|
594
|
+
const uniformMatrix4x2fv = this._getMethod('uniformMatrix4x2fv');
|
|
595
|
+
const value = location.native;
|
|
596
|
+
uniformMatrix4x2fv(value, transpose, data);
|
|
632
597
|
}
|
|
633
598
|
uniformMatrix4x3fv(location, transpose, data) {
|
|
634
|
-
if (data instanceof Float32Array) {
|
|
635
|
-
data = Array.from(data); //this.toNativeArray(data as any, 'float');
|
|
636
|
-
}
|
|
637
599
|
this._glCheckError('uniformMatrix4x3fv');
|
|
638
|
-
const
|
|
639
|
-
|
|
600
|
+
const uniformMatrix4x3fv = this._getMethod('uniformMatrix4x3fv');
|
|
601
|
+
const value = location.native;
|
|
602
|
+
uniformMatrix4x3fv(value, transpose, data);
|
|
640
603
|
}
|
|
641
604
|
vertexAttribDivisor(index, divisor) {
|
|
642
605
|
this._glCheckError('vertexAttribDivisor');
|
|
643
|
-
this.
|
|
606
|
+
const vertexAttribDivisor = this._getMethod('vertexAttribDivisor');
|
|
607
|
+
vertexAttribDivisor(index, divisor);
|
|
644
608
|
}
|
|
645
609
|
vertexAttribI4i(index, v0, v1, v2, v3) {
|
|
646
610
|
this._glCheckError('vertexAttribI4i');
|
|
647
|
-
this.
|
|
611
|
+
const vertexAttribI4i = this._getMethod('vertexAttribI4i');
|
|
612
|
+
vertexAttribI4i(index, v0, v1, v2, v3);
|
|
648
613
|
}
|
|
649
614
|
vertexAttribI4iv(index, value) {
|
|
650
|
-
if (value instanceof Int32Array) {
|
|
651
|
-
value = Array.from(value); //this.toNativeArray(value as any, 'int');
|
|
652
|
-
}
|
|
653
615
|
this._glCheckError('vertexAttribI4iv');
|
|
654
|
-
this.
|
|
616
|
+
const vertexAttribI4iv = this._getMethod('vertexAttribI4iv');
|
|
617
|
+
vertexAttribI4iv(index, value);
|
|
655
618
|
}
|
|
656
619
|
vertexAttribI4ui(index, v0, v1, v2, v3) {
|
|
657
620
|
this._glCheckError('vertexAttribI4ui');
|
|
658
|
-
this.
|
|
621
|
+
const vertexAttribI4ui = this._getMethod('vertexAttribI4ui');
|
|
622
|
+
vertexAttribI4ui(index, v0, v1, v2, v3);
|
|
659
623
|
}
|
|
660
624
|
vertexAttribI4uiv(index, value) {
|
|
661
|
-
if (value instanceof Uint32Array) {
|
|
662
|
-
value = Array.from(value); //this.toNativeArray(value as any, 'int');
|
|
663
|
-
}
|
|
664
625
|
this._glCheckError('vertexAttribI4uiv');
|
|
665
|
-
this.
|
|
626
|
+
const vertexAttribI4uiv = this._getMethod('vertexAttribI4uiv');
|
|
627
|
+
vertexAttribI4uiv(index, value);
|
|
666
628
|
}
|
|
667
629
|
}
|
|
630
|
+
(() => {
|
|
631
|
+
Helpers.initialize();
|
|
632
|
+
ctor = global.CanvasJSIModule.createWebGL2Context;
|
|
633
|
+
})();
|
|
668
634
|
//# sourceMappingURL=index.android.js.map
|