The current frame time in milliseconds
This is used to populate the lastRenderableChangeTime property of
Texture instances when their renderable state changes.
Set by stage via updateFrameTime method.
Map of textures by cache key
Renderer that this texture manager is associated with
Map of texture constructors by their type name
Clear all listeners for the given event names by setting their array length to 0, WITHOUT deleting the keys. This keeps the eventListeners object in V8's fast-properties mode and avoids re-allocating the arrays on the next on() call. Use this for objects with a known fixed set of event names (e.g. CoreAnimation, CoreAnimationController).
Only writes arr.length = 0 when the array is non-empty -- skips the write (and the write barrier on old-gen objects) when already empty, which is the common case after unregisterAnimation() has removed all listeners.
Create a texture
The type of texture to create
The properties to use for the texture
Destroy the CoreTextureManager and release all internal references.
Clears the upload queue, context-loss tracking sets, and key/inverse-key caches so that queued textures can be garbage-collected after a renderer teardown — including a teardown while the context is lost with pending restores. Bumps the context generation so in-flight decodes abort instead of uploading after destroy.
Optionaldata: anyEmit to all listeners, isolating each one from the others.
Optionaldata: anyOptionalonError: LoopErrorHandlerUnlike emit, a throwing listener neither aborts the remaining
listeners nor propagates to the caller (e.g. the rAF loop). Each error is
routed to onError (handleLoopError) or console.error and iteration
continues. Internal renderer code should keep using emit (fail loudly);
app-facing boundaries should use this.
Kept as a separate method so the hot emit path — and more importantly
its callers in the frame loop — stay try-free for older JITs.
Enqueue a texture for uploading to the GPU.
The texture to upload
Check whether this emitter has any listeners registered.
Optionalevent: string
Optional event name. When provided, checks only that event. When omitted, checks all events.
true if at least one listener is registered.
Initialize a texture to the cache
Texture to cache
Cache key for the texture
Override loadTexture to use the batched approach.
The texture to load
Optionalpriority: booleanOptionallistener: EventListenerProcess a limited number of uploads.
The maximum processing time in milliseconds
The maximum number of textures to process in this call
Resolve a parent texture from the cache or fallback to the provided texture.
The provided texture to resolve.
The cached or provided texture.
EventEmitter base class
Remarks
The
eventListenersmap is allocated lazily on the firston()call. Many objects (e.g. CoreNodes that never have listeners attached) avoid the cost of allocating an empty{}at construction time.