| 44 | |
| 45 | // A wrapper class for WebGL program and its utility functions. |
| 46 | class GlProgramImpl { |
| 47 | constructor(gl, program) { |
| 48 | this.gl_ = gl; |
| 49 | this.program_ = program; |
| 50 | this.cachedUniformLocations_ = new Map(); |
| 51 | } |
| 52 | |
| 53 | useProgram() { |
| 54 | this.gl_.useProgram(this.program_); |
| 55 | } |
| 56 | |
| 57 | getUniformLocation(symbol) { |
| 58 | if (this.cachedUniformLocations_.has(symbol)) { |
| 59 | return this.cachedUniformLocations_.get(symbol); |
| 60 | } else { |
| 61 | const location = this.gl_.getUniformLocation(this.program_, symbol); |
| 62 | this.cachedUniformLocations_.set(symbol, location); |
| 63 | return location; |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | // Utility class for drawing. |
| 69 | class FullscreenQuad { |
nothing calls this directly
no outgoing calls
no test coverage detected