Repository: flutter
Issue: [impeller] Poor performance with non-symmetrical shadows on older Android devices.
Labels: e: impeller,team-engine

### Steps to reproduce

It seems to happen on all the Android devices we've tested on.
 
1. Run the example project in profile mode (it defaults to Impeller), check the jank in DevTools' performance frames tab.
2. You can turn off elevation and notice how jank is minimized.
3. Turn on elevation again.
4. Run the project in Skia
5. Notice the jank is gone.

Seems to be related to a combination of `elevation` AND `borderRadius`.

### Code sample

https://github.com/larssn/flutter_elevation_jank


### Performance profiling on master channel

- [x] The issue still persists on the master channel

### Timeline Traces

[impeller_jank.zip](https://github.com/user-attachments/files/18574995/impeller_jank.zip)

### Video demonstration

If this is required, let me know. There's a loss of about 10fps on the SM-X200 due to jank.

### What target platforms are you seeing this bug on?

Android

### OS/Browser name and version | Device information

Android 14 - Samsung SM-X200: https://www.bosstab.com/eu/resources/tablet-guides/samsung/specs/tab-a/galaxy-tab-a8-105-2022
Android 11 - Samsung SM-T510: https://www.bosstab.com/eu/resources/tablet-guides/samsung/specs/tab-a/galaxy-tab-a-101-2021
Android 8.1 - Pax A920Pro: https://www.pax.us/wp-content/uploads/2023/12/A920Pro-Datasheet.pdf

### Does the problem occur on emulator/simulator as well as on physical devices?

Yes

### Is the problem only reproducible with Impeller?

Yes

### Logs

Let me know if needed. Only running flutter in profile mode.

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel master, 3.29.0-1.0.pre.127, on macOS 15.2 24C101 darwin-arm64, locale en-US) [1,423ms]
    • Flutter version 3.29.0-1.0.pre.127 on channel master at /Users/lars/workspace/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9e273d5e6e (11 hours ago), 2025-01-27 19:43:46 -0800
    • Engine revision 9e273d5e6e
    • Dart version 3.8.0 (build 3.8.0-24.0.dev)
    • DevTools version 2.42.0

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,952ms]
    • Android SDK at /Users/lars/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /Users/lars/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [1,048ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [10ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2) [10ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 21.0.3+-79915917-b509.11)

[✓] VS Code (version 1.96.4) [9ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.102.0

[✓] Connected device (4 available) [11.7s]    
    • Pixel 5 (mobile)                  • 0B011FDD4000FR            • android-arm64  • Android 14 (API 34)
    • Another Phone (wireless) (mobile) • 00008110-000404840C7A801E • ios            • iOS 18.2.1 22C161
    • macOS (desktop)                   • macos                     • darwin-arm64   • macOS 15.2 24C101 darwin-arm64
    • Chrome (web)                      • chrome                    • web-javascript • Google Chrome 132.0.6834.111

[✓] Network resources [799ms]
    • All expected network resources are available.

• No issues found!
```

</details>