Track a container's content-rect size via ResizeObserver, and density via
the ambient DeviceProfile.
This hook is the screen path's designated ambient-density source —
rendering code should take density as a parameter (cf.
renderSceneToPixels, renderSceneToCanvas's dpr) rather than reading
window.devicePixelRatio inline.
Density deliberately does NOT come from a window.devicePixelRatio read
inside the resize callback: that only refreshes when the element resizes,
so dragging a window to a different-density display without resizing it
left the snapshot stale. The profile watches a re-armed resolution media
query instead.
Track a container's content-rect size via
ResizeObserver, and density via the ambientDeviceProfile.This hook is the screen path's designated ambient-density source — rendering code should take density as a parameter (cf.
renderSceneToPixels,renderSceneToCanvas'sdpr) rather than readingwindow.devicePixelRatioinline.Density deliberately does NOT come from a
window.devicePixelRatioread inside the resize callback: that only refreshes when the element resizes, so dragging a window to a different-density display without resizing it left the snapshot stale. The profile watches a re-armed resolution media query instead.