logicalPixelVisualAngleDegrees top-level constant

double const logicalPixelVisualAngleDegrees

Derives a display scale factor (physical pixels per logical pixel) from physical display geometry and expected viewing distance, instead of trusting the OS or device manufacturer to report a sane DPI.

Follows Fuchsia's root_presenter DisplayModel (garnet/bin/ui/root_presenter/displays/display_model.cc), which defines the logical unit angularly: one logical pixel ("pip") subtends 0.0255 degrees of visual angle at nominal viewing distance. This is Android's dp (1/160in at ~14in => ~0.0253 deg) and iOS's pt (1/163in => ~0.0245 deg) generalized to be distance-independent. CSS px (1/96in at 28in => 0.0213 deg) is the outlier; it is used here only as a fallback.

The entire model reduces to:

scale = pxPerMm * tan(0.0255 deg) * vdist * (0.5 + 180mm / vdist)

The trailing term is Fuchsia's empirically-derived adaptation factor. Pure angular parity feels wrong across distances: human size constancy partially "un-shrinks" distant objects, and far displays (desktops, TVs) are expected to carry more content than a phone. The factor is anchored at 1.0 for handheld (360mm) — dp-equivalent by construction — and asymptotes to 0.5 for infinitely distant displays. Visual angle subtended by one logical pixel at nominal viewing distance, in degrees. Taken verbatim from Fuchsia; equals an Android dp to ~1%.

Implementation

/// Visual angle subtended by one logical pixel at nominal viewing distance,
/// in degrees. Taken verbatim from Fuchsia; equals an Android dp to ~1%.
const double logicalPixelVisualAngleDegrees = 0.0255;