-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix crash in BackdropFilterLayer::Diff #30460
Conversation
flar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I mentioned elsewhere that there are a number of places in the bounds calculation code that introduce the type of inaccuracy mentioned here, but if we can address at least one operation slightly more accurately with a small amount of code then that is fine.
|
|
flar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a thought that I left in the PR comments about whether or not the roundOut in the "non optimal" case actually better reflects the operation we are modeling here. I'm marking my review as "Request changes" until we evaluate that consideration.
|
I definitely might be missing something here, but as far as I can tell the filter is sampling the pixels from the underlying frame-buffer (which is in device space). So any rounding that needs to be done to get actual affected pixels should be done in device space (i.e. after transform). So do I think this approach is correct. Whether it's worth the extra branch is another question (especially after seeing the cullrect of SkPicture). |
|
I look at it this way. The bounds start as the theoretical bounds for the content of the backdrop filter. They identify the pixels that will be modified. The background of those pixels came from up to N pixels away - from the edges of those pixels (i.e. not from the edges of the theoretical bounds of the content). So, to determine what of the background needs to be rendered, you must determine which background pixels contributed to any part of the pixels that will be touched by the inner content. To compute this:
After having written this, I realize that this is exactly what the typical branch of the code is doing, so ignore my comments. |
flar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - my previous comments about a potential problem were off-base.
|
@flar, I pushed another variant where I instead of scaling the filter I pass the transform to |
|
Looking at |
* 9481a79 Roll Skia from 45f64bd52835 to 6bebf036a502 (2 revisions) (flutter/engine#30659) * fb4a86c Roll Fuchsia Mac SDK from RyUwCnr_M... to vpa6vKu7U... (flutter/engine#30661) * 154bd96 Roll Skia from 6bebf036a502 to 5726d457cf15 (1 revision) (flutter/engine#30665) * ba23c6c Roll Skia from 5726d457cf15 to 61d0fbbca795 (5 revisions) (flutter/engine#30673) * e749ba3 Impl and test (flutter/engine#30488) * a78103c Removed "UiThread" annotation from MethodChannel#Result. (flutter/engine#30671) * f8a398f Fix crash in BackdropFilterLayer::Diff (flutter/engine#30460) * a6a856f Only provide frame damage to rasterizer if partial repaint is enabled (flutter/engine#30461) * 3a667ab Roll Fuchsia Mac SDK from vpa6vKu7U... to Al-HXHXyQ... (flutter/engine#30677) * 830abeb [web] roll CanvasKit 0.32.0; fix frame order in animated images (flutter/engine#30680) * c726121 Add a new display_list_benchmarks test suite (flutter/engine#30678) * f181c4d [web] flip browser image codec flag to opt-out (flutter/engine#30681) * 436a346 Remove the ios_tools Chromium-style dependency (flutter/engine#30538) * 3f63998 [web] bring libraries.yaml/libraries.json up to date (flutter/engine#30467) * ab1e8f5 Roll Skia from 61d0fbbca795 to 4981c921c6d7 (1 revision) (flutter/engine#30684) * 8e4124b Roll Skia from 4981c921c6d7 to d7771857e9e2 (2 revisions) (flutter/engine#30685) * acb60b4 Roll Fuchsia Mac SDK from Al-HXHXyQ... to G04Sc3__F... (flutter/engine#30687) * 0176295 [Win32, Keyboard] TextInputPlugin is no longer a KeyboardHandlerBase (flutter/engine#30456) * bcb4b35 Roll Skia from d7771857e9e2 to ec2e8f11b97a (1 revision) (flutter/engine#30688) * e09f8d1 Roll Dart SDK from 1697706df708 to ab5047720a9e (5 revisions) (flutter/engine#30690) * d60c816 Roll Dart SDK from 1697706df708 to f59531cc2973 (10 revisions) (flutter/engine#30691) * 417042c GN targets for generating release artifacts (flutter/engine#30679) * 7f31015 Roll Skia from ec2e8f11b97a to 84d6cf9b5b76 (7 revisions) (flutter/engine#30693) * fed9e0b Roll Skia from 84d6cf9b5b76 to 88c5af7ecd72 (3 revisions) (flutter/engine#30695) * 36eafae [fuchsia][shader warmup] fix for fxbug.dev/90387 (flutter/engine#30482) * 0c036a7 Revert "Only provide frame damage to rasterizer if partial repaint is enabled (#30461)" (flutter/engine#30696) * 8498779 [fuchsia] Fix failing SDK roll. (flutter/engine#30675)
|
Hello all! After i updated to the latest version of Flutter, i faced the above problem! Is there something i could do? some temporary fix ? |
|
@TetrixGauss if you could be more specific on the version you discovered this on, the fix is currently being considered to be cherry picked for the stable release so it would be good to know if you found this on the stable branch or the ToT development branch. Otherwise, the fix looks like it should be good for cherry-picking to the latest release train. |
|
It should be cherry-picked for 2.10.1. |
|
Added to the queue for 2.10.2. |
@flar i just did flutter upgrade in stable channel and in version 2.10.0 and i found that bug! i dont know if that helps.. |
* Fix crash in BackdropFilterLayer::Diff * Pass context transform to filterBounds instead of scaling the filter
* Fix crash in BackdropFilterLayer::Diff (#30460) * Fix crash in BackdropFilterLayer::Diff * Pass context transform to filterBounds instead of scaling the filter * Disable building examples by default (#30946) This should be paired with a recipe change to enable building the example on CI that I'll prepare shortly. * Detach from GL context before attaching (#31390) * 'add branch flutter-2.8-candidate.16 to enabled_branches in .ci.yaml' * remove ref to branch * add junit dependency to gradle.build Co-authored-by: Matej Knopp <[email protected]> Co-authored-by: Zachary Anderson <[email protected]> Co-authored-by: Emmanuel Garcia <[email protected]> Co-authored-by: Kevin Chisholm <[email protected]>
|
Hello all! does the 2.10.2 has the fix for the backdropFillter bug ? |
It's fixed!!! Thank you guys!!! |
Fixes flutter/flutter#95211
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.