struct LayerObject

Defined at line 73 of file ../../src/ui/scenic/lib/flatland/flatland_session_types.h

The session-side state of a single Flatland2 layer.

Unlike the snapshot type (`UberStructLayer`), which carries only the active composition

mode's properties, a `LayerObject` holds the properties of every mode simultaneously,

plus a `mode` discriminant saying which of them is in effect. This is deliberate:

layer properties are sticky. Switching a layer from image mode to solid-color mode and

back loses nothing; `image_mode` keeps its values while `solid_color_mode` is in

effect, and vice versa. The shape mirrors the Flatland2 FIDL API (a single

`LayerProperties` table holding the union of every mode's fields) and the Composer3

HAL's `LayerCommand`, whose property bag likewise persists across composition-type

changes.

Which fields are in effect is determined by `mode` alone:

- `common` is always in effect.

- `image_mode` is in effect only when `mode == kImage`.

- `solid_color_mode` is in effect only when `mode == kSolidColor`.

- a `kInvisible` layer has no content: it keeps its place in any layer stack that

references it, but contributes nothing to the frame. (This is a property of the

layer itself; a layer in any mode can also contribute nothing via a zero-sized

`common.display_rect` or zero opacity.)

At `Present()`, `common` and the active mode's properties are copied into an

`UberStructLayer`; inactive-mode properties and session-lifetime state (`ref_count`)

stay behind.

Public Members

CommonProperties common
ImageModeProperties image_mode
SolidColorModeProperties solid_color_mode
Mode mode
bool sample_rect_is_full_image
vector hint_damage_rects
vector hint_visible_rects
int32_t ref_count

Enumerations

enum class Mode : uint8_t
Name Value
kInvisible 0
kImage 1
kSolidColor 2

Defined at line 74 of file ../../src/ui/scenic/lib/flatland/flatland_session_types.h