Surface synchronization: Update compositor scale factor whenever changes

If device emulation was enabled then the WebViewImpl device scale
factor may not change as system device scale factor changes.

Surface synchronization expects that every surface have a fixed device
scale factor. Prior to this CL, the layer compositor's view of device
scale factor may not be updated as system device scale factor changes
when device emulation is enabled. This would cause the layer compositor
to submit a CompositorFrame with an incorrect device scale factor. This
resulted in two problems:

1. Surface invariants violation error could result if device emulation
is later disabled. This can happen if the system DSF changes but the
device emulated DSF does not and then device emulation is turned off
with the new system DSF.

2. SurfaceAggregator does relative scaling of surfaces based on their
reported device scale factor. If the CompositorFrame doesn't report its
device scale factor correctly, it will be scaled incorrectly.

(cherry picked from commit e24c90e284ccaae925132cc0271d9179b5560ec3)

Bug: 791154, 672962
Change-Id: I68be4142a83806b8893185ca9e542afada126b9f
Commit-Queue: Fady Samuel <>
Reviewed-by: Antoine Labour <>
Cr-Original-Commit-Position: refs/heads/master@{#538042}
Reviewed-by: Fady Samuel <>
Cr-Commit-Position: refs/branch-heads/3325@{#561}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
3 files changed