class LayerProperties
Defined at line 2730 of file fidling/gen/sdk/fidl/fuchsia.ui.composition/fuchsia.ui.composition/cpp/fidl/fuchsia.ui.composition/cpp/wire_types.h
Stateful properties associated with a Layer.
All fields are sticky: [`SetLayerProperties`] merges the provided table into the
layer's stored properties, and stored values persist across [`SetLayerImage`] calls
and across composition mode changes. Fields not used by the current composition mode
keep their values, and take effect again when a mode that uses them is re-entered.
Nothing is cleared implicitly; [`ResetLayer`] is the only operation that forgets
stored properties.
**Hints (Safety and Performance Semantics)**:
Hints (such as [`hint_damage_rects`] and [`hint_visible_rects`]) are optional
optimization details provided by the client.
* **Ignorable by Design**: The implementation is free to ignore these hints. If ignored,
rendering remains fully correct, though possibly less optimal.
* **Correct Hints**: Yield the identical visual result but may improve performance (e.g.,
by allowing composition shortcuts or partial updates).
* **Incorrect Hints**: May result in rendering artifacts, stale regions, or incorrect
pixels on the display, as the implementation might optimize based on false assumptions.
Public Methods
bool IsEmpty ()
Returns whether no field is set.
bool HasUnknownData ()
Returns whether the table references unknown fields.
::fidl::WireTableBuilder< ::fuchsia_ui_composition::wire::LayerProperties> Builder (::fidl::AnyArena & arena)
Return a builder that by defaults allocates of an arena.
::fidl::WireTableExternalBuilder< ::fuchsia_ui_composition::wire::LayerProperties> ExternalBuilder (::fidl::ObjectView< ::fidl::WireTableFrame< ::fuchsia_ui_composition::wire::LayerProperties>> frame)
Return a builder that relies on explicitly allocating |fidl::ObjectView|s.
void LayerProperties ()
Defined at line 2732 of file fidling/gen/sdk/fidl/fuchsia.ui.composition/fuchsia.ui.composition/cpp/fidl/fuchsia.ui.composition/cpp/wire_types.h
void LayerProperties (const LayerProperties & other)
Defined at line 2733 of file fidling/gen/sdk/fidl/fuchsia.ui.composition/fuchsia.ui.composition/cpp/fidl/fuchsia.ui.composition/cpp/wire_types.h
::fuchsia_math::wire::RectU & display_rect ()
The rectangle where the layer content will be displayed in its local coordinate space.
For image layers, visual properties are applied in the following order:
1. **Sample**: The region specified by `sample_rect` is extracted from the image.
2. **Transform**: The sampled region is flipped and rotated as specified by `transform`.
3. **Scale/Fit**: Transformed content is implicitly scaled to fit the `display_rect`.
Hardware image scaling is requested implicitly when the dimensions of the transformed
`sample_rect` differ from the extent of the `display_rect`. Not all display hardware supports
scaling, or may have limitations.
The dimensions of `display_rect` must account for image dimension changes caused by rotations
to avoid implicit scaling or distortion. For example, rotating a 600x300 pixel region
by 90 degrees would require specifying 300x600 dimensions here to maintain the aspect ratio.
**Note**: This rectangle is specified in the local space of the LayerStack (or the Transform
the LayerStack is attached to). Any scaling applied by parent transforms in the Flatland scene
graph will further affect the final size on the physical display.
Default: (0,0,0,0). The layer will not be visible until a rectangle with non-zero
width and height is set.
bool has_display_rect ()
float & opacity ()
The opacity of the layer, in the range [0..1].
Multiplies with opacity inherited from `Transform`s above the layer's `LayerStack`
(see [`fuchsia.ui.composition/Flatland.SetOpacity`]) to give the layer's *effective
opacity*. The layer renders as if its content's own alpha (image pixels' alpha, or
`color.alpha` for a solid-color layer) were scaled by the effective opacity; since
this requires blending, a `REPLACE` layer with effective opacity below 1.0 renders
as `PREMULTIPLIED_ALPHA` (see [`blend_mode`]). A layer with effective opacity 0.0
is invisible.
Default: 1.0 (the content's own alpha applies unmodified).
bool has_opacity ()
::fuchsia_ui_composition::wire::BlendMode2 & blend_mode ()
The blend mode used to composite the layer over the content beneath it.
`REPLACE` is honored only while the layer's effective opacity is 1.0 (see [`opacity`]);
at lower effective opacity the layer renders as `PREMULTIPLIED_ALPHA`, so that opacity
always fades the layer. To write exact sub-unity alpha values into the output (e.g.
punching a hole for an underlay), author them in the content itself (the image's own
pixels, or `color.alpha` for a solid-color layer) and leave `opacity` at 1.0.
`STRAIGHT_ALPHA` names a content *encoding*, and is meaningful for image
content. A solid-color layer's encoding is fixed by the API (`color` is straight
RGBA regardless of `blend_mode`), so for solid-color content `STRAIGHT_ALPHA` is
accepted and composites identically to `PREMULTIPLIED_ALPHA`.
Default: `BlendMode2.REPLACE`.
bool has_blend_mode ()
::fuchsia_ui_composition::wire::ColorRgba & color ()
The color to fill the layer with, as straight (non-premultiplied) RGBA regardless
of `blend_mode`. The compositor performs any conversion needed for rendering.
Default: opaque white (1.0, 1.0, 1.0, 1.0).
bool has_color ()
LayerProperties & operator= (const LayerProperties & other)
Defined at line 2734 of file fidling/gen/sdk/fidl/fuchsia.ui.composition/fuchsia.ui.composition/cpp/fidl/fuchsia.ui.composition/cpp/wire_types.h
void LayerProperties (LayerProperties && other)
Defined at line 2735 of file fidling/gen/sdk/fidl/fuchsia.ui.composition/fuchsia.ui.composition/cpp/fidl/fuchsia.ui.composition/cpp/wire_types.h
LayerProperties & operator= (LayerProperties && other)
Defined at line 2736 of file fidling/gen/sdk/fidl/fuchsia.ui.composition/fuchsia.ui.composition/cpp/fidl/fuchsia.ui.composition/cpp/wire_types.h
::fuchsia_math::wire::RectF & sample_rect ()
Describes the region inside the image to sample from, in unnormalized coordinates
(rect width/height match image width/height).
Default: (0,0,0,0), which is interpreted as the entire image region. A client can
reset to the full image by setting this field to (0,0,0,0).
Must lie within the bounds of the bound image. This is checked during
[`fuchsia.ui.composition/Flatland.Present`], and only for layers whose
`composition_mode` is `IMAGE`, so the order of calls within a batch does not
matter: a rect and an image of matching size may be set in either order, and a
rect set while no image is bound (or while another mode is in effect) is stored
without complaint. A violation at `Present` closes the connection with
`BAD_OPERATION`.
bool has_sample_rect ()
::fuchsia_ui_composition::wire::FlipThenRotate & transform ()
Specifies image transform.
Default: No transformation (identity).
bool has_transform ()
::fidl::VectorView< ::fuchsia_math::wire::RectU> & hint_damage_rects ()
A hint describing the region of the source image that has changed since the last frame.
Specified in the coordinate space of the source image (buffer).
Default: Empty vector (interpreted as the entire sample rect being damaged).
Refer to [`LayerProperties`] for the general safety and performance semantics of hints.
bool has_hint_damage_rects ()
::fidl::VectorView< ::fuchsia_math::wire::RectU> & hint_visible_rects ()
A hint describing the visible region of the layer on the screen.
Specified in the local coordinate space of the Layer (matching `display_rect`).
Default: Empty vector (interpreted as the entire `display_rect` being visible).
Refer to [`LayerProperties`] for the general safety and performance semantics of hints.
bool has_hint_visible_rects ()
::fuchsia_ui_composition::wire::CompositionMode & composition_mode ()
Selects which of the property groups above is in effect; see [`CompositionMode`].
Default: `CompositionMode.INVISIBLE`.
bool has_composition_mode ()
void ~LayerProperties ()
Defined at line 2738 of file fidling/gen/sdk/fidl/fuchsia.ui.composition/fuchsia.ui.composition/cpp/fidl/fuchsia.ui.composition/cpp/wire_types.h
Friends
class WireTableBaseBuilder
class WireTableBaseBuilder