Skip to main content

Module host_surface

Module host_surface 

Source
Expand description

The surface the host gives the application, and what the application may ask of it.

On the web that is the canvas inside its page; on desktop the window’s client area; on mobile the activity’s content view. An application that wants to lay out against it — or, on a host that allows it, ask for a different size — reads observable state here instead of reaching for a platform API and a resize callback of its own.

Structs§

HostSurfaceObserver
Keeps a host-surface observer registered until it is dropped.
HostSurfaceSize
The size of the host surface, in logical pixels, with the scale the host renders it at.

Enums§

ResizeRefused
Why a resize request was refused.

Traits§

HostSurface
What an application may ask of the host’s surface.

Functions§

clear_platform_host_surface
Removes the installed host surface (tests and teardown).
host_surface
The installed host surface, or one that accepts no resize requests.
host_surface_can_resize
Whether this host lets the application choose its surface size.
host_surface_size
The size the host last reported.
observe_host_surface_size
Registers observer for host-surface size changes. Applications collect rememberHostSurfaceSize instead of calling this.
publish_host_surface_size
Publishes a new host-surface size. Platform backends call this whenever the host resizes the surface.
rememberHostSurfaceSize
The host surface’s size, observed for as long as this call stays in the composition.
request_host_surface_size
Asks the host for a different surface size.
set_platform_host_surface
Installs the platform host surface.

Type Aliases§

HostSurfaceRef
Shared handle to a HostSurface.