Remove use of goog.partial
Use Function.prototype.bind instead, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Partially_applied_functions_(currying)
This commit is contained in:
@@ -181,18 +181,20 @@ ol.renderer.Layer.prototype.renderIfReadyAndVisible = function() {
|
||||
*/
|
||||
ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSource) {
|
||||
if (tileSource.canExpireCache()) {
|
||||
/**
|
||||
* @param {ol.source.Tile} tileSource Tile source.
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
*/
|
||||
var postRenderFunction = function(tileSource, map, frameState) {
|
||||
var tileSourceKey = goog.getUid(tileSource).toString();
|
||||
tileSource.expireCache(frameState.viewState.projection,
|
||||
frameState.usedTiles[tileSourceKey]);
|
||||
}.bind(null, tileSource);
|
||||
|
||||
frameState.postRenderFunctions.push(
|
||||
/** @type {ol.PostRenderFunction} */ (goog.partial(
|
||||
/**
|
||||
* @param {ol.source.Tile} tileSource Tile source.
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {olx.FrameState} frameState Frame state.
|
||||
*/
|
||||
function(tileSource, map, frameState) {
|
||||
var tileSourceKey = goog.getUid(tileSource).toString();
|
||||
tileSource.expireCache(frameState.viewState.projection,
|
||||
frameState.usedTiles[tileSourceKey]);
|
||||
}, tileSource)));
|
||||
/** @type {ol.PostRenderFunction} */ (postRenderFunction)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -138,17 +138,18 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layer
|
||||
image = image_;
|
||||
texture = this.createTexture_(image_);
|
||||
if (this.texture) {
|
||||
/**
|
||||
* @param {WebGLRenderingContext} gl GL.
|
||||
* @param {WebGLTexture} texture Texture.
|
||||
*/
|
||||
var postRenderFunction = function(gl, texture) {
|
||||
if (!gl.isContextLost()) {
|
||||
gl.deleteTexture(texture);
|
||||
}
|
||||
}.bind(null, gl, this.texture);
|
||||
frameState.postRenderFunctions.push(
|
||||
/** @type {ol.PostRenderFunction} */ (goog.partial(
|
||||
/**
|
||||
* @param {WebGLRenderingContext} gl GL.
|
||||
* @param {WebGLTexture} texture Texture.
|
||||
*/
|
||||
function(gl, texture) {
|
||||
if (!gl.isContextLost()) {
|
||||
gl.deleteTexture(texture);
|
||||
}
|
||||
}, gl, this.texture)));
|
||||
/** @type {ol.PostRenderFunction} */ (postRenderFunction)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,20 +93,21 @@ ol.renderer.webgl.Layer.prototype.bindFramebuffer = function(frameState, framebu
|
||||
|
||||
if (this.framebufferDimension === undefined ||
|
||||
this.framebufferDimension != framebufferDimension) {
|
||||
/**
|
||||
* @param {WebGLRenderingContext} gl GL.
|
||||
* @param {WebGLFramebuffer} framebuffer Framebuffer.
|
||||
* @param {WebGLTexture} texture Texture.
|
||||
*/
|
||||
var postRenderFunction = function(gl, framebuffer, texture) {
|
||||
if (!gl.isContextLost()) {
|
||||
gl.deleteFramebuffer(framebuffer);
|
||||
gl.deleteTexture(texture);
|
||||
}
|
||||
}.bind(null, gl, this.framebuffer, this.texture);
|
||||
|
||||
frameState.postRenderFunctions.push(
|
||||
/** @type {ol.PostRenderFunction} */ (goog.partial(
|
||||
/**
|
||||
* @param {WebGLRenderingContext} gl GL.
|
||||
* @param {WebGLFramebuffer} framebuffer Framebuffer.
|
||||
* @param {WebGLTexture} texture Texture.
|
||||
*/
|
||||
function(gl, framebuffer, texture) {
|
||||
if (!gl.isContextLost()) {
|
||||
gl.deleteFramebuffer(framebuffer);
|
||||
gl.deleteTexture(texture);
|
||||
}
|
||||
}, gl, this.framebuffer, this.texture)));
|
||||
/** @type {ol.PostRenderFunction} */ (postRenderFunction)
|
||||
);
|
||||
|
||||
var texture = ol.webgl.Context.createEmptyTexture(
|
||||
gl, framebufferDimension, framebufferDimension);
|
||||
|
||||
Reference in New Issue
Block a user