-
Notifications
You must be signed in to change notification settings - Fork 6k
[macOS] Refactor rendering infrastructure #37789
Conversation
296fc00
to
3bc00c7
Compare
d368c3d
to
d949242
Compare
e4afa28
to
1881f57
Compare
This comment was marked as outdated.
This comment was marked as outdated.
c7a3ad9
to
1c7d550
Compare
shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm
Outdated
Show resolved
Hide resolved
I updated @iskakaushik's platform view example if anyone wants to test platform views: https://github.com/knopp/flutter_macos_platform_view_example platform.view.example.mov |
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.
The change looks OK to me, but I don't have enough knowledge to make the final approval.
6accd38
to
50a9413
Compare
cb2b42f
to
3d68042
Compare
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.
Overall, this is a really nice cleanup. Almost all of my comments are nitpicks.
Sending first round of comments. Still looking at FlutterSurfaceManager and FlutterThreadManager.
shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm
Outdated
Show resolved
Hide resolved
Gold has detected about 2 new digest(s) on patchset 8. |
Co-authored-by: Chris Bracken <[email protected]>
…agerTest.mm Co-authored-by: Chris Bracken <[email protected]>
…ager.h Co-authored-by: Chris Bracken <[email protected]>
…agerTest.mm Co-authored-by: Chris Bracken <[email protected]>
…ager.h Co-authored-by: Chris Bracken <[email protected]>
…ager.h Co-authored-by: Chris Bracken <[email protected]>
…ager.h Co-authored-by: Chris Bracken <[email protected]>
beb61ac
to
768aca8
Compare
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.
…117109) * 1a1b1feee Roll Skia from 537e1e8c1ca6 to 729ccbfb87bc (7 revisions) (flutter/engine#38277) * 3b18821e1 Roll Fuchsia Linux SDK from A0jnUUORf2LQu1z2V... to e2lfUFBW5ddtTZBbw... (flutter/engine#38280) * beb94ea2c Roll Skia from 729ccbfb87bc to 3171deabd88a (4 revisions) (flutter/engine#38279) * 8f9071ab9 Roll Fuchsia Mac SDK from FQQdl8AGAsALFniHl... to u-tC0QEGUT4xQ4KOo... (flutter/engine#38282) * aa78cd8d6 add link to website (flutter/engine#38273) * 955447b35 pylint all Python scripts under testing/ (flutter/engine#38268) * 3f22e1958 [web] correct float count in runtime effect (flutter/engine#38288) * 479bb736f Fix issues related to keyboard inset (flutter/engine#37719) * 6cd85616b [macOS] Refactor rendering infrastructure (flutter/engine#37789) * d1533d12b [web] Make Canvaskit's malloc more useful (flutter/engine#38130) * db5605ea7 Fix new `unnecessary_parenthesis` diagnostics. (flutter/engine#38291)
This reverts commit 6cd8561.
* [macos] Refactor rendering process * Put includes and imports together * Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm Co-authored-by: Chris Bracken <[email protected]> * Remove cast * Do not manually add platform view layer to FlutterView * Remove unnecesary _Internal header files * Make surfaceManager a readonly property * Add comment * Style nit: Rewrite as a noun phrase. * Naming nit for consistency with removeSurfaceForSize: * Write as ternary conditional. * Fix plural in comment. * Offset and index are already set to 0. * Remove FlutterSurfaceManager lookupSurface And the associate bookkeeping of borrowed (lent) surfaces. * Update shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h Co-authored-by: Chris Bracken <[email protected]> * Fix build error * Address nits * Replace EVent with fml::AutoResetWaitableEvent * Remove unecessary CATransaction * Add GetRequiredFrameSize Co-authored-by: Chris Bracken <[email protected]>
* [macos] Refactor rendering process * Put includes and imports together * Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterCompositor.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm Co-authored-by: Chris Bracken <[email protected]> * Remove cast * Do not manually add platform view layer to FlutterView * Remove unnecesary _Internal header files * Make surfaceManager a readonly property * Add comment * Style nit: Rewrite as a noun phrase. * Naming nit for consistency with removeSurfaceForSize: * Write as ternary conditional. * Fix plural in comment. * Offset and index are already set to 0. * Remove FlutterSurfaceManager lookupSurface And the associate bookkeeping of borrowed (lent) surfaces. * Update shell/platform/darwin/macos/framework/Source/FlutterThreadSynchronizer.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManagerTest.mm Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h Co-authored-by: Chris Bracken <[email protected]> * Update shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h Co-authored-by: Chris Bracken <[email protected]> * Fix build error * Address nits * Replace EVent with fml::AutoResetWaitableEvent * Remove unecessary CATransaction * Add GetRequiredFrameSize Co-authored-by: Chris Bracken <[email protected]>
…lutter#117109) * 1a1b1feee Roll Skia from 537e1e8c1ca6 to 729ccbfb87bc (7 revisions) (flutter/engine#38277) * 3b18821e1 Roll Fuchsia Linux SDK from A0jnUUORf2LQu1z2V... to e2lfUFBW5ddtTZBbw... (flutter/engine#38280) * beb94ea2c Roll Skia from 729ccbfb87bc to 3171deabd88a (4 revisions) (flutter/engine#38279) * 8f9071ab9 Roll Fuchsia Mac SDK from FQQdl8AGAsALFniHl... to u-tC0QEGUT4xQ4KOo... (flutter/engine#38282) * aa78cd8d6 add link to website (flutter/engine#38273) * 955447b35 pylint all Python scripts under testing/ (flutter/engine#38268) * 3f22e1958 [web] correct float count in runtime effect (flutter/engine#38288) * 479bb736f Fix issues related to keyboard inset (flutter/engine#37719) * 6cd85616b [macOS] Refactor rendering infrastructure (flutter/engine#37789) * d1533d12b [web] Make Canvaskit's malloc more useful (flutter/engine#38130) * db5605ea7 Fix new `unnecessary_parenthesis` diagnostics. (flutter/engine#38291)
Notable changes:
FlutterIOSurfaceHolder
,FlutterResizableBackingStore
FlutterResizeSynchronizer
withFlutterThreadSynchronizer
FlutterSurfaceManager
High level overview
FlutterView
ownsFlutterSurfaceManager
FlutterCompositor
andFlutterRenderer
interact withFlutterSurfaceManager
in order toFlutterSurfaceManager
sets as contents of CALayers that it manages.FlutterSurfaceManager
caches surfaces so that during normal (no resizing) repaint IOSurfaces do not need to be recreated.FlutterThreadSynchronizer
is in charge of synchronising raster and platform thread:Fixes
FlutterEngine.Compositor
test now works)List which issues are fixed by this PR. You must list at least one issue.
Fixes flutter/flutter#96668
Fixes flutter/flutter#113785
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.