The renderer that owns this DrawingContextPool.
The maximum age of a pooled DrawingContext in milliseconds, after which it becomes eligible for resizing and reuse.
The soft maximum number of DrawingContexts to keep in the pool. The pool may exceed this limit temporarily if demand requires it.
The pool of DrawingContexts by age. This is an array of DrawingContexts, oldest first.
The maximum age of a DrawingContext in milliseconds. After this time, the DrawingContext will be available for resizing.
The maximum number of DrawingContexts to store. This is not a hard limit, but the pool will attempt to reuse DrawingContexts rather than create new ones.
The renderer that owns this DrawingContextPool.
The pool of DrawingContexts by size.
This is an object with keys of the form ${width}x${height}.
Each value is an array of DrawingContexts.
Adds a DrawingContext to the pool. This is used by a DrawingContext to signal that it is available for reuse.
The DrawingContext to add to the pool.
Clears the DrawingContextPool. This will not destroy any DrawingContexts that are currently in use.
Returns a DrawingContext of the requested dimensions, following the pool's priority order: an exact-size spare, an aged spare resized, a newly created context within the pool limit, the oldest spare resized, or finally a newly created context that exceeds the pool limit. If width or height are omitted, the renderer's current dimensions are used. Both values are clamped to the renderer's maximum texture size.
Optionalwidth: number
The width of the DrawingContext.
Optionalheight: number
The height of the DrawingContext.
The DrawingContext.
Prunes the DrawingContextPool down to the maximum pool size. Oldest DrawingContexts will be destroyed first. This will not destroy any DrawingContexts that are currently in use.
Sets the maximum age of a DrawingContext in milliseconds.
The maximum age of a DrawingContext in milliseconds.
Sets the maximum number of DrawingContexts to store.
The maximum number of DrawingContexts to store.
A pool of DrawingContexts.
This class is used internally by the WebGLRenderer to manage DrawingContexts. It attempts to reuse DrawingContexts efficiently. When
getis called, it will return a DrawingContext of the given dimensions, using the following priority:We assume that DrawingContexts of a given size are likely to be reused from frame to frame, so we try to preserve them for greater efficiency.