fuchsia.ui.gfx

PROTOCOLS

SnapshotCallbackDEPRECATED

Defined in fuchsia.ui.gfx/commands.fidl

OnData

Request

NameType
data fuchsia.mem/Buffer

PoseBufferProvider

Defined in fuchsia.ui.gfx/pose_buffer_provider.fidl

A minimal fidl interface to allow sourcing the contents of a PoseBuffer from another service.

SetPoseBuffer

Sets the PoseBuffer and the parameters PoseBufferProvider will use to fill that PoseBuffer. Setting this when it is already set will replace the previously set parameters with the new parameters, which will release the provider's reference to the buffer.

Request

NameType
buffer handle<vmo>
num_entries uint32
base_time int64
time_interval uint64

STRUCTS

CreateResourceCmd

Defined in fuchsia.ui.gfx/commands.fidl

Instructs the compositor to create the specified Resource, and to register it in a table so that it can be referenced by subsequent commands.

NameTypeDescriptionDefault
id uint32

An ID that is currently not used within the session.

No default
resource ResourceArgs No default

ReleaseResourceCmd

Defined in fuchsia.ui.gfx/commands.fidl

Releases the client's reference to the resource; it is then illegal to use the ID in subsequent Commands. Other references to the resource may exist, so releasing the resource does not result in its immediate destruction; it is only destroyed once the last reference is released. For example, the resource may be required to render an in-progress frame, or it may be referred to by another resource). However, the ID will be immediately unregistered, and may be reused to create a new resource.

NameTypeDescriptionDefault
id uint32

ID of the resource to be dereferenced.

No default

ExportResourceCmdDeprecated

Defined in fuchsia.ui.gfx/commands.fidl

Create an external reference to the specified resource, which can then be imported into another Session by passing a handle to token's peer to ImportResourceCmd; see that comment for more details.

The importing client is typically in a different process than the exporter. No specific mechanism is provided for transferring a token from an exporter to an importer; collaborators may choose any out-of-band API they wish to do so.

NameTypeDescriptionDefault
id uint32 No default
token handle<eventpair> No default

ImportResourceCmdDeprecated

Defined in fuchsia.ui.gfx/commands.fidl

Import a resource that was exported via ExportResourceCmd(). token is a handle to the eventpair peer that was used to export the resource, and spec describes the type of the imported resource, and the commands which can legally be applied to it. Afterward, id can be used to refer to the resource in an Command, similarly (but not identically: see below) to a resource that was created in the session. For example, you can add children to an imported EntityNode via AddChildCmd.

However, note that the importer does not gain full access to the imported resource, but rather to an attenuated subset of its capabilities. For example, you cannot use a DetachCmd to detach an imported EntityNode from its parent.

Unlike ExportResourceCmd, there is no configurable timeout. There is an expectation that the exported resource will become available in a short amount of time. TODO: this needs elaboration... e.g. we might notify via the SessionListener when we know that the link will never be made (e.g. if the peer of the import token is destroyed).

NameTypeDescriptionDefault
id uint32 No default
token handle<eventpair> No default
spec ImportSpec No default

SetTagCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets/clears a node's tag value.

A session can apply a tag value to any node to which it has access, including imported nodes. These tags are private to the session and cannot be read or modified by other sessions. When multiple sessions import the same node, each session will only observe its own tag values.

Hit test results for a session only include nodes which the session has tagged with a non-zero value. Therefore a session can use tag values to associate nodes with their functional purpose when picked.

Constraints:

  • node_id refs a Node.
  • tag_value is the tag value to assign, or 0 to remove the tag.
NameTypeDescriptionDefault
node_id uint32 No default
tag_value uint32 No default

DetachCmd

Defined in fuchsia.ui.gfx/commands.fidl

Detaches a parentable object from its parent (e.g. a node from a parent node, or a layer from a layer stack). It is illegal to apply this command to a non-parentable object. No-op if the target object currently has no parent.

Constraints:

  • id refs a parentable object

Discussion: For nodes, this command will detach a node from its parent, regardless of whether it is a part or a child of its parent.

NameTypeDescriptionDefault
id uint32 No default

SetTranslationCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a Resource's (typically a Node's) translation.

Constraints:

  • id refs a Resource with the has_transform characteristic.
NameTypeDescriptionDefault
id uint32 No default
value Vector3Value No default

SetScaleCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a Resource's (typically a Node's) scale.

Constraints:

  • id refs a Resource with the has_transform characteristic.
NameTypeDescriptionDefault
id uint32 No default
value Vector3Value No default

SetRotationCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a Resource's (typically a Node's) rotation.

Constraints:

  • id refs a Resource with the has_transform characteristic.
NameTypeDescriptionDefault
id uint32 No default
value QuaternionValue No default

SetAnchorCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a Resource's (typically a Node's) anchor point.

Constraints:

  • id refs a Resource with the has_transform characteristic.
NameTypeDescriptionDefault
id uint32 No default
value Vector3Value No default

SetSizeCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets an object's size.

Constraints:

  • id refs a resizeable object.
  • some objects that support this command may have additional constraints (e.g. in some cases depth must be zero).
NameTypeDescriptionDefault
id uint32 No default
value Vector2Value No default

SetOpacityCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a node's opacity.

Constraints:

  • node_id refs a Node with the has_opacity characteristic.
  • opacity is in the range [0, 1].
NameTypeDescriptionDefault
node_id uint32 No default
opacity float32 No default

SendSizeChangeHintCmdHACK

Defined in fuchsia.ui.gfx/commands.fidl

Sends a hint about a pending size change to the given node and all nodes below. This is generally sent before an animation.

width_change_factor and height_change_factor is how much bigger or smaller the item is expected to be in the near future. This one number encapsulate both changes in scale, as well as changes to layout width and height.

NameTypeDescriptionDefault
node_id uint32 No default
width_change_factor float32 No default
height_change_factor float32 No default

AddChildCmd

Defined in fuchsia.ui.gfx/commands.fidl

Add a node as a child to another node.

Constraints:

  • id refs a Node with the has_children characteristic.
  • child_id refs any Node.

Discussion: The child node is first removed from its existing parent, as if DetachCmd was applied first.

NameTypeDescriptionDefault
node_id uint32 No default
child_id uint32 No default

AddPartCmd

Defined in fuchsia.ui.gfx/commands.fidl

Add a node as a part of another node. The implications of being a part rather than a child differ based on the type of the part. However, one implication is constant: removing all of a node's children (e.g. via DetachChildrenCmd) does not affect its parts. This is similar to the "shadow DOM" in a web browser: the controls of a

Constraints:

  • id refs a Node with the has_parts characteristic.
  • part_id refs any Node.

Discussion: The part node is first removed from its existing parent, as if DetachCmd was applied first.

