Repository: flutter
Issue: Path.combine() to compute intersection sometimes produces unexpected output
Labels: engine,dependency: skia,has reproducible steps,P2,found in release: 3.3,found in release: 3.4,team-engine,triaged-engine

Using Path.combine() to compute intersection of two Paths sometimes produce unexpected results, depending on its input path.

For instance, providing `Path()..addOval(Rect.fromLTRB(27.768423124012116, 47.73076455765533, 385.196320826695, 405.1586622603382))` as an input will produce an incorrect result (see example below), though `Path()..addOval(Rect.fromLTRB(27.76, 47.73, 385.19, 405.15))` will work as expected.

In my case, input Paths cannot always be rounded (if its the # of sig digits is the problem, I dunno), as I chain multiple Path.combine() intersection operations together. Also precise values like this are common in the case where the path is animating.

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample (or run https://dartpad.dev/?id=73d9210e94937811773b02c9ba1b54a1) on Web or iOS (have not tested other platforms)
2. `Path.combine(PathOperation.intersect, path1, path2);` will produce unexpected Path output on certain path inputs. Example uses circles but I have seen this behavior for other path types.

**Expected results:** Path.combine produces valid intersection path

**Actual results:** Path.combine produces  path that is not a true intersection. In the given example, it just returns the first Path parameter, though I've seen other cases where it produces a Path that is wrong in other ways.

<details>
<summary>Code sample</summary>

See full example on dartpad:
https://dartpad.dev/?id=73d9210e94937811773b02c9ba1b54a1

This produces a bad intersection path. The output path is identical to the first circle, when it should be the intersection:
```dart
final paint1 = Paint()
    ..style = PaintingStyle.fill
    ..color = Colors.red.withAlpha(100);
final paint2 = Paint()
    ..style = PaintingStyle.fill
    ..color = Colors.blue.withAlpha(100);
final circlePath1 = Path()
      ..addOval(Rect.fromLTRB(
          2.56,
          42.17,
          359.98,
          399.60));
final circlePath2 = Path()
  ..addOval(Rect.fromLTRB(27.768423124012116, 47.73076455765533, 385.196320826695, 405.1586622603382));
canvas.drawPath(circlePath1, paint1);
canvas.drawPath(circlePath2, paint2);

final intersectPaint = Paint()
    ..style = PaintingStyle.stroke
    ..strokeWidth = 2
    ..color = Colors.black;
final intersectPath =
      Path.combine(PathOperation.intersect, circlePath1, circlePath2);
canvas.drawPath(intersectPath, intersectPaint);
```

This code, with tweaked circlePath2 values, will actually work properly:
```dart
final paint1 = Paint()
    ..style = PaintingStyle.fill
    ..color = Colors.red.withAlpha(100);
final paint2 = Paint()
    ..style = PaintingStyle.fill
    ..color = Colors.blue.withAlpha(100);
final circlePath1 = Path()
      ..addOval(Rect.fromLTRB(
          2.56,
          42.17,
          359.98,
          399.60));
final circlePath2 = Path()
  ..addOval(Rect.fromLTRB(27.76, 47.73, 385.19, 405.15));
canvas.drawPath(circlePath1, paint1);
canvas.drawPath(circlePath2, paint2);

final intersectPaint = Paint()
    ..style = PaintingStyle.stroke
    ..strokeWidth = 2
    ..color = Colors.black;
final intersectPath =
      Path.combine(PathOperation.intersect, circlePath1, circlePath2);
canvas.drawPath(intersectPath, intersectPaint);
```

</details>

<details>
  <summary>Logs</summary>

```
flutter doctor -v
[✓] Flutter (Channel stable, 3.3.1, on macOS 12.6 21G115 darwin-x64, locale en-US)
    • Flutter version 3.3.1 on channel stable at /Users/joel/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4f9d92fbbd (3 weeks ago), 2022-09-06 17:54:53 -0700
    • Engine revision 3efdf03e73
    • Dart version 2.18.0
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc5)
    • Android SDK at /Users/joel/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0-rc5
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A309
    • CocoaPods version 1.11.3

[✓] 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-7281165)

[✓] VS Code (version 1.71.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.48.0

[✓] Connected device (3 available)
    • iPhone 14 (mobile) • EFC9078B-A45A-448D-AE37-9E955EDBB723 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-0 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64     • macOS 12.6 21G115 darwin-x64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 105.0.5195.125

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>


Screenshot is of output of dartpad above. The black outline is the Path result of Path.combine(). On the left, is an example of an invalid output (is not a valid intersection of the two circles), on the right is correct. The only difference between the two is a slightly adjusted x,y coordinates on the circle path input.
<img width="919" alt="Screen Shot 2022-09-27 at 12 36 25 PM" src="https://user-images.githubusercontent.com/16456279/192619671-9491253e-14d8-4be5-b8b8-32e4e4b042fa.png">