(
gl: WebGL2RenderingContext, flipHorizontal: boolean, flipVertical: boolean,
rotation: Rotation)
| 306 | } |
| 307 | |
| 308 | export function drawTextureProgram( |
| 309 | gl: WebGL2RenderingContext, flipHorizontal: boolean, flipVertical: boolean, |
| 310 | rotation: Rotation): ProgramObjects { |
| 311 | if (!programCacheByContext.has(gl)) { |
| 312 | programCacheByContext.set(gl, new Map()); |
| 313 | } |
| 314 | const programCache = programCacheByContext.get(gl); |
| 315 | |
| 316 | const cacheKey = `drawTexture_${flipHorizontal}_${flipVertical}_${rotation}`; |
| 317 | if (!programCache.has(cacheKey)) { |
| 318 | const vertSource = drawTextureProgramInfo.vertexShaderSource( |
| 319 | flipHorizontal, flipVertical, rotation); |
| 320 | const fragSource = drawTextureProgramInfo.fragmentShaderSource(); |
| 321 | |
| 322 | const vertices = drawTextureProgramInfo.vertices(); |
| 323 | const texCoords = drawTextureProgramInfo.texCoords(); |
| 324 | |
| 325 | const programObjects = |
| 326 | createProgramObjects(gl, vertSource, fragSource, vertices, texCoords); |
| 327 | |
| 328 | programCache.set(cacheKey, programObjects); |
| 329 | } |
| 330 | return programCache.get(cacheKey); |
| 331 | } |
| 332 | |
| 333 | function resizeProgram( |
| 334 | gl: WebGL2RenderingContext, sourceDims: Dimensions, targetDims: Dimensions, |
no test coverage detected
searching dependent graphs…