Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Not clearing backbuffer before drawing. #143408

Closed
gspencergoog opened this issue Feb 13, 2024 · 12 comments
Closed

[Linux] Not clearing backbuffer before drawing. #143408

gspencergoog opened this issue Feb 13, 2024 · 12 comments
Labels
c: rendering UI glitches reported at the engine/skia or impeller rendering level engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list platform-linux Building on or for Linux specifically team-linux Owned by the Linux platform team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@gspencergoog
Copy link
Contributor

gspencergoog commented Feb 13, 2024

On the main branch, I created this very simple Flutter app:

import 'package:flutter/material.dart';

/// Flutter code sample for [MenuAnchor].

void main() {
  debugFocusChanges = false;
  runApp(const MenuApp());
}

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

  @override
  Widget build(BuildContext context) {
    final ThemeData theme = ThemeData.from(colorScheme: const ColorScheme.light());

    return MaterialApp(
        theme: theme,
        home: Center(
          child: Column(
            children: <Widget>[
              FilledButton.tonal(
                onPressed: () { },
                child: const Text('Tonal'),
              ),
              FilledButton.tonalIcon(
                onPressed: () { },
                icon: const Icon(Icons.add),
                label: const Text('TonalIcon'),
              ),
            ],
          ),
        ),
      );
  }
}

And ran it on my Linux machine, I got a window that didn't clear the backbuffer when switching buffers, leaving an interesting artifact filled image.

output.mp4
flutter doctor -v
[✓] Flutter (Channel main, 3.20.0-7.0.pre.31, on Debian GNU/Linux rodete 6.5.13-1rodete2-amd64, locale en_US.UTF-8)
    • Flutter version 3.20.0-7.0.pre.31 on channel main at /usr/local/google/home/gspencer/code/flutter
    • Upstream repository [email protected]:flutter/flutter.git
    • Framework revision 5025681129 (57 minutes ago), 2024-02-13 21:48:41 +0000
    • Engine revision 0091a4914d
    • Dart version 3.4.0 (build 3.4.0-138.0.dev)
    • DevTools version 2.33.0-dev.6

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /usr/local/google/home/gspencer/Android/Sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • ANDROID_HOME = /usr/local/google/home/gspencer/Android/Sdk
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+7-Debian-1)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Debian clang version 16.0.6 (16)
    • cmake version 3.27.7
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Debian GNU/Linux rodete 6.5.13-1rodete2-amd64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 121.0.6167.160

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

! Doctor found issues in 1 category.
@gspencergoog gspencergoog added engine flutter/engine repository. See also e: labels. platform-linux Building on or for Linux specifically c: rendering UI glitches reported at the engine/skia or impeller rendering level labels Feb 13, 2024
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Feb 14, 2024
@danagbemava-nc
Copy link
Member

I could not reproduce this on my system using the example provided above.

Labeling based on the report shared above.

Screencast.from.14-02-24.08.52.02.webm
flutter doctor -v
[!] Flutter (Channel master, 3.20.0-7.0.pre.43, on Ubuntu 22.04.3 LTS 6.5.0-17-generic, locale en_US.UTF-8)
    • Flutter version 3.20.0-7.0.pre.43 on channel master at /home/daniel/fvm/versions/master
    ! Warning: `flutter` on your path resolves to /home/daniel/fvm/versions/stable/bin/flutter, which is not inside your current Flutter SDK checkout at /home/daniel/fvm/versions/master. Consider adding /home/daniel/fvm/versions/master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /home/linuxbrew/.linuxbrew/Cellar/dart/3.2.2/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /home/daniel/fvm/versions/master. Consider adding /home/daniel/fvm/versions/master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 295eeaf100 (5 hours ago), 2024-02-13 19:58:58 -0800
    • Engine revision 3af336bfb2
    • Dart version 3.4.0 (build 3.4.0-140.0.dev)
    • DevTools version 2.33.0-dev.6
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/daniel/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /home/daniel/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2023.1)
    • Android Studio at /home/daniel/.local/share/JetBrains/Toolbox/apps/android-studio
    • 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 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.85.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.82.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.3 LTS 6.5.0-17-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 120.0.6099.129

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

! Doctor found issues in 1 category.

@danagbemava-nc danagbemava-nc added team-desktop and removed in triage Presently being triaged by the triage team team-desktop labels Feb 14, 2024
@cbracken cbracken added waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds P2 Important issues not at the top of the work list triaged-desktop labels Feb 15, 2024
@cbracken
Copy link
Member

cbracken commented Feb 22, 2024

I'm able to replicate this on Ubuntu 22.04 running with XDG_SESSION_TYPE=x11. I tried to bisect this to figure out when it was introduced, but I'm able to replicate this issue all the way back to 2022-01-01, so I'm wondering if a newer version of underlying libraries has revealed an issue in the existing implementation.

This did not repro on another machine runnign Ubuntu 22.04 using wayland, and this definitely worked on older versions under X11.

@gspencergoog can you confirm whether you're using X11 or Wayland?
@danagbemava-nc are you using X11 or Wayland?

@cbracken
Copy link
Member

/cc @robert-ancell

@robert-ancell
Copy link
Contributor

Does it occur with the rendering changes in flutter/engine#50754?

@robert-ancell
Copy link
Contributor

I can reproduce this using flutter master on Ubuntu 23.10 using Wayland.

@robert-ancell
Copy link
Contributor

Confirmed the new rendering changes don't have this issue - the background is now black:
Screenshot from 2024-02-23 10-16-29

I suggest we consider this resolved once that PR lands.

@gspencergoog
Copy link
Contributor Author

I'm using X11: XDG_SESSION_TYPE=x11

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 23, 2024
@danagbemava-nc
Copy link
Member

@cbracken I am using wayland

@cbracken
Copy link
Member

Awesome thanks. Sounds like once flutter/engine#50754 lands, this is likely to be closeable.

robert-ancell added a commit to flutter/engine that referenced this issue Feb 29, 2024
Refactor GL rendering to prepare for GTK4    
- Remove FlGLArea - we can just use GtkGLArea directly
- Stop using gdk_cairo_draw_from_gl, it's not available in GTK4.
- Rename FlRendererGL to FlRendererGdk, this was implying that
FlRenderer could be something other than OpenGL which is not the case
currently.
- Remove unnecessary virtual methods in FlRenderer, just implement them
as standard methods.

Related: flutter/flutter#143408
@cbracken
Copy link
Member

cbracken commented Mar 6, 2024

flutter/engine#50754 has landed. @gspencergoog is this working for you at tip-of-tree (I don't have my linux machine here today).

@cbracken cbracken added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 6, 2024
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2024
@cbracken cbracken added the team-linux Owned by the Linux platform team label Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: rendering UI glitches reported at the engine/skia or impeller rendering level engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list platform-linux Building on or for Linux specifically team-linux Owned by the Linux platform team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

4 participants