| 330 | return delay(50); // FIXME this is a hack. |
| 331 | } |
| 332 | class Loader extends WebGLTextureLoader<typeof textureId> { |
| 333 | texture: ?Texture = null; |
| 334 | constructor(gl: WebGLRenderingContext) { |
| 335 | super(gl); |
| 336 | ++counters.constructor; |
| 337 | } |
| 338 | dispose() { |
| 339 | ++counters.dispose; |
| 340 | } |
| 341 | canLoad(input: any) { |
| 342 | ++counters.canLoad; |
| 343 | return input === textureId; |
| 344 | } |
| 345 | get() { |
| 346 | ++counters.get; |
| 347 | return ( |
| 348 | this.texture && { |
| 349 | texture: this.texture, |
| 350 | width: size[0], |
| 351 | height: size[1] |
| 352 | } |
| 353 | ); |
| 354 | } |
| 355 | load() { |
| 356 | ++counters.load; |
| 357 | const promise = d.promise.then(() => { |
| 358 | ++counters.createTexture; |
| 359 | this.texture = makeTexture(this.gl); |
| 360 | return { |
| 361 | texture: this.texture, |
| 362 | width: size[0], |
| 363 | height: size[1] |
| 364 | }; |
| 365 | }); |
| 366 | return promise; |
| 367 | } |
| 368 | } |
| 369 | return { |
| 370 | Loader, |
| 371 | textureId, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…