Skip to content

[Windows] Impeller windows bug: lines not anti-aliased #190392

Closed

Description

@filiph

Steps to reproduce

  1. Create an app that draws lines (e.g., with CustomPainter and a canvas.drawLine())
  2. Verify that it looks okay in non-impeller version of Flutter
  3. Try to run with impeller enabled (soon-to-be default)

Expected results

Lines are anti-aliased:

Image

Actual results

Lines are seemingly rendered without anti-aliasing:

Image

Code sample

Code sample

https://github.com/filiph/impeller_windows_render_bug

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: const MyHomePage());
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,

      body: SizedBox.expand(
        child: Column(
          mainAxisAlignment: .center,
          children: [
            Column(
              children: [
                CustomPaint(
                  painter: _DiagonalLinePainter(),
                  child: SizedBox(width: 200, height: 30),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

class _DiagonalLinePainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    final paint = Paint()
      ..style = .stroke
      ..strokeWidth = 0.5
      ..color = Colors.white;

    canvas.drawLine(Offset(0, size.height), Offset(size.width, 0), paint);
  }

  @override
  bool shouldRepaint(_DiagonalLinePainter oldDelegate) => true;
}

Screenshots or Video

Screenshots / Video demonstration Image

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
flutter doctor -v
[√] Flutter (Channel beta, 3.47.0-0.3.pre, on Microsoft Windows [Version 10.0.26200.8894], locale en-US)
    [273ms]
    • Flutter version 3.47.0-0.3.pre on channel beta at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7c7929adb0 (2 days ago), 2026-07-29 21:46:53 -0700
    • Engine revision effb186f31
    • Dart version 3.13.0 (build 3.13.0-282.3.beta)
    • DevTools version 2.59.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop,
      enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use,
      enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
      enable-uiscene-migration

[√] Windows Version (11 Pro 64-bit, 25H2, 2009) [830ms]

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [2.2s]
    • Android SDK at C:\Users\filip\AppData\Local\Android\sdk
    • Emulator version 32.1.15.0 (build_id 10696886) (CL:N/A)
    X Flutter requires Android SDK 36 and the Android BuildTools 28.0.3
      To update the Android SDK visit https://flutter.dev/to/windows-android-setup for detailed
      instructions.
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web [110ms]
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.12.3) [109ms]
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
    • Visual Studio Build Tools 2022 version 17.12.35527.113
    • Windows 10 SDK version 10.0.19041.0

[√] Connected device (3 available) [152ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26200.8894]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 150.0.7871.114
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 150.0.4078.48

[√] Network resources [567ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Activity

  1. filiph commented on Aug 1, 2026

    @filiph
    ContributorAuthor

    It seems as if there's some cut-off so that lines can completely disappear if they happen to be at exactly the wrong position.

    No impeller:

    Image

    Impeller:

    Image
  2. Razorex001 commented on Aug 1, 2026

    @Razorex001

    The antialiased lines issue should be #189827 which has been fixed on channel master, (I tested the antialsiasing on windows with Flutter 3.47.0-1.0.pre-322 • channel master, and the issue was not visible there. Not sure when the fix will get merged into beta.
    The lines disappearing, I don't know. It may be a different issue.

    @filiph Could you test these issues (together with the font rendering issue that you wrote for #190391 ) on latest channel master version?

  3. filiph commented on Aug 1, 2026

    @filiph
    ContributorAuthor

    Running on master shows a blank screen:

    Image
    flutter doctor -v
    [√] Flutter (Channel master, 3.47.0-0.3.pre, on Microsoft Windows [Version 10.0.26200.8894], locale
        en-US) [5.2s]
        • Flutter version 3.47.0-0.3.pre on channel master at C:\src\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 05d6005dd8 (8 months ago), 2025-12-01 04:15:13 -0500
        • Engine revision 05d6005dd8
        • Dart version 3.11.0 (build 3.11.0-189.0.dev)
        • DevTools version 2.52.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop,
          enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file,
          enable-lldb-debugging, enable-uiscene-migration
    
    [√] Windows Version (11 Pro 64-bit, 25H2, 2009) [590ms]
    
    [!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [1,112ms]
        • Android SDK at C:\Users\filip\AppData\Local\Android\sdk
        • Emulator version 32.1.15.0 (build_id 10696886) (CL:N/A)
        X Flutter requires Android SDK 36 and the Android BuildTools 28.0.3
          To update the Android SDK visit https://flutter.dev/to/windows-android-setup for detailed
          instructions.
        ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
    
    [√] Chrome - develop for the web [93ms]
        • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.12.3) [92ms]
        • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools
        • Visual Studio Build Tools 2022 version 17.12.35527.113
        • Windows 10 SDK version 10.0.19041.0
    
    [√] Connected device (3 available) [141ms]
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.26200.8894]
        • Chrome (web)      • chrome  • web-javascript • Google Chrome 150.0.7871.114
        • Edge (web)        • edge    • web-javascript • Microsoft Edge 150.0.4078.48
    
    [√] Network resources [525ms]
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
    
  4. Razorex001 commented on Aug 1, 2026

    @Razorex001

    @filiph , your master version is 8 months old. Please upgrade to latest channel master version.

    I have tried to reproduce the issue with the code you provided, but I was not able to. On my end everything looks good.
    The only difference I notice is that Impeller seems to draw that line a bit thicker or somewhat slightly more visible than Skia.

    See the screenshots:
    Skia:

    Image

    Impeller:

    Image
    flutter doctor -v
    [√] Flutter (Channel master, 3.47.0-1.0.pre-322, on Microsoft Windows [Version 10.0.19045.7548], locale it-IT) [2,7s]
        • Flutter version 3.47.0-1.0.pre-322 on channel master at C:\src\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision cda25ea220 (14 hours ago), 2026-07-31 20:43:58 -0400
        • Engine revision cda25ea220
        • Dart version 3.14.0 (build 3.14.0-82.0.dev)
        • DevTools version 2.61.0-dev.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets,
          enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-windowing, enable-lldb-debugging, enable-uiscene-migration, enable-riscv64
    
    [√] Windows Version (10 Pro 64-bit, 22H2, 2009) [3,0s]
    
    [√] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [3,5s]
        • Android SDK at C:\Users\moret\AppData\Local\Android\sdk
        • Emulator version 36.6.11.0 (build_id 15507667) (CL:N/A)
        • Platform android-36.1, build-tools 36.1.0
        • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web [124ms]
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.36) [123ms]
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
        • Visual Studio Community 2022 version 17.14.37502.11
        • Windows 10 SDK version 10.0.26100.0
    
    [√] Connected device (3 available) [297ms]
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.7548]
        • Chrome (web)      • chrome  • web-javascript • Google Chrome 150.0.7871.187
        • Edge (web)        • edge    • web-javascript • Microsoft Edge 150.0.4078.105
    
    [√] Network resources [687ms]
        • All expected network resources are available.
    
    • No issues found!
    
  5. filiph commented on Aug 1, 2026

    @filiph
    ContributorAuthor

    your master version is 8 months old

    🤦 Thanks for spotting that. I'm not using Windows that often, clearly.

    Yes, on master, anti-aliasing is back. It's different, and as @Razorex001 says, slightly more visible. But it's obviously much better than the non-anti-aliased version on current beta.

    Image
  6. filiph commented on Aug 1, 2026

    @filiph
    ContributorAuthor

    And yes, the horizontal lines issue seems to be the same issue.

    Impeller on beta:

    Image

    Impeller on master:

    Image

    So I'm guessing we can close this issue, unless it's needed as a backing for some cherry pick discussion or something.

  7. added
    r: solvedIssue is closed as solved
    and removed
    in triagePresently being triaged by the triage team
    on Aug 3, 2026
  8. b-luk commented on Aug 3, 2026

    @b-luk
    Contributor

    Thanks for the report and resolution, Filip and Razorex001. We did recently do a bunch of improvements to thin line rendering on Impeller, so we're hoping things look good now.

    In our fixes, we prioritized correctness and consistency rather than simply trying to reproduce what Skia renders. As you noticed, diagonal lines are slightly more visible on Impeller compared to Skia. Two specific differences that I'll highlight, which I think are improvements over Skia:

    • The more visible diagonal lines on Impeller more closely visually match the weight of axis-aligned (horizontal or vertical) lines drawn with the same stroke width.
    • The diagonal lines on Impeller have a more consistent perceptual weight across the entire line, compared to Skia which shows more visible oscillation between darker portions and lighter portions.

    If this doesn't seem to match what you see, or you notice any visual inaccuracies with lines, please file new issues and I will take a look.

  9. filiph commented on Aug 3, 2026

    @filiph
    ContributorAuthor

    This is fantastic, I'm very happy. Thank you!

  10. github-actions commented on Aug 17, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: solvedIssue is closed as solved

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions