-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
[Impeller] Issue with Flutter 3.19 optimization for BackdropFilter with animation #144211
Comments
Assuming we can reproduce this, we will need to bisect to find the cause. AFAIK the only optimizations we did for backdropfilters in 3.19 were related to clip replay/restore which sounds related to clipping masks. |
This issue doesn't occur on the previous stable release 3.16.9. I bisected this to 1333e16 which is a Roll Flutter Engine commit. git bisect (tailed output)1333e16a4a1237fcc026dac844a29e4566368fa8 is the first bad commit
commit 1333e16a4a1237fcc026dac844a29e4566368fa8
Author: engine-flutter-autoroll <engine-flutter-autoroll@skia.org>
Date: Tue Oct 31 23:26:23 2023 -0400
Roll Flutter Engine from db06c2e10459 to a0ac6b432cdf (8 revisions) (#137656)
https://github.com/flutter/engine/compare/db06c2e10459...a0ac6b432cdf
2023-11-01 bdero@google.com [Impeller] Include cstdint everywhere that uint32_t is used. (flutter/engine#47533)
2023-11-01 bdero@google.com [Impeller] Fix nullopt access and simplify coverage computation in GetSubpassCoverage. (flutter/engine#47347)
2023-11-01 bdero@google.com [Impeller] OpenGLES: Ensure frag/vert textures are bound with unique texture units. (flutter/engine#47218)
2023-11-01 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from LCfhx_lTRJI51G0zc... to _TyF0etsONe5aqCbM... (flutter/engine#47532)
2023-11-01 jonahwilliams@google.com [Impeller] stencil buffer record/replay instead of MSAA storage. (flutter/engine#47397)
2023-11-01 chris@bracken.jp [macOS] Delete FlutterCompositor tests (flutter/engine#47527)
2023-10-31 bdero@google.com [Impeller] Place Rect statics under the Rect template. (flutter/engine#47529)
2023-10-31 skia-flutter-autoroll@skia.org Roll Skia from aaa225e0cc6d to 34ef20100acc (1 revision) (flutter/engine#47530)
|
Thanks @huycozy , that makes the likely culprit:
|
Good news! This appears to be fixed on master. Going to try to bisect. |
This issue does not happen when stencil-then-cover is enabled. |
flutter/engine#47397 did indeed break it. |
Revert w/ conflicts resolved for 3.19: https://github.com/flutter/engine/compare/flutter-3.19-candidate.1...bdero:flutter-engine:bdero/cp-3.19-revert47397?expand=1 |
Here's a very small repro using I'mgoing to see if I can write an aiks unittest for this. import 'dart:ui';
typedef CanvasCallback = void Function(Canvas canvas);
Picture makePicture(CanvasCallback callback) {
final recorder = PictureRecorder();
final canvas = Canvas(recorder);
callback(canvas);
return recorder.endRecording();
}
void main() {
final sceneBuilder = SceneBuilder();
sceneBuilder.addPicture(Offset.zero, makePicture((Canvas canvas) {
canvas.clipRect(const Rect.fromLTRB(10, 10, 200, 200));
// canvas.clipRect(const Rect.fromLTRB(15, 10, 100, 200));
canvas.drawPaint(Paint()..color = const Color(0xFFFF0000));
}));
sceneBuilder.pushBackdropFilter(ImageFilter.blur(sigmaX: 3, sigmaY: 3));
sceneBuilder.addPicture(Offset.zero, makePicture((Canvas canvas) {
canvas.drawPaint(Paint()..color = const Color(0x88000000));
}));
final scene = sceneBuilder.build();
PlatformDispatcher.instance.onBeginFrame = (_) {
PlatformDispatcher.instance.implicitView!.render(scene);
};
PlatformDispatcher.instance.scheduleFrame();
} |
If you uncomment the second |
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 |
Steps to reproduce
I can reproduce this by adding a Rive asset (animated vector graphics) and then adding a BackdropFilter on top of that asset. The Rive asset does not have to be animated and the issue occurs only when the Rive asset contains two clipping masks. I'm not sure how the Rive runtime is built but everything worked fine in Flutter 3.16 but it no longer works with Flutter 3.19 on iOS - and I'm assuming it's related to the Impeller optimizations of BackdropFilter that was introduced in Flutter 3.19.
This issue does not affect Android or web because these platforms does not use Impeller. I have not tried to enable Impeller on Android.
The issue is clearly described in an issue that I filed on the the rive-flutter repo. However, one of the contributors to rive-flutter thought that this is primarily a Flutter problem, not a Rive problem.
This bug can be tested in this repo: https://github.com/mikeesouth/rive_mask_backdrop_bug
Expected results
I expect that the BackdropFilter optimizations in Flutter 3.19 still works on all scenarios that worked in Flutter 3.16.
Actual results
Impeller BackdropFilter in Flutter 3.19 does not affect Rive assets with two clipping masks - making these widgets look like they are rendered "on top" of the BackdropFilter. See rive-app/rive-flutter#360 for more details and screenshots.
Code sample
This bug can be tested in this repo: https://github.com/mikeesouth/rive_mask_backdrop_bug
Code sample
Screenshots or Video
Screenshots / Video demonstration
Logs
Logs
N/A
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: