Module type for ol.webgl.Context

This commit is contained in:
Frederic Junod
2018-03-23 12:17:42 +01:00
parent 353a3b77b6
commit 5306490733
10 changed files with 28 additions and 28 deletions

View File

@@ -12,7 +12,7 @@ import Event from '../events/Event.js';
* @param {ol.render.VectorContext=} opt_vectorContext Vector context. * @param {ol.render.VectorContext=} opt_vectorContext Vector context.
* @param {module:ol/PluggableMap~FrameState=} opt_frameState Frame state. * @param {module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
* @param {?CanvasRenderingContext2D=} opt_context Context. * @param {?CanvasRenderingContext2D=} opt_context Context.
* @param {?ol.webgl.Context=} opt_glContext WebGL Context. * @param {?module:ol/webgl/Context~WebGLContext=} opt_glContext WebGL Context.
*/ */
const RenderEvent = function( const RenderEvent = function(
type, opt_vectorContext, opt_frameState, opt_context, type, opt_vectorContext, opt_frameState, opt_context,
@@ -45,7 +45,7 @@ const RenderEvent = function(
/** /**
* WebGL context. Only available when a WebGL renderer is used, null * WebGL context. Only available when a WebGL renderer is used, null
* otherwise. * otherwise.
* @type {ol.webgl.Context|null|undefined} * @type {module:ol/webgl/Context~WebGLContext|null|undefined}
* @api * @api
*/ */
this.glContext = opt_glContext; this.glContext = opt_glContext;

View File

@@ -181,7 +181,7 @@ WebGLCircleReplay.prototype.finish = function(context) {
WebGLCircleReplay.prototype.getDeleteResourcesFunction = function(context) { WebGLCircleReplay.prototype.getDeleteResourcesFunction = function(context) {
// We only delete our stuff here. The shaders and the program may // We only delete our stuff here. The shaders and the program may
// be used by other CircleReplay instances (for other layers). And // be used by other CircleReplay instances (for other layers). And
// they will be deleted when disposing of the ol.webgl.Context // they will be deleted when disposing of the module:ol/webgl/Context~WebGLContext
// object. // object.
const verticesBuffer = this.verticesBuffer; const verticesBuffer = this.verticesBuffer;
const indicesBuffer = this.indicesBuffer; const indicesBuffer = this.indicesBuffer;
@@ -311,7 +311,7 @@ WebGLCircleReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, contex
/** /**
* @private * @private
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {Object} skippedFeaturesHash Ids of features to skip. * @param {Object} skippedFeaturesHash Ids of features to skip.
*/ */
WebGLCircleReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) { WebGLCircleReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {

View File

@@ -11,7 +11,7 @@ import WebGLReplayGroup from '../webgl/ReplayGroup.js';
/** /**
* @constructor * @constructor
* @extends {ol.render.VectorContext} * @extends {ol.render.VectorContext}
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {module:ol/coordinate~Coordinate} center Center. * @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @param {number} rotation Rotation. * @param {number} rotation Rotation.

View File

@@ -549,7 +549,7 @@ WebGLLineStringReplay.prototype.drawReplay = function(gl, context, skippedFeatur
/** /**
* @private * @private
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {Object} skippedFeaturesHash Ids of features to skip. * @param {Object} skippedFeaturesHash Ids of features to skip.
*/ */
WebGLLineStringReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) { WebGLLineStringReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {

View File

@@ -986,7 +986,7 @@ WebGLPolygonReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, conte
/** /**
* @private * @private
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {Object} skippedFeaturesHash Ids of features to skip. * @param {Object} skippedFeaturesHash Ids of features to skip.
*/ */
WebGLPolygonReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) { WebGLPolygonReplay.prototype.drawReplaySkipping_ = function(gl, context, skippedFeaturesHash) {

View File

@@ -125,7 +125,7 @@ inherits(WebGLReplay, VectorContext);
/** /**
* @abstract * @abstract
* @param {ol.webgl.Context} context WebGL context. * @param {module:ol/webgl/Context~WebGLContext} context WebGL context.
* @return {function()} Delete resources function. * @return {function()} Delete resources function.
*/ */
WebGLReplay.prototype.getDeleteResourcesFunction = function(context) {}; WebGLReplay.prototype.getDeleteResourcesFunction = function(context) {};
@@ -133,7 +133,7 @@ WebGLReplay.prototype.getDeleteResourcesFunction = function(context) {};
/** /**
* @abstract * @abstract
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
*/ */
WebGLReplay.prototype.finish = function(context) {}; WebGLReplay.prototype.finish = function(context) {};
@@ -142,7 +142,7 @@ WebGLReplay.prototype.finish = function(context) {};
* @abstract * @abstract
* @protected * @protected
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {module:ol/size~Size} size Size. * @param {module:ol/size~Size} size Size.
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @return {ol.render.webgl.circlereplay.defaultshader.Locations| * @return {ol.render.webgl.circlereplay.defaultshader.Locations|
@@ -169,7 +169,7 @@ WebGLReplay.prototype.shutDownProgram = function(gl, locations) {};
* @abstract * @abstract
* @protected * @protected
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {boolean} hitDetection Hit detection mode. * @param {boolean} hitDetection Hit detection mode.
@@ -181,7 +181,7 @@ WebGLReplay.prototype.drawReplay = function(gl, context, skippedFeaturesHash, hi
* @abstract * @abstract
* @protected * @protected
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback. * @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
@@ -196,7 +196,7 @@ WebGLReplay.prototype.drawHitDetectionReplayOneByOne = function(gl, context, ski
/** /**
* @protected * @protected
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback. * @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
@@ -223,7 +223,7 @@ WebGLReplay.prototype.drawHitDetectionReplay = function(gl, context, skippedFeat
/** /**
* @protected * @protected
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback. * @param {function((module:ol/Feature~Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
@@ -245,7 +245,7 @@ WebGLReplay.prototype.drawHitDetectionReplayAll = function(gl, context, skippedF
/** /**
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {module:ol/coordinate~Coordinate} center Center. * @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @param {number} rotation Rotation. * @param {number} rotation Rotation.
@@ -353,7 +353,7 @@ WebGLReplay.prototype.replay = function(context,
/** /**
* @protected * @protected
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {number} start Start index. * @param {number} start Start index.
* @param {number} end End index. * @param {number} end End index.
*/ */

View File

@@ -81,7 +81,7 @@ WebGLReplayGroup.prototype.addDeclutter = function(style, group) {};
/** /**
* @param {ol.webgl.Context} context WebGL context. * @param {module:ol/webgl/Context~WebGLContext} context WebGL context.
* @return {function()} Delete resources function. * @return {function()} Delete resources function.
*/ */
WebGLReplayGroup.prototype.getDeleteResourcesFunction = function(context) { WebGLReplayGroup.prototype.getDeleteResourcesFunction = function(context) {
@@ -106,7 +106,7 @@ WebGLReplayGroup.prototype.getDeleteResourcesFunction = function(context) {
/** /**
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
*/ */
WebGLReplayGroup.prototype.finish = function(context) { WebGLReplayGroup.prototype.finish = function(context) {
let zKey; let zKey;
@@ -151,7 +151,7 @@ WebGLReplayGroup.prototype.isEmpty = function() {
/** /**
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {module:ol/coordinate~Coordinate} center Center. * @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @param {number} rotation Rotation. * @param {number} rotation Rotation.
@@ -186,7 +186,7 @@ WebGLReplayGroup.prototype.replay = function(context,
/** /**
* @private * @private
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {module:ol/coordinate~Coordinate} center Center. * @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @param {number} rotation Rotation. * @param {number} rotation Rotation.
@@ -232,7 +232,7 @@ WebGLReplayGroup.prototype.replayHitDetection_ = function(context,
/** /**
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate. * @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {module:ol/coordinate~Coordinate} center Center. * @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @param {number} rotation Rotation. * @param {number} rotation Rotation.
@@ -287,7 +287,7 @@ WebGLReplayGroup.prototype.forEachFeatureAtCoordinate = function(
/** /**
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate. * @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {module:ol/coordinate~Coordinate} center Center. * @param {module:ol/coordinate~Coordinate} center Center.
* @param {number} resolution Resolution. * @param {number} resolution Resolution.
* @param {number} rotation Rotation. * @param {number} rotation Rotation.

View File

@@ -362,7 +362,7 @@ WebGLTextureReplay.prototype.drawReplay = function(gl, context, skippedFeaturesH
* *
* @protected * @protected
* @param {WebGLRenderingContext} gl gl. * @param {WebGLRenderingContext} gl gl.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {Array.<WebGLTexture>} textures Textures. * @param {Array.<WebGLTexture>} textures Textures.

View File

@@ -139,7 +139,7 @@ WebGLLayerRenderer.prototype.bindFramebuffer = function(frameState, framebufferD
/** /**
* @param {module:ol/PluggableMap~FrameState} frameState Frame state. * @param {module:ol/PluggableMap~FrameState} frameState Frame state.
* @param {module:ol/layer/Layer~State} layerState Layer state. * @param {module:ol/layer/Layer~State} layerState Layer state.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
*/ */
WebGLLayerRenderer.prototype.composeFrame = function(frameState, layerState, context) { WebGLLayerRenderer.prototype.composeFrame = function(frameState, layerState, context) {
@@ -183,7 +183,7 @@ WebGLLayerRenderer.prototype.composeFrame = function(frameState, layerState, con
/** /**
* @param {ol.render.EventType} type Event type. * @param {ol.render.EventType} type Event type.
* @param {ol.webgl.Context} context WebGL context. * @param {module:ol/webgl/Context~WebGLContext} context WebGL context.
* @param {module:ol/PluggableMap~FrameState} frameState Frame state. * @param {module:ol/PluggableMap~FrameState} frameState Frame state.
* @private * @private
*/ */
@@ -245,7 +245,7 @@ WebGLLayerRenderer.prototype.handleWebGLContextLost = function() {
* @abstract * @abstract
* @param {module:ol/PluggableMap~FrameState} frameState Frame state. * @param {module:ol/PluggableMap~FrameState} frameState Frame state.
* @param {module:ol/layer/Layer~State} layerState Layer state. * @param {module:ol/layer/Layer~State} layerState Layer state.
* @param {ol.webgl.Context} context Context. * @param {module:ol/webgl/Context~WebGLContext} context Context.
* @return {boolean} whether composeFrame should be called. * @return {boolean} whether composeFrame should be called.
*/ */
WebGLLayerRenderer.prototype.prepareFrame = function(frameState, layerState, context) {}; WebGLLayerRenderer.prototype.prepareFrame = function(frameState, layerState, context) {};

View File

@@ -92,7 +92,7 @@ const WebGLMapRenderer = function(container, map) {
/** /**
* @private * @private
* @type {ol.webgl.Context} * @type {module:ol/webgl/Context~WebGLContext}
*/ */
this.context_ = new WebGLContext(this.canvas_, this.gl_); this.context_ = new WebGLContext(this.canvas_, this.gl_);
@@ -335,7 +335,7 @@ WebGLMapRenderer.prototype.expireCache_ = function(map, frameState) {
/** /**
* @return {ol.webgl.Context} The context. * @return {module:ol/webgl/Context~WebGLContext} The context.
*/ */
WebGLMapRenderer.prototype.getContext = function() { WebGLMapRenderer.prototype.getContext = function() {
return this.context_; return this.context_;