The renderer that owns this DrawingContextPool.
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 given dimensions.
Optionalwidth: numberThe width of the DrawingContext.
Optionalheight: numberThe height of 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.