Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fuchsia][scenic] Fix logical size in flatland platform view. #37053

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions shell/platform/fuchsia/flutter/flatland_platform_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,27 @@ void FlatlandPlatformView::OnGetLayout(
}

SetViewportMetrics({
pixel_ratio, // device_pixel_ratio
view_logical_size_.value()[0], // physical_width
view_logical_size_.value()[1], // physical_height
0.0f, // physical_padding_top
0.0f, // physical_padding_right
0.0f, // physical_padding_bottom
0.0f, // physical_padding_left
0.0f, // physical_view_inset_top
0.0f, // physical_view_inset_right
0.0f, // physical_view_inset_bottom
0.0f, // physical_view_inset_left
0.0f, // p_physical_system_gesture_inset_top
0.0f, // p_physical_system_gesture_inset_right
0.0f, // p_physical_system_gesture_inset_bottom
0.0f, // p_physical_system_gesture_inset_left,
-1.0, // p_physical_touch_slop,
{}, // p_physical_display_features_bounds
{}, // p_physical_display_features_type
{}, // p_physical_display_features_state
pixel_ratio, // device_pixel_ratio
std::round(view_logical_size_.value()[0] *
pixel_ratio), // physical_width
std::round(view_logical_size_.value()[1] *
pixel_ratio), // physical_height
0.0f, // physical_padding_top
0.0f, // physical_padding_right
0.0f, // physical_padding_bottom
0.0f, // physical_padding_left
0.0f, // physical_view_inset_top
0.0f, // physical_view_inset_right
0.0f, // physical_view_inset_bottom
0.0f, // physical_view_inset_left
0.0f, // p_physical_system_gesture_inset_top
0.0f, // p_physical_system_gesture_inset_right
0.0f, // p_physical_system_gesture_inset_bottom
0.0f, // p_physical_system_gesture_inset_left,
-1.0, // p_physical_touch_slop,
{}, // p_physical_display_features_bounds
{}, // p_physical_display_features_type
{}, // p_physical_display_features_state
});

parent_viewport_watcher_->GetLayout(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,8 @@ TEST_F(FlatlandPlatformViewTests, SetViewportMetrics) {
watcher.SetLayout(width, height, kDPR);
RunLoopUntilIdle();
EXPECT_EQ(delegate.metrics(),
flutter::ViewportMetrics(kDPR, width, height, -1.0));
flutter::ViewportMetrics(kDPR, std::round(width * kDPR),
std::round(height * kDPR), -1.0));
}

// This test makes sure that the PlatformView correctly registers semantics
Expand Down