Skip to content

Commit

Permalink
Set a pending dimension change in the animator only if the viewport's…
Browse files Browse the repository at this point in the history
… physical width/height changed (flutter#4400)

Fixes flutter/flutter#13183
  • Loading branch information
jason-simmons authored Nov 29, 2017
1 parent d6d930e commit acb597b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shell/common/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit acb597b

Please sign in to comment.