NameTypeDescriptionDefault
node_id uint32 No default
part_id uint32 No default

DetachChildrenCmd

Defined in fuchsia.ui.gfx/commands.fidl

Detaches all of a node's children (but not its parts).

NameTypeDescriptionDefault
node_id uint32 No default

SetShapeCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets/clears a node's shape.

Constraints:

  • node_id refs a Node with the has_shape characteristic.
  • shape_id refs a Shape, or nothing.
  • if this command causes the target to have both a Shape and a Material, then these must be compatible with each other (see README.md regarding "Shape/Material Compatibility").

Discussion: In order to be painted, a node requires both a Shape and a Material. Without a material, a node can still participate in hit-testing and clipping. Without a shape, a node cannot do any of the above.

NameTypeDescriptionDefault
node_id uint32 No default
shape_id uint32 No default

SetMaterialCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets/clears a node's material.

Constraints:

  • node_id refs a Node with the has_material characteristic.
  • material_id refs a Material, or nothing.
  • if this command causes the target to have both a Shape and a Material, then these must be compatible with each other (see README.md regarding "Shape/Material Compatibility").

Discussion: In order to be painted, a node requires both a Shape and a Material. Without a material, a node can still participate in hit-testing and clipping. Without a shape, a node cannot do any of the above.

NameTypeDescriptionDefault
node_id uint32 No default
material_id uint32 No default

SetClipCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets/clears a node's clip. DEPRECATED: use SetClipPlanesCmd.

Constraints:

  • node_id refs a Node with the has_clip characteristic.
  • clip_id a Node with the is_clip characteristic, or nothing. If the referenced node is not rooted, then it will have no effect (since its full world-transform cannot be determined).
  • clip_to_self If false, children are only clipped to the region specified by clip_id. If true, children are additionally clipped to the node's shape (as determined by its ShapeNode parts).

Discussion: If a node has a clip, it will be applied to both the parts and the children of the node. Under some circumstances (TBD), a clip will not be applicable to a node; in such cases it will be as though no clip has been specified for the node.

NameTypeDescriptionDefault
node_id uint32 No default
clip_id uint32 No default
clip_to_self bool No default

SetHitTestBehaviorCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a node's hit test behavior.

Discussion: By default, hit testing is performed on the node's content, its parts, and its children.

NameTypeDescriptionDefault
node_id uint32 No default
hit_test_behavior HitTestBehavior No default

SetViewPropertiesCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets the properties for a ViewHolder's attached View.

Constraints:

  • view_holder_id refs a ViewHolder.
NameTypeDescriptionDefault
view_holder_id uint32 No default
properties ViewProperties No default

TakeSnapshotCmdDEPRECATED

Defined in fuchsia.ui.gfx/commands.fidl

NameTypeDescriptionDefault
node_id uint32 No default
callback SnapshotCallbackDEPRECATED No default

SetCameraCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a renderer's camera.

Constraints:

  • renderer_id refs a Renderer.
  • camera_id refs a Camera, or stops rendering by passing zero.
  • matrix is a value or variable of type kMatrix4x4.
NameTypeDescriptionDefault
renderer_id uint32 No default
camera_id uint32 No default

SetCameraTransformCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a camera's view matrix. This operation can be applied to both Cameras and StereoCameras.

Constraints:

  • camera_id refs a Camera.
  • eye_position is the position of the eye.
  • eye_look_at is the point is the scene the that eye is pointed at.
  • eye_up defines the camera's "up" vector.
NameTypeDescriptionDefault
camera_id uint32 No default
eye_position Vector3Value No default
eye_look_at Vector3Value No default
eye_up Vector3Value No default

SetCameraProjectionCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a camera's projection matrix. This operation cannot be applied to a StereoCamera.

Constraints:

  • camera_id refs a Camera that is not a StereoCamera.
  • fovy is the Y-axis field of view, in radians.

NOTE: A default orthographic projection is specified by setting fovy to zero. In this case, the camera transform is ignored.

NameTypeDescriptionDefault
camera_id uint32 No default
fovy FloatValue No default

SetStereoCameraProjectionCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a StereoCamera's projection matrices. This operation can only be applied to a StereoCamera.

Constraints:

  • camera_id refs a StereoCamera.
  • left_projection is the projection matrix for the left eye.
  • right_projection is the projection matrix for the right eye.

These projection matrices may also contain a transform in camera space for their eye if needed.

NameTypeDescriptionDefault
camera_id uint32 No default
left_projection Matrix4Value No default
right_projection Matrix4Value No default

SetCameraClipSpaceTransformCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a camera's 2D clip-space transform.

Constraints:

  • camera_id refs a Camera.
  • translation is the desired translation, in Vulkan NDC.
  • scale is the scale factor to apply on the x/y plane before translation.
NameTypeDescriptionDefault
camera_id uint32 No default
translation vec2 No default
scale float32 No default

SetCameraPoseBufferCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets the "pose buffer" for the camera identified by camera_id. This operation can be applied to both Cameras and StereoCameras.

This will override any position and rotation set for the camera and will make it take its position and rotation from the pose buffer each frame based on the presentation time for that frame.

A pose buffer represents a ring buffer of poses for a fixed number of time points in the future. Each entry in the buffer identified by buffer_id is a quaternion and a position layed out as follows:

struct Pose { // Quaternion float32 a; float32 b; float32 c; float32 d;

// Position float32 x; float32 y; float32 z;

// Reserved/Padding byte[4] reserved; }

The buffer can be thought of as a packed array of num_entries Pose structs and is required to be at least num_entries * sizeof(Pose) bytes.

The quaternions and positions are specified in the space of the camera's parent node.

base_time is a base time point expressed in nanoseconds in the CLOCK_MONOTONIC timebase and time_interval is the time in nanoseconds between entries in the buffer. base_time must be in the past.

For a given point in time t expressed in nanoseconds in the CLOCK_MONOTONIC timebase the index of the corresponding pose in the pose buffer can be computed as follows:

index(t) = ((t - base_time) / time_interval) % num_entries

poses[index(t)] is valid for t over the time interval (t - time_interval, t] and should be expected to updated continuously without synchronization for the duration of that interval. If a single pose value is needed for multiple non-atomic operations a value should be latched and stored outside the pose buffer.

Because the poses are not protected by any synchronization primitives it is possible that when a pose is latched it will be only partially updated, and the pose being read will contain some components from the pose before it is updated and some components from the updated pose. The safety of using these "torn" poses relies on two things:

  1. Sequential poses written to poses[index(t)] are very similar to each other numerically, so that if some components are taken from the first and some are taken from another the result is numerically similar to both

