Creates a canvas for recording graphical operations into the given picture recorder.
Graphical operations that affect pixels entirely outside the given
cullRect might be discarded by the implementation. However, the
implementation might draw outside these bounds if, for example, a command
draws partially inside and outside the cullRect
. To ensure that pixels
outside a given region are discarded, consider using a clipRect.
To end the recording, call PictureRecorder.endRecording on the given recorder.
Source
Canvas(PictureRecorder recorder, Rect cullRect) { assert(recorder != null); if (recorder.isRecording) throw new ArgumentError('"recorder" must not already be associated with another Canvas.'); assert(cullRect != null); _constructor(recorder, cullRect.left, cullRect.top, cullRect.right, cullRect.bottom); }