class Renderer

Defined at line 31 of file ../../src/ui/scenic/lib/flatland/renderer/renderer.h

This is the main renderer interface used by the Flatland System. Since Flatland is

agnostic to the implementation of the renderer, it is declared here as a virtual

interface, whose concrete implementation is to be injected into Flatland.

Public Methods

void Render (const allocation::ImageMetadata & render_target, const std::vector<ImageRect> & rectangles, const std::vector<allocation::ImageMetadata> & images, const RenderArgs & render_args)

This function is responsible for rendering a single batch of Flatland rectangles into a

render target. This function is designed to be called on the render thread, not on any

Flatland instance thread. The specific behavior may differ depending on the specific subclass

implementation, which may also be a null renderer.

This function assumes that clients have already validated their input data by comparing it

against the BufferCollectionMetadata received from calling |Validate| above. This function

will abort if invalid data has been passed in or if |Validate| has never been called.

The size of the arrays |rectangles| and |images| must match or else this function will CHECK.

Entries in each array with the same index will be used together in rendering.

The final argument |render_args| contains optional arguments that affect rendering. See the

doc comments on each field of |struct RenderArgs|.

If any of the |images| use protected memory but the |render_target| is not using protected

memory, the renderer replaces protected content with black solid color.

void SetColorConversionValues (const fidl::Array<float, 9> & coefficients, const fidl::Array<float, 3> & preoffsets, const fidl::Array<float, 3> & postoffsets)

Values needed to adjust the color of the framebuffer as a postprocessing effect.

fuchsia_images2::PixelFormat ChoosePreferredRenderTargetFormat (const std::vector<fuchsia_images2::PixelFormat> & available_formats)

Returns the pixel format that the renderer prefers to use for render targets.

TODO(https://fxbug.dev/42065293): Rename this to reflect that it's for a render target.

bool SupportsRenderInProtected ()

Returns true if the renderer is capable of switching to protected mode.

bool RequiresRenderInProtected (const std::vector<allocation::ImageMetadata> & images)

Returns true if the renderer has to switch to protected mode to render the given |images|. If

true, the caller is responsible for providing a render target using the protected memory when

calling Render().

TODO(https://fxbug.dev/42062402): The caller should be able to figure out if the images are

protected. Remove this after moving to prunable tokens in the callers.

void ~Renderer ()

Defined at line 33 of file ../../src/ui/scenic/lib/flatland/renderer/renderer.h

void WarmPipelineCache ()

Implementations which use Vulkan or similar should implement this by generating render passes

and pipelines, so that there is no jank due to lazily generating them later.

Defined at line 94 of file ../../src/ui/scenic/lib/flatland/renderer/renderer.h

Records