class SoftwareCompositor

Defined at line 65 of file ../../src/graphics/display/testing/software-compositor/software-compositor.h

A compositor using software rendering to fill solid colors and draw images

onto an output image (canvas).

Public Methods

void SoftwareCompositor (const OutputImage & canvas)

The buffer backing `canvas` must outlive the newly created instance.

Defined at line 63 of file ../../src/graphics/display/testing/software-compositor/software-compositor.cc

void ClearCanvas (const PixelData & color, PixelFormat pixel_format)

Clears the canvas by filling a solid `color` of format `pixel_format` on

the whole canvas.

This produces the same result as Vulkan command `vkCmdClearColorImage`.

Defined at line 65 of file ../../src/graphics/display/testing/software-compositor/software-compositor.cc

void CompositeLayers (std::span<const LayerForComposition> image_layers)

Composites all the layers in `image_layers` onto the the canvas using

composition properties specified in each image layer.

Canvas pixels not covered by any image layer in `image_layers` will not

be modified.

Image layers are sorted by z-index in ascending order, i.e. image layer

in the front of the `image_layers` list will be composited first and on the

bottom, the layer in the end will be composited the last and on the top.

For each ImageLayerForComposition, its `composition_properties` must

fulfill the following constraints:

- `alpha_mode` must be kDisable.

- `transform` must be kIdentity.

- the source frame `source_frame` must start at (0, 0) and have the same

size as `input_image`.

- the destination frame `canvas_frame` must fall completely within the

canvas and have the same size as `input_image`.

TODO(https://fxbug.dev/42075534): Supports more composition properties.

TODO(https://fxbug.dev/42080652): Instead of providing a separate ClearCanvas()

command, we should integrate background filling into

CompositeImageLayers().

Defined at line 172 of file ../../src/graphics/display/testing/software-compositor/software-compositor.cc

Records