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

[CP-stable] fix iOS platform view clipping path intersection #55007

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Sep 6, 2024

#54820 on stable branch.

That PR was using some of the symbol changes in #54335, so I had so switch some back: e0a630d

Cherry-pick request: flutter/flutter#154712

Pre-launch Checklist

  • 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 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.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

hellohuanlin and others added 2 commits September 6, 2024 11:14
…utter#54820)

It turns out that when there are multiple paths to clip, they are unioned together, rather than intersected. But clipping paths need to be intersected.

There isn't any good way to intersect arbitrary paths. However, it is easy to intersect rect paths, which is the most common use case. Then we simply fallback to software rendering if we have to intersect non-rect paths. That is:

**Case 1** Only 1 clipping path (either rect path or arbitrary path):
Hardware rendering. This should be the most common use case

**Case 2** Multiple rect clipping path:
Hardware rendering. This is also common, and it's the linked issue that we are fixing.

**Case 3** Other complex case (multiple non-rect clipping path)
Fallback to software rendering. This should be rare.

After flutter#53826, we don't have a working benchmark that measures the main thread anymore. However, this PR shouldn't impact our ad benchmark, since it only has 1 clipping path. I will verify manually by checking Instruments and make sure no software rendering is happening. But we really should make the benchmark working again, not just for performance improvement, but also for monitoring regression.

*List which issues are fixed by this PR. You must list at least one issue.*

Fixes flutter/flutter#153904

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@jmagman jmagman self-assigned this Sep 6, 2024
@jmagman jmagman changed the title [ios][platform_view] fix platform view clipping path intersection [CP-stable] fix iOS platform view clipping path intersection Sep 6, 2024
@kishangohel
Copy link

@jonahwilliams Can you please review this?

Copy link
Contributor

@hellohuanlin hellohuanlin left a comment

Choose a reason for hiding this comment

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

Thanks for resolving the conflict and putting this up!

@jmagman jmagman added the cp: review add the cp request to the review queue of release engineers label Sep 9, 2024
@nateshmbhat
Copy link

@jonahwilliams review please 😇

@itsjustkevin itsjustkevin added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 11, 2024
@auto-submit auto-submit bot merged commit 1c80ab6 into flutter:flutter-3.24-candidate.0 Sep 11, 2024
28 checks passed
auto-submit bot pushed a commit that referenced this pull request Sep 11, 2024
# Flutter stable 3.24.3 Engine

## Scheduled Cherrypicks

- Roll dart revision: dart-lang/sdk@179da3ba6
- #54842
- #54843
- #54871
- #54870
- #54942
- #55007
- #55056
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App cp: review add the cp request to the review queue of release engineers platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants