-
Notifications
You must be signed in to change notification settings - Fork 6k
Make updating window metrics multi-view #43366
Changes from 5 commits
3630458
d0a43cd
3d86303
1a69ee9
a293b8e
7699ee8
1c57271
85adee8
ad0a0d6
d397d55
57e705e
1dfe95d
13764d7
e49b875
a71e5b5
6517132
14f5094
bc67089
2aaabb8
19a5e69
19f24b2
73790ca
4b57af3
f3cb395
03e4b53
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -413,9 +413,10 @@ class PlatformConfiguration final { | |||||||||||
| /// | ||||||||||||
| /// @param[in] window_id The id of the window to find and return. | ||||||||||||
| /// | ||||||||||||
| /// @return a pointer to the Window. | ||||||||||||
| /// @return a pointer to the Window. Nullptr if the ID is not registered | ||||||||||||
| /// yet. | ||||||||||||
|
||||||||||||
| SkScalar dpr = static_cast<float>(UIDartState::Current() | |
| ->platform_configuration() | |
| ->get_window(0) | |
| ->viewport_metrics() | |
| .device_pixel_ratio); |
If the implicit view is disabled, this will crash
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.
Oh right, I totally forgot. I'll open an issue to discuss this.
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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,8 @@ | |
| namespace flutter { | ||
|
|
||
| namespace { | ||
| constexpr int64_t kDefaultViewId = 0ll; | ||
dkwingsmt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| class MockDelegate : public Engine::Delegate { | ||
| public: | ||
| MOCK_METHOD2(OnEngineUpdateSemantics, | ||
|
|
@@ -330,7 +332,8 @@ TEST_F(EngineTest, SpawnResetsViewportMetrics) { | |
| const double kViewHeight = 1024; | ||
| old_viewport_metrics.physical_width = kViewWidth; | ||
| old_viewport_metrics.physical_height = kViewHeight; | ||
| mock_runtime_controller->SetViewportMetrics(old_viewport_metrics); | ||
| mock_runtime_controller->SetViewportMetrics(kDefaultViewId, | ||
| old_viewport_metrics); | ||
|
Member
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. This test uses
Contributor
Author
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. Yeah I added a TODO at
Contributor
Author
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. Actually, I don't think an extra one is needed here.
Member
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. Could you put a TODO on |
||
| auto engine = std::make_unique<Engine>( | ||
| /*delegate=*/delegate_, | ||
| /*dispatcher_maker=*/dispatcher_maker_, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -954,7 +954,8 @@ void Shell::OnPlatformViewScheduleFrame() { | |||||
| } | ||||||
|
|
||||||
| // |PlatformView::Delegate| | ||||||
| void Shell::OnPlatformViewSetViewportMetrics(const ViewportMetrics& metrics) { | ||||||
| void Shell::OnPlatformViewSetViewportMetrics(int64_t view_id, | ||||||
| const ViewportMetrics& metrics) { | ||||||
| FML_DCHECK(is_setup_); | ||||||
| FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); | ||||||
|
|
||||||
|
|
@@ -978,9 +979,9 @@ void Shell::OnPlatformViewSetViewportMetrics(const ViewportMetrics& metrics) { | |||||
| }); | ||||||
|
|
||||||
| task_runners_.GetUITaskRunner()->PostTask( | ||||||
| [engine = engine_->GetWeakPtr(), metrics]() { | ||||||
| [engine = engine_->GetWeakPtr(), metrics, view_id]() { | ||||||
|
||||||
| [engine = engine_->GetWeakPtr(), metrics, view_id]() { | |
| [engine = engine_->GetWeakPtr(), view_id, metrics]() { |
I don't feel strongly about this.
Uh oh!
There was an error while loading. Please reload this page.