MCPcopy Create free account
hub / github.com/gre/gl-react / Loader

Class Loader

packages/tests/utils.js:332–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…