Surface synchronization: Make sure viewport size is updated with DSF/LocalSurfaceId

Surface synchronization expects to maintain the invariant that if the viewport size
or device scale factor changes, then we must allocate a new LocalSurfaceId.

The problem is we don't plumb these quantities through the same flow today. LocalSurfaceId
and device scale factor are plumbed through the pending/active tree flow but viewport
size changes go directly from LayerTreeHost to LayerTreeHostImpl, bypassing the activation
flow. This introduces the possibility for a race where a draw might happen with the new
viewport before picking up the new LocalSurfaceId. This CL refactors viewport size so
that it follows the same flow as the other two surface sync quantities.

Subsequent CLs will move all cc properties to follow through the same flow.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: Iab21c2fd108c856dcdeee2800ba3bacf1bd17907
Bug: 672962
Commit-Queue: Fady Samuel <>
Reviewed-by: vmpstr <>
Cr-Commit-Position: refs/heads/master@{#578050}
23 files changed