mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Set a pending dimension change in the animator only if the viewport's physical width/height changed (flutter/engine#4400)
Fixes https://github.com/flutter/flutter/issues/13183
This commit is contained in:
parent
76cf72a8c3
commit
59c2536d34
@ -343,11 +343,15 @@ void Engine::OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation) {
|
||||
}
|
||||
|
||||
void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) {
|
||||
bool dimensions_changed =
|
||||
viewport_metrics_.physical_height != metrics.physical_height ||
|
||||
viewport_metrics_.physical_width != metrics.physical_width;
|
||||
viewport_metrics_ = metrics;
|
||||
if (runtime_)
|
||||
runtime_->SetViewportMetrics(viewport_metrics_);
|
||||
if (animator_) {
|
||||
animator_->SetDimensionChangePending();
|
||||
if (dimensions_changed)
|
||||
animator_->SetDimensionChangePending();
|
||||
if (have_surface_)
|
||||
ScheduleFrame();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user