| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.ui.display.singleton; |
| |
| using fuchsia.math; |
| |
| /// Describes the physical display, and how to map between physical and logical pixels. |
| type Metrics = table { |
| /// Same meaning as `horizontal_resolution` and `vertical_resolution` |
| /// in `fuchsia.hardware.display.Mode`. Given in physical pixels. |
| 1: extent_in_px fuchsia.math.SizeU; |
| /// Same meaning as `horizontal_size_mm` and `vertical_size_mm` |
| /// in `fuchsia.hardware.display.Info`. |
| 2: extent_in_mm fuchsia.math.SizeU; |
| /// The number of physical pixels per "logical" pixel, for example as in |
| /// `fuchsia.ui.composition.LayoutInfo.logical_size`. It provides an indication |
| /// of the size of image buffers that should be allocated. This value would typically |
| /// be used by a component near the root of the scene graph to set a scale for the rest |
| /// of the scene beneath. |
| 3: recommended_device_pixel_ratio fuchsia.math.VecF; |
| /// The maximum mumber of images transmitted to the display in 1000 seconds. |
| /// This is the display's maximum vertical refresh rate, in millihertz (0.001 Hz). |
| @available(added=16) |
| 4: maximum_refresh_rate_in_millihertz uint32; |
| }; |
| |
| /// Get information about Scenic's primary display. |
| // TODO(https://fxbug.dev/42097799): in the future there will probably be a DisplayManager, and |
| // info about which displays to use will be explicitly specified to Scenic. |
| @discoverable |
| closed protocol Info { |
| strict GetMetrics() -> (struct { |
| info Metrics; |
| }); |
| }; |