-
Notifications
You must be signed in to change notification settings - Fork 6k
Allow Hybrid Composition fallback for Android platform views #35233
Allow Hybrid Composition fallback for Android platform views #35233
Conversation
|
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. |
|
@bparrishMines @dnfield This is a WIP since I still need to add tests, but I wanted to post it to get initial feedback on the approach. |
| return temp; | ||
| } | ||
|
|
||
| List<int> _encodeString(String value) { |
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.
This was just a drive-by improvement since I accidentally mismatched the strings in the .length and utf8.encode lines when I added a new string, so I thought I'd prevent the whole class of mistake once I realized what I'd done wrong.
|
The new golden tests I added have somewhat odd visual output where the top of the platform view square is white and the bottom is pale grey, instead of the whole square being pale grey like most of the other outputs from this suite of tests. I'm not sure why (and whether it's a problem with the manual composition these tests do, or a real issue with HC + |
|
Gold has detected about 1 new digest(s) on patchset 11. |
bparrishMines
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
|
Gold has detected about 1 new digest(s) on patchset 12. |
|
Gold has detected about 1 new digest(s) on patchset 13. |
Bypasses the step of wrapping the `Context` provided to the platform view factory when Hybrid Composition has been requested (i.e., when using `initExpensiveAndroidView`). This was added to the Hybrid Composition codepath in flutter#35233 when the creation flow was unified; it was intended to be a no-op for HC, but turns out not to have been, as described in flutter/flutter#113449 This effectively reverts just the HC-specific part of flutter#35233 without affecting the other codepaths (so doesn't require reverting other changes built on that for TLHC mode). Fixes b/249389618 See also flutter/flutter#113449
Bypasses the step of wrapping the `Context` provided to the platform view factory when Hybrid Composition has been requested (i.e., when using `initExpensiveAndroidView`). This was added to the Hybrid Composition codepath in flutter#35233 when the creation flow was unified; it was intended to be a no-op for HC, but turns out not to have been, as described in flutter/flutter#113449 This effectively reverts just the HC-specific part of flutter#35233 without affecting the other codepaths (so doesn't require reverting other changes built on that for TLHC mode). Fixes b/249389618 See also flutter/flutter#113449
Bypasses the step of wrapping the `Context` provided to the platform view factory when Hybrid Composition has been requested (i.e., when using `initExpensiveAndroidView`). This was added to the Hybrid Composition codepath in flutter#35233 when the creation flow was unified; it was intended to be a no-op for HC, but turns out not to have been, as described in flutter/flutter#113449 This effectively reverts just the HC-specific part of flutter#35233 without affecting the other codepaths (so doesn't require reverting other changes built on that for TLHC mode). Fixes b/249389618 See also flutter/flutter#113449
Allows for the new Android platform view mode introduced in Flutter 3.0 (tentatively called Texture Layer Hybrid Composition) to fall back—when explicitly requested—to Hybrid Composition rather than Virtual Display when TLHC mode is not supported. This allows us to avoid the issue introduced in Flutter 3.0 where a plugin that previously used HC will now use VD in some cases, which would not be the plugin author's intent since they had explicitly chosen the initialization mode that was for HC in Flutter 2.x.
In order to support this, the internals of creation of each mode have been extracted to helper methods, to allow for delegation, and the use of a mutable wrapper context is now unconditional as we now no longer know if we will need it until after the context has been provided to the plugin's factory method; we just don't ever set the underlying context to anything else in the cases where it's not needed.
This is the engine portion of flutter/flutter#107313
Framework portion: flutter/flutter#109161
Pre-launch Checklist
writing and running engine tests.
///).