Repository: flutter
Issue: [Android] InteractiveViewer Performance issue when scaling a Picture object 
Labels: platform-android,framework,c: performance,has reproducible steps,P3,found in release: 2.10,team-android,triaged-android

## Details

I made a flutter application to demonstrate the issue: https://github.com/cristian1980/FlutterPictureTest

I put all the relevant code inside this file: https://github.com/cristian1980/FlutterPictureTest/blob/master/lib/main.dart

I also recorded a [video](https://youtu.be/6INf6n-a9a0) with the issue, the application in the video was compiled on release using master branch.

The program draws ~32k shapes which are recorded inside a Picture object which is then drawn using LeafRenderObjectWidget/RenderBox.

When the zooming in, the performance improves because not all shapes are drawn, but at minimum zoom the performance is very bad on Android (android 10 running on Samsung S9+) with 900+ms frame time vs ~20 ms iOS (ios 14.1 running on iPhone XR and iPad 7th gen running iOS 15.1).

Testing the code on iOS simulator I am getting 400ms frame time vs Android emulator where I am getting 1000ms frame time(emulator/simulator tests were run on the same computer)

I used the code above to generate a [big SVG file](https://raw.githubusercontent.com/cristian1980/FlutterPictureTest/cc4844627bbab77582bac9f7cf81fab29bcb2f17/test/heart_test.svg) containing all the shapes above, which I loaded in Chrome running on the same Android phone see video above. The performance was better than the application running on iOS which is strange because I understand both Flutter and Chrome use Skia for rendering this type of graphics.

I also notice on Chrome that there is a slight blur when zooming before the shapes are redrawin at the correct scale, is it possible to implement this in Flutter?

Note this is a test application, the real application will draw different and more complex shapes.

I left the code that generates the SVG inside the [main.dart](https://github.com/cristian1980/FlutterPictureTest/blob/master/lib/main.dart) but I disabled it for performance reasons. This is detected by "flutter analyze" as dead code but it may be relevant since above I compare performance of Flutter vs Chrome.

**Target Platform:**
Android

**Target OS version/browser:**
Android 10

**Devices:**
Samsung S9+

## Logs

<details>
<summary>Logs</summary>

flutter analyze
Analyzing picture_tester...                                             

   info • The value of the local variable 'svg' isn't used • lib/main.dart:28:10 • unused_local_variable
   info • Dead code • lib/main.dart:40:29 • dead_code
   info • Dead code • lib/main.dart:51:29 • dead_code
   info • Dead code • lib/main.dart:57:29 • dead_code
   info • Dead code • lib/main.dart:63:29 • dead_code

5 issues found. (ran in 2.1s)


```
```

$ flutter doctor -v
[✓] Flutter (Channel master, 2.10.0-1.0.pre.402, on macOS 11.6 20G165 darwin-x64, locale en-US)
    • Flutter version 2.10.0-1.0.pre.402 at /Users/cristi/Desktop/work/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ac52901c14 (12 hours ago), 2022-02-02 19:28:25 -0800
    • Engine revision baadc162a9
    • Dart version 2.17.0 (build 2.17.0-79.0.dev)
    • DevTools version 2.10.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/cristi/Library/Android/sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • 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 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.15.0

[✓] Connected device (5 available)
    • SM G965F (mobile)                  • 25cc7b60fb0d7ece                         • android-arm64  • Android 10 (API 29)
    • Android SDK built for x86 (mobile) • emulator-5554                            • android-x86    • Android 10 (API 29) (emulator)
    • Constantin’s iPad (mobile)         • b1ef8b2504b35534e5217f197a197dc34b9b368c • ios            • iOS 15.1 19B74
    • iPhone 13 mini (mobile)            • 841D80D1-6F0D-4CE0-A058-9F88EDD5AC8E     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
    • Chrome (web)                       • chrome                                   • web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

```
```

</details>