Skip to content

[Impeller] ImageFiltered flickers when widget is rendered on top (Regression) #144985

@jamesblasco

Description

@jamesblasco

Steps to reproduce

This was already detected in previous versions #139294.
It has gotten worse.

  1. Add an ImageFiltered
  2. Add a widget on top of it (eg: in a stack) and move it around

Expected results

The ImageFiltered should render as normal and not be affected by the widget on top
This happens correctly on Android but not on iOS using Impeller
This issue has been detected in stable 3.19.3 and latest master 3.21.0-4.0.pre.14

Actual results

Weird glitches when the widget on top moves. This happens only on iOS using Impeller

Code sample

Code sample
import 'dart:ui';

import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: MyHomePage());
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  double y = 400;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          Center(
            child: ImageFiltered(
              imageFilter: ImageFilter.dilate(radiusX: 100, radiusY: 100),
              child: Container(
                height: 200,
                color: Colors.green,
                margin: const EdgeInsets.all(24),
              ),
            ),
          ),
          Positioned(
            left: 0,
            right: 0,
            top: y,
            height: 24,
            child: GestureDetector(
              onHorizontalDragUpdate: (details) {
                setState(() {
                  y = details.globalPosition.dy;
                });
              },
              child: Container(
                color: Colors.black,
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-12.at.11.47.06.mp4

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel master, 3.21.0-4.0.pre.14, on macOS 14.1.1 23B81 darwin-arm64, locale en-GB)
    • Flutter version 3.21.0-4.0.pre.14 on channel master at /Users/jb/fvm/versions/master
    ! Warning: `flutter` on your path resolves to /Users/jb/fvm/versions/3.16.9/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/jb/fvm/versions/master. Consider adding /Users/jb/fvm/versions/master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.19.6/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/jb/fvm/versions/master. Consider adding /Users/jb/fvm/versions/master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1ca88730a0 (9 hours ago), 2024-03-11 18:31:25 -0700
    • Engine revision 6745955bb4
    • Dart version 3.4.0 (build 3.4.0-220.0.dev)
    • DevTools version 2.33.1
    • 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 33.0.2)
    • Android SDK at /Users/jb/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.85.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

[✓] Connected device (5 available)
    • sdk gphone64 arm64 (mobile)     • emulator-5554                        • android-arm64  • Android 13 (API 33) (emulator)
    • iPhone 15 Pro (mobile)          • 92FA52F6-E6A5-4656-A33F-5C8F26A839F9 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.1.1 23B81 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 14.1.1 23B81 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 122.0.6261.112
    ! Error: Browsing on the local area network for iPhone de Jaime. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

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

! Doctor found issues in 1 category.
exit code 0

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: regressionIt was better in the past than it is nowc: renderingUI glitches reported at the engine/skia or impeller rendering levele: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.found in release: 3.19Found to occur in 3.19found in release: 3.21Found to occur in 3.21has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-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