Repository: flutter
Issue: Issue rendering CustomPainter using Impeller
Labels: waiting for customer response,in triage

### Steps to reproduce

I have updated to version 3.27, in which Impeller is enabled by default.  
The issue is relatively easy to reproduce: simply create a CustomPainter widget with a lot of content inside (in my case, it contains approximately 200 Text widgets, a local image, a widget with a barcode, and another with a QR code using the `barcode_widget` and `qr_flutter` libraries). Then, navigate to this widget using a "fade" transition. Upon entering and leaving the widget, a series of noticeable flickers occur, which did not happen in version 3.24.

### Expected results

The expected outcome is a clean and smooth rendering without flickering.

### Actual results

What is currently observed is a series of flickers that occur only the first few times. If you navigate back to the same widget, the flickering still happens but is significantly reduced.

### Code sample

<details open><summary>Code sample</summary>

```dart
Route fadeTransitionRoute(Widget destination) {
  return PageRouteBuilder(
    pageBuilder: (_, __, ___) => destination,
    transitionsBuilder: (_, animation, __, child) {
      return FadeTransition(
        opacity: animation,
        child: child,
      );
    },
  );
}
```

</details>


### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

```console
[√] Flutter (Channel stable, 3.27.0, on Microsoft Windows [Versi¢n 10.0.19045.5011], locale es-ES)
    • Flutter version 3.27.0 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 8495dee1fd (4 weeks ago), 2024-12-10 14:23:39 -0800
    • Engine revision 83bacfc525
    • Dart version 3.6.0
    • DevTools version 2.40.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) 
    • Android SDK at C:\Users\JMMARTINEZ\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java       
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.8.6)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional
    • Visual Studio Professional 2022 version 17.8.34525.116
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[√] VS Code (version 1.96.2)
    • VS Code at C:\Users\JMMARTINEZ\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.102.0

[√] Connected device (4 available)
    • CPH2483 (mobile)  • IZZXSCAQ6XZTIJ55 • android-arm64  • Android 14 (API 34)
    • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [Versi¢n 10.0.19045.5011]
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 131.0.6778.205
    • Edge (web)        • edge             • web-javascript • Microsoft Edge 131.0.2903.112

[√] Network resources
    • All expected network resources are available.

• No issues found!
```