Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[WIP] UIKitView Support Blur #31795

Closed
wants to merge 1 commit into from

Conversation

JsouLiang
Copy link
Contributor

Try to provide a way to fix the issue: flutter/flutter#43902

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@JsouLiang
Copy link
Contributor Author

JsouLiang commented Mar 3, 2022

@cyanglaz hello, i am trying to to fix the UIKit View doesn't support blur problem, and I am realize a simple scheme to fix the problem, I needs your suggest. Thank you~

@JsouLiang JsouLiang force-pushed the UIKitView-Support-BlurMode branch from 0e371c4 to 857dbdd Compare March 3, 2022 09:41
@chinmaygarde chinmaygarde added the Work in progress (WIP) Not ready (yet) for review! label Mar 10, 2022
@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

@@ -416,9 +416,20 @@
CGFloat screenScale = [UIScreen mainScreen].scale;
clippingView.frame = CGRectMake(rect.x() / screenScale, rect.y() / screenScale,
rect.width() / screenScale, rect.height() / screenScale);
if (params.has_backdropfilter()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think when a backdrop filter is applied to a platform view, what we need to do is not to blur the platform view, rather the blur everything else behind the platform view. So I don't think this fix will solve the issue.

The real issue is that when there is a backdrop filter that is applied to a widget on top of platform view, the platform view has to be blurred.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I know, the blur in skia couldn't have an effect on the UIKit view.
So that I think if we need to blur the UIKit View, we may use the iOS UIBlurEffect to blur the UIKit view.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need to do some trick to make UIKitView blur.

The problem is that if the backdrop filter layer is a parent layer of PlatformView layer, it doesn't mean we need to blur the PlatformView. Instead, we need to blur everything underneath the PlatformView. This is already working.

What the flutter/flutter#43902 is about, IIRC, is when you apply backdrop filter on a widget that is above the PlatformView, the PlatformView needs to be blurred as all the other sibling widgets.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked into the code, but the UIBlurEffect might be the right thing to do.

We don't want to apply UIBlurEffect when the backdrop filter layer is the parent, but when a backdrop filter layer appears later than the PlatformView during the preorder tree traversal.

@cyanglaz cyanglaz marked this pull request as draft April 29, 2022 17:48
@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

@chinmaygarde
Copy link
Member

@cyanglaz Based on your last comment, it seems like this isn't the right fix. I am closing this for now. Please re-open when progress can be made.

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

Successfully merging this pull request may close these issues.

None yet

3 participants