layertree

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package layertree implements the LayerTree domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the LayerTree domain with the connection set to conn.

Types

type CompositingReasonsArgs

type CompositingReasonsArgs struct {
	LayerID LayerID `json:"layerId"` // The id of the layer for which we want to get the reasons it was composited.
}

CompositingReasonsArgs represents the arguments for CompositingReasons in the LayerTree domain.

func NewCompositingReasonsArgs

func NewCompositingReasonsArgs(layerID LayerID) *CompositingReasonsArgs

NewCompositingReasonsArgs initializes CompositingReasonsArgs with the required arguments.

type CompositingReasonsReply

type CompositingReasonsReply struct {
	CompositingReasons []string `json:"compositingReasons"` // A list of strings specifying reasons for the given layer to become composited.
}

CompositingReasonsReply represents the return values for CompositingReasons in the LayerTree domain.

type DidChangeClient

type DidChangeClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*DidChangeReply, error)
	rpcc.Stream
}

DidChangeClient is a client for LayerTreeDidChange events.

type DidChangeReply

type DidChangeReply struct {
	Layers []Layer `json:"layers,omitempty"` // Layer tree, absent if not in the comspositing mode.
}

DidChangeReply is the reply for LayerTreeDidChange events.

type Layer

type Layer struct {
	LayerID                  LayerID                   `json:"layerId"`                            // The unique id for this layer.
	ParentLayerID            *LayerID                  `json:"parentLayerId,omitempty"`            // The id of parent (not present for root).
	BackendNodeID            *dom.BackendNodeID        `json:"backendNodeId,omitempty"`            // The backend id for the node associated with this layer.
	OffsetX                  float64                   `json:"offsetX"`                            // Offset from parent layer, X coordinate.
	OffsetY                  float64                   `json:"offsetY"`                            // Offset from parent layer, Y coordinate.
	Width                    float64                   `json:"width"`                              // Layer width.
	Height                   float64                   `json:"height"`                             // Layer height.
	Transform                []float64                 `json:"transform,omitempty"`                // Transformation matrix for layer, default is identity matrix
	AnchorX                  *float64                  `json:"anchorX,omitempty"`                  // Transform anchor point X, absent if no transform specified
	AnchorY                  *float64                  `json:"anchorY,omitempty"`                  // Transform anchor point Y, absent if no transform specified
	AnchorZ                  *float64                  `json:"anchorZ,omitempty"`                  // Transform anchor point Z, absent if no transform specified
	PaintCount               int                       `json:"paintCount"`                         // Indicates how many time this layer has painted.
	DrawsContent             bool                      `json:"drawsContent"`                       // Indicates whether this layer hosts any content, rather than being used for transform/scrolling purposes only.
	Invisible                *bool                     `json:"invisible,omitempty"`                // Set if layer is not visible.
	ScrollRects              []ScrollRect              `json:"scrollRects,omitempty"`              // Rectangles scrolling on main thread only.
	StickyPositionConstraint *StickyPositionConstraint `json:"stickyPositionConstraint,omitempty"` // Sticky position constraint information
}

Layer Information about a compositing layer.

type LayerID

type LayerID string

LayerID Unique Layer identifier.

type LayerPaintedClient

type LayerPaintedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*LayerPaintedReply, error)
	rpcc.Stream
}

LayerPaintedClient is a client for LayerPainted events.

type LayerPaintedReply

type LayerPaintedReply struct {
	LayerID LayerID  `json:"layerId"` // The id of the painted layer.
	Clip    dom.Rect `json:"clip"`    // Clip rectangle.
}

LayerPaintedReply is the reply for LayerPainted events.

type LoadSnapshotArgs

type LoadSnapshotArgs struct {
	Tiles []PictureTile `json:"tiles"` // An array of tiles composing the snapshot.
}

LoadSnapshotArgs represents the arguments for LoadSnapshot in the LayerTree domain.

func NewLoadSnapshotArgs

func NewLoadSnapshotArgs(tiles []PictureTile) *LoadSnapshotArgs

NewLoadSnapshotArgs initializes LoadSnapshotArgs with the required arguments.

type LoadSnapshotReply

type LoadSnapshotReply struct {
	SnapshotID SnapshotID `json:"snapshotId"` // The id of the snapshot.
}

LoadSnapshotReply represents the return values for LoadSnapshot in the LayerTree domain.

type MakeSnapshotArgs

type MakeSnapshotArgs struct {
	LayerID LayerID `json:"layerId"` // The id of the layer.
}

MakeSnapshotArgs represents the arguments for MakeSnapshot in the LayerTree domain.

func NewMakeSnapshotArgs

func NewMakeSnapshotArgs(layerID LayerID) *MakeSnapshotArgs

NewMakeSnapshotArgs initializes MakeSnapshotArgs with the required arguments.

type MakeSnapshotReply

type MakeSnapshotReply struct {
	SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot.
}

MakeSnapshotReply represents the return values for MakeSnapshot in the LayerTree domain.

type PaintProfile

type PaintProfile []float64

PaintProfile Array of timings, one per paint step.

type PictureTile

type PictureTile struct {
	X       float64 `json:"x"`       // Offset from owning layer left boundary
	Y       float64 `json:"y"`       // Offset from owning layer top boundary
	Picture []byte  `json:"picture"` // Base64-encoded snapshot data.
}

PictureTile Serialized fragment of layer picture along with its offset within the layer.

type ProfileSnapshotArgs

type ProfileSnapshotArgs struct {
	SnapshotID     SnapshotID `json:"snapshotId"`               // The id of the layer snapshot.
	MinRepeatCount *int       `json:"minRepeatCount,omitempty"` // The maximum number of times to replay the snapshot (1, if not specified).
	MinDuration    *float64   `json:"minDuration,omitempty"`    // The minimum duration (in seconds) to replay the snapshot.
	ClipRect       *dom.Rect  `json:"clipRect,omitempty"`       // The clip rectangle to apply when replaying the snapshot.
}

ProfileSnapshotArgs represents the arguments for ProfileSnapshot in the LayerTree domain.

func NewProfileSnapshotArgs

func NewProfileSnapshotArgs(snapshotID SnapshotID) *ProfileSnapshotArgs

NewProfileSnapshotArgs initializes ProfileSnapshotArgs with the required arguments.

func (*ProfileSnapshotArgs) SetClipRect

func (a *ProfileSnapshotArgs) SetClipRect(clipRect dom.Rect) *ProfileSnapshotArgs

SetClipRect sets the ClipRect optional argument. The clip rectangle to apply when replaying the snapshot.

func (*ProfileSnapshotArgs) SetMinDuration

func (a *ProfileSnapshotArgs) SetMinDuration(minDuration float64) *ProfileSnapshotArgs

SetMinDuration sets the MinDuration optional argument. The minimum duration (in seconds) to replay the snapshot.

func (*ProfileSnapshotArgs) SetMinRepeatCount

func (a *ProfileSnapshotArgs) SetMinRepeatCount(minRepeatCount int) *ProfileSnapshotArgs

SetMinRepeatCount sets the MinRepeatCount optional argument. The maximum number of times to replay the snapshot (1, if not specified).

type ProfileSnapshotReply

type ProfileSnapshotReply struct {
	Timings []PaintProfile `json:"timings"` // The array of paint profiles, one per run.
}

ProfileSnapshotReply represents the return values for ProfileSnapshot in the LayerTree domain.

type ReleaseSnapshotArgs

type ReleaseSnapshotArgs struct {
	SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot.
}

ReleaseSnapshotArgs represents the arguments for ReleaseSnapshot in the LayerTree domain.

func NewReleaseSnapshotArgs

func NewReleaseSnapshotArgs(snapshotID SnapshotID) *ReleaseSnapshotArgs

NewReleaseSnapshotArgs initializes ReleaseSnapshotArgs with the required arguments.

type ReplaySnapshotArgs

type ReplaySnapshotArgs struct {
	SnapshotID SnapshotID `json:"snapshotId"`         // The id of the layer snapshot.
	FromStep   *int       `json:"fromStep,omitempty"` // The first step to replay from (replay from the very start if not specified).
	ToStep     *int       `json:"toStep,omitempty"`   // The last step to replay to (replay till the end if not specified).
	Scale      *float64   `json:"scale,omitempty"`    // The scale to apply while replaying (defaults to 1).
}

ReplaySnapshotArgs represents the arguments for ReplaySnapshot in the LayerTree domain.

func NewReplaySnapshotArgs

func NewReplaySnapshotArgs(snapshotID SnapshotID) *ReplaySnapshotArgs

NewReplaySnapshotArgs initializes ReplaySnapshotArgs with the required arguments.

func (*ReplaySnapshotArgs) SetFromStep

func (a *ReplaySnapshotArgs) SetFromStep(fromStep int) *ReplaySnapshotArgs

SetFromStep sets the FromStep optional argument. The first step to replay from (replay from the very start if not specified).

func (*ReplaySnapshotArgs) SetScale

func (a *ReplaySnapshotArgs) SetScale(scale float64) *ReplaySnapshotArgs

SetScale sets the Scale optional argument. The scale to apply while replaying (defaults to 1).

func (*ReplaySnapshotArgs) SetToStep

func (a *ReplaySnapshotArgs) SetToStep(toStep int) *ReplaySnapshotArgs

SetToStep sets the ToStep optional argument. The last step to replay to (replay till the end if not specified).

type ReplaySnapshotReply

type ReplaySnapshotReply struct {
	DataURL string `json:"dataURL"` // A data: URL for resulting image.
}

ReplaySnapshotReply represents the return values for ReplaySnapshot in the LayerTree domain.

type ScrollRect

type ScrollRect struct {
	Rect dom.Rect `json:"rect"` // Rectangle itself.
	// Type Reason for rectangle to force scrolling on the main thread
	//
	// Values: "RepaintsOnScroll", "TouchEventHandler", "WheelEventHandler".
	Type string `json:"type"`
}

ScrollRect Rectangle where scrolling happens on the main thread.

type SnapshotCommandLogArgs

type SnapshotCommandLogArgs struct {
	SnapshotID SnapshotID `json:"snapshotId"` // The id of the layer snapshot.
}

SnapshotCommandLogArgs represents the arguments for SnapshotCommandLog in the LayerTree domain.

func NewSnapshotCommandLogArgs

func NewSnapshotCommandLogArgs(snapshotID SnapshotID) *SnapshotCommandLogArgs

NewSnapshotCommandLogArgs initializes SnapshotCommandLogArgs with the required arguments.

type SnapshotCommandLogReply

type SnapshotCommandLogReply struct {
	CommandLog []json.RawMessage `json:"commandLog"` // The array of canvas function calls.
}

SnapshotCommandLogReply represents the return values for SnapshotCommandLog in the LayerTree domain.

type SnapshotID

type SnapshotID string

SnapshotID Unique snapshot identifier.

type StickyPositionConstraint added in v0.9.1

type StickyPositionConstraint struct {
	StickyBoxRect                       dom.Rect `json:"stickyBoxRect"`                                 // Layout rectangle of the sticky element before being shifted
	ContainingBlockRect                 dom.Rect `json:"containingBlockRect"`                           // Layout rectangle of the containing block of the sticky element
	NearestLayerShiftingStickyBox       *LayerID `json:"nearestLayerShiftingStickyBox,omitempty"`       // The nearest sticky layer that shifts the sticky box
	NearestLayerShiftingContainingBlock *LayerID `json:"nearestLayerShiftingContainingBlock,omitempty"` // The nearest sticky layer that shifts the containing block
}

StickyPositionConstraint Sticky position constraints.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL