Repository: flutter
Issue: Support MaskFilter on Canvas.drawVertices.
Labels: c: new feature,engine,has reproducible steps,P3,team-engine,triaged-engine,found in release: 3.22,found in release: 3.23

### Steps to reproduce

Use `canvas.drawVertices` with a paint that has a `maskFilter`.

### Expected results

We should be able to blur using `drawVertices`.

### Actual results

We are not able to blur using `drawVertices`.

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'dart:ui';

import 'package:flutter/material.dart';

void main() {
  runApp(const _MyApp());
}

class _MyApp extends StatelessWidget {
  const _MyApp();

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: _MyHomePage(),
    );
  }
}

class _MyHomePage extends StatelessWidget {
  const _MyHomePage();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Blur issue with drawVertices'),
      ),
      body: const Row(
        children: [
          Expanded(
            child: _Pane(
              title: 'drawVertices',
              painter: _VerticesPainter(),
            ),
          ),
          Expanded(
            child: _Pane(
              title: 'drawRect',
              painter: _RectPainter(),
            ),
          ),
        ],
      ),
    );
  }
}

class _Pane extends StatelessWidget {
  const _Pane({
    required this.title,
    required this.painter,
  });

  final String title;
  final CustomPainter painter;

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(16),
      child: Column(
        children: [
          Text(
            title,
            style: Theme.of(context).textTheme.displayMedium,
          ),
          Expanded(
            child: CustomPaint(
              painter: painter,
              child: const SizedBox.expand(),
            ),
          ),
        ],
      ),
    );
  }
}

class _VerticesPainter extends CustomPainter {
  const _VerticesPainter();

  @override
  void paint(Canvas canvas, Size size) {
    final rect = Rect.fromCircle(
      center: size.center(Offset.zero),
      radius: size.shortestSide / 4,
    );

    final paint = Paint()
      ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 10);

    return canvas.drawVertices(
      Vertices(
        VertexMode.triangles,
        [rect.topLeft, rect.topRight, rect.bottomLeft, rect.bottomRight],
        colors: List.filled(4, Colors.red),
        indices: [0, 1, 2, 1, 2, 3],
      ),
      BlendMode.dst,
      paint,
    );
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return false;
  }
}

class _RectPainter extends CustomPainter {
  const _RectPainter();

  @override
  void paint(Canvas canvas, Size size) {
    final rect = Rect.fromCircle(
      center: size.center(Offset.zero),
      radius: size.shortestSide / 4,
    );

    final paint = Paint()
      ..color = Colors.red
      ..maskFilter = const MaskFilter.blur(BlurStyle.solid, 10);

    return canvas.drawRect(rect, paint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return false;
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

Screenshot showing the above code in action and putting side by side the same rect drawn differently. At the left we used `drawVertices`, and for the right we used `drawRect`.

<img width="912" alt="Capture d’écran 2024-06-09 à 10 26 11" src="https://github.com/flutter/flutter/assets/9378033/4fe72bdf-fa5b-4fd7-bd09-198400f5a13a">

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.1 23B74 darwin-arm64, locale fr-FR)
    • Flutter version 3.22.1 on channel stable at /Users/letsar/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (3 weeks ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/letsar/Library/Android/sdk
    • Platform android-33, 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.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode-15.0.1.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • 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.10+0-b96-7249189)

[✓] VS Code (version 1.86.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0

[✓] Connected device (3 available)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.1 23B74 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.1 23B74 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 125.0.6422.142

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>