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