Repository: flutter
Issue: Canvas.drawPoints with round caps has weird squares
Labels: engine,dependency: skia,P2,team-engine,triaged-engine

### Steps to reproduce

3. `flutter run`

### Expected results

I see a plain grey screen.

### Actual results

The app has some dark gray squares on a light grey background.

When I instead run `flutter run --enable-impeller`, it crashes:
`[FATAL:..\flutter/impeller/renderer/backend/gles/proc_table_gles.h(39)] Fatal GL Error GL_INVALID_OPERATION(1282) encountered on call to glBlitFramebuffer`

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'dart:ui';

import 'package:flutter/material.dart';

void main() {
  runApp(CustomPaint(
    size: Size.square(500),
    painter: MyPainter(),
  ));
}

class MyPainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    List<Offset> points = [];
    int x = 0;
    while (x < size.width) {
      int y = 0;
      while (y < size.height) {
        points.add(Offset(x.toDouble(), y.toDouble()));
        y++;
      }
      x++;
    }
    canvas.drawPoints(
        PointMode.points,
        points,
        Paint()
          ..color = Colors.white
          ..strokeCap = StrokeCap.round
          ..strokeWidth = .7);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }
}
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

![image](https://github.com/flutter/flutter/assets/51892395/fb7555f0-aee8-45aa-bc35-749ed30890af)

</details>


### Logs

_No response_

### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel main, 3.23.0-13.0.pre.277, on Microsoft Windows [Version 10.0.19045.4529], locale en-US)
    • Flutter version 3.23.0-13.0.pre.277 on channel main at C:\dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 71ac7f55b3 (13 hours ago), 2024-06-19 15:40:31 +0800
    • Engine revision a31279381b
    • Dart version 3.5.0 (build 3.5.0-277.0.dev)
    • DevTools version 2.36.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc4)
    • Android SDK at C:\Users\...\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0-rc4
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.0.2)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.0.31919.166
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.2)
    • 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.6+0-b2043.56-9586694)

[√] VS Code (version 1.90.1)
    • VS Code at C:\Users\...\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.90.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4529]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 125.0.6422.176
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 121.0.2277.112

[√] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>