Skip to content

[Impeller][macOS] Whole-window flickering when scrolling an image grid on Intel (x86_64) Macs (default renderer since 3.47) #191538

Closed

Description

@cxx1234

Steps to reproduce

  1. flutter create bug_repro (Flutter 3.47.0, Dart 3.13.0).
  2. Replace lib/main.dart with the code below (runtime-generated solid-color placeholder images, no assets).
  3. flutter run -d macos; confirm the console shows:
    Using the Impeller rendering backend (Metal).
  4. Scroll the grid (and scroll around in general).

impeller_flicker_repro.txt

Expected results

Smooth scrolling, no flicker.

Actual results

The whole window flickers/disappears while scrolling; grid items flash (transparent frame + fade-in).
With FLTEnableImpeller = false (Skia) on the same machine, there is no flicker.

Code sample

Code sample
import 'dart:typed_data';
import 'dart:ui' as ui;

import 'package:flutter/material.dart';

void main() => runApp(const ReproApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Impeller flicker repro',
      theme: ThemeData(useMaterial3: true, colorSchemeSeed: Colors.teal),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final List<Uint8List> _covers = [];
  bool _ready = false;

  @override
  void initState() {
    super.initState();
    _generate();
  }

  /// Generate 60 Color Blocks.
  Future<void> _generate() async {
    const palette = [
      Color(0xFFE53935),
      Color(0xFFD81B60),
      Color(0xFF8E24AA),
      Color(0xFF3949AB),
      Color(0xFF1E88E5),
      Color(0xFF00897B),
      Color(0xFF43A047),
      Color(0xFFFB8C00),
      Color(0xFF6D4C41),
    ];
    for (var i = 0; i < 60; i++) {
      _covers.add(await _solidPng(palette[i % palette.length]));
    }
    if (mounted) setState(() => _ready = true);
  }

  /// Blocks -> PNGs.
  Future<Uint8List> _solidPng(Color color, {int size = 512}) async {
    final recorder = ui.PictureRecorder();
    final canvas = Canvas(recorder);
    canvas.drawRect(
      Rect.fromLTWH(0, 0, size.toDouble(), size.toDouble()),
      Paint()..color = color,
    );
    final image = await recorder.endRecording().toImage(size, size);
    final data = await image.toByteData(format: ui.ImageByteFormat.png);
    return data!.buffer.asUint8List();
  }

  @override
  Widget build(BuildContext context) {
    if (!_ready) {
      return const Scaffold(body: Center(child: CircularProgressIndicator()));
    }
    return Scaffold(
      appBar: AppBar(title: const Text('Impeller flicker repro')),
      body: GridView.builder(
        padding: const EdgeInsets.all(16),
        gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
          maxCrossAxisExtent: 200,
          childAspectRatio: 0.76,
          crossAxisSpacing: 12,
          mainAxisSpacing: 12,
        ),
        itemCount: _covers.length,
        itemBuilder: (context, i) =>
            _Cover(bytes: _covers[i], title: 'Title ${i + 1}'),
      ),
    );
  }
}

class _Cover extends StatelessWidget {
  const _Cover({required this.bytes, required this.title});

  final Uint8List bytes;
  final String title;

  @override
  Widget build(BuildContext context) {
    return Card(
      clipBehavior: Clip.hardEdge,
      child: Column(
        children: [
          Expanded(
            //  200ms fade-in
            child: Image.memory(
              bytes,
              fit: BoxFit.cover,
              frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
                if (wasSynchronouslyLoaded) return child;
                return AnimatedOpacity(
                  opacity: frame == null ? 0 : 1,
                  duration: const Duration(milliseconds: 200),
                  child: child,
                );
              },
            ),
          ),
          Padding(
            padding: const EdgeInsets.all(8),
            child: Text(title, maxLines: 1, overflow: TextOverflow.ellipsis),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
With_Impeller.mov
With_Skia.mov

Logs

Logs
[IMPORTANT:flutter/shell/platform/embedder/embedder_surface_metal_impeller.mm(53)] Using the Impeller rendering backend (MetalSDF).

Flutter Doctor output

Doctor output
[!] Flutter (Channel stable, 3.47.1, on macOS 15.7.9 24G830 darwin-x64, locale zh-Hans-CN) [1,005ms]
    ! Flutter is deprecating support for Intel-based Macs. A future version of Flutter will require an Apple Silicon Mac to build applications.
    • Flutter version 3.47.1 on channel stable at /usr/local/share/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6655482ec0 (3 天前), 2026-08-19 10:07:23 -0700
    • Engine revision 5d53178869
    • Dart version 3.13.1
    • 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
    • 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 [411ms]
    • Android SDK at /usr/local/Caskroom/android-platform-tools/37.0.1
    • Emulator version unknown
    ✗ cmdline-tools component is missing.
      Try installing or updating Android Studio.
      Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment
      variable.
      See https://developer.android.com/studio/command-line for more details.

[!] Xcode - develop for iOS and macOS (Xcode 26.3) [3.3s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C529
    ✗ Unable to get list of installed Simulator runtimes.
    • CocoaPods version 1.17.0

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [15ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Connected device (1 available) [6.4s]
    • macOS (desktop) • macos • darwin-x64 • macOS 15.7.9 24G830 darwin-x64

[!] Network resources [75.2s]           
    ✗ A network error occurred while checking "https://maven.google.com/": Operation timed out

! Doctor found issues in 5 categories.

Activity

  1. suryaKommana2662 commented on Aug 24, 2026

    @suryaKommana2662
    Contributor

    @cxx1234 Thanks for the report. Tested the provided reproduction on macOS 26.4 running on an Apple M5 (arm64) with Impeller enabled. The reported flickering issue was not reproducible in this environment. Since the reporter is using an Intel (x86_64) Mac and the issue is specific to Impeller, routing to team-engine for further investigation.

  2. added
    engineflutter/engine related. See also e: labels.
    platform-macosBuilding on or for macOS specifically
    e: impellerImpeller rendering backend issues and features requests
    and removed
    in triagePresently being triaged by the triage team
    on Aug 24, 2026
  3. added
    P2Important issues not at the top of the work list
    on Aug 24, 2026
  4. gaaclarke commented on Aug 24, 2026

    @gaaclarke
    Member

    Heads up, @cxx1234 Apple is abandoning x86_64 and we are removing those machines from our testing facilities. Support for x86_64 is being drawn back.

    That said, can you please try your reproduction on main. We have some fixes that have landed on there that might address your problem.

  5. cxx1234 commented on Aug 25, 2026

    @cxx1234
    Author

    Thanks! I tested the impeller_flicker_repro on Flutter Channel main, 3.48.0-1.0.pre-404, on macOS 15.7.9 24G830 darwin-x64 and the flickering issue is no longer reproducible on my Intel Mac.

    Thanks again for the fix!

  6. gaaclarke commented on Aug 25, 2026

    @gaaclarke
    Member

    nice call @jason-simmons

  7. github-actions commented on Sep 8, 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.

  8. locked as resolved and limited conversation to collaborators on Sep 8, 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

    P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.platform-macosBuilding on or for macOS specificallyteam-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