-
Notifications
You must be signed in to change notification settings - Fork 6k
Reland "Improve iOS PlatformViews to better handle thread merging. #16935" #17609
Reland "Improve iOS PlatformViews to better handle thread merging. #16935" #17609
Conversation
…ging. (flutter#16935)" (flutter#17600)" This reverts commit caebc93.
cyanglaz
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.
Below are changes made during this re-land
| // Any UIKit related code has to run on main thread. | ||
| // When on a non-main thread, we only allow the rest of the method to run if there is no | ||
| // Pending UIView operations. | ||
| FML_DCHECK([[NSThread currentThread] isMainThread] || !HasPendingViewOperations()); |
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.
I updated to use !HasPendingViewOperations() which I think is more accurate in this situation.
| } | ||
|
|
||
| bool FlutterPlatformViewsController::HasPendingViewOperations() { | ||
| if (!views_to_dispose_.empty()) { |
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.
consider views_to_dispose also as pending view operation
| // Default to `false`. | ||
| // If `true`, gpu thread and platform thread should be merged during |EndFrame|. | ||
| // Always resets to `false` right after the threads are merged. | ||
| bool merge_threads_ = false; |
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.
updated to defaults to false.
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.
👍
blasten
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!
|
This pull request is not suitable for automatic merging in its current state.
|
|
This commit breaks rendering on iOS with both OpenGL and Metal rendering backends due to the missing transactions on the raster thread. These are now only added when on the main thread. However both |
Reland #16935
Fix to make sure the merge_threads defaults as
false.Also fixed a DCheck.
Will mark the diffs in inline comments