Allow WebGL tile layer style to be updated
This commit is contained in:
@@ -340,7 +340,6 @@ class WebGLHelper extends Disposable {
|
||||
* @type {WebGLRenderingContext}
|
||||
*/
|
||||
this.gl_ = getContext(this.canvas_);
|
||||
const gl = this.getGL();
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -407,14 +406,11 @@ class WebGLHelper extends Disposable {
|
||||
*/
|
||||
this.uniforms_ = [];
|
||||
if (options.uniforms) {
|
||||
for (const name in options.uniforms) {
|
||||
this.uniforms_.push({
|
||||
name: name,
|
||||
value: options.uniforms[name],
|
||||
});
|
||||
}
|
||||
this.setUniforms(options.uniforms);
|
||||
}
|
||||
|
||||
const gl = this.getGL();
|
||||
|
||||
/**
|
||||
* An array of PostProcessingPass objects is kept in this variable, built from the steps provided in the
|
||||
* options. If no post process was given, a default one is used (so as not to have to make an exception to
|
||||
@@ -447,6 +443,20 @@ class WebGLHelper extends Disposable {
|
||||
this.startTime_ = Date.now();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object<string, UniformValue>} uniforms Uniform definitions.
|
||||
*/
|
||||
setUniforms(uniforms) {
|
||||
this.uniforms_ = [];
|
||||
for (const name in uniforms) {
|
||||
this.uniforms_.push({
|
||||
name: name,
|
||||
value: uniforms[name],
|
||||
});
|
||||
}
|
||||
this.uniformLocations_ = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} canvasCacheKey The canvas cache key.
|
||||
* @return {boolean} The provided key matches the one this helper was constructed with.
|
||||
|
||||
Reference in New Issue
Block a user