performPaint method

  1. @override
void performPaint(
  1. PaintingContext context,
  2. Offset offset
)

RenderLayoutBox real paint things after basiclly paint box model. Override which to paint layout or intrinsic things. Used by RenderReplaced, RenderFlowLayout, RenderFlexLayout.

Implementation

@override
void performPaint(PaintingContext context, Offset offset) {
  _outerClipLayer.layer = context
      .pushClipRect(true, offset, Offset.zero & size, (context, offset) {
    _transformLayer.layer = context
        .pushTransform(false, offset, _ratio.getMatrix(_renderViewBox, size),
            (context, offset) {
      _innerClipLayer.layer = context
          .pushClipRect(false, offset, _renderViewBox, (context, offset) {
        // Draw debug rect
        // context.canvas.drawRect(_renderViewBox, Paint()..color = Color.fromARGB(255, 255, 0, 0)..style = PaintingStyle.stroke);
        visitChildren((child) {
          if (enableWebFProfileTracking) {
            WebFProfiler.instance.pauseCurrentPaintOp();
          }
          context.paintChild(child, offset);
          if (enableWebFProfileTracking) {
            WebFProfiler.instance.resumeCurrentPaintOp();
          }
        });
      }, oldLayer: _innerClipLayer.layer);
    }, oldLayer: _transformLayer.layer);
  }, oldLayer: _outerClipLayer.layer);
  // Debug rect
  // context.canvas.drawRect(offset & size, Paint()..color = Color.fromARGB(255, 0, 255, 0)..style = PaintingStyle.stroke);
}