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
fbl::RefPtr<Image> committed_image ()
Defined at line 59 of file ../../src/graphics/display/drivers/coordinator/layer.h
bool is_skipped ()
Defined at line 61 of file ../../src/graphics/display/drivers/coordinator/layer.h
bool in_use ()
Defined at line 68 of file ../../src/graphics/display/drivers/coordinator/layer.h
const display::ImageMetadata & draft_image_metadata ()
Defined at line 73 of file ../../src/graphics/display/drivers/coordinator/layer.h
bool is_primary ()
True iff the draft config was set up by SetPrimaryConfig() with non-empty
image metadata. Color layers and layers that were never configured have
empty image metadata.
This checks the image metadata, not the image source, because only
SetPrimaryConfig() changes the metadata. SetPrimaryPosition() can set an
empty image source on a primary layer, and that layer must stay primary:
the FIDL makes an empty image source an invalid config, not an illegal
call.
Defined at line 86 of file ../../src/graphics/display/drivers/coordinator/layer.h
void Layer (display::LayerId id)
`controller` must be non-null.
Defined at line 88 of file ../../src/graphics/display/drivers/coordinator/layer.cc
void ~Layer ()
Defined at line 99 of file ../../src/graphics/display/drivers/coordinator/layer.cc
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 104 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 120 of file ../../src/graphics/display/drivers/coordinator/layer.cc
void CommitChanges ()
Set the committed layer configuration to the draft layer configuration.
Defined at line 145 of file ../../src/graphics/display/drivers/coordinator/layer.cc
const display::DriverLayer & committed_driver_layer_config ()
Defined at line 156 of file ../../src/graphics/display/drivers/coordinator/layer.h
void DiscardChanges ()
Set the draft layer configuration to the committed layer configuration.
This discards any changes in the draft layer configuration.
Defined at line 170 of file ../../src/graphics/display/drivers/coordinator/layer.cc
bool CleanUpAllImages ()
Removes references to all Images associated with this Layer.
Returns true if the committed config has been affected.
Defined at line 179 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 committed config has been affected.
Defined at line 187 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 207 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 200 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 248 of file ../../src/graphics/display/drivers/coordinator/layer.cc
void SetPrimaryConfig (display::ImageMetadata image_metadata)
Defined at line 257 of file ../../src/graphics/display/drivers/coordinator/layer.cc
void SetPrimaryPosition (display::CoordinateTransformationimage_source_transformation,display::Rectangleimage_source,display::Rectangledisplay_destination)
Defined at line 284 of file ../../src/graphics/display/drivers/coordinator/layer.cc
void SetPrimaryAlpha (display::AlphaMode alpha_mode, float alpha_coefficient)
Defined at line 301 of file ../../src/graphics/display/drivers/coordinator/layer.cc
void SetColorConfig (display::Color color, display::Rectangle display_destination)
Defined at line 316 of file ../../src/graphics/display/drivers/coordinator/layer.cc
void SetImage (fbl::RefPtr<Image> image_id, display::EventId wait_event_id)
Defined at line 342 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 347 of file ../../src/graphics/display/drivers/coordinator/layer.cc
bool HasWaitingImages ()
Returns true if the layer has any waiting images. An image transitions from "draft" to
"waiting" (in the context of a specific layer) when that layer appears in a committed config.
Defined at line 349 of file ../../src/graphics/display/drivers/coordinator/layer.cc
Friends
class LayerTest
class Client