  2. The space of positions and quaternions is locally flat at the scale of changes between sequential updates, which guarantees that two poses which are numerically similar also represent semantically similar poses (i.e. there are no discontinuities which will cause a small numerical change in the position or quaterninon to cause a large change in the encoded pose) For positions this is guaranteed because Scenic uses a Euclidean 3-space which is globally flat and for quaternions this is guaranteed because quaternions encode rotation as points on a unit 4-sphere, and spheres are locally flat. For more details on the encoding of rotations in quaterions see https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

This commanderation is intended for late latching camera pose to support low-latency motion-tracked rendering.

NameTypeDescriptionDefault
camera_id uint32 No default
buffer_id uint32 No default
num_entries uint32 No default
base_time int64 No default
time_interval uint64 No default

SetLightColorCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets the color of the Light identified by light_id.

NameTypeDescriptionDefault
light_id uint32 No default
color ColorRgbValue No default

SetLightDirectionCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets the direction of the DirectionalLight identified by light_id.

NameTypeDescriptionDefault
light_id uint32 No default
direction Vector3Value No default

AddLightCmd

Defined in fuchsia.ui.gfx/commands.fidl

DEPRECATED Adds the light specified by light_id specified by light_id to the scene identified by scene_id.

NameTypeDescriptionDefault
scene_id uint32 No default
light_id uint32 No default

DetachLightCmd

Defined in fuchsia.ui.gfx/commands.fidl

Detach the light specified by light_id from the scene that it is attached to, if any.

NameTypeDescriptionDefault
light_id uint32 No default

DetachLightsCmd

Defined in fuchsia.ui.gfx/commands.fidl

Detach all lights from the scene specified by scene_id.

NameTypeDescriptionDefault
scene_id uint32 No default

SetTextureCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets/clears a material's texture.

Constraints:

  • material_id refs a Material.
  • texture_id refs a Image, ImagePipe, or nothing.

If no texture is provided (i.e. texture_id is zero), a solid color is used. If a texture is provided, then the value sampled from the texture is multiplied by the color.

NameTypeDescriptionDefault
material_id uint32 No default
texture_id uint32 No default

SetColorCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a material's color.

Constraints:

  • material_id refs a Material.

If a texture is set on the material, then the value sampled from the texture is multiplied by the color.

NameTypeDescriptionDefault
material_id uint32 No default
color ColorRgbaValue No default

MeshVertexFormat

Defined in fuchsia.ui.gfx/commands.fidl

NameTypeDescriptionDefault
position_type ValueType

kVector2 or kVector3.

No default
normal_type ValueType

kVector2 or kVector3 (must match position_type), or kNone.

No default
tex_coord_type ValueType

kVector2 or kNone.

No default

BindMeshBuffersCmd

Defined in fuchsia.ui.gfx/commands.fidl

NameTypeDescriptionDefault
mesh_id uint32 No default
index_buffer_id uint32 No default
index_format MeshIndexFormat No default
index_offset uint64 No default
index_count uint32 No default
vertex_buffer_id uint32 No default
vertex_format MeshVertexFormat No default
vertex_offset uint64 No default
vertex_count uint32 No default
bounding_box BoundingBox No default

AddLayerCmd

Defined in fuchsia.ui.gfx/commands.fidl

Add a layer to a layer stack. Constraints:

  • layer_stack_id refs a LayerStack.
  • layer_id refs a Layer.
  • The layer must not already belong to a different stack; it must first be detached.
NameTypeDescriptionDefault
layer_stack_id uint32 No default
layer_id uint32 No default

RemoveLayerCmd

Defined in fuchsia.ui.gfx/commands.fidl

Remove a layer from a layer stack. Constraints:

  • layer_stack_id refs a LayerStack.
  • layer_id refs a Layer.
  • The layer must belong to this stack.
NameTypeDescriptionDefault
layer_stack_id uint32 No default
layer_id uint32 No default

RemoveAllLayersCmd

Defined in fuchsia.ui.gfx/commands.fidl

Remove all layers from a layer stack. Constraints

  • layer_stack_id refs a LayerStack.
NameTypeDescriptionDefault
layer_stack_id uint32 No default

SetLayerStackCmd

Defined in fuchsia.ui.gfx/commands.fidl

Set a compositor's layer stack, replacing the current stack (if any). Constraints:

  • compositor_id refs a DisplayCompositor or ImagePipeCompositor.
  • layer_stack_id refs a LayerStack.
NameTypeDescriptionDefault
compositor_id uint32 No default
layer_stack_id uint32 No default

SetRendererCmd

Defined in fuchsia.ui.gfx/commands.fidl

Set a layer's renderer, replacing the current renderer (if any). Constraints:

  • layer_id refs a Layer.
  • renderer_id refs a Renderer.
NameTypeDescriptionDefault
layer_id uint32 No default
renderer_id uint32 No default

SetRendererParamCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets a parameter that affects how a renderer renders a scene.

renderer_id refs the Renderer that is being modified. param describes the parameter that should be set, and to what.

NameTypeDescriptionDefault
renderer_id uint32 No default
param RendererParam No default

SetEventMaskCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets which events a resource should deliver to the session listener. This command replaces any prior event mask for the resource.

The initial event mask for a resource is zero, meaning no events are reported.

Constraints:

  • resource_id is a valid resource id
  • event_mask is zero or a combination of k*EventMask bits OR'ed together.
NameTypeDescriptionDefault
id uint32 No default
event_mask uint32 No default

SetLabelCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets/clears a label to help developers identify the purpose of the resource when using diagnostic tools.

The label serves no functional purpose in the scene graph. It exists only to help developers understand its structure. The scene manager may truncate or discard labels at will.

Constraints:

  • The label's maximum length is kLabelMaxLength characters.
  • Setting the label to an empty string clears it.
NameTypeDescriptionDefault
id uint32 No default
label string No default

SetDisableClippingCmd

Defined in fuchsia.ui.gfx/commands.fidl

Set whether clipping should be disabled for the specified renderer. For a newly-created renderer, clipping will NOT be disabled (i.e. it will be enabled).

NOTE: this disables visual clipping only; objects are still clipped for the purposes of hit-testing.

renderer_id refs the target renderer. disable_clipping specifies whether the clipping should be disabled.

NameTypeDescriptionDefault
renderer_id uint32 No default
disable_clipping bool No default

SetImportFocusCmdDEPRECATED

Defined in fuchsia.ui.gfx/commands.fidl

NameTypeDescriptionDefault

SetClipPlanesCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets the list of clip planes that apply to a Node and all of its children. Replaces the list set by any previous SetClipPlanesCmd.

  • node_id refs a Node with the has_clip characteristic.
  • clip_planes is the new list of oriented clip planes.
NameTypeDescriptionDefault
node_id uint32 No default
clip_planes vector<Plane3> No default

SetPointLightPositionCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets the position of the PointLight identified by light_id.

NameTypeDescriptionDefault
light_id uint32 No default
position Vector3Value No default

SetPointLightFalloffCmd

Defined in fuchsia.ui.gfx/commands.fidl

Sets the falloff factor of the PointLight identified by light_id. A value of 1.0 corresponds to the physically-based "inverse-square law" (see Wikipedia). Other values can be used for artistic effect, e.g. a value of 0.0 means that the radiance of a surface is not dependant on its distance from the light.

NameTypeDescriptionDefault
light_id uint32 No default
falloff FloatValue No default

SceneAddAmbientLightCmd

Defined in fuchsia.ui.gfx/commands.fidl

Adds the light specified by light_id specified by light_id to the scene identified by scene_id.

NameTypeDescriptionDefault
scene_id uint32 No default
light_id uint32 No default

SceneAddDirectionalLightCmd

Defined in fuchsia.ui.gfx/commands.fidl

Adds the light specified by light_id specified by light_id to the scene identified by scene_id.

NameTypeDescriptionDefault
scene_id uint32 No default
light_id uint32 No default

SceneAddPointLightCmd

Defined in fuchsia.ui.gfx/commands.fidl

Adds the light specified by light_id specified by light_id to the scene identified by scene_id.

NameTypeDescriptionDefault
scene_id uint32 No default
light_id uint32 No default

SetDisplayColorConversionCmdHACK

Defined in fuchsia.ui.gfx/commands.fidl

Set the color conversion applied to the compositor's display. The conversion is applied to to each pixel according to the formula:

(matrix * (pixel + preoffsets)) + postoffsets

where pixel is a column vector consisting of the pixel's 3 components.

matrix is passed in row-major order. Clients will be responsible for passing default values, when needed. Default values are not currently supported in fidl. Default Values: preoffsets = [0 0 0] matrix = [1 0 0 0 1 0 0 0 1] postoffsets = [0 0 0]

NameTypeDescriptionDefault
compositor_id uint32 No default
preoffsets float32[3] No default
matrix float32[9] No default
postoffsets float32[3] No default

SetDisplayRotationCmdHACK

Defined in fuchsia.ui.gfx/commands.fidl

Depending on the device, the display might be rotated with respect to what the lower level device controller considers the physical orientation of pixels. The compositors and layers must be in alignment with the underlying physical orientation which means that for certain operations like screenshotting, they cannot provide results with the accurate orientation unless they have information about how the higher-level display is orienting the screen. The only legal values for the rotation are 0, 90, 180, and 270, which are each applied counterclockwise.

NameTypeDescriptionDefault
compositor_id uint32 No default
rotation_degrees uint32 No default

SetEnableDebugViewBoundsCmd

Defined in fuchsia.ui.gfx/commands.fidl

NameTypeDescriptionDefault
view_id uint32 No default
enable bool No default

SetViewHolderBoundsColorCmd

Defined in fuchsia.ui.gfx/commands.fidl

NameTypeDescriptionDefault
view_holder_id uint32 No default
color ColorRgbValue No default

DisplayInfo

Defined in fuchsia.ui.gfx/display_info.fidl

Provides information about a display.

NameTypeDescriptionDefault
width_in_px uint32

The size of the display, in physical pixels.

No default
height_in_px uint32 No default

MetricsEvent

Defined in fuchsia.ui.gfx/events.fidl

Provides rendering target metrics information about the specified node.

This event is delivered when the following conditions are true:

  • The node is a descendant of a Scene.
  • The node has kMetricsEventMask set to an enabled state.
  • The node's metrics have changed since they were last delivered, or since kMetricsEventMask transitioned from a disabled state to an enabled state.

Subscribe to this event to receive information about the scale factors you should apply when generating textures for your nodes.

NameTypeDescriptionDefault
node_id uint32 No default
metrics Metrics No default

SizeChangeHintEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered in response to a size change hint from a parent node (SendSizeChangeHintCmd).

This event is delivered when the following conditions are true:

  • The node has kSizeChangeEventMask set to an enabled state.
  • A parent node has sent a SendSizeChangeHintCmd.

Subscribe to this event to receive information about how large textures you will need in the near future for your nodes. The canonical use case is to pre-allocate memory to avoid repeated re-allocations.

NameTypeDescriptionDefault
node_id uint32 No default
width_change_factor float32 No default
height_change_factor float32 No default

ImportUnboundEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered when the imported resource with the given ID is no longer bound to its host resource, or if the imported resource can not be bound because the host resource is not available.

NameTypeDescriptionDefault
resource_id uint32 No default

ViewConnectedEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered to a ViewHolder's Session when its peer View is connected.

NameTypeDescriptionDefault
view_holder_id uint32 No default

ViewDisconnectedEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered to a ViewHolder's Session when its peer View is disconnected or destroyed.

If the View is destroyed before the connection is established, then this event will be delivered immediately when the ViewHolder attempts to connect.

NameTypeDescriptionDefault
view_holder_id uint32 No default

ViewHolderDisconnectedEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered to a View's Session when its peer ViewHolder is disconnected or destroyed.

If the ViewHolder is destroyed before the connection is established, then this event will be delivered immediately when the View attempts to connect.

NameTypeDescriptionDefault
view_id uint32 No default

ViewHolderConnectedEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered to a View's Session when its peer ViewHolder is connected.

If the ViewHolder is destroyed before the connection is established, then this event will not be delivered.

NameTypeDescriptionDefault
view_id uint32 No default

ViewAttachedToSceneEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered to a View's Session when the parent ViewHolder for the given View becomes a part of a Scene.

A ViewHolder is considered to be part of a Scene if there is an unbroken chain of parent-child relationships between the Scene node and the ViewHolder node.

NameTypeDescriptionDefault
view_id uint32 No default
properties ViewProperties No default

ViewDetachedFromSceneEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered to a View's Session when the parent ViewHolder for the given View is no longer part of a scene.

This can happen if the ViewHolder is detached directly from the scene, or if one of its parent nodes is.

A ViewHolder is considered to be part of a Scene if there is an unbroken chain of parent-child relationships between the Scene node and the ViewHolder node.

NameTypeDescriptionDefault
view_id uint32 No default

ViewPropertiesChangedEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered when the parent ViewHolder for the given View makes a change to the View's properties.

NameTypeDescriptionDefault
view_id uint32 No default
properties ViewProperties No default

ViewStateChangedEvent

Defined in fuchsia.ui.gfx/events.fidl

Delivered to a ViewHolder's Session when its peer View's state has changed.

NameTypeDescriptionDefault
view_holder_id uint32 No default
state ViewState No default

Hit

Defined in fuchsia.ui.gfx/hit.fidl

Describes where a hit occurred within the content of a node tagged by this session.

To compute the point of intersection within the node's local coordinate system, perform the following calculation using the ray which was originally passed to Session.HitTest().

hit_point = ray.origin + (hit.distance * ray.direction) local_point = hit.inverse_transform * hit_point

NameTypeDescriptionDefault
tag_value uint32

The node's tag value.

No default
ray_origin vec4

The origin of the ray that was used for the hit test, in the hit node's coordinate system.

No default
ray_direction vec4

The direction of the ray that was used for the hit test, in the hit node's coordinate system.

No default
inverse_transform mat4

The inverse transformation matrix which maps the coordinate system of the node at which the hit test was initiated into the local coordinate system of the node which was hit.

No default
distance float32

The distance from the ray's origin to the closest point of intersection in multiples of the ray's direction vector.

No default

ShapeNodeArgs

Defined in fuchsia.ui.gfx/nodes.fidl

Characteristics:

