-
Notifications
You must be signed in to change notification settings - Fork 6k
[iOS] Supported rendering platform views without merging the raster thread. #53826
Changes from all commits
02556ae
b3f6670
b31aae6
75f931a
4525bd8
6ce3aa0
be03cf8
6770376
912cd40
1f65cc3
53adc81
870b950
f8267bd
80565d5
2b9a825
0a7dc5a
2745e88
6002aa0
e7a832f
f099d74
e2e6a2a
44d5b5b
b53063a
9a84539
65a5210
735ce22
a4f523b
b6c3345
a4b771e
cd8e1de
6603d18
27c0daa
d794211
2f4314b
25a4e06
ea2e66d
d220885
9b534cd
970e13a
63ebe66
ff4802a
e3fc731
c0fab3b
d73671e
7285907
bcd8519
b25a742
5f6a8d4
be7853d
b19b4d8
ab08739
6e6e5a2
355ab30
8cd1c74
30e7b97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,19 @@ class SurfaceFrame { | |
// | ||
// Defaults to true, which is generally a safe value. | ||
bool frame_boundary = true; | ||
|
||
// Whether this surface presents with a CATransaction on Apple platforms. | ||
// | ||
// When there are platform views in the scene, the drawable needs to be | ||
// presented in the same CATransaction as the one created for platform view | ||
// mutations. | ||
// | ||
// If the drawables are being presented from the raster thread, we cannot | ||
// use a transaction as it will dirty the UIViews being presented. If there | ||
// is a non-Flutter UIView active, such as in add2app or a | ||
// presentViewController page transition, then this will cause CoreAnimation | ||
// assertion errors and exit the app. | ||
bool present_with_transaction = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume this is necessary for things to correctly work with FlutterMetalLayer disabled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FlutterMetalLayer is always presenting with a CATransaction, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it always makes the jump to platform thread (can't set CALayer content on background thread). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. I ported this over from the existing logic, but once we remove the old metal layer usage we could remove this as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}; | ||
|
||
bool Encode(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -286,7 +286,7 @@ - (void)flutterPrepareForPresent:(nonnull id<MTLCommandBuffer>)commandBuffer; | |
// If the threads have been merged, or there is a pending frame capture, | ||
// then block on cmd buffer scheduling to ensure that the | ||
// transaction/capture work correctly. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The above comment isn't adding much and rather than making it even longer to cover the new case, we could probably just yank out a local and the code would do the exact same amount of documenting as the comment currently does: BOOL threads_merged = [[NSThread currentThread] isMainThread]; Or maybe extract the whole blobby conditional to a bool named There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I can move this to the surface_frame doc comment? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. |
||
if ([[NSThread currentThread] isMainThread] || | ||
if (present_with_transaction_ || [[NSThread currentThread] isMainThread] || | ||
[[MTLCaptureManager sharedCaptureManager] isCapturing] || | ||
alwaysWaitForScheduling) { | ||
TRACE_EVENT0("flutter", "waitUntilScheduled"); | ||
|
Uh oh!
There was an error while loading. Please reload this page.