class Layer

Defined at line 47 of file ../../src/graphics/display/drivers/coordinator/layer.h

Manages Client-created Layer configurations.

Instances are not thread-safe. Concurrent access must be synchronized

externally.

Public Methods

void Layer (const Layer & )

Defined at line 52 of file ../../src/graphics/display/drivers/coordinator/layer.h

void Layer (Layer && )

Defined at line 53 of file ../../src/graphics/display/drivers/coordinator/layer.h

Layer & operator= (const Layer & )

Defined at line 54 of file ../../src/graphics/display/drivers/coordinator/layer.h

Layer & operator= (Layer && )

Defined at line 55 of file ../../src/graphics/display/drivers/coordinator/layer.h

void Layer (display::LayerId id)

`controller` must be non-null.

Defined at line 59 of file ../../src/graphics/display/drivers/coordinator/layer.cc

fbl::RefPtr<Image> applied_image ()

The most recent image sent to the display engine for this layer.

Defined at line 60 of file ../../src/graphics/display/drivers/coordinator/layer.h

bool is_skipped ()

Defined at line 62 of file ../../src/graphics/display/drivers/coordinator/layer.h

bool in_use ()

Defined at line 69 of file ../../src/graphics/display/drivers/coordinator/layer.h

void ~Layer ()

Defined at line 70 of file ../../src/graphics/display/drivers/coordinator/layer.cc

const display::ImageMetadata & draft_image_metadata ()

Defined at line 74 of file ../../src/graphics/display/drivers/coordinator/layer.h

bool ResolveDraftLayerProperties ()

If the layer properties were changed in the draft configuration, this

retires all images as they are invalidated with layer properties change.

Defined at line 75 of file ../../src/graphics/display/drivers/coordinator/layer.cc

bool ResolveDraftImage (FenceCollection * fence, display::ConfigStamp stamp)

This sets up the fence and config stamp for pending images on this layer.

- If the layer image has a fence to wait before presentation, this prepares

the new fence and start async waiting for the fence.

- The layer's latest pending (waiting) image will be associated with the

client configuration |stamp|, as it reflects the latest configuration

state; this will overwrite all the previous stamp states for this image.

The stamp will be used later when display core integrates stamps of all

layers to determine the current frame state.

Returns false if there were any errors.

Defined at line 91 of file ../../src/graphics/display/drivers/coordinator/layer.cc

void ApplyChanges ()

Set the applied layer configuration to the draft layer configuration.

Defined at line 114 of file ../../src/graphics/display/drivers/coordinator/layer.cc

void DiscardChanges ()

Set the draft layer configuration to the applied layer configuration.

This discards any changes in the draft layer configuration.

Defined at line 139 of file ../../src/graphics/display/drivers/coordinator/layer.cc

const display::DriverLayer & applied_driver_layer_config ()

Defined at line 146 of file ../../src/graphics/display/drivers/coordinator/layer.h

bool CleanUpAllImages ()

Removes references to all Images associated with this Layer.

Returns true if the applied config has been affected.

Defined at line 148 of file ../../src/graphics/display/drivers/coordinator/layer.cc

bool CleanUpImage (const Image & image)

Removes references to the provided Image. `image` must be valid.

Returns true if the applied config has been affected.

Defined at line 156 of file ../../src/graphics/display/drivers/coordinator/layer.cc

bool ActivateLatestReadyImage ()

If a new image is available, retire applied_image() and other pending images. Returns false if

no images were ready.

Defined at line 176 of file ../../src/graphics/display/drivers/coordinator/layer.cc

std::optional<display::ConfigStamp> GetCurrentClientConfigStamp ()

Get the stamp of configuration that is associated (at ResolveDraftImage)

with the image that is currently being displayed on the device.

If no image is being displayed on this layer, returns nullopt.

Defined at line 169 of file ../../src/graphics/display/drivers/coordinator/layer.cc

bool AppendToConfigLayerList (fbl::DoublyLinkedList<LayerNode *> & config_layer_list)

Adds the layer's draft config to a display configuration's layer list.

Returns true if the method succeeds. The layer's draft config is be at

the end of the display configuration's list of layer configs.

Returns false if the layer's draft config is already in a display

configuration's layer list. No changes are made.

Defined at line 203 of file ../../src/graphics/display/drivers/coordinator/layer.cc

void SetPrimaryConfig (display::ImageMetadata image_metadata)

Defined at line 212 of file ../../src/graphics/display/drivers/coordinator/layer.cc

void SetPrimaryPosition (display::CoordinateTransformation image_source_transformation, display::Rectangle image_source, display::Rectangle display_destination)

Defined at line 236 of file ../../src/graphics/display/drivers/coordinator/layer.cc

void SetPrimaryAlpha (display::AlphaMode alpha_mode, float alpha_coefficient)

Defined at line 253 of file ../../src/graphics/display/drivers/coordinator/layer.cc

void SetColorConfig (display::Color color, display::Rectangle display_destination)

Defined at line 268 of file ../../src/graphics/display/drivers/coordinator/layer.cc

void SetImage (fbl::RefPtr<Image> image_id, display::EventId wait_event_id)

Defined at line 289 of file ../../src/graphics/display/drivers/coordinator/layer.cc

bool MarkFenceReady (Fence & fence)

Called on all waiting images when any fence is signaled.

Returns true if an image is ready for use by the display engine.

Defined at line 294 of file ../../src/graphics/display/drivers/coordinator/layer.cc

bool HasWaitingImages ()

Returns true if the layer has any waiting images. An image transitions from "pending" to

"waiting" (in the context of a specific layer) when that layer appears in an applied config.

Defined at line 296 of file ../../src/graphics/display/drivers/coordinator/layer.cc

Friends

class LayerTest
class Client