BlockedTextPaintingContext class

A painting context used to replace all text blocks with colored rectangles.

This is used in golden tests to circumvent inconsistencies with font rendering between operating systems.

Only used internally and should not be used by consumers.

Inheritance

Constructors

BlockedTextPaintingContext({required ContainerLayer containerLayer, required Rect estimatedBounds})
A painting context used to replace all text blocks with colored rectangles.

Properties

canvas Canvas
The canvas on which to paint.
no setteroverride
estimatedBounds Rect
An estimate of the bounds within which the painting context's canvas will record painting commands. This can be useful for debugging.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addCompositionCallback(CompositionCallback callback) VoidCallback
Adds a CompositionCallback for the current ContainerLayer used by this context.
inherited
addLayer(Layer layer) → void
Adds a composited leaf layer to the recording.
inherited
appendLayer(Layer layer) → void
Adds a layer to the recording requiring that the recording is already stopped.
inherited
clipPathAndPaint(Path path, Clip clipBehavior, Rect bounds, VoidCallback painter) → void
Clip canvas with Path according to Clip and then paint. canvas is restored to the pre-clip status afterwards.
inherited
clipRectAndPaint(Rect rect, Clip clipBehavior, Rect bounds, VoidCallback painter) → void
Clip canvas with Path according to rect and then paint. canvas is restored to the pre-clip status afterwards.
inherited
clipRRectAndPaint(RRect rrect, Clip clipBehavior, Rect bounds, VoidCallback painter) → void
Clip canvas with Path according to rrect and then paint. canvas is restored to the pre-clip status afterwards.
inherited
createChildContext(ContainerLayer childLayer, Rect bounds) PaintingContext
Creates a painting context configured to paint into childLayer.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paintChild(RenderObject child, Offset offset) → void
Paint a child RenderObject.
override
paintSingleChild(RenderObject child) → void
Paints the single given RenderObject.
pushClipPath(bool needsCompositing, Offset offset, Rect bounds, Path clipPath, PaintingContextCallback painter, {Clip clipBehavior = Clip.antiAlias, ClipPathLayer? oldLayer}) ClipPathLayer?
Clip further painting using a path.
inherited
pushClipRect(bool needsCompositing, Offset offset, Rect clipRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.hardEdge, ClipRectLayer? oldLayer}) ClipRectLayer?
Clip further painting using a rectangle.
inherited
pushClipRRect(bool needsCompositing, Offset offset, Rect bounds, RRect clipRRect, PaintingContextCallback painter, {Clip clipBehavior = Clip.antiAlias, ClipRRectLayer? oldLayer}) ClipRRectLayer?
Clip further painting using a rounded rectangle.
inherited
pushColorFilter(Offset offset, ColorFilter colorFilter, PaintingContextCallback painter, {ColorFilterLayer? oldLayer}) ColorFilterLayer
Blend further painting with a color filter.
inherited
pushLayer(ContainerLayer childLayer, PaintingContextCallback painter, Offset offset, {Rect? childPaintBounds}) → void
Appends the given layer to the recording, and calls the painter callback with that layer, providing the childPaintBounds as the estimated paint bounds of the child. The childPaintBounds can be used for debugging but have no effect on painting.
inherited
pushOpacity(Offset offset, int alpha, PaintingContextCallback painter, {OpacityLayer? oldLayer}) OpacityLayer
Blend further painting with an alpha value.
inherited
pushTransform(bool needsCompositing, Offset offset, Matrix4 transform, PaintingContextCallback painter, {TransformLayer? oldLayer}) TransformLayer?
Transform further painting using a matrix.
inherited
setIsComplexHint() → void
Hints that the painting in the current layer is complex and would benefit from caching.
inherited
setWillChangeHint() → void
Hints that the painting in the current layer is likely to change next frame.
inherited
stopRecordingIfNeeded() → void
Stop recording to a canvas if recording has started.
inherited
toString() String
A string representation of this object.
inherited

Operators

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