Struct LayoutInfo
pub struct LayoutInfo {
pub logical_size: Option<SizeU>,
pub device_pixel_ratio: Option<VecF>,
pub inset: Option<Inset>,
/* private fields */
}
Expand description
The return type of [GetLayout
]. This table contains most of the information necessary
for a client to decide how to layout their content in a Flatland instance. This data may be
provided to the client before the command that creates the View is presented, so that the
client may lay out content properly before their first call to [Present
].
Fields§
§logical_size: Option<SizeU>
The layout size of a View in logical pixels, defined by the parent’s call to
[SetViewportProperties
].
The logical size also serves as the clip boundary of the View. Anything outside the clip boundary will not be rendered. Hence, the View’s Root Transform has a useful coordinate space of (0, 0) to (logical_size.width, logical_size.height).
Clients should re-layout their content when this value changes.
device_pixel_ratio: Option<VecF>
The ratio of display’s physical pixels to device independent pixels. Each logical pixel of a
View is displayed on-screen by one or more physical pixels, as determined by this scale.
Clients should not necessarily re-layout their content when this value changes, but
accommodate by reallocating their Image buffers to avoid sampling artifacts. The HiDPI-aware
client should allocate buffers that are sized (logical_size
*device_pixel_ratio
).
inset: Option<Inset>
The offsets between the edges and the visible rectangle of the View. The clients can assume
that the boundary region between the inset and the View edge is occluded, and should adjust
content layout to avoid this region. This inset is described in the view’s logical
coordinate system. The HiDPI-aware clients should scale this by device_pixel_ratio
.
Trait Implementations§
§impl Clone for LayoutInfo
impl Clone for LayoutInfo
§fn clone(&self) -> LayoutInfo
fn clone(&self) -> LayoutInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for LayoutInfo
impl Debug for LayoutInfo
§impl<D> Decode<LayoutInfo, D> for LayoutInfowhere
D: ResourceDialect,
impl<D> Decode<LayoutInfo, D> for LayoutInfowhere
D: ResourceDialect,
§fn new_empty() -> LayoutInfo
fn new_empty() -> LayoutInfo
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl Default for LayoutInfo
impl Default for LayoutInfo
§fn default() -> LayoutInfo
fn default() -> LayoutInfo
§impl<D> Encode<LayoutInfo, D> for &LayoutInfowhere
D: ResourceDialect,
impl<D> Encode<LayoutInfo, D> for &LayoutInfowhere
D: ResourceDialect,
§impl PartialEq for LayoutInfo
impl PartialEq for LayoutInfo
§impl TypeMarker for LayoutInfo
impl TypeMarker for LayoutInfo
§type Owned = LayoutInfo
type Owned = LayoutInfo
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for LayoutInfo
impl ValueTypeMarker for LayoutInfo
§type Borrowed<'a> = &'a LayoutInfo
type Borrowed<'a> = &'a LayoutInfo
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<LayoutInfo as TypeMarker>::Owned,
) -> <LayoutInfo as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<LayoutInfo as TypeMarker>::Owned, ) -> <LayoutInfo as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.