Repository: flutter
Issue: CustomPainter Lines look different shade/color when using same Paint object
Labels: engine,dependency: skia,a: quality,has reproducible steps,P2,found in release: 3.3,found in release: 3.6,team-engine,triaged-engine

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

Here is a minimal example:
```
import 'package:flutter/material.dart';
// import 'package:flutter/foundation.dart';

void main() {
  // debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title})
      : paths = {Offset.zero: [Offset(200,500), Offset(400,500),Offset(600,500)]},
        super(key: key);

  final String title;
  final Map<Offset, List<Offset>> paths;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: CustomPaint(
          foregroundPainter: LineTestPainter(widget.paths),
          child: Container(
            color: Colors.black87,
          ),
        ),
      ),
    );
  }
}

class LineTestPainter extends CustomPainter {
  final Offset endOffset;
  final Map<Offset, List<Offset>> paths;

  LineTestPainter(this.paths, {this.endOffset = Offset.zero}) : super();

  @override
  void paint(Canvas canvas, Size size) {
    final Paint paint = Paint()
      ..color = Colors.white12
      ..style = PaintingStyle.stroke
      ..strokeWidth = 1.5;

    Path path = Path();
    paths.forEach((s, ends) {
      ends.forEach((e) {
        path.moveTo(s.dx, s.dy);
        path.cubicTo(
            e.dx, s.dy, s.dx, e.dy, e.dx + endOffset.dx, e.dy + endOffset.dy);
        canvas.drawPath(path, paint);
      });
    });
  }

  @override
  bool shouldRepaint(CustomPainter oldDelegate) => true;
}
```

**Expected results:** Lines should have  the same color and width, etc.

**Actual results:** The last curve (and maybe 2nd?) is fainter and appears thinner than the previous.
It should be noted that I originally ran this for Windows (that is my use case), but it also occurs (although less obvious) when running on mobile (emulator).

<details>
  <summary>Logs</summary>

