mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2025-02-17 02:10:00 +00:00
Modify code security specification alarm
Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAZA48?from=project-issue Signed-off-by: yy <yejunwen2@h-partners.com>
This commit is contained in:
parent
8a2f165ee3
commit
c2ac0c39b2
@ -18,14 +18,14 @@ import { X2DFast } from './graphics/X2DFast.js';
|
|||||||
import { Scr } from './XDefine.js';
|
import { Scr } from './XDefine.js';
|
||||||
import { XTools } from './XTools.js';
|
import { XTools } from './XTools.js';
|
||||||
|
|
||||||
export var gl;
|
export let gl;
|
||||||
var Mouse = {
|
const Mouse = {
|
||||||
MOUSE_LEFT: 0,
|
MOUSE_LEFT: 0,
|
||||||
MOUSE_RILLER: 1,
|
MOUSE_RILLER: 1,
|
||||||
MOUSE_RIGHT: 2,
|
MOUSE_RIGHT: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
var MouseEvent = {
|
const MouseEvent = {
|
||||||
LEFT_CLICK: 1,
|
LEFT_CLICK: 1,
|
||||||
LEFT_MOVE: 2,
|
LEFT_MOVE: 2,
|
||||||
LEFT_RELEASE: 3,
|
LEFT_RELEASE: 3,
|
||||||
|
@ -31,7 +31,7 @@ export class Scr {
|
|||||||
Scr.height = h;
|
Scr.height = h;
|
||||||
|
|
||||||
if ('undefined' != typeof wx) {
|
if ('undefined' != typeof wx) {
|
||||||
var info = wx.getSystemInfoSync();
|
let info = wx.getSystemInfoSync();
|
||||||
Scr.width = info.windowWidth;
|
Scr.width = info.windowWidth;
|
||||||
Scr.height = info.windowHeight;
|
Scr.height = info.windowHeight;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ export function iDistance(x, y) {
|
|||||||
return Math.sqrt(x * x + y * y);
|
return Math.sqrt(x * x + y * y);
|
||||||
}
|
}
|
||||||
|
|
||||||
export var timeMs = 0;
|
export let timeMs = 0;
|
||||||
export function freshTime() {
|
export function freshTime() {
|
||||||
let t = new Date();
|
let t = new Date();
|
||||||
timeMs = t.getTime();
|
timeMs = t.getTime();
|
||||||
|
@ -177,4 +177,4 @@ export class XMat4 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var tmpmat = new XMat4();
|
let tmpmat = new XMat4();
|
||||||
|
@ -73,7 +73,7 @@ export class XShader {
|
|||||||
return this.pUseingShader;
|
return this.pUseingShader;
|
||||||
}
|
}
|
||||||
initShader(vss, fss) {
|
initShader(vss, fss) {
|
||||||
var vs = gl.createShader(gl.VERTEX_SHADER);
|
let vs = gl.createShader(gl.VERTEX_SHADER);
|
||||||
gl.shaderSource(vs, vss);
|
gl.shaderSource(vs, vss);
|
||||||
gl.compileShader(vs);
|
gl.compileShader(vs);
|
||||||
if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) {
|
if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) {
|
||||||
@ -83,7 +83,7 @@ export class XShader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fs = gl.createShader(gl.FRAGMENT_SHADER);
|
let fs = gl.createShader(gl.FRAGMENT_SHADER);
|
||||||
gl.shaderSource(fs, fss);
|
gl.shaderSource(fs, fss);
|
||||||
gl.compileShader(fs);
|
gl.compileShader(fs);
|
||||||
if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) {
|
if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) {
|
||||||
@ -93,7 +93,7 @@ export class XShader {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ret = gl.createProgram();
|
let ret = gl.createProgram();
|
||||||
|
|
||||||
gl.attachShader(ret, vs);
|
gl.attachShader(ret, vs);
|
||||||
gl.attachShader(ret, fs);
|
gl.attachShader(ret, fs);
|
||||||
|
@ -50,9 +50,9 @@ export class XTexture {
|
|||||||
}
|
}
|
||||||
loadTextureFromImage(path, keepdata = false) {
|
loadTextureFromImage(path, keepdata = false) {
|
||||||
if (path === 'CUSTOM_TEXTURE_1') {
|
if (path === 'CUSTOM_TEXTURE_1') {
|
||||||
var rid = this.ximages.length;
|
let rid = this.ximages.length;
|
||||||
|
|
||||||
var texture = gl.createTexture();
|
let texture = gl.createTexture();
|
||||||
XTexture.initTextureStatus(texture);
|
XTexture.initTextureStatus(texture);
|
||||||
|
|
||||||
let tmp = new Uint8Array([255, 255, 255, 255]);
|
let tmp = new Uint8Array([255, 255, 255, 255]);
|
||||||
@ -76,12 +76,12 @@ export class XTexture {
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var rid = this.ximages.length;
|
let rid = this.ximages.length;
|
||||||
this.ximages[rid] = { stat: 0, path: path, tex: null };
|
this.ximages[rid] = { stat: 0, path: path, tex: null };
|
||||||
var image = new Image();
|
let image = new Image();
|
||||||
image.src = path; //"http://localhost:8910/"+
|
image.src = path; //"http://localhost:8910/"+
|
||||||
image.onload = function () {
|
image.onload = function () {
|
||||||
var texture = gl.createTexture();
|
let texture = gl.createTexture();
|
||||||
XTexture.initTextureStatus(texture);
|
XTexture.initTextureStatus(texture);
|
||||||
|
|
||||||
gl.texImage2D(
|
gl.texImage2D(
|
||||||
@ -154,15 +154,15 @@ export class XTexture {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PutTexture(tex, w, h) {
|
PutTexture(tex, w, h) {
|
||||||
var rid = this.ximages.length;
|
let rid = this.ximages.length;
|
||||||
this.ximages[rid] = { stat: 1, path: 'put' + rid, tex: tex, w: w, h: h };
|
this.ximages[rid] = { stat: 1, path: 'put' + rid, tex: tex, w: w, h: h };
|
||||||
return rid;
|
return rid;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadTexture(width, height) {
|
loadTexture(width, height) {
|
||||||
var rid = this.ximages.length;
|
let rid = this.ximages.length;
|
||||||
|
|
||||||
var texture = gl.createTexture();
|
let texture = gl.createTexture();
|
||||||
XTexture.initTextureStatus(texture);
|
XTexture.initTextureStatus(texture);
|
||||||
gl.texImage2D(
|
gl.texImage2D(
|
||||||
gl.TEXTURE_2D,
|
gl.TEXTURE_2D,
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var shaderFastVs = `
|
const shaderFastVs = `
|
||||||
attribute vec3 position;
|
attribute vec3 position;
|
||||||
attribute vec2 aTexCoord;
|
attribute vec2 aTexCoord;
|
||||||
attribute vec4 ext1;//x,y,sw,sh,
|
attribute vec4 ext1;//x,y,sw,sh,
|
||||||
@ -55,7 +55,7 @@ void main()
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
var shaderFastFs = `
|
const shaderFastFs = `
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
|
|
||||||
varying vec2 TexCoord;
|
varying vec2 TexCoord;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user