Repository: flutter
Issue: [Web] Unexpected anti aliasing with custom painter on web only.
Labels: engine,platform-web,e: web_html,has reproducible steps,P3,found in release: 3.10,found in release: 3.12,team-web,triaged-web

When using a `CustomPainter` to draw multiple rects on top of each other, flutter web seems to be applying anti-aliasing, even when the `Paint` objects have `isAntiAlias = false`.

## Steps to Reproduce

In the following example, I'm trying to paint a `white` box on top of a `black` box of equal size. Because `isAntiAlias` is false, I would expect to _never_ see any black. 

Here is how the app behaves on iOS **note that you can never see the box, regardless of its size.**:

![giphy](https://user-images.githubusercontent.com/4229329/81351064-6b1de380-9091-11ea-8391-d3af80045f5c.gif)

Now on flutter web, I _can_ see the box, whenever the size is not a clean number of pixels. I expected to _never_ see the box. 

![giphy](https://user-images.githubusercontent.com/4229329/81351148-aa4c3480-9091-11ea-8528-2b0d2e6b23ae.gif)


## Example source code:

```dart
// Copyright (c) 2019, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(backgroundColor: Colors.white, body: Body()),
    );
  }
}

class Body extends StatefulWidget {
  @override
  _BodyState createState() => _BodyState();
}

class _BodyState extends State<Body> {
  var _height = 50.0;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Row(
        children: [
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text('Box height: $_height'),
              Slider(
                onChanged: (val) => setState(() {
                  _height = val;
                }),
                value: _height,
                min: 50,
                max: 400,
              ),
            ],
          ),
          Container(
            width: _height,
            height: _height,
            child: CustomPaint(painter: BoxPainter()),
          ),
        ],
      ),
    );
  }
}

class BoxPainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    final paint = Paint()..isAntiAlias = false;
    canvas.drawRect(
      size.topLeft(Offset.zero) & size,
      paint..color = Colors.black,
    );
    canvas.drawRect(
      size.topLeft(Offset.zero) & size,
      paint..color = Colors.white,
    );
  }

  @override
  bool shouldRepaint(CustomPainter oldDelegate) {
    return true;
  }
}

```


<details>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel master, 1.18.0-10.0.pre, on Mac OS X 10.14.6 18G3020, locale en-US)
    • Flutter version 1.18.0-10.0.pre at /Users/johnsonmh/mdc/flutter
    • Framework revision 0d452b8305 (7 days ago), 2020-04-30 11:20:14 -0700
    • Engine revision 2db3276573
    • Dart version 2.9.0 (build 2.9.0-3.0.dev 726d3c7725)


[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/johnsonmh/Library/Android/sdk
    • Platform android-stable, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[!] Xcode - develop for iOS and macOS (Xcode 11.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3, Build version 11C29
    ! CocoaPods 1.7.5 out of date (1.8.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade:
        sudo gem install cocoapods

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio
    • Android Studio at /Applications/Android Studio with Blaze.app/Contents
    • Flutter plugin version 45.1.2
    • Dart plugin version 193.6494.35
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (4 available)
    • iPhone 11 Pro • 1B783592-BEFF-4105-8FDA-74B084EEB388 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
    • macOS         • macOS                                • darwin-x64     • Mac OS X 10.14.6 18G3020
    • Web Server    • web-server                           • web-javascript • Flutter Tools
    • Chrome        • chrome                               • web-javascript • Google Chrome 81.0.4044.138
```

</details>