(image)
| 259 | } |
| 260 | |
| 261 | setImage(image) { |
| 262 | if (this.textures.source) { |
| 263 | this.gl.deleteTexture(this.textures.source); |
| 264 | this.textures.source = null; |
| 265 | } |
| 266 | if (image) { |
| 267 | this.textures.source = this._createTexture(image); |
| 268 | this.imageWidth = image.width || image.videoWidth; |
| 269 | this.imageHeight = image.height || image.videoHeight; |
| 270 | } else { |
| 271 | this.imageWidth = 0; |
| 272 | this.imageHeight = 0; |
| 273 | const gl = this.gl; |
| 274 | gl.bindFramebuffer(gl.FRAMEBUFFER, null); |
| 275 | gl.viewport(0, 0, this.canvas.width, this.canvas.height); |
| 276 | gl.clearColor(0, 0, 0, 0); |
| 277 | gl.clear(gl.COLOR_BUFFER_BIT); |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | updateVideoFrame(video) { |
| 282 | if (!this.textures.source || !video) return; |
nothing calls this directly
no test coverage detected