Skip to content

Canvas.drawCircle behaves wrong on Linux with Impeller #195208

Description

@jefflongo

Steps to reproduce

  1. Create a CustomPainter
  2. Call canvas.drawCircle in paint using the PaintingStyle.stroke style in the Paint
  3. flutter run, the bug occurs
  4. flutter run --no-enable-impeller, the bug does not occur

Expected results

A hoop is drawn:

Image

Actual results

The entire outside of the circle is filled:

Image

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(MainApp());
}

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

  @override
  Widget build(BuildContext context) {
    return CustomPaint(painter: MyPainter());
  }
}

class MyPainter extends CustomPainter {
  late final Paint _trackPaint;

  MyPainter() {
    _trackPaint = Paint()
      ..color = Colors.white
      ..style = PaintingStyle.stroke
      ..strokeWidth = 4;
  }

  @override
  void paint(Canvas canvas, Size size) {
    Offset center = Offset(size.width / 2, size.height / 2);
    double r = (size.width > size.height ? size.height : size.width) / 2;

    canvas.drawCircle(center, r, _trackPaint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return false;
  }
}

Screenshots or Video

Screenshots / Video demonstration

See above

Logs

Logs
N/A

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.47.7, on Ubuntu 26.04.1 LTS 7.0.0-38-generic, locale en_US.UTF-8) [31ms]
    • Flutter version 3.47.7 on channel stable at /home/jeff/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision abaf9c5237 (2 weeks ago), 2026-10-08 09:51:21 -0700
    • Engine revision deb287481e
    • Dart version 3.13.5
    • DevTools version 2.60.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

[✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [259ms]
    • Android SDK at /home/jeff/Android/Sdk
    • Emulator version 37.2.12.0 (build_id 16428233) (CL:N/A)
    • Platform android-37.0, build-tools 37.0.0
    • Java binary at: /opt/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 25.0.3+-15898627-b508.16)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [4ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop [289ms]
    • Ubuntu clang version 21.1.8 (6ubuntu1)
    • cmake version 4.2.3
    • ninja version 1.13.2
    • pkg-config version 2.5.1
    • OpenGL core renderer: NVIDIA GeForce RTX 5080/PCIe/SSE2
    • OpenGL core version: 4.6.0 NVIDIA 595.91.07
    • OpenGL core shading language version: 4.60 NVIDIA
    • OpenGL ES renderer: NVIDIA GeForce RTX 5080/PCIe/SSE2
    • OpenGL ES version: OpenGL ES 3.2 NVIDIA 595.91.07
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20
    • GL_EXT_framebuffer_blit: yes
    • GL_EXT_texture_format_BGRA8888: yes

[✓] Connected device (1 available) [29ms]
    • Linux (desktop) • linux • linux-x64 • Ubuntu 26.04.1 LTS 7.0.0-38-generic

[✓] Network resources [304ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Activity

  1. suryaKommana2662 commented on Oct 26, 2026

    @suryaKommana2662
    Contributor

    @jefflongo Thanks for the report. I was able to reproduce the issue on Linux with Impeller enabled. The issue does not occur when Impeller is disabled using --no-enable-impeller.

    This may be related to (#182708) and (#183339). Further investigation is needed. routing to the team-engine for further investigation.

    Flutter Doctor Output

    [✓] Flutter (Channel master, 3.50.0-1.0.pre-232, on Ubuntu 26.04
        LTS 6.6.147-09648-g97ef00d8a343, locale C.UTF-8) [1,892ms]
        • Flutter version 3.50.0-1.0.pre-232 on channel master at
          /home/suryak2662/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 66b3ad9017 (25 hours ago), 2026-10-25
          03:58:21 +0000
        • Engine revision 66b3ad9017
        • Dart version 3.15.0 (build 3.15.0-72.0.dev)
        • DevTools version 2.61.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, enable-hcpp
    
    [!] Android toolchain - develop for Android devices (Android SDK
        version 36.0.0) [3.3s]
        • Android SDK at /home/suryak2662/Android/Sdk
        • Emulator version 36.6.11.0 (build_id 15507667) (CL:N/A)
        • Platform android-36, build-tools 36.0.0
        ! Multiple adb binaries found. This can cause conflicts and
          device detection issues:
            - /home/suryak2662/Android/Sdk/platform-tools/adb
            - /usr/lib/android-sdk/platform-tools/adb
        • Java binary at: /opt/android-studio/jbr/bin/java
          This JDK is specified in your Flutter configuration.
          To change the current JDK, run: `flutter config
          --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build
          21.0.10+-14961533-b1163.108)
        ! Some Android licenses not accepted. To resolve this, run:
          flutter doctor --android-licenses
    
    [✓] Chrome - develop for the web [20ms]
        • Chrome at google-chrome
    
    [✓] Linux toolchain - develop for Linux desktop [1,266ms]
        • Ubuntu clang version 21.1.8 (6ubuntu1)
        • cmake version 4.2.3
        • ninja version 1.13.2
        • pkg-config version 2.5.1
        • OpenGL core renderer: llvmpipe (LLVM 21.1.8, 256 bits)
        • OpenGL core version: 4.5 (Core Profile) Mesa
          26.0.3-1ubuntu1
        • OpenGL core shading language version: 4.50
        • OpenGL ES renderer: llvmpipe (LLVM 21.1.8, 256 bits)
        • OpenGL ES version: OpenGL ES 3.2 Mesa 26.0.3-1ubuntu1
        • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20
        • GL_EXT_framebuffer_blit: yes
        • GL_EXT_texture_format_BGRA8888: yes
    
    [✓] Connected device (2 available) [744ms]
        • Linux (desktop) • linux  • linux-x64      • Ubuntu 26.04
          LTS 6.6.147-09648-g97ef00d8a343
        • Chrome (web)    • chrome • web-javascript • Google Chrome
          150.0.7871.128
    
    [✓] Network resources [552ms]
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
  2. added
    engineflutter/engine related. See also e: labels.
    c: renderingUI glitches reported at the engine/skia or impeller rendering level
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    e: impellerImpeller rendering backend issues and features requests
    and removed
    in triagePresently being triaged by the triage team
    on Oct 26, 2026
  3. added
    P1High-priority issues at the top of the work list
    on Oct 26, 2026
  4. gaaclarke commented on Oct 26, 2026

    @gaaclarke
    Member

    @walley892 can you please take a look at this?

  5. walley892 commented on Oct 30, 2026

    @walley892
    Contributor

    This also affects ovals

    Image
  6. jefflongo commented on Oct 30, 2026

    @jefflongo
    Author

    Also affects arcs. My workaround was to draw an arc from 0 to 2pi - 1e-6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: renderingUI glitches reported at the engine/skia or impeller rendering levele: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions