LayerTree Domain
Methods
LayerTree.compositingReasons #
Provides the reasons why the given layer was composited.
Parameters
layerId The id of the layer for which we want to get the reasons it was composited.
Return object
compositingReasons array[ string ]A list of strings specifying reasons for the given layer to become composited.
compositingReasonIds array[ string ]A list of strings specifying reason IDs for the given layer to become composited.
LayerTree.loadSnapshot #
Returns the snapshot identifier.
Parameters
tiles array[ PictureTile ]An array of tiles composing the snapshot.
Return object
snapshotId The id of the snapshot.
LayerTree.makeSnapshot #
Returns the layer snapshot identifier.
Parameters
layerId The id of the layer.
Return object
snapshotId The id of the layer snapshot.
LayerTree.profileSnapshot #
Parameters
snapshotId The id of the layer snapshot.
minRepeatCountOptional
integerThe maximum number of times to replay the snapshot (1, if not specified).
minDurationOptional
numberThe minimum duration (in seconds) to replay the snapshot.
clipRectOptional
The clip rectangle to apply when replaying the snapshot.
Return object
timings array[ PaintProfile ]The array of paint profiles, one per run.
LayerTree.releaseSnapshot #
Releases layer snapshot captured by the back-end.
Parameters
snapshotId The id of the layer snapshot.
LayerTree.replaySnapshot #
Replays the layer snapshot and returns the resulting bitmap.
Parameters
snapshotId The id of the layer snapshot.
fromStepOptional
integerThe first step to replay from (replay from the very start if not specified).
toStepOptional
integerThe last step to replay to (replay till the end if not specified).
scaleOptional
numberThe scale to apply while replaying (defaults to 1).
Return object
dataURL stringA data: URL for resulting image.
LayerTree.snapshotCommandLog #
Replays the layer snapshot and returns canvas log.
Parameters
snapshotId The id of the layer snapshot.
Return object
commandLog array[ object ]The array of canvas function calls.
Events
Types
LayerTree.Layer #
Information about a compositing layer.
Type: object
Properties
layerId The unique id for this layer.
parentLayerIdOptional
The id of parent (not present for root).
backendNodeIdOptional
The backend id for the node associated with this layer.
offsetX numberOffset from parent layer, X coordinate.
offsetY numberOffset from parent layer, Y coordinate.
width numberLayer width.
height numberLayer height.
transformOptional
array[ number ]Transformation matrix for layer, default is identity matrix
anchorXOptional
numberTransform anchor point X, absent if no transform specified
anchorYOptional
numberTransform anchor point Y, absent if no transform specified
anchorZOptional
numberTransform anchor point Z, absent if no transform specified
paintCount integerIndicates how many time this layer has painted.
drawsContent booleanIndicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only.
invisibleOptional
booleanSet if layer is not visible.
scrollRectsOptional
array[ ScrollRect ]Rectangles scrolling on main thread only.
stickyPositionConstraintOptional
Sticky position constraint information
LayerTree.PictureTile #
Serialized fragment of layer picture along with its offset within the layer.
Type: object
Properties
x numberOffset from owning layer left boundary
y numberOffset from owning layer top boundary
picture stringBase64-encoded snapshot data. (Encoded as a base64 string when passed over JSON)
LayerTree.ScrollRect #
Rectangle where scrolling happens on the main thread.
Type: object
Properties
rect Rectangle itself.
type stringReason for rectangle to force scrolling on the main thread
Allowed values: RepaintsOnScroll, TouchEventHandler, WheelEventHandler
LayerTree.StickyPositionConstraint #
Sticky position constraints.
Type: object
Properties
stickyBoxRect Layout rectangle of the sticky element before being shifted
containingBlockRect Layout rectangle of the containing block of the sticky element
nearestLayerShiftingStickyBoxOptional
The nearest sticky layer that shifts the sticky box
nearestLayerShiftingContainingBlockOptional
The nearest sticky layer that shifts the containing block