Skip to content

Impeller's DisplayList dispatcher fails to save when drawing nested displaylists #130084

@dnfield

Description

@dnfield

Small repro in Dart:

import 'dart:ui';

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    debugShowCheckedModeBanner: false,
    home: Scaffold(
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            color: Colors.amber,
            child: SizedBox(
              child: CustomPaint(
                painter: ArrowPainter(),
              ),
              width: 24,
              height: 24,
            ),
          ),
          Text(
            "Hello",
            style: TextStyle(fontSize: 36),
          ),
        ],
      ),
    ),
  ));
}

class ClippingPainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    final recorder = PictureRecorder();
    final c = Canvas(recorder);
    c.clipRect(Offset.zero & size);
    final picture = recorder.endRecording();
    canvas.drawPicture(picture);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}

The nested picture has a clip operation that prevents drawing of anything that falls outside of subsequent draw calls in the DL. The fix is simple, I am writing an engine test for it now.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: renderingUI glitches reported at the engine/skia or impeller rendering levele: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions