class Layer

Defined at line 33 of file ../../src/ui/scenic/lib/display/internal/layer.h

Manages the state of a single display layer within the `CoordinatorProxy`.

This class maintains a "draft" state, representing pending changes, and an "applied" state,

representing the configuration last known to be successfully applied on the display hardware via

the FIDL `ApplyConfig()` method.

The `Layer` also holds a `LayerEquivalence`, which is a projection of the layer's state used by

`CoordinatorProxy` to determine `CheckConfig()` equivalency.

Workflow:

1. Calls to `Set*()` methods update the `draft_equiv_` and other draft fields

(e.g., `draft_image_`).

2. `CoordinatorProxy` calls `SendDiffsToCoordinator()`. This method compares the current

`draft_equiv_` and `draft_image_` against the `applied_equiv_` and `applied_image_`. It

sends the minimal set of FIDL commands to the `fuchsia.hardware.display.Coordinator` to make

the coordinator's layer state match this `Layer`'s draft state.

3a. *After* a successful `CheckConfig()` and `ApplyConfig()` sequence in `CoordinatorProxy`, the

proxy calls this `Layer`'s `AcceptDraftState()` method to promote the draft state to the

applied state. Or:

3b. If `CheckConfig()` fails, `CoordinatorProxy` calls `ResetDraftState()` to

revert the draft state back to the last known good applied state.

Public Methods

void SetPrimaryConfig (const Extent2 & image_dimensions, uint32_t image_tiling_type)

Corresponds to `fuchsia.hardware.display.Coordinator/SetLayerPrimaryConfig()`.

Modifies the layer's draft state; no FIDL methods are invoked.

Note: calling this clears the image, as done by the coordinator impl.

Defined at line 14 of file ../../src/ui/scenic/lib/display/internal/layer.cc

void SetPrimaryPosition (const RotateFlip & transform, const Rectangle & src, const Rectangle & dst)

Corresponds to `fuchsia.hardware.display.Coordinator/SetLayerPrimaryPosition()`.

Modifies the layer's draft state; no FIDL methods are invoked.

Defined at line 26 of file ../../src/ui/scenic/lib/display/internal/layer.cc

void SetPrimaryAlpha (const BlendMode & blend_mode, float alpha_value)

Corresponds to `fuchsia.hardware.display.Coordinator/SetLayerPrimaryAlpha()`.

Modifies the layer's draft state; no FIDL methods are invoked.

Defined at line 35 of file ../../src/ui/scenic/lib/display/internal/layer.cc

void Layer ()

Defined at line 42 of file ../../src/ui/scenic/lib/display/internal/layer.h

void SetLayerImage (const ImageId & image_id, const EventId & wait_event_id)

Corresponds to `fuchsia.hardware.display.Coordinator/SetLayerPrimaryImage()`.

Modifies the layer's draft state; no FIDL methods are invoked.

Defined at line 44 of file ../../src/ui/scenic/lib/display/internal/layer.cc

void SetColorConfig (const WireColor & color, const Rectangle & display_destination)

Corresponds to `fuchsia.hardware.display.Coordinator/SetLayerColorConfig()`.

Modifies the layer's draft state; no FIDL methods are invoked.

Defined at line 50 of file ../../src/ui/scenic/lib/display/internal/layer.cc

void UnsetImage (const ImageId & image_id)

If either the draft or applied state includes `image_id`, replace with `kInvalidImageId`.

Defined at line 59 of file ../../src/ui/scenic/lib/display/internal/layer.cc

size_t SendDiffsToCoordinator (const LayerId & layer_id, fidl::WireSharedClient<fuchsia_hardware_display::Coordinator> & coordinator)

Compute the diffs between the draft and applied states, and make only the necessary FIDL calls

to make the Coordinator's draft state match this layer's draft state. Returns the number of

FIDL API calls that were sent.

Defined at line 68 of file ../../src/ui/scenic/lib/display/internal/layer.cc

const LayerEquivalence & draft_equiv ()

Defined at line 82 of file ../../src/ui/scenic/lib/display/internal/layer.h

void ResetDraftState ()

Reset all draft state to be identical to the currently-applied state.

Defined at line 82 of file ../../src/ui/scenic/lib/display/internal/layer.cc

void AcceptDraftState ()

Replace the accepted state with the draft state. Afterward, they are identical.

Defined at line 88 of file ../../src/ui/scenic/lib/display/internal/layer.cc

Records