current blend mode
current fill & stroke style color
current scissor/clipping rectangle [x, y, width, height]
current tint applied to sprites
current transformation matrix
Reset all state to defaults and clear the stack.
canvas width
canvas height
Restore state from the stack.
Color, tint, transform, and scissor are restored in place.
Blend mode is NOT applied to currentBlendMode — it is returned so the
renderer can call its own setBlendMode() (which has context-specific side effects).
current canvas width (used when scissor was inactive)
current canvas height (used when scissor was inactive)
restored blend mode and scissor flag, or null if stack was empty
Save the current state onto the stack (zero allocations).
OptionalscissorTestActive: boolean = falsewhether scissor/clip is currently enabled
Renderer-agnostic state container with a pre-allocated save/restore stack.
Owns the mutable rendering state (color, tint, transform, scissor, blend mode) and provides zero-allocation save()/restore() via index-based stacks. Both CanvasRenderer and WebGLRenderer (and future WebGPU) delegate state management here, keeping rendering-context-specific code in the renderers.