```
[  +30 ms] executing: [C:\Users\isaac\Desktop\slate\flutter_sdk\flutter\] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +102 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] 27321ebbad34b0a3fafe99fac037102196d655ff
[        ] executing: [C:\Users\isaac\Desktop\slate\flutter_sdk\flutter\] git describe --match v*.*.* --first-parent --long --tags
[  +79 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.12.13+hotfix.5-0-g27321ebba
[   +8 ms] executing: [C:\Users\isaac\Desktop\slate\flutter_sdk\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +63 ms] Exit code 128 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] fatal: HEAD does not point to a branch
[  +15 ms] executing: [C:\Users\isaac\Desktop\slate\flutter_sdk\flutter\] git rev-parse --abbrev-ref HEAD
[  +70 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] HEAD
[  +90 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[+5129 ms] Exit code 0 from: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[        ] List of devices attached
           emulator-5554          device product:sdk_gphone_x86 model:Android_SDK_built_for_x86 device:generic_x86 transport_id:1
[  +31 ms] C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell getprop
[+16062 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[  +11 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +232 ms] Generating C:\Users\isaac\Desktop\lines\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +58 ms] ro.hardware = ranchu
[  +69 ms] Launching lib\main.dart on Android SDK built for x86 in debug mode...
[  +13 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\build-tools\28.0.3\aapt dump xmltree C:\Users\isaac\Desktop\lines\build\app\outputs\apk\app.apk AndroidManifest.xml
[  +31 ms] Exit code 0 from: C:\Users\isaac\AppData\Local\Android\sdk\build-tools\28.0.3\aapt dump xmltree C:\Users\isaac\Desktop\lines\build\app\outputs\apk\app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c
               A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9")
               A: package="com.example.lines" (Raw: "com.example.lines")
               A: platformBuildVersionCode=(type 0x10)0x1c
               A: platformBuildVersionName=(type 0x10)0x9
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=22)
                 A: android:label(0x01010001)="lines" (Raw: "lines")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=28)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.lines.MainActivity" (Raw: "com.example.lines.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: intent-filter (line=35)
                     E: action (line=36)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=38)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=45)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[   +8 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell -x logcat -v time -s flutter
[   +9 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe version
[  +52 ms] Android Debug Bridge version 1.0.40
           Version 28.0.2-5303910
           Installed as C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe
[   +3 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[+3508 ms] Building APK
[  +25 ms] gradle.properties already sets `android.enableR8`
[   +6 ms] Using gradle from C:\Users\isaac\Desktop\lines\android\gradlew.bat.
[  +14 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +104 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[        ] openjdk version "1.8.0_152-release"
           OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
           OpenJDK 64-Bit Server VM (build 25.152-b06, mixed mode)
[   +1 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +101 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[        ] openjdk version "1.8.0_152-release"
           OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
           OpenJDK 64-Bit Server VM (build 25.152-b06, mixed mode)
[   +3 ms] executing: [C:\Users\isaac\Desktop\lines\android\] C:\Users\isaac\Desktop\lines\android\gradlew.bat -q -Ptarget=C:\Users\isaac\Desktop\lines\lib\main.dart -Ptrack-widget-creation=true -Pfilesystem-scheme=org-dartlang-root -Ptarget-platform=android-x86 assembleDebug
[+5987 ms] calculateSha: LocalDirectory: 'C:\Users\isaac\Desktop\lines\build\app\outputs\apk'/app.apk
[  +61 ms] calculateSha: reading file took 60us
[ +878 ms] calculateSha: computing sha took 878us
[  +11 ms] √ Built build\app\outputs\apk\debug\app-debug.apk.
[   +6 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\build-tools\28.0.3\aapt dump xmltree C:\Users\isaac\Desktop\lines\build\app\outputs\apk\app.apk AndroidManifest.xml
[  +46 ms] Exit code 0 from: C:\Users\isaac\AppData\Local\Android\sdk\build-tools\28.0.3\aapt dump xmltree C:\Users\isaac\Desktop\lines\build\app\outputs\apk\app.apk AndroidManifest.xml
[        ] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c
               A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9")
               A: package="com.example.lines" (Raw: "com.example.lines")
               A: platformBuildVersionCode=(type 0x10)0x1c
               A: platformBuildVersionName=(type 0x10)0x9
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=22)
                 A: android:label(0x01010001)="lines" (Raw: "lines")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw: "io.flutter.app.FlutterApplication")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
                 E: activity (line=28)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.lines.MainActivity" (Raw: "com.example.lines.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: intent-filter (line=35)
                     E: action (line=36)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=38)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
                 E: meta-data (line=45)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[   +1 ms] Stopping app 'app.apk' on Android SDK built for x86.
[   +2 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell am force-stop com.example.lines
[+16974 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell pm list packages com.example.lines
[+16048 ms] package:com.example.lines
[   +5 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell cat /data/local/tmp/sky.com.example.lines.sha1
[+16069 ms] 013f72dc8c0fc0ecb20a6cd25b7b496b4e390cee
[        ] Latest build already installed.
[        ] Android SDK built for x86 startApp
[   +3 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true --ez start-paused true com.example.lines/com.example.lines.MainActivity
[+16122 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.lines/.MainActivity (has extras) }
[        ] Waiting for observatory port to be available...
[ +211 ms] Observatory URL on device: http://127.0.0.1:39393/5QsR0rgA1FU=/
[   +2 ms] executing: C:\Users\isaac\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:0 tcp:39393
[+6816 ms] 59308
[        ] Forwarded host port 59308 to device port 39393 for Observatory
[  +11 ms] Connecting to service protocol: http://127.0.0.1:59308/5QsR0rgA1FU=/
[+7018 ms] Successfully connected to service protocol: http://127.0.0.1:59308/5QsR0rgA1FU=/
[   +7 ms] Sending to VM service: getVM({})
[+3009 ms] Result: {type: VM, name: vm, architectureBits: 32, hostCPU: Virtual CPU, operatingSystem: android, targetCPU: ia32, version: 2.7.0 (Mon Dec 2 20:10:59 2019 +0100) on "android_ia32", _profilerMode: VM, _nativeZoneMemoryUsage: 0, pid: 11781, startTime: 1586...
[   +8 ms] Sending to VM service: getIsolate({isolateId: isolates/4382570094551211})
[   +5 ms] Sending to VM service: _flutter.listViews({})
[+1992 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0xe1be8710, isolate: {type: @Isolate, fixedId: true, id: isolates/4382570094551211, name: main.dart$main-4382570094551211, number: 4382570094551211}}]}
[  +15 ms] DevFS: Creating new filesystem on the device (null)
[   +1 ms] Sending to VM service: _createDevFS({fsName: lines})
[+2031 ms] Result: {type: Isolate, id: isolates/4382570094551211, name: main, number: 4382570094551211, _originNumber: 4382570094551211, startTime: 1586185542441, _heaps: {new: {type: HeapSpace, name: new, vmName: Scavenger, collections: 2, avgCollectionPeriodMillis...
[+1969 ms] Result: {type: FileSystem, name: lines, uri: file:///data/user/0/com.example.lines/code_cache/linesDMPCEY/lines/}
[        ] DevFS: Created new filesystem on the device (file:///data/user/0/com.example.lines/code_cache/linesDMPCEY/lines/)
[   +4 ms] Updating assets
[  +92 ms] Scanning asset files
[   +3 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[  +11 ms] C:\Users\isaac\Desktop\slate\flutter_sdk\flutter\bin\cache\dart-sdk\bin\dart.exe C:\Users\isaac\Desktop\slate\flutter_sdk\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root C:\Users\isaac\Desktop\slate\flutter_sdk\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter -Ddart.developer.causal_async_stacks=true --output-dill C:\Users\isaac\AppData\Local\Temp\flutter_tool.ecb82261-7817-11ea-9519-c8215893387a\app.dill --packages C:\Users\isaac\Desktop\lines\.packages -Ddart.vm.profile=false -Ddart.vm.product=false --bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions --enable-asserts --track-widget-creation
[  +11 ms] <- compile package:lines/main.dart
[+6180 ms] Updating files
[+7752 ms] DevFS: Sync finished
[   +1 ms] Synced 0.9MB.
[   +1 ms] Sending to VM service: _flutter.listViews({})
[+2006 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0xe1be8710, isolate: {type: @Isolate, fixedId: true, id: isolates/4382570094551211, name: main.dart$main-4382570094551211, number: 4382570094551211}}]}
[   +4 ms] <- accept
[   +1 ms] Connected to _flutterView/0xe1be8710.
[+37266 ms] Sending to VM service: ext.flutter.platformOverride({isolateId: isolates/4382570094551211})
[   +1 ms] Sending to VM service: ext.flutter.inspector.structuredErrors({enabled: true, isolateId: isolates/4382570094551211})
[  +23 ms] Sending to VM service: ext.flutter.inspector.setPubRootDirectories({arg0: file:///C:/Users/isaac/Desktop/lines, arg1: C:\Users\isaac\Desktop\lines, isolateId: isolates/4382570094551211})
[   +1 ms] Sending to VM service: ext.flutter.inspector.isWidgetCreationTracked({isolateId: isolates/4382570094551211})
[+1906 ms] Result: {value: android, type: _extensionType, method: ext.flutter.platformOverride}
[+2003 ms] Result: {enabled: true, type: _extensionType, method: ext.flutter.inspector.structuredErrors}
[   +1 ms] Result: {result: null, type: _extensionType, method: ext.flutter.inspector.setPubRootDirectories}
[        ] Result: {result: true, type: _extensionType, method: ext.flutter.inspector.isWidgetCreationTracked}
```

Flutter doctor:
```
[√] Flutter (Channel unknown, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18362.720], locale en-US)
    • Flutter version 1.12.13+hotfix.5 at C:\Users\isaac\Desktop\slate\flutter_sdk\flutter
    • Framework revision 27321ebbad (4 months ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\isaac\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[√] Visual Studio - develop for Windows (Visual Studio Community 2017 15.9.12)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
    • Visual Studio Community 2017 version 15.9.28307.665

[√] Android Studio (version 3.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[√] IntelliJ IDEA Community Edition (version 2018.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.2
    • Flutter plugin version 33.3.2
    • Dart plugin version 183.5901

[√] VS Code (version 1.43.2)
    • VS Code at C:\Users\isaac\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.8.0

[√] Connected device (1 available)
    • Windows • Windows • windows-x64 • Microsoft Windows [Version 10.0.18362.720]

• No issues found!
```

</details>