-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
[iOS][Impeller] AnimatedOpacity affects blended color overlay render #139571
Comments
this sample was working fine in 3.13 stable release |
Thanks for the report. Replicable using latest master and stable versions. 139571.movstable, master flutter doctor -v
|
I there any news regarding this issue? We currently blocked with flutter upgrade because of this issue( we have some elements flickering here and there across the app( |
Just trying to understand if it's something that may be fixed in near future or we will need to wait till next stable release, or maybe even turn off impeller ( |
You can work around this issue by disabling partial repaint in Impeller. To do that, set I also noticed that the issue does not appear if you patch
|
Is the optimization in the linked commit misfiring because partial repaint adds a translation to the canvas? |
@jason-simmons do you know how bad it will impact performance? At least rawly |
Just a guess maybe) I'm curious if I need to spend time on benchmark at all if it's going to be very bad 😅 |
I will look into fixing this one. |
The behavior is different on ToT, instead the text is flashing black. Upon investigation the surface has NaNs, and disabling the clear color optimization causes it to render correctly. This might be similar to previous clear color optimization bugs. |
I have a fix. If I can confirm that this is fixable on stable by turning off entity culling then we can put together a cherry pick |
The problem is that the logic to force pass creation isn't general enough: https://github.com/flutter/engine/blob/main/impeller/entity/entity_pass.cc#L848-L853 This uses a transparent color as a signal that we don't need to force create the pass, but its entirely valid to clear to transparent black and then create UI which feeds that texture elsewhere, as the following test demonstrates. You should TEST_P(AiksTest, SubpassWithClearColorOptimization) {
Canvas canvas;
// Use a non-srcOver blend mode to ensure that we don't detect this as an
// opacity peephole optimization.
canvas.SaveLayer(
{.color = Color::Blue().WithAlpha(0.5), .blend_mode = BlendMode::kSource},
Rect::MakeLTRB(0, 0, 200, 200));
canvas.DrawPaint(
{.color = Color::BlackTransparent(), .blend_mode = BlendMode::kSource});
canvas.Restore();
canvas.SaveLayer(
{.color = Color::Blue(), .blend_mode = BlendMode::kDestinationOver});
canvas.Restore();
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
}
As a fix I would propose that |
…lear color. (#49038) If we clear to transparent black, we're not forcing the pass to be constructed. Change the entity pass API so that we can tell the difference between clearing transparent black and not having a clear color. In flutter/flutter#139571 , the app is creating a layer that is clearing to a transparent color, which is getting skipped. That invalid texture is fed into a blend which produces either black or magenta error texture. Fixes flutter/flutter#139571
…lear color. (flutter#49038) If we clear to transparent black, we're not forcing the pass to be constructed. Change the entity pass API so that we can tell the difference between clearing transparent black and not having a clear color. In flutter/flutter#139571 , the app is creating a layer that is clearing to a transparent color, which is getting skipped. That invalid texture is fed into a blend which produces either black or magenta error texture. Fixes flutter/flutter#139571
…lear color. (flutter#49038) If we clear to transparent black, we're not forcing the pass to be constructed. Change the entity pass API so that we can tell the difference between clearing transparent black and not having a clear color. In flutter/flutter#139571 , the app is creating a layer that is clearing to a transparent color, which is getting skipped. That invalid texture is fed into a blend which produces either black or magenta error texture. Fixes flutter/flutter#139571
…lear color. (flutter#49038) If we clear to transparent black, we're not forcing the pass to be constructed. Change the entity pass API so that we can tell the difference between clearing transparent black and not having a clear color. In flutter/flutter#139571 , the app is creating a layer that is clearing to a transparent color, which is getting skipped. That invalid texture is fed into a blend which produces either black or magenta error texture. Fixes flutter/flutter#139571
…9190) This PR cherry-picks the following two commits: 2dbc5d2 0b0fab8 to address flutter/flutter#139571
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 |
Is there an existing issue for this?
Steps to reproduce
Expected results
animated widget changes without affecting overlay
Actual results
widget rebuild affects overlay with blended color
Overall this is a very simple case with the error, in real life, it causes much bigger problems when it comes to render elements
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
iOS with Impeller
Simulator.Screen.Recording.-.iPhone.15.-.2023-12-05.at.18.33.10.mp4
iOS without Impeller
Simulator.Screen.Recording.-.iPhone.15.-.2023-12-05.at.18.32.24.mp4
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: