class Engine

Defined at line 39 of file ../../src/ui/scenic/lib/flatland/engine/engine.h

Engine is responsible for building a display list for DisplayCompositor, to insulate it from

needing to know anything about the Flatland scene graph.

Public Methods

void Engine (std::shared_ptr<flatland::DisplayCompositor> flatland_compositor, std::shared_ptr<flatland::FlatlandPresenterImpl> flatland_presenter, std::shared_ptr<flatland::UberStructSystem> uber_struct_system, std::shared_ptr<flatland::LinkSystem> link_system, inspect::Node inspect_node, GetRootTransformFunc get_root_transform)

Defined at line 31 of file ../../src/ui/scenic/lib/flatland/engine/engine.cc

void ~Engine ()

Defined at line 46 of file ../../src/ui/scenic/lib/flatland/engine/engine.h

void RenderScheduledFrame (uint64_t frame_number, zx::time presentation_time, const FlatlandDisplay & display, scheduling::FramePresentedCallback callback)

Orchestrates the generation and submission of a frame to the `DisplayCompositor`.

This updates scene topology and link watchers, culls invisible content, and

handles first-frame startup logic to avoid driving the display before content

is ready.

Defined at line 78 of file ../../src/ui/scenic/lib/flatland/engine/engine.cc

void UpdateLinkWatchersAfterViewTreePublished ()

Dispatches updated layout information (coordinate transforms, view dimensions,

device pixel ratio, etc.) to layout observers and link watchers based on the

current frame's scene state.

CRITICAL: This must be called *after* the new ViewTree snapshot has been fully

updated and published (e.g. in `UpdateSnapshot()`), but *before* the frame's scene

state is cleared by `CleanUpFrame()`. This ensures layout observers do not query

or receive layout updates against a stale ViewTree snapshot.

Defined at line 194 of file ../../src/ui/scenic/lib/flatland/engine/engine.cc

void CleanUpFrame ()

Resets internal state to prepare for the next frame.

This completes the frame cycle; it must be called after every invocation of

`RenderScheduledFrame()` or `SkipRender()`. Attempting to render a new

frame without cleaning up the previous one will trigger a DCHECK.

Defined at line 206 of file ../../src/ui/scenic/lib/flatland/engine/engine.cc

view_tree::GeneratedSubtreeSnapshot GenerateViewTreeSnapshot (const TransformHandle & root_transform)

Snapshots the current Flatland content tree rooted at |root_transform|. |root_transform| is set

from the root transform of the display returned from

|FlatlandManager::GetPrimaryFlatlandDisplayForRendering|.

Defined at line 224 of file ../../src/ui/scenic/lib/flatland/engine/engine.cc

Renderables GetRenderables (const FlatlandDisplay & display)

Returns all renderables reachable from the display's root transform.

Defined at line 254 of file ../../src/ui/scenic/lib/flatland/engine/engine.cc

void SkipRender (scheduling::FramePresentedCallback callback, bool rotate_scene_state)

Signal all release fences and skip rendering.

`rotate_scene_state == true` is probably what you want, unless you know you don't.

Defined at line 332 of file ../../src/ui/scenic/lib/flatland/engine/engine.cc

void AddDisplay (display::Display & display)

Defined at line 352 of file ../../src/ui/scenic/lib/flatland/engine/engine.cc