This repository was archived by the owner on Feb 25, 2025. It is now read-only.
started sharing GPU contexts between spawned engines#23435
Merged
gaaclarke merged 2 commits intoflutter:masterfrom Jan 7, 2021
Merged
started sharing GPU contexts between spawned engines#23435gaaclarke merged 2 commits intoflutter:masterfrom
gaaclarke merged 2 commits intoflutter:masterfrom
Conversation
ef5e5be to
d0410e2
Compare
This comment has been minimized.
This comment has been minimized.
xster
approved these changes
Jan 6, 2021
| static_cast<flutter::PlatformViewIOS*>(platform_view.get()); | ||
| std::shared_ptr<flutter::IOSContext> context = ios_platform_view->GetIosContext(); | ||
| FML_DCHECK(context); | ||
| flutter::Shell::CreateCallback<flutter::PlatformView> on_create_platform_view = |
Member
There was a problem hiding this comment.
I was wondering whether there might be a race here too and then noticed there was a comment in the other place where this callback was created to say the whole thing is synchronous. Worth copying that comment here too.
| - (void)tearDown { | ||
| } | ||
|
|
||
| - (void)testSpawnsShareGpuContext { |
Member
Author
There was a problem hiding this comment.
Because of our smart pointers around objective-c objects in headers. Certain internal headers for the engine can't be included without blowing up. In particular FlutterEngine_Internal.h. I tried to fix our smart pointers but it's a losing battle.
| // |PlatformView| | ||
| void SetSemanticsEnabled(bool enabled) override; | ||
|
|
||
| const std::shared_ptr<IOSContext>& GetIosContext() { return ios_context_; } |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 8, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
As shown in flutter.dev/go/multiple-engines, sharing graphics contexts between engines in a group opens up memory savings. This is one more optimization that is happening as part of the multiple-flutters work.
Related Issues
fixes flutter/flutter#72022
Tests
I added the following tests:
FlutterEngineTest unit tests.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.Reviewer Checklist
Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.