  • has_parent
  • has_shape
  • has_material
NameTypeDescriptionDefault
unused uint32 0

ClipNodeArgs

Defined in fuchsia.ui.gfx/nodes.fidl

Characteristics:

  • has_parent
  • is_clip
  • has_parts
NameTypeDescriptionDefault
unused uint32 0

OpacityNodeArgsHACK

Defined in fuchsia.ui.gfx/nodes.fidl

Characteristics:

  • has_transform
  • has_parent
  • has_children
  • has_parts
  • has_opacity
NameTypeDescriptionDefault
unused uint32 0

EntityNodeArgs

Defined in fuchsia.ui.gfx/nodes.fidl

Characteristics:

  • has_transform
  • has_children
  • has_parent
  • has_parts
  • has_clip
NameTypeDescriptionDefault
unused uint32 0

ImagePipeArgs

Defined in fuchsia.ui.gfx/resources.fidl

NameTypeDescriptionDefault
image_pipe_request request<fuchsia.images/ImagePipe> No default

ImagePipe2Args

Defined in fuchsia.ui.gfx/resources.fidl

ImagePipe2 is a Resource that can be used as a Texture for a Material.

NameTypeDescriptionDefault
image_pipe_request request<fuchsia.images/ImagePipe2> No default

MemoryArgs

Defined in fuchsia.ui.gfx/resources.fidl

Memory is a Resource that wraps a client-provided Zircon vmo to register it with Scenic.

NameTypeDescriptionDefault
vmo handle<vmo> No default
allocation_size uint64 No default
memory_type fuchsia.images/MemoryType No default

ImageArgs

Defined in fuchsia.ui.gfx/resources.fidl

An image mapped to a range of a Memory resource.

NameTypeDescriptionDefault
info fuchsia.images/ImageInfo No default
memory_id uint32 No default
memory_offset uint32 No default

BufferArgs

Defined in fuchsia.ui.gfx/resources.fidl

A buffer mapped to a range of Memory.

NameTypeDescriptionDefault
memory_id uint32 No default
memory_offset uint32 No default
num_bytes uint32 No default

ViewArgs

Defined in fuchsia.ui.gfx/resources.fidl

Represents the root of a subgraph within a larger scene graph. Nodes can be attached to the View as children, and these Nodes will have the Views' coordinate transform applied to their own, in addition to being clipped to the Views' bounding box. See ViewProperties.

Each View is linked to a paired ViewHolder via a shared token pair.

Usually the View and its associated ViewHolder exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.

NameTypeDescriptionDefault
token fuchsia.ui.views/ViewToken No default
debug_name string? No default

ViewArgs2

Defined in fuchsia.ui.gfx/resources.fidl

NameTypeDescriptionDefault
token fuchsia.ui.views/ViewToken No default
debug_name string? No default

ViewArgs3

Defined in fuchsia.ui.gfx/resources.fidl

Represents the root of a subgraph within a larger scene graph. Nodes can be attached to the |View| as children, and these Nodes will have the |View|s' coordinate transform applied to their own, in addition to being clipped to the |View|s' bounding box. See |ViewProperties|.

Each |View| is linked to a paired |ViewHolder| via a shared token pair.

Usually the |View| and its associated |ViewHolder| exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.

Clients self-identify their |View| with a |ViewRef|, which is a stable identifier that may be cloned and passed to other components in a feed-forward style. It is accompanied by a |ViewRefControl|, which Scenic uses to signal |View| destruction across the system; the |ViewRefControl| must be unique - do not clone it.

NameTypeDescriptionDefault
token fuchsia.ui.views/ViewToken No default
control_ref fuchsia.ui.views/ViewRefControl

|control_ref.reference| must have full rights (i.e., with signaling).

No default
view_ref fuchsia.ui.views/ViewRef

|view_ref.reference| must have basic rights (i.e., no signaling).

No default
debug_name string? No default

ViewHolderArgs

Defined in fuchsia.ui.gfx/resources.fidl

Represents an attachment point for a subgraph within a larger scene graph. The ViewHolder can be attached to a Node as a child, and the contents of the linked View will become a child of the Node as well.

Each ViewHolder is linked to a paired View via a shared token pair.

Usually the ViewHolder and its associated View exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.

NameTypeDescriptionDefault
token fuchsia.ui.views/ViewHolderToken No default
debug_name string? No default

ViewHolderArgs2

Defined in fuchsia.ui.gfx/resources.fidl

NameTypeDescriptionDefault
token fuchsia.ui.views/ViewHolderToken No default
debug_name string? No default

CompositorArgs

Defined in fuchsia.ui.gfx/resources.fidl

A Compositor draws its LayerStack into a framebuffer provided by its attached Display, if any. If no display is attached, nothing is rendered.

NameTypeDescriptionDefault
dummy uint32 0

DisplayCompositorArgs

Defined in fuchsia.ui.gfx/resources.fidl

A DisplayCompositor draws its attached LayerStack into an image that is presented on a display.

NameTypeDescriptionDefault
dummy uint32 0

ImagePipeCompositorArgs

Defined in fuchsia.ui.gfx/resources.fidl

An ImagePipeCompositor draws its attached LayerStack into an image that is presented on an image-pipe.

NameTypeDescriptionDefault
target fuchsia.images/ImagePipe No default

LayerStackArgs

Defined in fuchsia.ui.gfx/resources.fidl

A LayerStack is a stack of layers that are attached to a Compositor, which draws them in order of increasing Z-order (or rather, presents the illusion of drawing them in that order: it may apply any optimizations that don't affect the output).

Supported commands:

  • AddLayer
NameTypeDescriptionDefault
dummy uint32 0

LayerArgs

Defined in fuchsia.ui.gfx/resources.fidl

A Layer is a 2-dimensional image that is drawn by a Compositor. The contents of each Layer in a Layerstack are independent of each other. A layer is not drawn unless it has a camera, texture, or color.

Supported commands:

  • Detach
  • SetCamera
  • SetColor
  • SetTexture
  • SetSize (depth must be zero)
  • SetSize
  • SetTranslation (z component determines the relative Z-ordering of layers)
  • SetRotation (must rotate around Z-axis)
  • SetScale
NameTypeDescriptionDefault
dummy uint32 0

SceneArgs

Defined in fuchsia.ui.gfx/resources.fidl

A Scene is the root of a scene-graph, and defines the rendering environment (lighting, etc.) for the tree of nodes beneath it.

Supported commands:

  • Add/RemoveLight
  • AddChild
NameTypeDescriptionDefault
dummy uint32 0

CameraArgs

Defined in fuchsia.ui.gfx/resources.fidl

A Camera is used to render a Scene from a particular viewpoint. This is achieved by setting a Renderer to use the camera.

The following commands may be applied to a Camera:

  • SetCameraTransform
  • SetCameraProjection
  • SetCameraPoseBuffer
NameTypeDescriptionDefault
scene_id uint32 No default

StereoCameraArgs

Defined in fuchsia.ui.gfx/resources.fidl

A StereoCamera is a Camera that renders the scene in side-by-side stereo.

Any command which can be applied to a Camera can also be applied to a StereoCamera. Additional supported commands:

  • SetStereoCameraProjection
NameTypeDescriptionDefault
scene_id uint32 No default

RendererArgs

Defined in fuchsia.ui.gfx/resources.fidl

A Renderer renders a Scene via a Camera.

Supported commands:

  • SetCamera
  • SetRendererParam
NameTypeDescriptionDefault
dummy uint32 0

AmbientLightArgs

Defined in fuchsia.ui.gfx/resources.fidl

An AmbientLight is a Light that is is assumed to be everywhere in the scene, in all directions.

Supported commands:

  • SetLightColor
NameTypeDescriptionDefault
dummy uint32 0

DirectionalLightArgs

Defined in fuchsia.ui.gfx/resources.fidl

A DirectionalLight is a Light that is emitted from a point at infinity.

Although the light is directional, the light has some amount of angular dispersion (i.e., the light is not fully columnated). For simplicity, we assume the dispersion of the light source is symmetric about the light's primary direction.

Supported commands:

  • SetLightColor
  • SetLightDirection
NameTypeDescriptionDefault
dummy uint32 0

PointLightArgs

Defined in fuchsia.ui.gfx/resources.fidl

A PointLight is a Light that emits light in all directions. By default, the intensity of the light falls off according to the physically based "inverse-square law" (see Wikipedia), although it can be adjusted to other values for artistic effect.

Supported commands:

  • SetLightColor
  • SetPointLightPosition
  • SetPointLightFalloff
NameTypeDescriptionDefault
dummy uint32 0

MaterialArgs

Defined in fuchsia.ui.gfx/resources.fidl

Simple texture-mapped material.

Supported commands:

  • SetTextureCmd: sets the texture, or it can be left as zero (no texture). The texture can be an Image or ImagePipe.
  • SetColorCmd: sets the color.
NameTypeDescriptionDefault
dummy uint32 0

VariableArgs

Defined in fuchsia.ui.gfx/resources.fidl

Describes a typed, client-modifiable value.

NameTypeDescriptionDefault
type ValueType No default
initial_value Value No default

RectangleArgs

Defined in fuchsia.ui.gfx/shapes.fidl

Rectangle centered at (0,0).

NameTypeDescriptionDefault
width Value No default
height Value No default

RoundedRectangleArgs

Defined in fuchsia.ui.gfx/shapes.fidl

RoundedRectangle centered at (0,0). Legal parameter values must satisfy the constraint that the flat sides of the rectangle have non-negative length. In other words, the following constraints must hold:

  • top_left_radius + top_right_radius <= width
  • bottom_left_radius + bottom_right_radius <= width
  • top_left_radius + bottom_left_radius <= height
  • top_right_radius + bottom_right_radius <= height
NameTypeDescriptionDefault
width Value No default
height Value No default
top_left_radius Value No default
top_right_radius Value No default
bottom_right_radius Value No default
bottom_left_radius Value No default

CircleArgs

Defined in fuchsia.ui.gfx/shapes.fidl

NameTypeDescriptionDefault
radius Value No default

MeshArgs

Defined in fuchsia.ui.gfx/shapes.fidl

A Mesh cannot be rendered until it has been bound to vertex/index buffers; see BindMeshBuffersCmd.

NameTypeDescriptionDefault

ImportToken

Defined in fuchsia.ui.gfx/tokens.fidl

Token that uniquely identifies an attachment point for a subgraph in the global scene graph. Each ImportToken has exactly one corresponding ExportToken.

A Scenic client can reference contents from another client by creating a typed resource using this token. The other client must also create a correspondingly typed resource using the corresponding ExportToken.

The exact nature of the inter-client reference depends on the specific resources created from the tokens. For example, creating a ViewHolder resource from this token allows a client to embed another client's View.

NameTypeDescriptionDefault
value handle<eventpair> No default

ExportToken

Defined in fuchsia.ui.gfx/tokens.fidl

Token that uniquely identifies a root point for a subgraph in the global scene graph. Each ExportToken has exactly one corresponding ImportToken.

A Scenic client can have its contents referenced from another client by creating a typed resource using this token. The other client must also create a correspondingly typed resource using the corresponding ImportToken.

The exact nature of the inter-client reference depends on the specific resources created from the tokens. For example, creating a View resource from this token allows everything attached to the View to be embedded in another clients ViewHolder.

NameTypeDescriptionDefault
value handle<eventpair> No default

vec2

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescriptionDefault
x float32 No default
y float32 No default

vec3

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescriptionDefault
x float32 No default
y float32 No default
z float32 No default

vec4

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescriptionDefault
x float32 No default
y float32 No default
z float32 No default
w float32 No default

mat4

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescriptionDefault
matrix float32[16]

Column major order.

No default

ColorRgba

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescriptionDefault
red uint8 No default
green uint8 No default
blue uint8 No default
alpha uint8 No default

ColorRgb

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescriptionDefault
red float32 No default
green float32 No default
blue float32 No default

Quaternion

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescriptionDefault
x float32 No default
y float32 No default
z float32 No default
w float32 No default

Plane3

Defined in fuchsia.ui.gfx/types.fidl

Oriented plane described by a normal vector and a distance from the origin along that vector.

NameTypeDescriptionDefault
dir vec3 No default
dist float32 No default

FactoredTransform

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescriptionDefault
translation vec3 No default
scale vec3 No default
anchor vec3

Point around which rotation and scaling occur.

No default
rotation Quaternion No default

FloatValue

Defined in fuchsia.ui.gfx/types.fidl

A value that is specified explicitly by value if variable_id is zero, or is the value produced by the resource identified by variable_id, e.g. an animation or expression. In the latter case, the value produced by the resource must be a float32, and value is ignored.

NameTypeDescriptionDefault
value float32 No default
variable_id uint32 No default

Vector2Value

Defined in fuchsia.ui.gfx/types.fidl

A value that is specified explicitly by value if variable_id is zero, or is the value produced by the resource identified by variable_id, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec2, and value is ignored.

NameTypeDescriptionDefault
value vec2 No default
variable_id uint32 No default

Vector3Value

Defined in fuchsia.ui.gfx/types.fidl

A value that is specified explicitly by value if variable_id is zero, or is the value produced by the resource identified by variable_id, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec3, and value is ignored.

NameTypeDescriptionDefault
value vec3 No default
variable_id uint32 No default

Vector4Value

Defined in fuchsia.ui.gfx/types.fidl

A value that is specified explicitly by value if variable_id is zero, or is the value produced by the resource identified by variable_id, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec4, and value is ignored.

NameTypeDescriptionDefault
value vec4 No default
variable_id uint32 No default

Matrix4Value

Defined in fuchsia.ui.gfx/types.fidl

A value that is specified explicitly by value if variable_id is zero, or is the value produced by the resource identified by variable_id, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec4, and value is ignored.

NameTypeDescriptionDefault
value mat4 No default
variable_id uint32 No default

ColorRgbValue

Defined in fuchsia.ui.gfx/types.fidl

A value that is specified explicitly by value if variable_id is zero, or is the value produced by the resource identified by variable_id, e.g. an animation or expression. In the latter case, the value produced by the resource must be a ColorRgb, and value is ignored.

NameTypeDescriptionDefault
value ColorRgb No default
variable_id uint32 No default

ColorRgbaValue

Defined in fuchsia.ui.gfx/types.fidl

A value that is specified explicitly by value if variable_id is zero, or is the value produced by the resource identified by variable_id, e.g. an animation or expression. In the latter case, the value produced by the resource must be a ColorRgba, and value is ignored.

NameTypeDescriptionDefault
value ColorRgba No default
variable_id uint32 No default

QuaternionValue

Defined in fuchsia.ui.gfx/types.fidl

A value that is specified explicitly by value if variable_id is zero, or is the value produced by the resource identified by variable_id, e.g. an animation or expression. In the latter case, the value produced by the resource must be a Quaternion, and value is ignored.

NameTypeDescriptionDefault
value Quaternion No default
variable_id uint32 No default

Metrics

Defined in fuchsia.ui.gfx/types.fidl

Rendering target metrics associated with a node. See also MetricsEvent.

NameTypeDescriptionDefault
scale_x float32

The ratio between the size of one logical pixel within the node's local coordinate system and the size of one physical pixel of the rendering target.

This scale factors change in relation to the resolution of the rendering target and the scale transformations applied by containing nodes. They are always strictly positive and non-zero.

For example, suppose the rendering target is a high resolution display with a device pixel ratio of 2.0 meaning that each logical pixel within the model corresponds to two physical pixels of the display. Assuming no scale transformations affect the node, then its metrics event will report a scale factor of 2.0.

Building on this example, if instead the node's parent applies a scale transformation of 0.25 to the node, then the node's metrics event will report a scale factor of 0.5 indicating that the node should render its content at a reduced resolution and level of detail since a smaller area of physical pixels (half the size in each dimension) will be rendered.

No default
scale_y float32 No default
scale_z float32 No default

BoundingBox

Defined in fuchsia.ui.gfx/types.fidl

Represents an axis-aligned bounding box. If any of the dimensions has a negative extent (e.g. max.x < min.x) then the bounding box is treated as empty.

NameTypeDescriptionDefault
min vec3 No default
max vec3 No default

ViewProperties

Defined in fuchsia.ui.gfx/types.fidl

Represents the properties for a View.

NameTypeDescriptionDefault
bounding_box BoundingBox

The View's bounding box extents can be defined as: { bounding_box.min + inset_from_min, bounding_box.max - inset_from_max } Content contained within the View is clipped to this bounding box.

No default
inset_from_min vec3

insets_from_min and insets_from_max specify the distances between the view's bounding box and that of its parent.

No default
inset_from_max vec3 No default
focus_change bool

Whether the View can receive a focus event; default is true. When false, and this View is eligible to receive a focus event, no focus/unfocus event is actually sent to any View.

true
downward_input bool

Whether the View allows geometrically underlying Views to receive input; default is true. When false, Scenic does not send input events to underlying Views.

true

ViewState

Defined in fuchsia.ui.gfx/types.fidl

Represents the state of a View in Scenic.

NameTypeDescriptionDefault
is_rendering bool

Whether the View is rendering. Default is false. Delivered to the View's corresponding ViewHolder after the View's first frame render request.

No default

ENUMS

MeshIndexFormat

Type: uint32

Defined in fuchsia.ui.gfx/commands.fidl

Set a mesh's indices and vertices.

mesh_id refs the Mesh to be updated. index_buffer_id refs a Buffer that contains the mesh indices. index_format defines how the index buffer data is to be interpreted. index_offset number of bytes from the start of the index Buffer. index_count number of indices. vertex_buffer_id refs a Buffer that contains the mesh vertices. vertex_format defines how the vertex buffer data is to be interpreted. vertex_offset number of bytes from the start of the vertex Buffer. vertex_count number of vertices. bounding_box must contain all vertices within the specified range.

The MeshVertexFormat defines which per-vertex attributes are provided by the mesh, and the size of each attribute (and therefore the size of each vertex). The attributes are ordered within the vertex in the same order that they appear within the MeshVertexFormat struct. For example, if the values are kVector3, kNone and kVector2, then:

  • each vertex has a position and UV-coordinates, but no surface normal.
  • the 3D position occupies bytes 0-11 (3 dimensions * 4 bytes per float32).
  • the UV coords occupy bytes 12-19, since no surface normal is provided.
NameValueDescription
kUint16 1
kUint32 2

ShadowTechnique

Type: uint32

Defined in fuchsia.ui.gfx/renderer.fidl

Represents the shadow algorithm that the Renderer should use when lighting the scene.

NameValueDescription
UNSHADOWED 0

No shadows.

SCREEN_SPACE 1

Default. Screen-space, depth-buffer based shadows; SSDO-ish.

SHADOW_MAP 2

Basic shadow map.

MOMENT_SHADOW_MAP 3

Moment shadow map (see http:///momentsingraphics.de).

STENCIL_SHADOW_VOLUME 4

Stencil shadow volume.

RenderFrequency

Type: uint32

Defined in fuchsia.ui.gfx/renderer.fidl

NameValueDescription
WHEN_REQUESTED 0

Render only on when requested (i.e. when something triggers it). Default behavior.

CONTINUOUSLY 1

Render one frame after another regardless of it it's needed.

ImportSpec

Type: uint32

Defined in fuchsia.ui.gfx/resources.fidl

Describes an exported resource that is to be imported by an ImportResourceCmd.

NOTE: Currently just an enum of importable resource types, but may later be expanded to express concepts like "meshes with a particular vertex format".

NameValueDescription
NODE 0

ValueType

Type: uint32

Defined in fuchsia.ui.gfx/types.fidl

NameValueDescription
kNone 0
kVector1 1
kVector2 2
kVector3 3
kVector4 4
kMatrix4 5
kColorRgb 6
kColorRgba 7
kQuaternion 8
kFactoredTransform 9

HitTestBehavior

Type: uint32

Defined in fuchsia.ui.gfx/types.fidl

Describes how nodes interact with hit testings.

NameValueDescription
kDefault 0

Apply hit testing to the node's content, its parts, and its children.

kSuppress 1

Suppress hit testing of the node and everything it contains.

UNIONS

Command

Defined in fuchsia.ui.gfx/commands.fidl

Commands that are used to modify the state of a Session.

NameTypeDescription
create_resource CreateResourceCmd
release_resource ReleaseResourceCmd
export_resource ExportResourceCmdDeprecated
import_resource ImportResourceCmdDeprecated
set_tag SetTagCmd

Tagging commands.

detach DetachCmd

Grouping commands.

set_translation SetTranslationCmd

Spatial commands.

set_scale SetScaleCmd
set_rotation SetRotationCmd
set_anchor SetAnchorCmd
set_size SetSizeCmd
set_opacity SetOpacityCmd
send_size_change_hint_hack SendSizeChangeHintCmdHACK
add_child AddChildCmd

Node-specific commands.

add_part AddPartCmd

re-parenting?

detach_children DetachChildrenCmd
set_shape SetShapeCmd
set_material SetMaterialCmd
set_clip SetClipCmd
set_hit_test_behavior SetHitTestBehaviorCmd
set_view_properties SetViewPropertiesCmd
take_snapshot_cmd TakeSnapshotCmdDEPRECATED
set_camera SetCameraCmd

Camera and lighting commands.

set_camera_transform SetCameraTransformCmd
set_camera_projection SetCameraProjectionCmd
set_stereo_camera_projection SetStereoCameraProjectionCmd
set_camera_pose_buffer SetCameraPoseBufferCmd
set_light_color SetLightColorCmd
set_light_direction SetLightDirectionCmd
add_light AddLightCmd
detach_light DetachLightCmd
detach_lights DetachLightsCmd
set_texture SetTextureCmd
set_color SetColorCmd
bind_mesh_buffers BindMeshBuffersCmd

Mesh commands.

add_layer AddLayerCmd

Layer and renderer commands.

remove_layer RemoveLayerCmd
remove_all_layers RemoveAllLayersCmd
set_layer_stack SetLayerStackCmd
set_renderer SetRendererCmd
set_renderer_param SetRendererParamCmd
set_event_mask SetEventMaskCmd

Events.

set_label SetLabelCmd

Diagnostic commands.

set_disable_clipping SetDisableClippingCmd

Debugging commands.

set_import_focus SetImportFocusCmdDEPRECATED
set_clip_planes SetClipPlanesCmd
set_point_light_position SetPointLightPositionCmd
set_point_light_falloff SetPointLightFalloffCmd
scene__add_ambient_light SceneAddAmbientLightCmd
scene__add_directional_light SceneAddDirectionalLightCmd
scene__add_point_light SceneAddPointLightCmd
set_display_color_conversion SetDisplayColorConversionCmdHACK
set_display_rotation SetDisplayRotationCmdHACK
set_enable_view_debug_bounds SetEnableDebugViewBoundsCmd
set_view_holder_bounds_color SetViewHolderBoundsColorCmd
set_camera_clip_space_transform SetCameraClipSpaceTransformCmd

Event

Defined in fuchsia.ui.gfx/events.fidl

These are all of the types of events which can be reported by a Session. Use SetEventMaskCmd to enable event delivery for a resource.

NameTypeDescription
metrics MetricsEvent

Events which are controlled by a mask.

size_change_hint SizeChangeHintEvent
import_unbound ImportUnboundEvent

Events which are always delivered, regardless of mask.

view_connected ViewConnectedEvent
view_disconnected ViewDisconnectedEvent
view_holder_disconnected ViewHolderDisconnectedEvent
view_attached_to_scene ViewAttachedToSceneEvent
view_detached_from_scene ViewDetachedFromSceneEvent
view_properties_changed ViewPropertiesChangedEvent
view_state_changed ViewStateChangedEvent
view_holder_connected ViewHolderConnectedEvent

RendererParam

Defined in fuchsia.ui.gfx/renderer.fidl

These are all of the types of parameters that can be set to configure a Renderer.

NameTypeDescription
shadow_technique ShadowTechnique
render_frequency RenderFrequency
enable_debugging bool

ResourceArgs

Defined in fuchsia.ui.gfx/resources.fidl

These are all of the types of resources that can be created within a Session. Add new fields only to the bottom of the list.

NameTypeDescription
memory MemoryArgs
image ImageArgs
image_pipe ImagePipeArgs
buffer BufferArgs
view ViewArgs
view_holder ViewHolderArgs
rectangle RectangleArgs
rounded_rectangle RoundedRectangleArgs
circle CircleArgs
mesh MeshArgs
shape_node ShapeNodeArgs
clip_node ClipNodeArgs
entity_node EntityNodeArgs
opacity_node OpacityNodeArgsHACK
material MaterialArgs
compositor CompositorArgs
display_compositor DisplayCompositorArgs
image_pipe_compositor ImagePipeCompositorArgs
layer_stack LayerStackArgs
layer LayerArgs
scene SceneArgs
camera CameraArgs
stereo_camera StereoCameraArgs
renderer RendererArgs
ambient_light AmbientLightArgs
directional_light DirectionalLightArgs
variable VariableArgs
point_light PointLightArgs
view2 ViewArgs2
view_holder2 ViewHolderArgs2
view3 ViewArgs3
image_pipe2 ImagePipe2Args

Value

Defined in fuchsia.ui.gfx/types.fidl

NameTypeDescription
vector1 float32
vector2 vec2
vector3 vec3
vector4 vec4
matrix4x4 mat4
color_rgba ColorRgba
color_rgb ColorRgb
degrees float32

Degrees of counter-clockwise rotation in the XY plane.

quaternion Quaternion
transform FactoredTransform
variable_id uint32

ID of a value-producing resource (an animation or an expression). The type of this value matches the type produced by the named resource.

CONSTANTS

NameValueTypeDescription
kLabelMaxLength 32 uint32

Maximum length for a resource label.

kMetricsEventMask 1 uint32

Reports metrics information. This event type is only reported for node resources.

kSizeChangeHintEventMask 2 uint32