Skip to content
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

[0.4.5] Webview flashing when using with haze #99

Open
wezley98 opened this issue Jan 15, 2024 · 4 comments
Open

[0.4.5] Webview flashing when using with haze #99

wezley98 opened this issue Jan 15, 2024 · 4 comments

Comments

@wezley98
Copy link

Looks like haze is having issues with Webviews, Our QA's found this in our real app code we we had to revert for now, but I've created a simple example to reproduce here: Just a fork with a webview sample added. Had to drop toolchain to 17 but that's nothing to do with the issue just my current setup.

wezley98@82427ef

API 34 emulator

Screen_recording_20240115_105304.webm

For our usecase: most of the app is native which works fine with the bottombar and haze. But some screens are still been migrated away from webviews, when using haze with webviews we see this repeated flashing issue.

@chrisbanes
Copy link
Owner

chrisbanes commented Jan 15, 2024

Hmmm. Looks like an invalidation issue when using AndroidViews underneath, where we need to invalidate a lot. We can look at potential issues with invalidating too much, but that's about it.

@wezley98
Copy link
Author

Yes, jetpack-compose

@chrisbanes
Copy link
Owner

FYI: one of the issues in your sample is that you are calling loadUrl in the update block, which means that you'll be calling loadUrl on every composition. This is why the video above is so bad (as it's constantly reloading the URL).

Even fixing that, there is an issue here for when the web content changes. The problem seems to be something around drawing WebViews in a RenderNode with a RenderEffect. Drawing it once works fine but drawing it multiple times (for the blurred areas) leads to the flashing. If I remove the RenderEffect, but still draw the RenderNode again for the blurred areas, it works fine too.

I initially thought it might be caused by skipping loads of frames, but I don't think that is the case. See the screenshot below. We're in and around the yellow line, which is good (enough here anyway). If we were skipping enough frames to lead to the flashing above, you'd expect lots of spikes past the red line.

Screenshot_1705320269

I'll leave this open, but I'm not sure there's much we can do here. I do want to spend some time optimizing the draw paths which might help this issue.

@wezley98
Copy link
Author

Thanks for looking into this, I'll look at a way for us conditionally turn off haze when we are using webviews for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants