PictureLayer class

A composited layer containing a ui.Picture.

Picture layers are always leaves in the layer tree. They are also responsible for disposing of the ui.Picture object they hold. This is typically done when their parent and all RenderObjects that participated in painting the picture have been disposed.

Inheritance

Constructors

PictureLayer(Rect canvasBounds)
Creates a leaf layer for the layer tree.

Properties

alwaysNeedsAddToScene bool
Subclasses may override this to true to disable retained rendering.
no setterinherited
attached bool
Whether the layer tree containing this layer is attached to an owner.
no setterinherited
canvasBounds Rect
The bounds that were used for the canvas that drew this layer's picture.
final
debugCreator Object?
The object responsible for creating this layer.
getter/setter pairinherited
debugDisposed bool
If asserts are enabled, returns whether dispose has been called since the last time any retained resources were created.
no setterinherited
debugHandleCount int
Returns the number of objects holding a LayerHandle to this layer.
no setterinherited
debugSubtreeNeedsAddToScene bool?
Whether this or any descendant layer in the subtree needs addToScene.
no setterinherited
depth int
The depth of this layer in the layer tree.
no setterinherited
engineLayer EngineLayer?
Stores the engine layer created for this layer in order to reuse engine resources across frames for better app performance.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isComplexHint bool
Hints that the painting in this layer is complex and would benefit from caching.
getter/setter pair
nextSibling Layer?
This layer's next sibling in the parent layer's child list.
no setterinherited
owner Object?
The owner for this layer (null if unattached).
no setterinherited
parent ContainerLayer?
This layer's parent in the layer tree.
no setterinherited
picture Picture?
The picture recorded for this layer.
getter/setter pair
previousSibling Layer?
This layer's previous sibling in the parent layer's child list.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subtreeHasCompositionCallbacks bool
Whether the subtree rooted at this layer has any composition callback observers.
no setterinherited
willChangeHint bool
Hints that the painting in this layer is likely to change next frame.
getter/setter pair

Methods

addCompositionCallback(CompositionCallback callback) VoidCallback
Adds a callback for when the layer tree that this layer is part of gets composited, or when it is detached and will not be rendered again.
inherited
addToScene(SceneBuilder builder) → void
Override this method to upload this layer to the engine.
override
attach(covariant Object owner) → void
Mark this layer as attached to the given owner.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
debugMarkClean() → void
Mark that this layer is in sync with engine.
inherited
describeClipBounds() Rect?
Describes the clip that would be applied to contents of this layer, if any.
inherited
detach() → void
Mark this layer as detached from its owner.
inherited
dispose() → void
Clears any retained resources that this layer holds.
override
find<S extends Object>(Offset localPosition) → S?
Search this layer and its subtree for the first annotation of type S under the point described by localPosition.
inherited
findAllAnnotations<S extends Object>(Offset localPosition) AnnotationResult<S>
Search this layer and its subtree for all annotations of type S under the point described by localPosition.
inherited
findAnnotations<S extends Object>(AnnotationResult<S> result, Offset localPosition, {required bool onlyFirst}) bool
Search this layer and its subtree for annotations of type S at the location described by localPosition.
override
markNeedsAddToScene() → void
Mark that this layer has changed and addToScene needs to be called.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redepthChildren() → void
Adjust the depth of this node's children, if any.
inherited
remove() → void
Removes this layer from its parent layer's child list.
inherited
supportsRasterization() bool
Whether or not this layer, or any child layers, can be rasterized with ui.Scene.toImage or ui.Scene.toImageSync.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited
updateSubtreeNeedsAddToScene() → void
Traverses the layer subtree starting from this layer and determines whether it needs addToScene.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited