prepareInitialFrame method

void prepareInitialFrame()

Bootstrap the rendering pipeline by preparing the first frame.

This should only be called once. It is typically called immediately after setting the configuration the first time (whether by passing one to the constructor, or setting it directly). The configuration must have been set before calling this method, and the RenderView must have been attached to a PipelineOwner using attach.

This does not actually schedule the first frame. Call PipelineOwner.requestVisualUpdate on the owner to do that.

This should be called before using any methods that rely on the layer being initialized, such as compositeFrame.

This method calls scheduleInitialLayout and scheduleInitialPaint.

Implementation

void prepareInitialFrame() {
  assert(owner != null, 'attach the RenderView to a PipelineOwner before calling prepareInitialFrame');
  assert(_rootTransform == null, 'prepareInitialFrame must only be called once'); // set by _updateMatricesAndCreateNewRootLayer
  assert(hasConfiguration, 'set a configuration before calling prepareInitialFrame');
  scheduleInitialLayout();
  scheduleInitialPaint(_updateMatricesAndCreateNewRootLayer());
  assert(_rootTransform != null);
}