Manual class transform

This commit is contained in:
Tim Schaub
2018-07-16 17:09:50 -06:00
parent 7b4a73f3b9
commit f78d0d4cfa
96 changed files with 8112 additions and 7964 deletions

View File

@@ -13,43 +13,45 @@ import Event from '../events/Event.js';
* @param {?CanvasRenderingContext2D=} opt_context Context.
* @param {?module:ol/webgl/Context=} opt_glContext WebGL Context.
*/
const RenderEvent = function(
type, opt_vectorContext, opt_frameState, opt_context,
opt_glContext) {
class RenderEvent {
Event.call(this, type);
constructor(type, opt_vectorContext, opt_frameState, opt_context, opt_glContext) {
/**
* For canvas, this is an instance of {@link module:ol/render/canvas/Immediate}.
* @type {module:ol/render/VectorContext|undefined}
* @api
*/
this.vectorContext = opt_vectorContext;
Event.call(this, type);
/**
* An object representing the current render frame state.
* @type {module:ol/PluggableMap~FrameState|undefined}
* @api
*/
this.frameState = opt_frameState;
/**
* For canvas, this is an instance of {@link module:ol/render/canvas/Immediate}.
* @type {module:ol/render/VectorContext|undefined}
* @api
*/
this.vectorContext = opt_vectorContext;
/**
* Canvas context. Only available when a Canvas renderer is used, null
* otherwise.
* @type {CanvasRenderingContext2D|null|undefined}
* @api
*/
this.context = opt_context;
/**
* An object representing the current render frame state.
* @type {module:ol/PluggableMap~FrameState|undefined}
* @api
*/
this.frameState = opt_frameState;
/**
* WebGL context. Only available when a WebGL renderer is used, null
* otherwise.
* @type {module:ol/webgl/Context|null|undefined}
* @api
*/
this.glContext = opt_glContext;
/**
* Canvas context. Only available when a Canvas renderer is used, null
* otherwise.
* @type {CanvasRenderingContext2D|null|undefined}
* @api
*/
this.context = opt_context;
};
/**
* WebGL context. Only available when a WebGL renderer is used, null
* otherwise.
* @type {module:ol/webgl/Context|null|undefined}
* @api
*/
this.glContext = opt_glContext;
}
}
inherits(RenderEvent, Event);
export default RenderEvent;

View File

@@ -12,79 +12,84 @@ import {DEBUG as DEBUG_WEBGL} from '../../../../webgl.js';
* @param {WebGLProgram} program Program.
* @struct
*/
const Locations = function(gl, program) {
class Locations {
/**
* @type {WebGLUniformLocation}
*/
this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
constructor(gl, program) {
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/**
* @type {WebGLUniformLocation}
*/
this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/**
* @type {WebGLUniformLocation}
*/
this.u_lineWidth = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_lineWidth' : 'k');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/**
* @type {WebGLUniformLocation}
*/
this.u_pixelRatio = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_pixelRatio' : 'l');
/**
* @type {WebGLUniformLocation}
*/
this.u_lineWidth = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_lineWidth' : 'k');
/**
* @type {WebGLUniformLocation}
*/
this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'm');
/**
* @type {WebGLUniformLocation}
*/
this.u_pixelRatio = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_pixelRatio' : 'l');
/**
* @type {WebGLUniformLocation}
*/
this.u_fillColor = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_fillColor' : 'n');
/**
* @type {WebGLUniformLocation}
*/
this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'm');
/**
* @type {WebGLUniformLocation}
*/
this.u_strokeColor = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_strokeColor' : 'o');
/**
* @type {WebGLUniformLocation}
*/
this.u_fillColor = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_fillColor' : 'n');
/**
* @type {WebGLUniformLocation}
*/
this.u_size = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_size' : 'p');
/**
* @type {WebGLUniformLocation}
*/
this.u_strokeColor = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_strokeColor' : 'o');
/**
* @type {number}
*/
this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'e');
/**
* @type {WebGLUniformLocation}
*/
this.u_size = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_size' : 'p');
/**
* @type {number}
*/
this.a_instruction = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_instruction' : 'f');
/**
* @type {number}
*/
this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'e');
/**
* @type {number}
*/
this.a_radius = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_radius' : 'g');
};
/**
* @type {number}
*/
this.a_instruction = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_instruction' : 'f');
/**
* @type {number}
*/
this.a_radius = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_radius' : 'g');
}
}
export default Locations;

View File

@@ -12,85 +12,90 @@ import {DEBUG as DEBUG_WEBGL} from '../../../../webgl.js';
* @param {WebGLProgram} program Program.
* @struct
*/
const Locations = function(gl, program) {
class Locations {
/**
* @type {WebGLUniformLocation}
*/
this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
constructor(gl, program) {
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/**
* @type {WebGLUniformLocation}
*/
this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/**
* @type {WebGLUniformLocation}
*/
this.u_lineWidth = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_lineWidth' : 'k');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/**
* @type {WebGLUniformLocation}
*/
this.u_miterLimit = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_miterLimit' : 'l');
/**
* @type {WebGLUniformLocation}
*/
this.u_lineWidth = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_lineWidth' : 'k');
/**
* @type {WebGLUniformLocation}
*/
this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'm');
/**
* @type {WebGLUniformLocation}
*/
this.u_miterLimit = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_miterLimit' : 'l');
/**
* @type {WebGLUniformLocation}
*/
this.u_color = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_color' : 'n');
/**
* @type {WebGLUniformLocation}
*/
this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'm');
/**
* @type {WebGLUniformLocation}
*/
this.u_size = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_size' : 'o');
/**
* @type {WebGLUniformLocation}
*/
this.u_color = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_color' : 'n');
/**
* @type {WebGLUniformLocation}
*/
this.u_pixelRatio = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_pixelRatio' : 'p');
/**
* @type {WebGLUniformLocation}
*/
this.u_size = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_size' : 'o');
/**
* @type {number}
*/
this.a_lastPos = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_lastPos' : 'd');
/**
* @type {WebGLUniformLocation}
*/
this.u_pixelRatio = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_pixelRatio' : 'p');
/**
* @type {number}
*/
this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'e');
/**
* @type {number}
*/
this.a_lastPos = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_lastPos' : 'd');
/**
* @type {number}
*/
this.a_nextPos = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_nextPos' : 'f');
/**
* @type {number}
*/
this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'e');
/**
* @type {number}
*/
this.a_direction = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_direction' : 'g');
};
/**
* @type {number}
*/
this.a_nextPos = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_nextPos' : 'f');
/**
* @type {number}
*/
this.a_direction = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_direction' : 'g');
}
}
export default Locations;

View File

@@ -12,43 +12,48 @@ import {DEBUG as DEBUG_WEBGL} from '../../../../webgl.js';
* @param {WebGLProgram} program Program.
* @struct
*/
const Locations = function(gl, program) {
class Locations {
/**
* @type {WebGLUniformLocation}
*/
this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'b');
constructor(gl, program) {
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'c');
/**
* @type {WebGLUniformLocation}
*/
this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'b');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'd');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'c');
/**
* @type {WebGLUniformLocation}
*/
this.u_color = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_color' : 'e');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'd');
/**
* @type {WebGLUniformLocation}
*/
this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'f');
/**
* @type {WebGLUniformLocation}
*/
this.u_color = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_color' : 'e');
/**
* @type {number}
*/
this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'a');
};
/**
* @type {WebGLUniformLocation}
*/
this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'f');
/**
* @type {number}
*/
this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'a');
}
}
export default Locations;

View File

@@ -12,67 +12,72 @@ import {DEBUG as DEBUG_WEBGL} from '../../../../webgl.js';
* @param {WebGLProgram} program Program.
* @struct
*/
const Locations = function(gl, program) {
class Locations {
/**
* @type {WebGLUniformLocation}
*/
this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
constructor(gl, program) {
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/**
* @type {WebGLUniformLocation}
*/
this.u_projectionMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_projectionMatrix' : 'h');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetScaleMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetScaleMatrix' : 'i');
/**
* @type {WebGLUniformLocation}
*/
this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'k');
/**
* @type {WebGLUniformLocation}
*/
this.u_offsetRotateMatrix = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_offsetRotateMatrix' : 'j');
/**
* @type {WebGLUniformLocation}
*/
this.u_image = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_image' : 'l');
/**
* @type {WebGLUniformLocation}
*/
this.u_opacity = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_opacity' : 'k');
/**
* @type {number}
*/
this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'c');
/**
* @type {WebGLUniformLocation}
*/
this.u_image = gl.getUniformLocation(
program, DEBUG_WEBGL ? 'u_image' : 'l');
/**
* @type {number}
*/
this.a_texCoord = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_texCoord' : 'd');
/**
* @type {number}
*/
this.a_position = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_position' : 'c');
/**
* @type {number}
*/
this.a_offsets = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_offsets' : 'e');
/**
* @type {number}
*/
this.a_texCoord = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_texCoord' : 'd');
/**
* @type {number}
*/
this.a_opacity = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_opacity' : 'f');
/**
* @type {number}
*/
this.a_offsets = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_offsets' : 'e');
/**
* @type {number}
*/
this.a_rotateWithView = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_rotateWithView' : 'g');
};
/**
* @type {number}
*/
this.a_opacity = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_opacity' : 'f');
/**
* @type {number}
*/
this.a_rotateWithView = gl.getAttribLocation(
program, DEBUG_WEBGL ? 'a_rotateWithView' : 'g');
}
}
export default Locations;