A layer that is displayed at an offset from its parent layer.
Offset layers are key to efficient repainting because they are created by repaint boundaries in the RenderObject tree (see isRepaintBoundary). When a render object that is a repaint boundary is asked to paint at given offset in a PaintingContext, the render object first checks whether it needs to repaint itself. If not, it reuses its existing OffsetLayer (and its entire subtree) by mutating its offset property, cutting off the paint walk.
- Inheritance
- Object
- Layer
- ContainerLayer
- OffsetLayer
- Implemented by
Constructors
- OffsetLayer({Offset offset: Offset.zero })
-
Creates an offset layer.
Properties
- offset → Offset
-
Offset from parent in the parent's coordinate system.
read / write - debugCreator → dynamic
-
The object responsible for creating this layer.
read / write, inherited - firstChild → Layer
-
The first composited layer in this layer's child list
read-only, inherited - hashCode → int
-
Get a hash code for this object.
read-only, inherited - lastChild → Layer
-
The last composited layer in this layer's child list
read-only, inherited - nextSibling → Layer
-
This layer's next sibling in the parent layer's child list
read-only, inherited - parent → ContainerLayer
-
This layer's parent in the layer tree
read-only, inherited - previousSibling → Layer
-
This layer's previous sibling in the parent layer's child list
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
addToScene(
SceneBuilder builder, Offset layerOffset) → void -
Override this method to upload this layer to the engine
-
debugFillDescription(
List<String> description) → void -
Add additional information to the given description for use by
toStringDeep
. -
addChildrenToScene(
SceneBuilder builder, Offset childOffset) → void -
Uploads all of this layer's children to the engine
inherited -
append(
Layer child) → void -
Adds the given layer to the end of this layer's child list
inherited -
debugDescribeChildren(
String prefix) → String -
Returns a description of this layer's children for use by
toStringDeep
.inherited -
detach(
) → void -
Removes this layer from its parent layer's child list
inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
removeAllChildren(
) → void -
Removes all of this layer's children from its child list
inherited -
replaceWith(
Layer newLayer) → void -
Replaces this layer with the given layer in the parent layer's child list
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited -
toStringDeep(
[String prefixLineOne = '', String prefixOtherLines = '' ]) → String -
Returns a string representation of this layer and its descendants.
inherited